Compare commits

..

5 Commits

Author SHA1 Message Date
64ac836e4e Fixes 2025-12-09 12:22:43 +03:00
97608010ec Fix bug 2025-11-21 14:27:48 +03:00
0c18faa594 Fix compiler version detection 2025-11-21 14:21:21 +03:00
c50a027a61 Fix core build 2025-11-19 18:42:39 +03:00
cae736081d Add ARM64 sysroot in flags 2025-11-12 07:18:18 +03:00
12 changed files with 114 additions and 155 deletions

View File

@ -202,13 +202,11 @@ core_win_64 {
core_linux {
DEFINES += LINUX _LINUX
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
core_linux_64 {
!linux_arm64 { # x86_64
QMAKE_CUSTOM_SYSROOT_LIB = $$(QMAKE_CUSTOM_SYSROOT)/usr/lib/x86_64-linux-gnu
core_linux_64 {
!linux_arm64 { # x86_64
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
QMAKE_CUSTOM_SYSROOT_LIB = $$(QMAKE_CUSTOM_SYSROOT)/usr/lib/x86_64-linux-gnu
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
QMAKE_CC = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "gcc")
@ -217,13 +215,48 @@ core_linux {
QMAKE_LINK_SHLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_CFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
QMAKE_CXXFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT -std=gnu++1y
QMAKE_CXXFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
QMAKE_LFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
}
}
}
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
ARM64_SYSROOT = $$(ARM64_SYSROOT)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
gcc {
COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
COMPILER_MAJOR_VERSION_ARRAY = $$split(COMPILER_VERSION, ".")
@ -324,12 +357,6 @@ core_win_64 {
core_win_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = win_arm64
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_mac_64 {
CORE_BUILDS_PLATFORM_PREFIX = mac_64
@ -338,34 +365,6 @@ core_mac_64 {
QMAKE_APPLE_DEVICE_ARCHS = arm64
}
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
core_ios {
CORE_BUILDS_PLATFORM_PREFIX = ios

View File

@ -45,10 +45,6 @@
#undef DeleteFile
#endif
#if defined(GetSystemDirectory)
#undef GetSystemDirectory
#endif
#ifndef _BUILD_FILE_CROSSPLATFORM_H_
#define _BUILD_FILE_CROSSPLATFORM_H_

View File

@ -1740,8 +1740,8 @@ namespace MetaFile
const TRectL& oEmfRect{oEmfParser.GetDCBounds()};
const TRectL& oCurentRect{GetDCBounds()};
const double dScaleX = std::abs((double)(oCurentRect.Right - oCurentRect.Left) / (double)(oEmfRect.Right - oEmfRect.Left));
const double dScaleY = std::abs((double)(oCurentRect.Bottom - oCurentRect.Top) / (double)(oEmfRect.Bottom - oEmfRect.Top));
const double dScaleX = std::abs((oCurentRect.Right - oCurentRect.Left) / (oEmfRect.Right - oEmfRect.Left));
const double dScaleY = std::abs((oCurentRect.Bottom - oCurentRect.Top) / (oEmfRect.Bottom - oEmfRect.Top));
const bool bAddGElement = !Equals(1., dScaleX) || !Equals(1., dScaleY);

View File

@ -343,6 +343,22 @@ void WriteEmptyParagraph(NSStringUtils::CStringBuilder* pXml, bool bVahish = fal
pXml->WriteString(L"</w:pPr></w:p>");
}
void WriteLine(NSStringUtils::CStringBuilder* pXml, const std::wstring& wsAlign, const std::wstring& wsColor, bool bShade, double dSize, double dWidth)
{
if (dWidth < 0)
dWidth = -dWidth;
if (dSize < 0)
dSize = -dSize;
if (dWidth > 100)
dWidth = 0;
pXml->WriteNodeBegin(L"w:pict");
pXml->WriteString(L"<v:rect style=\"height:" + std::to_wstring(dSize) + L"pt\"" + ((0. != dWidth) ? (L" o:hrpct=\"" + std::to_wstring((int)(10. * dWidth)) + L"\"") : L"") + L" o:hralign=\"" + wsAlign + L"\" o:hrstd=\"t\" " + ((bShade) ? L"o:hrnoshade=\"t\" " : L"") + L"o:hr=\"t\" fillcolor=\"#" + wsColor + L"\" stroked=\"f\"/>");
pXml->WriteNodeEnd(L"w:pict");
}
bool ElementInTable(const std::vector<NSCSS::CNode>& arSelectors)
{
return arSelectors.crend() != std::find_if(arSelectors.crbegin(), arSelectors.crend(), [](const NSCSS::CNode& oNode) { return L"table" == oNode.m_wsName; });
@ -1466,7 +1482,6 @@ private:
int m_nHyperlinkId; // ID ссылки
int m_nNumberingId; // ID списка
int m_nId; // ID остальные элементы
int m_nShapeId; // Id shape's
NSStringUtils::CStringBuilder m_oStylesXml; // styles.xml
NSStringUtils::CStringBuilder m_oDocXmlRels; // document.xml.rels
@ -1501,7 +1516,7 @@ private:
public:
CHtmlFile2_Private()
: m_nFootnoteId(1), m_nHyperlinkId(1), m_nNumberingId(1), m_nId(1), m_nShapeId(1), m_pFonts(NULL)
: m_nFootnoteId(1), m_nHyperlinkId(1), m_nNumberingId(1), m_nId(1), m_pFonts(NULL)
{
m_oPageData.SetWidth (DEFAULT_PAGE_WIDTH, NSCSS::UnitMeasure::Twips, 0, true);
m_oPageData.SetHeight(DEFAULT_PAGE_HEIGHT, NSCSS::UnitMeasure::Twips, 0, true);
@ -2877,100 +2892,68 @@ private:
if (NULL == pXml)
return false;
bool bPrint = true;
for (const NSCSS::CNode& item : arSelectors)
{
if (item.m_wsName == L"div" && item.m_wsStyle == L"mso-element:footnote-list")
return false;
}
NSCSS::NSProperties::CDigit oSize, oWidth;
NSCSS::NSProperties::CColor oColor;
bool bShade = true;
std::wstring wsAlign{L"center"};
if (m_oLightReader.MoveToFirstAttribute())
{
std::wstring wsAttributeName;
do
{
wsAttributeName = m_oLightReader.GetName();
if (L"align" == wsAttributeName)
{
const std::wstring wsValue{m_oLightReader.GetText()};
if (NSStringFinder::Equals(L"left", wsValue))
wsAlign = L"left";
else if (NSStringFinder::Equals(L"right", wsValue))
wsAlign = L"right";
else if (NSStringFinder::Equals(L"center", wsValue))
wsAlign = L"center";
}
if (L"color" == wsAttributeName)
oColor.SetValue(m_oLightReader.GetText());
else if (L"noshade" == wsAttributeName)
bShade = false;
else if (L"size" == wsAttributeName)
oSize.SetValue(m_oLightReader.GetText());
else if (L"width" == wsAttributeName)
oWidth.SetValue(m_oLightReader.GetText());
} while (m_oLightReader.MoveToNextAttribute());
m_oLightReader.MoveToElement();
bPrint = false;
break;
}
}
OpenP(pXml);
if (bPrint)
{
NSCSS::NSProperties::CDigit oSize, oWidth;
NSCSS::NSProperties::CColor oColor;
bool bShade = false;
std::wstring wsAlign{L"center"};
pXml->WriteString(L"<w:pPr><w:jc w:val=\"" + wsAlign + L"\"/></w:pPr>");
if (m_oLightReader.MoveToFirstAttribute())
{
std::wstring wsAttributeName;
do
{
wsAttributeName = m_oLightReader.GetName();
OpenR(pXml);
if (L"align" == wsAttributeName)
{
const std::wstring wsValue{m_oLightReader.GetText()};
const unsigned int unPageWidth{static_cast<unsigned int>((m_oPageData.GetWidth().ToDouble(NSCSS::Inch) - m_oPageData.GetMargin().GetLeft().ToDouble(NSCSS::Inch) - m_oPageData.GetMargin().GetRight().ToDouble(NSCSS::Inch)) * 914400.)};
if (NSStringFinder::Equals(L"left", wsValue))
wsAlign = L"left";
else if (NSStringFinder::Equals(L"right", wsValue))
wsAlign = L"right";
else if (NSStringFinder::Equals(L"center", wsValue))
wsAlign = L"center";
}
if (L"color" == wsAttributeName)
oColor.SetValue(m_oLightReader.GetText());
else if (L"noshade" == wsAttributeName)
bShade = true;
else if (L"size" == wsAttributeName)
oSize.SetValue(m_oLightReader.GetText());
else if (L"width" == wsAttributeName)
oWidth.SetValue(m_oLightReader.GetText());
} while (m_oLightReader.MoveToNextAttribute());
std::wstring wsWidth;
m_oLightReader.MoveToElement();
}
// width измеряется в px или %
if (!oWidth.Empty())
wsWidth = std::to_wstring(static_cast<int>((NSCSS::UnitMeasure::Percent != oWidth.GetUnitMeasure()) ? (NSCSS::CUnitMeasureConverter::ConvertPx(oWidth.ToDouble(), NSCSS::Inch, 96) * 914400.) : oWidth.ToDouble(NSCSS::Inch, unPageWidth)));
else
wsWidth = std::to_wstring(unPageWidth);
const bool bOpenedP = OpenP(pXml);
std::wstring wsHeight{L"14288"};
OpenR(pXml);
WriteLine(pXml, wsAlign, (!oColor.Empty()) ? oColor.ToWString() : L"a0a0a0", bShade, (!oSize.Empty()) ? oSize.ToDouble(NSCSS::Point) : 1.5, (NSCSS::UnitMeasure::Percent == oWidth.GetUnitMeasure()) ? oWidth.ToDouble() : 0);
CloseR(pXml);
// size измеряется только в px
if (!oSize.Empty())
wsHeight = std::to_wstring(static_cast<int>(NSCSS::CUnitMeasureConverter::ConvertPx(oSize.ToDouble(), NSCSS::Inch, 96) * 914400.));
if (bOpenedP)
CloseP(pXml, arSelectors);
pXml->WriteString(L"<w:rPr><w:noProof/></w:rPr>");
pXml->WriteString(L"<mc:AlternateContent><mc:Choice Requires=\"wps\"><w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\">");
pXml->WriteString(L"<wp:extent cx=\"" + wsWidth + L"\" cy=\"0\"/>");
pXml->WriteString(L"<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>");
pXml->WriteString(L"<wp:docPr id=\"" + std::to_wstring(m_nShapeId) + L"\" name=\"Line " + std::to_wstring(m_nShapeId) + L"\"/>"
"<wp:cNvGraphicFramePr/>"
"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">"
"<a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">"
"<wps:wsp>"
"<wps:cNvSpPr/>"
"<wps:spPr>");
pXml->WriteString(L"<a:xfrm>"
"<a:off x=\"0\" y=\"0\"/>"
"<a:ext cx=\"" + wsWidth + L"\" cy=\"0\"/>"
"</a:xfrm>"
"<a:custGeom><a:pathLst><a:path>"
"<a:moveTo><a:pt x=\"0\" y=\"0\"/></a:moveTo>"
"<a:lnTo><a:pt x=\"" + wsWidth + L"\" y=\"0\"/></a:lnTo>"
"</a:path></a:pathLst></a:custGeom>"
"<a:ln w=\"" + wsHeight + L"\"><a:solidFill><a:srgbClr val=\"" + ((!oColor.Empty()) ? oColor.ToHEX() : L"808080") + L"\"/></a:solidFill></a:ln>");
return true;
}
if (bShade)
pXml->WriteString(L"<a:scene3d><a:camera prst=\"orthographicFront\"/><a:lightRig rig=\"threePt\" dir=\"t\"/></a:scene3d><a:sp3d><a:bevelT prst=\"angle\"/></a:sp3d>");
pXml->WriteString(L"</wps:spPr><wps:bodyPr/></wps:wsp></a:graphicData></a:graphic></wp:inline></w:drawing></mc:Choice></mc:AlternateContent>");
CloseP(pXml, arSelectors);
++m_nShapeId;
return true;
return false;
}
bool ReadPre(NSStringUtils::CStringBuilder* pXml, std::vector<NSCSS::CNode>& arSelectors, CTextSettings& oTS)
@ -4803,7 +4786,7 @@ private:
oXml->WriteString(L"\"/></w:r>");
m_oNoteXml.WriteString(L"<w:footnote w:id=\"");
m_oNoteXml.WriteString(std::to_wstring(m_nFootnoteId++));
m_oNoteXml.WriteString(L"\"><w:p><w:pPr><w:pStyle w:val=\"footnote-p\"/></w:pPr><w:r><w:rPr><w:rStyle w:val=\"footnote\"/></w:rPr><w:footnoteRef/></w:r><w:r><w:t xml:space=\"preserve\"> </w:t></w:r><w:r><w:t xml:space=\"preserve\">");
m_oNoteXml.WriteString(L"\"><w:p><w:pPr><w:pStyle w:val=\"footnote-p\"/></w:pPr><w:r><w:rPr><w:footnoteRef/></w:rPr><w:t xml:space=\"preserve\"> </w:t></w:r><w:r><w:rPr><w:rStyle w:val=\"footnote\"/></w:rPr></w:r><w:r><w:t xml:space=\"preserve\">");
m_oNoteXml.WriteEncodeXmlString(sNote);
m_oNoteXml.WriteString(L"</w:t></w:r></w:p></w:footnote>");

View File

@ -5182,7 +5182,7 @@ int Binary_DocumentTableReader::ReadParagraph(BYTE type, long length, void* poRe
else if (c_oSerParType::TextID == type)
{
m_oTextId.Init();
_INT64 res = m_oBufferedStream.GetULong();
_INT64 res = m_oBufferedStream.GetLong64();
m_oTextId->SetValue(res);
}
else

View File

@ -3937,7 +3937,7 @@ void BinaryDocumentTableWriter::WriteParapraph(OOX::Logic::CParagraph& par, OOX:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerParType::TextID);
nCurPos = m_oBcw.WriteItemWithLengthStart();
m_oBcw.m_oStream.WriteULONG(par.m_oTextId->GetValue());
m_oBcw.m_oStream.WriteLONG64(par.m_oTextId->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}

View File

@ -6059,7 +6059,7 @@ HRESULT CDrawingConverter::SaveObject(LONG lStart, LONG lLength, const std::wstr
PPTX::Logic::Pic& s = oElem.as<PPTX::Logic::Pic>();
if (s.spPr.xfrm.IsInit() == false)
{
//s.spPr.xfrm.Init(); pXfrm = s.spPr.xfrm.GetPointer();
s.spPr.xfrm.Init(); pXfrm = s.spPr.xfrm.GetPointer();
}
}
else if (oElem.getType() == OOX::et_graphicFrame)

View File

@ -159,17 +159,7 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val)
case odf_types::style_wrap::None:
serialize_wrap_top_bottom(strm, val);
break;
case odf_types::style_wrap::Dynamic:
{
//if (val.styleWrapContour && *val.styleWrapContour == false)
//{
// CP_XML_NODE(L"wp:wrapTopAndBottom");
//}
//else
{
serialize_wrap_square(strm, val);
}
}break;
case odf_types::style_wrap::Dynamic: //Présentation_de_tib.odt
default:
CP_XML_NODE(L"wp:wrapTopAndBottom");
break;

View File

@ -59,7 +59,6 @@ public:
_CP_OPT(odf_types::vertical_rel) styleVerticalRel;
_CP_OPT(odf_types::style_wrap) styleWrap;
_CP_OPT(bool) styleWrapContour;
int number_wrapped_paragraphs;

View File

@ -191,7 +191,6 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode,
_CP_OPT(horizontal_rel) styleHorizontalRel;
_CP_OPT(horizontal_pos) styleHorizontalPos;
_CP_OPT(style_wrap) styleWrap;
_CP_OPT(bool) styleWrapContour;
_CP_OPT(length) frameMarginLeft;
_CP_OPT(length) frameMarginRight;
@ -200,7 +199,6 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode,
styleHorizontalRel = graphicProperties->common_horizontal_rel_attlist_.style_horizontal_rel_;
styleHorizontalPos = graphicProperties->common_horizontal_pos_attlist_.style_horizontal_pos_;
styleWrap = graphicProperties->style_wrap_;
styleWrapContour = graphicProperties->style_wrap_contour_;
frameMarginLeft = GetOnlyLength(graphicProperties->common_horizontal_margin_attlist_.fo_margin_left_);
frameMarginRight = GetOnlyLength(graphicProperties->common_horizontal_margin_attlist_.fo_margin_right_);
}
@ -839,7 +837,6 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
if (graphicProperties)
{
drawing->styleWrap = graphicProperties->style_wrap_;
drawing->styleWrapContour = graphicProperties->style_wrap_contour_;
if (drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::Parallel)
{

View File

@ -112,10 +112,10 @@ std::wstring pptx_process_margin(const _CP_OPT(length_or_percent) & margin, leng
{
if (margin->get_type() == length_or_percent::Length)
{
int val = (int)(0.5 + Mul * margin->get_length().get_value_unit(unit));
int val = (int)(0.57 * (0.5 + Mul * margin->get_length().get_value_unit(unit)));
return std::to_wstring( val );
}
else
else
{
}
}

View File

@ -831,11 +831,6 @@ void CPdfReader::DrawPageOnRenderer(IRenderer* pRenderer, int _nPageIndex, bool*
((GlobalParamsAdaptor*)globalParams)->ClearRedact();
LONG lRendererType = 0;
pRenderer->get_Type(&lRendererType);
if (c_nDocxWriter == lRendererType)
return; // Без отрисовки Redact при ScanPage
Page* pPage = pDoc->getCatalog()->getPage(nPageIndex);
PDFRectangle* cropBox = pPage->getCropBox();
pRenderer->SetTransform(1, 0, 0, 1, 0, 0);