diff options
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 24 |
2 files changed, 17 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 3eeb701ae6f8..419e4bd6cdb2 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -972,11 +972,10 @@ struct ApoTestResults struct ANLDRuleMap { - SwNumRule* mpOutlineNumRule; // WinWord 6 numbering, variant 1 - SwNumRule* mpNumberingNumRule; // WinWord 6 numbering, variant 2 - SwNumRule* GetNumRule(sal_uInt8 nNumType); + OUString msOutlineNumRule; // WinWord 6 numbering, variant 1 + OUString msNumberingNumRule; // WinWord 6 numbering, variant 2 + SwNumRule* GetNumRule(SwDoc& rDoc, sal_uInt8 nNumType); void SetNumRule(SwNumRule*, sal_uInt8 nNumType); - ANLDRuleMap() : mpOutlineNumRule(nullptr), mpNumberingNumRule(nullptr) {} }; struct SprmReadInfo; diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index c5d11892a418..dca9b47c655c 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -956,17 +956,21 @@ WW8LvlType GetNumType(sal_uInt8 nWwLevelNo) return nRet; } -SwNumRule *ANLDRuleMap::GetNumRule(sal_uInt8 nNumType) +SwNumRule *ANLDRuleMap::GetNumRule(SwDoc& rDoc, sal_uInt8 nNumType) { - return (WW8_Numbering == nNumType ? mpNumberingNumRule : mpOutlineNumRule); + const OUString& rNumRule = WW8_Numbering == nNumType ? msNumberingNumRule : msOutlineNumRule; + if (rNumRule.isEmpty()) + return nullptr; + return rDoc.FindNumRulePtr(rNumRule); } void ANLDRuleMap::SetNumRule(SwNumRule *pRule, sal_uInt8 nNumType) { + OUString sNumRule = pRule ? pRule->GetName() : OUString(); if (WW8_Numbering == nNumType) - mpNumberingNumRule = pRule; + msNumberingNumRule = sNumRule; else - mpOutlineNumRule = pRule; + msOutlineNumRule = sNumRule; } // StartAnl is called at the beginning of a row area that contains @@ -980,7 +984,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13) return; m_nWwNumType = nT; - SwNumRule *pNumRule = m_aANLDRules.GetNumRule(m_nWwNumType); + SwNumRule *pNumRule = m_aANLDRules.GetNumRule(m_rDoc, m_nWwNumType); // check for COL numbering: const sal_uInt8* pS12 = nullptr;// sprmAnld @@ -1048,7 +1052,7 @@ void SwWW8ImplReader::NextAnlLine(const sal_uInt8* pSprm13) if (!m_bAnl) return; - SwNumRule *pNumRule = m_aANLDRules.GetNumRule(m_nWwNumType); + SwNumRule *pNumRule = m_aANLDRules.GetNumRule(m_rDoc, m_nWwNumType); // pNd->UpdateNum ohne Regelwerk gibt GPF spaetestens beim Speichern als // sdw3 @@ -1057,7 +1061,7 @@ void SwWW8ImplReader::NextAnlLine(const sal_uInt8* pSprm13) if (*pSprm13 == 10 || *pSprm13 == 11) { m_nSwNumLevel = 0; - if (!pNumRule->GetNumFormat(m_nSwNumLevel)) + if (pNumRule && !pNumRule->GetNumFormat(m_nSwNumLevel)) { // not defined yet // sprmAnld o. 0 @@ -1069,7 +1073,7 @@ void SwWW8ImplReader::NextAnlLine(const sal_uInt8* pSprm13) { m_nSwNumLevel = *pSprm13 - 1; // outline // undefined - if (!pNumRule->GetNumFormat(m_nSwNumLevel)) + if (pNumRule && !pNumRule->GetNumFormat(m_nSwNumLevel)) { if (m_pNumOlst) // there was a OLST { @@ -1122,7 +1126,7 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack) else m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE); - m_aANLDRules.mpNumberingNumRule = nullptr; + m_aANLDRules.msNumberingNumRule.clear(); /* #i18816# my take on this problem is that moving either way from an outline to a @@ -1132,7 +1136,7 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack) (((m_nWwNumType == WW8_Outline) && (nNewType == WW8_Numbering)) || ((m_nWwNumType == WW8_Numbering) && (nNewType == WW8_Outline))); if (!bNumberingNotStopOutline) - m_aANLDRules.mpOutlineNumRule = nullptr; + m_aANLDRules.msOutlineNumRule.clear(); m_nSwNumLevel = 0xff; m_nWwNumType = WW8_None; |