mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Merge remote-tracking branch 'origin/fix/hwp-bugs' into fix/fb2-html-hwp
This commit is contained in:
@ -5,10 +5,9 @@
|
|||||||
#include "../../../DesktopEditor/common/File.h"
|
#include "../../../DesktopEditor/common/File.h"
|
||||||
#include "../../../DesktopEditor/common/Directory.h"
|
#include "../../../DesktopEditor/common/Directory.h"
|
||||||
#include "../../../DesktopEditor/common/SystemUtils.h"
|
#include "../../../DesktopEditor/common/SystemUtils.h"
|
||||||
#include "../../../DesktopEditor/raster/BgraFrame.h"
|
|
||||||
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
||||||
|
|
||||||
#include "../../../DesktopEditor/graphics/pro/Graphics.h"
|
#include "../../../DesktopEditor/graphics/pro/Image.h"
|
||||||
|
|
||||||
#include "../Paragraph/ParaText.h"
|
#include "../Paragraph/ParaText.h"
|
||||||
#include "../Paragraph/CtrlTable.h"
|
#include "../Paragraph/CtrlTable.h"
|
||||||
@ -1293,8 +1292,8 @@ void CConverter2OOXML::WriteSectionSettings(TConversionState& oState)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_oDocXml.WriteString(L"<w:pgSz w:w=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetWidth())) + L"\" w:h=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetHeight())) + L"\"/>");
|
m_oDocXml.WriteString(L"<w:pgSz w:w=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetWidth())) + L"\" w:h=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetHeight())) + L"\"/>");
|
||||||
m_oDocXml.WriteString(L"<w:pgMar w:top=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginTop())) + L"\" w:right=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginRight())) + L"\" w:bottom=\"" +
|
m_oDocXml.WriteString(L"<w:pgMar w:top=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginTop() + pPage->GetMarginHeader())) + L"\" w:right=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginRight())) + L"\" w:bottom=\"" +
|
||||||
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginBottom())) + L"\" w:left=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginRight())) + L"\" w:header=\"" +
|
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginBottom() + pPage->GetMarginFooter())) + L"\" w:left=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginRight())) + L"\" w:header=\"" +
|
||||||
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginHeader())) + L"\" w:footer=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginFooter())) + L"\" w:gutter=\"" +
|
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginHeader())) + L"\" w:footer=\"" + std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginFooter())) + L"\" w:gutter=\"" +
|
||||||
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginGutter())) + L"\"/>");
|
std::to_wstring(Transform::HWPUINT2Twips(pPage->GetMarginGutter())) + L"\"/>");
|
||||||
}
|
}
|
||||||
@ -1647,13 +1646,13 @@ void CConverter2OOXML::WriteShapeExtent(const CCtrlObjElement* pCtrlShape, NSStr
|
|||||||
if (nullptr == pCtrlShape)
|
if (nullptr == pCtrlShape)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int nFinalWidth = pCtrlShape->GetCurWidth();
|
int nFinalWidth = std::abs(pCtrlShape->GetWidth());
|
||||||
int nFinalHeight = pCtrlShape->GetCurHeight();
|
int nFinalHeight = std::abs(pCtrlShape->GetHeight());
|
||||||
|
|
||||||
if (0 == nFinalWidth || 0 == nFinalHeight)
|
if (0 == nFinalWidth || 0 == nFinalHeight)
|
||||||
{
|
{
|
||||||
nFinalWidth = std::abs(pCtrlShape->GetWidth());
|
nFinalWidth = pCtrlShape->GetCurWidth();
|
||||||
nFinalHeight = std::abs(pCtrlShape->GetHeight());
|
nFinalHeight = pCtrlShape->GetCurHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nullptr != pWidth)
|
if (nullptr != pWidth)
|
||||||
@ -2026,7 +2025,11 @@ void CConverter2OOXML::WriteAutoNumber(const CCtrlAutoNumber* pAutoNumber, short
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case ENumType::TOTAL_PAGE:
|
case ENumType::TOTAL_PAGE:
|
||||||
ushValue = m_ushPageCount; break;
|
{
|
||||||
|
OpenParagraph(shParaShapeID, shParaStyleID, oBuilder, oState);
|
||||||
|
oBuilder.WriteString(L"<w:fldSimple w:instr=\"NUMPAGES \\* ARABIC\"><w:r><w:t>1</w:t></w:r></w:fldSimple>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
case ENumType::FOOTNOTE:
|
case ENumType::FOOTNOTE:
|
||||||
{
|
{
|
||||||
OpenParagraph(shParaShapeID, shParaStyleID, oBuilder, oState);
|
OpenParagraph(shParaShapeID, shParaStyleID, oBuilder, oState);
|
||||||
|
|||||||
@ -152,7 +152,7 @@ LIST<CCtrl*> CHWPRecordParaText::Parse(int nTagNum, int nLevel, int nSize, CHWPS
|
|||||||
{
|
{
|
||||||
UPDATE_CURRENT_TEXT();
|
UPDATE_CURRENT_TEXT();
|
||||||
|
|
||||||
if (sText.length() < unIndex + 6 || (sText[unIndex] != sText[unIndex + 6] && sText[unIndex] != sText[unIndex + 7]))
|
if (sText.length() < unIndex + 7 || (sText[unIndex] != sText[unIndex + 6] && sText[unIndex] != sText[unIndex + 7]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
arParas.push_back(new CCtrlCharacter(L" _", ECtrlCharType::TABULATION));
|
arParas.push_back(new CCtrlCharacter(L" _", ECtrlCharType::TABULATION));
|
||||||
|
|||||||
Reference in New Issue
Block a user