sw/source/filter/ww8/docxattributeoutput.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
New commits: commit ac89eb0705ffc9d76a6ec2cdaf5856f3dcf998f6 Author: Serge Krot <[email protected]> AuthorDate: Mon Dec 10 12:28:50 2018 +0100 Commit: Thorsten Behrens <[email protected]> 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 <[email protected]> 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 _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
