mirror of
https://github.com/ONLYOFFICE/core.git
synced 2025-04-18 14:04:06 +03:00
Merge remote-tracking branch 'origin/hotfix/v8.3.1' into develop
This commit is contained in:
commit
ccad697cd8
@ -191,7 +191,7 @@ namespace NSDoctRenderer
|
||||
m_strSdkPath = oNode.ReadNodeText(L"sdkjs");
|
||||
if (!m_strSdkPath.empty())
|
||||
{
|
||||
if (!NSDirectory::Exists(m_strSdkPath))
|
||||
if (0 == m_strSdkPath.find(L"./") || !NSDirectory::Exists(m_strSdkPath))
|
||||
m_strSdkPath = sConfigDir + m_strSdkPath;
|
||||
}
|
||||
|
||||
|
@ -260,10 +260,13 @@
|
||||
"folder": "../../../OfficeUtils/js",
|
||||
"files": ["../src/ZipBuffer.cpp", "wasm/src/base.cpp", "../src/zlib_addon.c"]
|
||||
},
|
||||
|
||||
{
|
||||
"folder": "../../",
|
||||
"files": ["graphics/Image.cpp", "raster/BgraFrame.cpp", "raster/ImageFileFormatChecker.cpp"]
|
||||
"files": ["graphics/Image.cpp", "raster/BgraFrame.cpp", "raster/ImageFileFormatChecker.cpp", "graphics/Matrix.cpp"]
|
||||
},
|
||||
{
|
||||
"folder": "../../agg-2.4/src/",
|
||||
"files": ["agg_trans_affine.cpp"]
|
||||
},
|
||||
{
|
||||
"folder": "../../raster/",
|
||||
|
@ -611,6 +611,9 @@ namespace MetaFile
|
||||
|
||||
void CMetaFile::ConvertToRaster(const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight)
|
||||
{
|
||||
if (nWidth == 0 || nHeight == 0)
|
||||
return;
|
||||
|
||||
NSGraphics::IGraphicsRenderer* pGrRenderer = NSGraphics::Create();
|
||||
|
||||
NSFonts::IFontManager* pFontManager = m_pAppFonts->GenerateFontManager();
|
||||
|
@ -371,9 +371,9 @@ const std::wstring wchar_t2hex_str(const wchar_t val)
|
||||
}
|
||||
|
||||
|
||||
static boost::wregex match_hex(L"^_x[0-9A-F]{4}_");
|
||||
const std::wstring escape_ST_Xstring(const std::wstring& wstr)
|
||||
{
|
||||
static boost::wregex match_hex(L"^_x[0-9A-F]{4}_");
|
||||
std::wstring ret_val = L"";
|
||||
|
||||
for (size_t i = 0; i < wstr.length(); i++)
|
||||
@ -399,6 +399,7 @@ const std::wstring escape_ST_Xstring(const std::wstring& wstr)
|
||||
|
||||
const std::wstring unescape_ST_Xstring(const std::wstring& wstr)
|
||||
{
|
||||
static boost::wregex match_hex(L"^_x[0-9A-F]{4}_");
|
||||
std::wstring::const_iterator x_pos_noncopied = wstr.begin();
|
||||
std::wstring::const_iterator x_pos_next;// = wstr.begin();
|
||||
std::wstring::const_iterator wstr_end = wstr.end();
|
||||
|
@ -701,7 +701,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
double CBinaryFileWriter::GetShapeWidth()
|
||||
{
|
||||
if (m_dCyCurShape < 0.001)
|
||||
if (m_dCxCurShape < 0.001)
|
||||
return -1;
|
||||
return m_dCxCurShape / 36000;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
#include "../../Presentation/FontCutter.h"
|
||||
#include "../../../PPTXFormat/Logic/HeadingVariant.h"
|
||||
#include "../../../PPTXFormat/Logic/Shape.h"
|
||||
|
||||
#include "../../../XlsxFormat/Xlsx.h"
|
||||
#include "../../../XlsxFormat/XlsxFlat.h"
|
||||
@ -5970,6 +5971,14 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh
|
||||
pShapeElem = pFind->second.pElement;
|
||||
}
|
||||
}
|
||||
if (!pShapeElem && pDrawing)
|
||||
{
|
||||
std::map<unsigned int, OOX::WritingElement*>::iterator pFind = pDrawing->m_mapShapes.find(pOleObject->m_oShapeId->GetValue());
|
||||
if (pFind != pDrawing->m_mapShapes.end())
|
||||
{
|
||||
pShapeElem = pFind->second;
|
||||
}
|
||||
}
|
||||
SimpleTypes::Spreadsheet::CCellAnchorType eAnchorType;
|
||||
eAnchorType.SetValue(SimpleTypes::Spreadsheet::cellanchorTwoCell);
|
||||
bool bSetAnchor = false;
|
||||
@ -6030,13 +6039,13 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh
|
||||
|
||||
smart_ptr<OOX::Image> pImageFileCache;
|
||||
|
||||
std::wstring sIdImageFileCache;
|
||||
std::wstring sIdImageFileCache;
|
||||
if ((NULL != pShapeElem) && (OOX::et_v_shapetype != pShapeElem->getType()))
|
||||
{
|
||||
OOX::Vml::CShape* pShape = static_cast<OOX::Vml::CShape*>(pShapeElem);
|
||||
for (size_t j = 0; (pShape) && (j < pShape->m_arrItems.size()); ++j)
|
||||
OOX::Vml::CShape* pShapeVml = dynamic_cast<OOX::Vml::CShape*>(pShapeElem);
|
||||
for (size_t j = 0; (pShapeVml) && (j < pShapeVml->m_arrItems.size()); ++j)
|
||||
{
|
||||
OOX::WritingElement* pChildElemShape = pShape->m_arrItems[j];
|
||||
OOX::WritingElement* pChildElemShape = pShapeVml->m_arrItems[j];
|
||||
if (!bSetAnchor && OOX::et_v_ClientData == pChildElemShape->getType())
|
||||
{
|
||||
OOX::Vml::CClientData* pClientData = static_cast<OOX::Vml::CClientData*>(pChildElemShape);
|
||||
@ -6065,7 +6074,17 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pShapeVml)
|
||||
{
|
||||
PPTX::Logic::Shape* pShape = dynamic_cast<PPTX::Logic::Shape*>(pShapeElem);
|
||||
if (pShape && pShape->spPr.xfrm.IsInit())
|
||||
{
|
||||
olePic->spPr.xfrm = pShape->spPr.xfrm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (false == pImageFileCache.IsInit() && pOleObject->m_oObjectPr.IsInit() && pOleObject->m_oObjectPr->m_oRid.IsInit())
|
||||
{
|
||||
sIdImageFileCache = pOleObject->m_oObjectPr->m_oRid->GetValue();
|
||||
@ -6651,6 +6670,8 @@ void BinaryWorksheetTableWriter::WriteDrawing(const OOX::Spreadsheet::CWorksheet
|
||||
if (pCellAnchor->m_oElement.IsInit() == false &&
|
||||
pCellAnchor->m_sVmlSpId.IsInit() == false) return;
|
||||
|
||||
m_oBcw.m_oStream.ClearCurShapePositionAndSizes();
|
||||
|
||||
WriteCellAnchor(pCellAnchor);
|
||||
|
||||
if (pCellAnchor->m_oExt.IsInit())
|
||||
|
@ -292,7 +292,7 @@ namespace PPTX
|
||||
void Xfrm::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (chExtX.IsInit() && extX.IsInit())
|
||||
pWriter->m_dCxCurShape = pWriter->m_dCyCurShape * (double)*extX / (double)*chExtX;
|
||||
pWriter->m_dCxCurShape = pWriter->m_dCxCurShape * (double)*extX / (double)*chExtX;
|
||||
else if (extX.IsInit())
|
||||
pWriter->m_dCxCurShape = ((pWriter->m_bInGroup && pWriter->m_dCxCurShape > 0) ? pWriter->m_dCxCurShape : 1) * *extX;
|
||||
|
||||
|
@ -100,7 +100,8 @@ namespace OOX
|
||||
void ClearItems();
|
||||
|
||||
public:
|
||||
std::vector<CCellAnchor *> m_arrItems;
|
||||
std::vector<CCellAnchor*> m_arrItems;
|
||||
std::map<unsigned int, OOX::WritingElement*> m_mapShapes;
|
||||
};
|
||||
} //Spreadsheet
|
||||
} // namespace OOX
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "Drawing.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../../PPTXFormat/Logic/Shape.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
using namespace Drawing;
|
||||
@ -221,8 +223,15 @@ namespace OOX
|
||||
nCurDepth--;
|
||||
}
|
||||
|
||||
if ( pItem )
|
||||
m_arrItems.push_back( pItem );
|
||||
if (pItem)
|
||||
{
|
||||
m_arrItems.push_back(pItem);
|
||||
|
||||
if (pItem->m_nId.IsInit() && pItem->m_oElement.is_init())
|
||||
{
|
||||
m_mapShapes.insert(std::make_pair(*pItem->m_nId, pItem->m_oElement->GetElem().GetPointer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,17 +274,17 @@ namespace OOX
|
||||
{
|
||||
}
|
||||
void CDrawing::ClearItems()
|
||||
{
|
||||
m_mapShapes.clear();
|
||||
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
|
||||
{
|
||||
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
|
||||
{
|
||||
if ( m_arrItems[nIndex] )
|
||||
delete m_arrItems[nIndex];
|
||||
|
||||
m_arrItems[nIndex] = NULL;
|
||||
}
|
||||
|
||||
m_arrItems.clear();
|
||||
if ( m_arrItems[nIndex] )
|
||||
delete m_arrItems[nIndex];
|
||||
|
||||
m_arrItems[nIndex] = NULL;
|
||||
}
|
||||
m_arrItems.clear();
|
||||
}
|
||||
|
||||
} //Spreadsheet
|
||||
} // namespace OOX
|
||||
|
@ -200,6 +200,15 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
std::wstring strRectClip = properties->fo_clip_.get();
|
||||
Context.get_drawing_context().set_clipping(strRectClip.substr(5, strRectClip.length() - 6));
|
||||
}
|
||||
|
||||
if (properties->style_mirror_)
|
||||
{
|
||||
bool flipV = properties->style_mirror_->find(L"vertical") != std::wstring::npos;
|
||||
bool flipH = properties->style_mirror_->find(L"horizontal") != std::wstring::npos;
|
||||
|
||||
Context.get_drawing_context().set_property(odf_reader::_property(L"flipV", flipV));
|
||||
Context.get_drawing_context().set_property(odf_reader::_property(L"flipH", flipH));
|
||||
}
|
||||
}
|
||||
|
||||
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_left", Compute_BorderWidth(properties, sideLeft)));
|
||||
|
@ -255,6 +255,9 @@ size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
void paragraph::process_list_bullet_style(oox::docx_conversion_context& Context)
|
||||
{
|
||||
if (Context.get_list_style_level() == 0)
|
||||
return;
|
||||
|
||||
if (content_.size() <= 0)
|
||||
return;
|
||||
|
||||
|
@ -484,6 +484,7 @@ namespace PdfWriter
|
||||
for (unsigned int i = 0; i < unCount; i++)
|
||||
vUnicodes.push_back(pUnicodes[i]);
|
||||
m_vUnicodes[ushCurCode] = vUnicodes;
|
||||
m_mGlyphs[unGID] = true;
|
||||
}
|
||||
return ushCurCode;
|
||||
}
|
||||
@ -530,7 +531,7 @@ namespace PdfWriter
|
||||
|
||||
m_mGlyphs.insert(std::pair<unsigned short, bool>(nSubGID, false));
|
||||
|
||||
EncodeGID(nSubGID, NULL, 0); // TODO необходимо верно указать Unicode для случая записи подсимволов
|
||||
EncodeGID(nSubGID, NULL, 0);
|
||||
FT_Load_Glyph(m_pFace, unGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user