diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 3 |
2 files changed, 19 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 847888dfba75..bf120d3e47a9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -367,7 +367,10 @@ void DocxAttributeOutput::StartContentControl(const SwFormatContentControl& rFor m_pContentControl = rFormatContentControl.GetContentControl(); } -void DocxAttributeOutput::EndContentControl() { ++m_nCloseContentControl; } +void DocxAttributeOutput::EndContentControl() +{ + ++m_nCloseContentControlInThisRun; +} static void checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutput) { @@ -1628,8 +1631,9 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / m_bEndCharSdt = false; } - for (; m_nCloseContentControl > 0; --m_nCloseContentControl) + for (; m_nCloseContentControlInPreviousRun > 0; --m_nCloseContentControlInPreviousRun) { + // Not the last run of this paragraph. m_pSerializer->endElementNS(XML_w, XML_sdtContent); m_pSerializer->endElementNS(XML_w, XML_sdt); } @@ -1854,6 +1858,13 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / m_pRedlineData = nullptr; } + for (; m_nCloseContentControlInThisRun > 0; --m_nCloseContentControlInThisRun) + { + // Last run of this paragraph. + m_pSerializer->endElementNS(XML_w, XML_sdtContent); + m_pSerializer->endElementNS(XML_w, XML_sdt); + } + if ( m_closeHyperlinkInThisRun ) { if ( m_startedHyperlink ) @@ -3259,6 +3270,10 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh { m_closeHyperlinkInPreviousRun = true; } + if (m_nCloseContentControlInThisRun > 0) + { + ++m_nCloseContentControlInPreviousRun; + } m_bRunTextIsOn = true; // one text can be split into more <w:t>blah</w:t>'s by line breaks etc. const sal_Unicode *pBegin = rText.getStr(); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 4b4be1ca6160..00549f5d8beb 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -911,7 +911,8 @@ private: o3tl::sorted_vector<const SwFrameFormat*> m_aFloatingTablesOfParagraph; sal_Int32 m_nTextFrameLevel; - sal_Int32 m_nCloseContentControl = 0; + sal_Int32 m_nCloseContentControlInThisRun = 0; + sal_Int32 m_nCloseContentControlInPreviousRun = 0; // close of hyperlink needed bool m_closeHyperlinkInThisRun; |