[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 11 10:22:44 UTC 2018


 sw/source/filter/ww8/docxattributeoutput.cxx |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit ac89eb0705ffc9d76a6ec2cdaf5856f3dcf998f6
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Mon Dec 10 12:28:50 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Dec 11 11:22:21 2018 +0100

    sw: docx: avoid GrabBag checks without m_bStartedParaSdt flag
    
    Change-Id: If5c903030c624cbe2552cebfb011f912648929bf
    Reviewed-on: https://gerrit.libreoffice.org/64867
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f3955135065c..3791a6a8f7d8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -367,15 +367,18 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
     // would normally arrive, it would be too late (would be after the
     // paragraph start has been written).
     bool bEndParaSdt = false;
-    SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
-    if (pTextNode && pTextNode->GetpSwAttrSet())
+    if (m_bStartedParaSdt)
     {
-        const SfxItemSet* pSet = pTextNode->GetpSwAttrSet();
-        if (const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_GRABBAG))
+        SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
+        if (pTextNode && pTextNode->GetpSwAttrSet())
         {
-            const SfxGrabBagItem& rParaGrabBag = static_cast<const SfxGrabBagItem&>(*pItem);
-            const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.GetGrabBag();
-            bEndParaSdt = m_bStartedParaSdt && rMap.find("ParaSdtEndBefore") != rMap.end();
+            const SfxItemSet* pSet = pTextNode->GetpSwAttrSet();
+            if (const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_GRABBAG))
+            {
+                const SfxGrabBagItem& rParaGrabBag = static_cast<const SfxGrabBagItem&>(*pItem);
+                const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.GetGrabBag();
+                bEndParaSdt = m_bStartedParaSdt && rMap.find("ParaSdtEndBefore") != rMap.end();
+            }
         }
     }
     // TODO also avoid multiline paragraphs in those SDT types for shape text


More information about the Libreoffice-commits mailing list