Compare commits

..

31 Commits

Author SHA1 Message Date
2a4d97c7b4 fix loss of an attribute in sqrt 2025-11-20 16:18:28 +03:00
94f06bf997 Merge pull request 'fix bug #78614' (#537) from fix/bug78614 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/537
2025-11-20 10:09:25 +00:00
230316aefa fix bug #78614 2025-11-20 12:51:35 +03:00
50c7e106fb Merge pull request 'Fix bug #78449' (#535) from fix/bug-78449 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/535
2025-11-19 15:16:23 +00:00
6b5ee390a2 Fix bug #78449 2025-11-19 18:08:55 +03:00
9049e2e6a8 Merge pull request 'Fix bugs' (#533) from fix/metafile into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/533
2025-11-18 11:26:53 +00:00
67c6707072 Merge pull request 'Fix bug 76845' (#531) from fix/bug-76845 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/531
2025-11-18 08:10:19 +00:00
0c29a5d436 Fix bug 76845 2025-11-18 11:06:10 +03:00
02d492ff90 Fix typo 2025-11-17 23:02:02 +03:00
a7026ccb8d Fix bug #77816 2025-11-17 23:01:50 +03:00
ae8fb19147 Merge pull request 'fix bug #78248' (#530) from fix/fix-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/530
2025-11-14 08:05:38 +00:00
12083905dc fix bug #78248 2025-11-14 10:46:48 +03:00
e653442b8c Merge pull request 'Fix bug #74743' (#529) from fix/bug-74743 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/529
2025-11-13 18:10:58 +00:00
511cfb6158 Fix bug #74743 2025-11-13 20:08:15 +03:00
6b80b39d4d Merge pull request 'fix bug #78278' (#525) from fix/bug78278 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/525
2025-11-13 14:32:04 +00:00
cbf138b1eb Merge pull request 'fix/fix-bugs' (#528) from fix/fix-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/528
2025-11-13 12:43:13 +00:00
897f8fa9f2 Merge pull request 'fix/sysroot' (#527) from fix/sysroot into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/527
2025-11-13 12:19:14 +00:00
8feb44225d Fix bug 2025-11-13 14:52:11 +03:00
517e337049 Fix building with newer qmake 2025-11-13 14:31:35 +03:00
c05231cf58 Merge pull request 'Fix bug in metafile conversion' (#526) from fix/metafile into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/526
2025-11-13 10:57:15 +00:00
66b1007ab4 fix bug #78278 2025-11-13 12:44:09 +03:00
62413b8df5 Fix bug in metafile conversion 2025-11-13 03:03:25 +03:00
f93c259977 . 2025-11-12 20:57:32 +03:00
910ff6a6dd Merge pull request 'Fix bug 78223' (#523) from fix/bug-78223 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/523
2025-11-12 10:42:18 +00:00
22e5bcbde3 Fix bug 78223 2025-11-12 13:05:51 +03:00
a77cbf903b fix bug #77941 2025-11-12 10:52:37 +03:00
9b4416952f Merge pull request 'fix bug #78156' (#521) from fix/bug78156 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/521
2025-11-12 07:10:09 +00:00
a320b5bd5a Fix build 2025-11-11 22:46:36 +03:00
34a1f117c9 Merge pull request 'For bug #74646' (#522) from fix/md into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/522
2025-11-11 16:16:23 +00:00
ec4700ac38 For bug #74646 2025-11-11 18:57:35 +03:00
85047874b7 fix bug #78156 2025-11-11 10:03:48 +03:00
18 changed files with 205 additions and 156 deletions

View File

@ -149,7 +149,7 @@ namespace NSCSS
case NSCSS::Millimeter:
return dValue * 0.01764;
case NSCSS::Inch:
return dValue * 1440.;
return dValue / 1440.;
case NSCSS::Peak:
return dValue * 0.004167; // 0.004167 = 6 / 1440
default:

View File

@ -202,11 +202,13 @@ core_win_64 {
core_linux {
DEFINES += LINUX _LINUX
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
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
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
QMAKE_CC = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "gcc")
@ -215,48 +217,13 @@ core_linux {
QMAKE_LINK_SHLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_CFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
QMAKE_CXXFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
QMAKE_CXXFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT -std=gnu++1y
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, ".")
@ -357,6 +324,12 @@ 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
@ -365,6 +338,34 @@ 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,6 +45,10 @@
#undef DeleteFile
#endif
#if defined(GetSystemDirectory)
#undef GetSystemDirectory
#endif
#ifndef _BUILD_FILE_CROSSPLATFORM_H_
#define _BUILD_FILE_CROSSPLATFORM_H_

View File

@ -1237,7 +1237,7 @@ namespace MetaFile
// Вычисление минимально возможной ширины пера
// # Код явялется дублированным из Graphics
const double dSqrtDet = sqrt(abs(oMatrix.Determinant()));
const double dSqrtDet = sqrt(fabs(oMatrix.Determinant()));
const double dWidthMinSize = (dSqrtDet != 0) ? (1.0 / dSqrtDet) : dWidth;
if (0 == pPen->GetWidth())

View File

@ -1740,8 +1740,8 @@ namespace MetaFile
const TRectL& oEmfRect{oEmfParser.GetDCBounds()};
const TRectL& oCurentRect{GetDCBounds()};
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 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 bool bAddGElement = !Equals(1., dScaleX) || !Equals(1., dScaleY);

View File

@ -270,7 +270,6 @@ struct CTextSettings
bool bMergeText; // Объединять подяр идущий текст в 1?
int nLi; // Уровень списка
bool bNumberingLi; // Является ли список нумерованным
bool bWritedLi; // Записан ли уже w:numPr
std::wstring sPStyle;
@ -284,12 +283,12 @@ struct CTextSettings
NSCSS::CCompiledStyle oAdditionalStyle;
CTextSettings()
: bBdo(false), bPre(false), bQ(false), bAddSpaces(true), bMergeText(false), nLi(-1), bNumberingLi(false), bWritedLi(false), eTextMode(Normal)
: bBdo(false), bPre(false), bQ(false), bAddSpaces(true), bMergeText(false), nLi(-1), bNumberingLi(false), eTextMode(Normal)
{}
CTextSettings(const CTextSettings& oTS) :
bBdo(oTS.bBdo), bPre(oTS.bPre), bQ(oTS.bQ), bAddSpaces(oTS.bAddSpaces), bMergeText(oTS.bMergeText),
nLi(oTS.nLi), bNumberingLi(oTS.bNumberingLi), bWritedLi(oTS.bWritedLi), sPStyle(oTS.sPStyle), eTextMode(oTS.eTextMode)
nLi(oTS.nLi), bNumberingLi(oTS.bNumberingLi), sPStyle(oTS.sPStyle), eTextMode(oTS.eTextMode)
{}
void AddPStyle(const std::wstring& wsStyle)
@ -343,22 +342,6 @@ 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; });
@ -1482,6 +1465,7 @@ 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
@ -1516,7 +1500,7 @@ private:
public:
CHtmlFile2_Private()
: m_nFootnoteId(1), m_nHyperlinkId(1), m_nNumberingId(1), m_nId(1), m_pFonts(NULL)
: m_nFootnoteId(1), m_nHyperlinkId(1), m_nNumberingId(1), m_nId(1), m_nShapeId(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);
@ -2892,68 +2876,100 @@ 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")
{
bPrint = false;
break;
}
return false;
}
if (bPrint)
NSCSS::NSProperties::CDigit oSize, oWidth;
NSCSS::NSProperties::CColor oColor;
bool bShade = true;
std::wstring wsAlign{L"center"};
if (m_oLightReader.MoveToFirstAttribute())
{
NSCSS::NSProperties::CDigit oSize, oWidth;
NSCSS::NSProperties::CColor oColor;
bool bShade = false;
std::wstring wsAlign{L"center"};
if (m_oLightReader.MoveToFirstAttribute())
std::wstring wsAttributeName;
do
{
std::wstring wsAttributeName;
do
wsAttributeName = m_oLightReader.GetName();
if (L"align" == wsAttributeName)
{
wsAttributeName = m_oLightReader.GetName();
const std::wstring wsValue{m_oLightReader.GetText()};
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());
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());
m_oLightReader.MoveToElement();
}
const bool bOpenedP = OpenP(pXml);
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);
if (bOpenedP)
CloseP(pXml, arSelectors);
return true;
m_oLightReader.MoveToElement();
}
return false;
OpenP(pXml);
pXml->WriteString(L"<w:pPr><w:jc w:val=\"" + wsAlign + L"\"/></w:pPr>");
OpenR(pXml);
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.)};
std::wstring wsWidth;
// 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);
std::wstring wsHeight{L"14288"};
// size измеряется только в px
if (!oSize.Empty())
wsHeight = std::to_wstring(static_cast<int>(NSCSS::CUnitMeasureConverter::ConvertPx(oSize.ToDouble(), NSCSS::Inch, 96) * 914400.));
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>");
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;
}
bool ReadPre(NSStringUtils::CStringBuilder* pXml, std::vector<NSCSS::CNode>& arSelectors, CTextSettings& oTS)
@ -3896,19 +3912,14 @@ private:
bool ReadListElement(NSStringUtils::CStringBuilder* oXml, std::vector<NSCSS::CNode>& arSelectors, CTextSettings& oTS)
{
if (0 > oTS.nLi)
{
CTextSettings oTSLi;
oTSLi.nLi = 0;
oTSLi.oAdditionalStyle.m_oMargin.SetLeft(360., NSCSS::UnitMeasure::Twips, 0, true);
if (OpenP(oXml))
wrP(oXml, arSelectors, oTSLi);
}
else if (OpenP(oXml))
if (OpenP(oXml))
wrP(oXml, arSelectors, oTS);
return readStream(oXml, arSelectors, oTS);
const bool bResult{readStream(oXml, arSelectors, oTS)};
CloseP(oXml, arSelectors);
return bResult;
}
bool ReadList(NSStringUtils::CStringBuilder* oXml, std::vector<NSCSS::CNode>& arSelectors, CTextSettings& oTS)
@ -3964,20 +3975,13 @@ private:
oTSList.oAdditionalStyle.m_oMargin.SetTop (100, NSCSS::UnitMeasure::Twips, 0, true);
oTSList.oAdditionalStyle.m_oMargin.SetBottom(100, NSCSS::UnitMeasure::Twips, 0, true);
oTSLi.bWritedLi = true;
int nDeath = m_oLightReader.GetDepth();
while(m_oLightReader.ReadNextSiblingNode2(nDeath))
{
const std::wstring wsName = m_oLightReader.GetName();
if (L"li" == wsName)
{
if (OpenP(oXml))
wrP(oXml, arSelectors, oTSList);
ReadListElement(oXml, arSelectors, oTSLi);
}
ReadListElement(oXml, arSelectors, oTSList);
else
{
CloseP(oXml, arSelectors);
@ -4066,7 +4070,6 @@ private:
m_oLightReader.MoveToElement();
oTSLiP.nLi++;
oTSLiP.bWritedLi = false;
if (!wsValue.empty())
{
@ -4541,18 +4544,8 @@ private:
}
if (oTS.nLi >= 0)
{
if (!oTS.bWritedLi)
{
oXml->WriteString(L"<w:numPr><w:ilvl w:val=\"" + std::to_wstring(oTS.nLi) + L"\"/><w:numId w:val=\"" +
(!oTS.bNumberingLi ? L"1" : std::to_wstring(m_nNumberingId)) + L"\"/></w:numPr>");
oTS.bWritedLi = true;
}
else if (sSelectors.back().m_pCompiledStyle->m_oText.GetIndent().Empty() &&
oTS.oAdditionalStyle.m_oText.GetIndent().Empty())
oXml->WriteString(L"<w:ind w:left=\"" + std::to_wstring(720 * (oTS.nLi + 1)) + L"\"/>");
}
oXml->WriteString(L"<w:numPr><w:ilvl w:val=\"" + std::to_wstring(oTS.nLi) + L"\"/><w:numId w:val=\"" +
(!oTS.bNumberingLi ? L"1" : std::to_wstring(m_nNumberingId)) + L"\"/></w:numPr>");
oXml->WriteString(oTS.sPStyle + sPSettings);
oXml->WriteNodeEnd(L"w:pPr");
@ -4786,7 +4779,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: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.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.WriteEncodeXmlString(sNote);
m_oNoteXml.WriteString(L"</w:t></w:r></w:p></w:footnote>");

View File

@ -2554,6 +2554,13 @@ void xlsx_drawing_context::serialize_bitmap_fill(std::wostream & stream, _drawin
CP_XML_ATTR(L"thresh", *fill.biLevel * 1000);
}
}
if (fill.color.opacity > 0.00001)
{
CP_XML_NODE(L"a:alphaModFix")
{
CP_XML_ATTR(L"amt", (int)(fill.color.opacity * 100000));
}
}
}
CP_XML_NODE(L"a:srcRect")

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.GetLong64();
_INT64 res = m_oBufferedStream.GetULong();
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.WriteLONG64(par.m_oTextId->GetValue());
m_oBcw.m_oStream.WriteULONG(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

@ -94,6 +94,8 @@ namespace StarMath
if(pReader->GetAttribute() != nullptr && !CheckForLeftArgument(pReader->GetGlobalType()))
pElement->SetBaseAttribute(pReader->GetAttribute());
else if(pReader->GetAttribute() != nullptr && pElement->GetBaseType() == TypeElement::Index && dynamic_cast<CElementIndex*>(pElement)->GetType() == TypeElement::sqrt)
pElement->SetBaseAttribute(pReader->GetAttribute());
else if(pReader->GetAttribute() != nullptr && (pReader->GetLocalType() == TypeElement::plus || TypeElement::minus == pReader->GetLocalType() || TypeElement::frac == pReader->GetLocalType() || TypeElement::neg == pReader->GetLocalType()))
pElement->SetBaseAttribute(pReader->GetAttribute());
pReader->ClearReader();
@ -2610,6 +2612,8 @@ namespace StarMath
m_pLeftArg->SetBaseAttribute(pAttribute);
this->SetBaseAttribute(m_pLeftArg->GetAttribute());
}
if(m_enTypeIndex == TypeElement::sqrt)
this->SetBaseAttribute(pAttribute);
if(m_pValueIndex != nullptr)
m_pValueIndex->SetAttribute(pAttribute);
if(m_pLeftArg != nullptr)

View File

@ -159,7 +159,17 @@ 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: //Présentation_de_tib.odt
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;
default:
CP_XML_NODE(L"wp:wrapTopAndBottom");
break;

View File

@ -59,6 +59,7 @@ 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,6 +191,7 @@ 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;
@ -199,6 +200,7 @@ 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_);
}
@ -837,6 +839,7 @@ 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.57 * (0.5 + Mul * margin->get_length().get_value_unit(unit)));
int val = (int)(0.5 + Mul * margin->get_length().get_value_unit(unit));
return std::to_wstring( val );
}
else
else
{
}
}

View File

@ -831,6 +831,11 @@ 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);
@ -2194,14 +2199,21 @@ BYTE* CPdfReader::GetAPAnnots(int nRasterW, int nRasterH, int nBackgroundColor,
}
if (oAnnot.dictLookup("Subtype", &oObj)->isName())
sType = oObj.getName();
oObj.free(); oAnnot.free();
oObj.free();
if (sType == "Widget")
{
oAnnotRef.free();
oAnnotRef.free(); oAnnot.free();
continue;
}
if (oAnnot.dictLookupNF("IRT", &oObj)->isRef())
{
oObj.free(); oAnnotRef.free(); oAnnot.free();
continue;
}
oAnnot.free(); oObj.free();
PdfReader::CAnnotAP* pAP = new PdfReader::CAnnotAP(pDoc, m_pFontManager, pFontList, nRasterW, nRasterH, nBackgroundColor, nPageIndex, sView, &oAnnotRef, nStartRefID);
if (pAP)
pAP->ToWASM(oRes);

View File

@ -3095,6 +3095,7 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in
if (oAnnot.dictLookupNF("IRT", &oObj)->isRef())
{
m_unFlags |= (1 << 5);
m_unAFlags &= ~(1 << 6); // IRT аннотации не отображаются
m_unRefNumIRT = oObj.getRefNum() + nStartRefID;
}
oObj.free();

View File

@ -1662,6 +1662,7 @@ void Annot::drawText(GString *text, GString *da, int quadding, double margin,
void Annot::draw(Gfx *gfx, GBool printing) {
GBool oc, isLink;
Object annotObj, oIRTObj;
// check the flags
if ((flags & annotFlagHidden) ||
@ -1670,6 +1671,18 @@ void Annot::draw(Gfx *gfx, GBool printing) {
return;
}
if (!getObject(&annotObj)->isDict()) {
annotObj.free();
return;
}
if (annotObj.dictLookupNF("IRT", &oIRTObj)->isRef()) {
annotObj.free(); oIRTObj.free();
return;
}
annotObj.free(); oIRTObj.free();
// check the optional content entry
if (doc->getOptionalContent()->evalOCObject(&ocObj, &oc) && !oc) {
return;