This commit is contained in:
Green
2025-02-03 15:35:39 +03:00
parent fe208f5243
commit 79a4434583
3 changed files with 5 additions and 3 deletions

View File

@ -353,7 +353,7 @@ void CConverter2OOXML::WriteCharacter(const CCtrlCharacter* pCharacter, short sh
void CConverter2OOXML::WriteShape(const CCtrlGeneralShape* pShape, short shParaShapeID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState)
{
if (nullptr == pShape)
if (nullptr == pShape || oState.m_bInTextBox)
return;
switch (pShape->GetShapeType())
@ -1094,6 +1094,7 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
oBuilder.WriteString(L"<wps:txbx><w:txbxContent>");
TConversionState oShapeState;
oShapeState.m_bInTextBox = true;
for (unsigned int unParaIndex = 0; unParaIndex < nCountParagraphs; ++unParaIndex)
WriteParagraph(pGeneralShape->GetParagraphs(unParaIndex), oBuilder, oShapeState);
@ -2194,7 +2195,7 @@ HWP_STRING CConverter2OOXML::GetTempDirectory() const
}
TConversionState::TConversionState()
: m_bOpenedP(false), m_bOpenedR(false), m_bIsNote(false), m_ushLastCharShapeId(-1), m_ushSecdIndex(0), m_unParaIndex(0), m_pHighlightColor(nullptr),
: m_bOpenedP(false), m_bOpenedR(false), m_bIsNote(false), m_bInTextBox(false), m_ushLastCharShapeId(-1), m_ushSecdIndex(0), m_unParaIndex(0), m_pHighlightColor(nullptr),
m_pSectionDef(nullptr), m_pColumnDef(nullptr), m_eBreakType(EBreakType::None)
{}

View File

@ -39,6 +39,8 @@ struct TConversionState
bool m_bOpenedR;
bool m_bIsNote;
bool m_bInTextBox; // TODO:: используется, чтобы в wps:txbx не появилась новая фигура (посмотреть этот момент нужно подробнее)
unsigned short m_ushLastCharShapeId;
unsigned short m_ushSecdIndex;

View File

@ -979,7 +979,6 @@ int CHWPSection::ParseContainerRecurse(CCtrlContainer* pContainer, int nRunLevel
{
CCtrlGeneralShape* pCtrl = pContainer->GetLastShape();
int nSubParaCount = CHWPRecordListHeader::GetCount(nTagNum, nLevel, nSize, oBuffer, 0, nVersion);
oBuffer.Skip(6);
if (EShapeType::Rect == pCtrl->GetShapeType() || EShapeType::Polygon == pCtrl->GetShapeType())
{