Kaydet (Commit) ac89eb07 authored tarafından Serge Krot's avatar Serge Krot Kaydeden (comit) Thorsten Behrens

sw: docx: avoid GrabBag checks without m_bStartedParaSdt flag

Change-Id: If5c903030c624cbe2552cebfb011f912648929bf
Reviewed-on: https://gerrit.libreoffice.org/64867
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 2b14ac71
...@@ -367,15 +367,18 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText ...@@ -367,15 +367,18 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
// would normally arrive, it would be too late (would be after the // would normally arrive, it would be too late (would be after the
// paragraph start has been written). // paragraph start has been written).
bool bEndParaSdt = false; bool bEndParaSdt = false;
SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode(); if (m_bStartedParaSdt)
if (pTextNode && pTextNode->GetpSwAttrSet())
{ {
const SfxItemSet* pSet = pTextNode->GetpSwAttrSet(); SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
if (const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_GRABBAG)) if (pTextNode && pTextNode->GetpSwAttrSet())
{ {
const SfxGrabBagItem& rParaGrabBag = static_cast<const SfxGrabBagItem&>(*pItem); const SfxItemSet* pSet = pTextNode->GetpSwAttrSet();
const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.GetGrabBag(); if (const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_GRABBAG))
bEndParaSdt = m_bStartedParaSdt && rMap.find("ParaSdtEndBefore") != rMap.end(); {
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 // TODO also avoid multiline paragraphs in those SDT types for shape text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment