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

Caolán McNamara caolanm at redhat.com
Thu Jul 6 13:23:24 UTC 2017


 sw/source/filter/ww8/ww8graf.cxx |   20 ++---
 sw/source/filter/ww8/ww8par.cxx  |   65 ++++++++--------
 sw/source/filter/ww8/ww8par.hxx  |   13 ++-
 sw/source/filter/ww8/ww8par2.cxx |   24 +++---
 sw/source/filter/ww8/ww8par3.cxx |    4 -
 sw/source/filter/ww8/ww8par5.cxx |   16 ++--
 sw/source/filter/ww8/ww8par6.cxx |  152 +++++++++++++++++++--------------------
 7 files changed, 148 insertions(+), 146 deletions(-)

New commits:
commit f396f02dd02ef0e921060240bd19d3ad87813bf5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 6 10:49:38 2017 +0100

    ofz: fix some leaks
    
    Change-Id: Ia29ccd98c60bb73ce2532e47eefc317de1e87303
    Reviewed-on: https://gerrit.libreoffice.org/39641
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index afec6649a14b..38070fe68586 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -586,7 +586,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
     std::deque<Chunk> aChunks;
 
     // Here store stack location
-    size_t nCurrentCount = m_pCtrlStck->size();
+    size_t nCurrentCount = m_xCtrlStck->size();
     while (nStart < nEndCp)
     {
         // nStart is the beginning of the attributes for this range, and
@@ -645,13 +645,13 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
             {
                 if (bStartAttr)
                 {
-                    size_t nCount = m_pCtrlStck->size();
+                    size_t nCount = m_xCtrlStck->size();
                     if (m_aFieldStack.empty() && Read_Field(&aRes))
                     {
                         OUString sURL;
-                        for (size_t nI = m_pCtrlStck->size(); nI > nCount; --nI)
+                        for (size_t nI = m_xCtrlStck->size(); nI > nCount; --nI)
                         {
-                            const SfxPoolItem *pItem = ((*m_pCtrlStck)[nI-1]).pAttr.get();
+                            const SfxPoolItem *pItem = ((*m_xCtrlStck)[nI-1]).pAttr.get();
                             sal_uInt16 nWhich = pItem->Which();
                             if (nWhich == RES_TXTATR_INETFMT)
                             {
@@ -659,7 +659,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
                                     static_cast<const SwFormatINetFormat *>(pItem);
                                 sURL = pURL->GetValue();
                             }
-                            m_pCtrlStck->DeleteAndDestroy(nI-1);
+                            m_xCtrlStck->DeleteAndDestroy(nI-1);
                         }
                         aChunks.push_back(Chunk(nStart, sURL));
                     }
@@ -683,11 +683,11 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
             // Here read current properties and convert them into pS
             // and put those attrs into the draw box if they can be converted
             // to draw attributes
-            if (m_pCtrlStck->size() - nCurrentCount)
+            if (m_xCtrlStck->size() - nCurrentCount)
             {
-                for (size_t i = nCurrentCount; i < m_pCtrlStck->size(); ++i)
+                for (size_t i = nCurrentCount; i < m_xCtrlStck->size(); ++i)
                 {
-                    const SfxPoolItem *pItem = ((*m_pCtrlStck)[i]).pAttr.get();
+                    const SfxPoolItem *pItem = ((*m_xCtrlStck)[i]).pAttr.get();
                     sal_uInt16 nWhich = pItem->Which();
                     if( nWhich < RES_FLTRATTR_BEGIN ||
                         nWhich >= RES_FLTRATTR_END )
@@ -724,8 +724,8 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
 
     // pop off as far as recorded location just in case there were some left
     // unclosed
-    for (size_t nI = m_pCtrlStck->size(); nI > nCurrentCount; --nI)
-        m_pCtrlStck->DeleteAndDestroy(nI-1);
+    for (size_t nI = m_xCtrlStck->size(); nI > nCurrentCount; --nI)
+        m_xCtrlStck->DeleteAndDestroy(nI-1);
 
     typedef std::deque<Chunk>::iterator myIter;
     myIter aEnd = aChunks.end();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 35fbe69fcdf0..05b0fdee3e4f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -550,24 +550,24 @@ void SwMSDffManager::EnableFallbackStream()
 
 sal_uInt16 SwWW8ImplReader::GetToggleAttrFlags() const
 {
-    return m_pCtrlStck ? m_pCtrlStck->GetToggleAttrFlags() : 0;
+    return m_xCtrlStck ? m_xCtrlStck->GetToggleAttrFlags() : 0;
 }
 
 sal_uInt16 SwWW8ImplReader::GetToggleBiDiAttrFlags() const
 {
-    return m_pCtrlStck ? m_pCtrlStck->GetToggleBiDiAttrFlags() : 0;
+    return m_xCtrlStck ? m_xCtrlStck->GetToggleBiDiAttrFlags() : 0;
 }
 
 void SwWW8ImplReader::SetToggleAttrFlags(sal_uInt16 nFlags)
 {
-    if (m_pCtrlStck)
-        m_pCtrlStck->SetToggleAttrFlags(nFlags);
+    if (m_xCtrlStck)
+        m_xCtrlStck->SetToggleAttrFlags(nFlags);
 }
 
 void SwWW8ImplReader::SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
 {
-    if (m_pCtrlStck)
-        m_pCtrlStck->SetToggleBiDiAttrFlags(nFlags);
+    if (m_xCtrlStck)
+        m_xCtrlStck->SetToggleBiDiAttrFlags(nFlags);
 }
 
 SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
@@ -1627,7 +1627,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
 {
     if (nLen < 0)
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_TABSTOP);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_TABSTOP);
         return;
     }
 
@@ -1964,7 +1964,7 @@ void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo)
  */
 WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
     maTmpPos(*pRdr->m_pPaM->GetPoint()),
-    mpOldStck(pRdr->m_pCtrlStck),
+    mxOldStck(std::move(pRdr->m_xCtrlStck)),
     mxOldAnchorStck(std::move(pRdr->m_xAnchorStck)),
     mxOldRedlines(std::move(pRdr->m_xRedlineStack)),
     mxOldPlcxMan(pRdr->m_xPlcxMan),
@@ -1998,8 +1998,8 @@ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
     pRdr->m_pTableDesc = nullptr;
     pRdr->m_nAktColl = 0;
 
-    pRdr->m_pCtrlStck = new SwWW8FltControlStack(&pRdr->m_rDoc, pRdr->m_nFieldFlags,
-        *pRdr);
+    pRdr->m_xCtrlStck.reset(new SwWW8FltControlStack(&pRdr->m_rDoc, pRdr->m_nFieldFlags,
+        *pRdr));
 
     pRdr->m_xRedlineStack.reset(new sw::util::RedlineStack(pRdr->m_rDoc));
 
@@ -2044,7 +2044,7 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
 
     // Close all attributes as attributes could be created that extend the Fly
     pRdr->DeleteCtrlStack();
-    pRdr->m_pCtrlStck = mpOldStck;
+    pRdr->m_xCtrlStck = std::move(mxOldStck);
 
     pRdr->m_xRedlineStack->closeall(*pRdr->m_pPaM->GetPoint());
     pRdr->m_xRedlineStack = std::move(mxOldRedlines);
@@ -2145,9 +2145,9 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
     aPostIt.SetTextObject(pOutliner);
 
     SwPaM aEnd(*m_pPaM->End(), *m_pPaM->End());
-    m_pCtrlStck->NewAttr(*aEnd.GetPoint(), SvxCharHiddenItem(false, RES_CHRATR_HIDDEN));
+    m_xCtrlStck->NewAttr(*aEnd.GetPoint(), SvxCharHiddenItem(false, RES_CHRATR_HIDDEN));
     m_rDoc.getIDocumentContentOperations().InsertPoolItem(aEnd, SwFormatField(aPostIt));
-    m_pCtrlStck->SetAttr(*aEnd.GetPoint(), RES_CHRATR_HIDDEN);
+    m_xCtrlStck->SetAttr(*aEnd.GetPoint(), RES_CHRATR_HIDDEN);
     // If this is a range, make sure that it ends after the just inserted character, not before it.
     m_xReffedStck->MoveAttrs(*aEnd.GetPoint());
 
@@ -2448,7 +2448,7 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper )
         bool bRet = false;
         const SwPosition* pSpacingPos = rMyPam.GetPoint();
 
-        const SvxULSpaceItem* pULSpaceItem = static_cast<const SvxULSpaceItem*>(m_pCtrlStck->GetFormatAttr(*pSpacingPos, RES_UL_SPACE));
+        const SvxULSpaceItem* pULSpaceItem = static_cast<const SvxULSpaceItem*>(m_xCtrlStck->GetFormatAttr(*pSpacingPos, RES_UL_SPACE));
 
         if(pULSpaceItem != nullptr)
         {
@@ -2461,9 +2461,9 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper )
 
             const sal_Int32 nEnd = pSpacingPos->nContent.GetIndex();
             rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), 0);
-            m_pCtrlStck->NewAttr(*pSpacingPos, aUL);
+            m_xCtrlStck->NewAttr(*pSpacingPos, aUL);
             rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), nEnd);
-            m_pCtrlStck->SetAttr(*pSpacingPos, RES_UL_SPACE);
+            m_xCtrlStck->SetAttr(*pSpacingPos, RES_UL_SPACE);
             bRet = true;
         }
         return bRet;
@@ -2791,9 +2791,9 @@ void SwWW8ImplReader::PostProcessAttrs()
         {
             do
             {
-                m_pCtrlStck->NewAttr(*m_pPostProcessAttrsInfo->mPaM.GetPoint(),
+                m_xCtrlStck->NewAttr(*m_pPostProcessAttrsInfo->mPaM.GetPoint(),
                                    *pItem);
-                m_pCtrlStck->SetAttr(*m_pPostProcessAttrsInfo->mPaM.GetMark(),
+                m_xCtrlStck->SetAttr(*m_pPostProcessAttrsInfo->mPaM.GetMark(),
                                    pItem->Which());
             }
             while (!aIter.IsAtEnd() && nullptr != (pItem = aIter.NextItem()));
@@ -3298,11 +3298,11 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString
                     if (aForced[i])
                     {
                         pOverriddenItems[i] =
-                            static_cast<const SvxFontItem*>(m_pCtrlStck->GetStackAttr(*m_pPaM->GetPoint(), aIds[i]));
+                            static_cast<const SvxFontItem*>(m_xCtrlStck->GetStackAttr(*m_pPaM->GetPoint(), aIds[i]));
 
                         SvxFontItem aForceFont(*pSourceFont);
                         aForceFont.SetWhich(aIds[i]);
-                        m_pCtrlStck->NewAttr(*m_pPaM->GetPoint(), aForceFont);
+                        m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), aForceFont);
                     }
                 }
             }
@@ -3314,9 +3314,9 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString
         {
             if (aForced[i])
             {
-                m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), aIds[i]);
+                m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), aIds[i]);
                 if (pOverriddenItems[i])
-                    m_pCtrlStck->NewAttr(*m_pPaM->GetPoint(), *(pOverriddenItems[i]));
+                    m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), *(pOverriddenItems[i]));
             }
         }
 
@@ -3390,9 +3390,9 @@ bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd,
             {
                 m_rDoc.getIDocumentContentOperations().InsertString( *m_pPaM, OUString(m_cSymbol) );
             }
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONT );
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONT );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONT );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONT );
         }
         m_pStrm->SeekRel(nRequested);
         rPos = nEnd; // Ignore until attribute end
@@ -3431,7 +3431,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
         }
 
         m_bPgSecBreak = true;
-        m_pCtrlStck->KillUnlockedAttrs(*m_pPaM->GetPoint());
+        m_xCtrlStck->KillUnlockedAttrs(*m_pPaM->GetPoint());
         /*
         If it's a 0x0c without a paragraph end before it, act like a
         paragraph end, but nevertheless, numbering (and perhaps other
@@ -3792,7 +3792,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar
 
     // Find next Attr position (and Skip attributes of field contents if needed)
     if (nSkipChars && !m_bIgnoreText)
-        m_pCtrlStck->MarkAllAttrsOld();
+        m_xCtrlStck->MarkAllAttrsOld();
     bool bOldIgnoreText = m_bIgnoreText;
     m_bIgnoreText = true;
     sal_uInt16 nOldColl = m_nAktColl;
@@ -3827,7 +3827,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar
     m_bIgnoreText    = bOldIgnoreText;
     if( nSkipChars )
     {
-        m_pCtrlStck->KillUnlockedAttrs( *m_pPaM->GetPoint() );
+        m_xCtrlStck->KillUnlockedAttrs( *m_pPaM->GetPoint() );
         if( nOldColl != m_xPlcxMan->GetColl() )
             ProcessAktCollChange(aRes, nullptr, false);
     }
@@ -3995,7 +3995,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
             // Need to reset the font size and text position for the dropcap
             {
                 SwPaM aTmp(*pEndNd, 0, *pEndNd, nDropCapLen+1);
-                m_pCtrlStck->Delete(aTmp);
+                m_xCtrlStck->Delete(aTmp);
             }
 
             // Get the default document dropcap which we can use as our template
@@ -4015,8 +4015,8 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
                 aDrop.SetCharFormat(pNewSwCharFormat);
 
             SwPosition aStart(*pEndNd);
-            m_pCtrlStck->NewAttr(aStart, aDrop);
-            m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_DROP);
+            m_xCtrlStck->NewAttr(aStart, aDrop);
+            m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_DROP);
             pPreviousNode = nullptr;
         }
         else if (m_bDropCap)
@@ -4124,7 +4124,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
     , m_pDataStream(nullptr)
     , m_rDoc(rD)
     , m_pPaM(nullptr)
-    , m_pCtrlStck(nullptr)
     , m_pReffingStck(nullptr)
     , m_aSectionManager(*this)
     , m_aExtraneousParas(rD)
@@ -4902,7 +4901,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
 
     m_pPaM = mpCursor.get();
 
-    m_pCtrlStck = new SwWW8FltControlStack( &m_rDoc, m_nFieldFlags, *this );
+    m_xCtrlStck.reset(new SwWW8FltControlStack(&m_rDoc, m_nFieldFlags, *this));
 
     m_xRedlineStack.reset(new sw::util::RedlineStack(m_rDoc));
 
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index c737d0503d12..6d9ad31dfc63 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -580,7 +580,7 @@ private:
     SwPosition maTmpPos;
     std::deque<bool> maOldApos;
     std::deque<WW8FieldEntry> maOldFieldStack;
-    SwWW8FltControlStack* mpOldStck;
+    std::unique_ptr<SwWW8FltControlStack> mxOldStck;
     std::unique_ptr<SwWW8FltAnchorStack> mxOldAnchorStck;
     std::unique_ptr<sw::util::RedlineStack> mxOldRedlines;
     std::shared_ptr<WW8PLCFMan> mxOldPlcxMan;
@@ -1081,7 +1081,7 @@ private:
     std::shared_ptr<SwUnoCursor> mpCursor;
     SwPaM* m_pPaM;
 
-    SwWW8FltControlStack* m_pCtrlStck;    // stack for the attributes
+    std::unique_ptr<SwWW8FltControlStack> m_xCtrlStck;    // stack for the attributes
 
     /*
     This stack is for redlines, because their sequence of discovery can
@@ -1376,7 +1376,10 @@ private:
                            SwPageDesc* pNewPageDesc, sal_uInt8 nCode );
 
     void DeleteStack(SwFltControlStack* prStck);
-    void DeleteCtrlStack()    { DeleteStack( m_pCtrlStck  ); m_pCtrlStck   = nullptr; }
+    void DeleteCtrlStack()
+    {
+        DeleteStack(m_xCtrlStck.release());
+    }
     void DeleteRefStacks()
     {
         DeleteStack(m_xReffedStck.release());
@@ -1632,7 +1635,7 @@ private:
     void ChkToggleAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask )
     {
         if( nOldStyle81Mask != nNewStyle81Mask &&
-            m_pCtrlStck->GetToggleAttrFlags() )
+            m_xCtrlStck->GetToggleAttrFlags() )
             ChkToggleAttr_( nOldStyle81Mask, nNewStyle81Mask );
     }
 
@@ -1641,7 +1644,7 @@ private:
     void ChkToggleBiDiAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask )
     {
         if( nOldStyle81Mask != nNewStyle81Mask &&
-            m_pCtrlStck->GetToggleBiDiAttrFlags() )
+            m_xCtrlStck->GetToggleBiDiAttrFlags() )
             ChkToggleBiDiAttr_( nOldStyle81Mask, nNewStyle81Mask );
     }
 
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index a3cdf54b00f5..75d76dc9f2ed 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1092,7 +1092,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13)
 
     sNumRule = pNumRule ? pNumRule->GetName() : OUString();
     // set NumRules via stack
-    m_pCtrlStck->NewAttr(*m_pPaM->GetPoint(),
+    m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(),
         SfxStringItem(RES_FLTR_NUMRULE, sNumRule));
 
     m_aANLDRules.SetNumRule(pNumRule, m_nWwNumType);
@@ -1174,11 +1174,11 @@ void SwWW8ImplReader::StopAnlToRestart(sal_uInt8 nNewType, bool bGoBack)
     {
         SwPosition aTmpPos(*m_pPaM->GetPoint());
         m_pPaM->Move(fnMoveBackward, GoInContent);
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);
         *m_pPaM->GetPoint() = aTmpPos;
     }
     else
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_NUMRULE);
 
     m_aANLDRules.mpNumberingNumRule = nullptr;
     /*
@@ -2489,7 +2489,7 @@ void WW8TabDesc::CreateSwTable()
         // set font size to 1 point to minimize y-growth of Hd/Ft
         SvxFontHeightItem aSz(20, 100, RES_CHRATR_FONTSIZE);
         m_pIo->NewAttr( aSz );
-        m_pIo->m_pCtrlStck->SetAttr(*pPoint, RES_CHRATR_FONTSIZE);
+        m_pIo->m_xCtrlStck->SetAttr(*pPoint, RES_CHRATR_FONTSIZE);
     }
 
     if (bInsNode)
@@ -2625,8 +2625,8 @@ void WW8TabDesc::UseSwTable()
     // insert extra cells if needed and something like this
     AdjustNewBand();
 
-    WW8DupProperties aDup(m_pIo->m_rDoc,m_pIo->m_pCtrlStck);
-    m_pIo->m_pCtrlStck->SetAttr(*m_pIo->m_pPaM->GetPoint(), 0, false);
+    WW8DupProperties aDup(m_pIo->m_rDoc, m_pIo->m_xCtrlStck.get());
+    m_pIo->m_xCtrlStck->SetAttr(*m_pIo->m_pPaM->GetPoint(), 0, false);
 
     // now set the correct PaM and prepare first merger group if any
     SetPamInCell(m_nAktCol, true);
@@ -2819,8 +2819,8 @@ void WW8TabDesc::FinishSwTable()
     m_pIo->m_xRedlineStack->closeall(*m_pIo->m_pPaM->GetPoint());
     m_pIo->m_xRedlineStack = std::move(mxOldRedlineStack);
 
-    WW8DupProperties aDup(m_pIo->m_rDoc,m_pIo->m_pCtrlStck);
-    m_pIo->m_pCtrlStck->SetAttr( *m_pIo->m_pPaM->GetPoint(), 0, false);
+    WW8DupProperties aDup(m_pIo->m_rDoc,m_pIo->m_xCtrlStck.get());
+    m_pIo->m_xCtrlStck->SetAttr( *m_pIo->m_pPaM->GetPoint(), 0, false);
 
     MoveOutsideTable();
     delete m_pTmpPos;
@@ -2960,7 +2960,7 @@ void WW8TabDesc::StartMiserableHackForUnsupportedDirection(short nWwCol)
     OSL_ENSURE(m_pActBand, "Impossible");
     if (m_pActBand && m_pActBand->maDirections[nWwCol] == 3)
     {
-        m_pIo->m_pCtrlStck->NewAttr(*m_pIo->m_pPaM->GetPoint(),
+        m_pIo->m_xCtrlStck->NewAttr(*m_pIo->m_pPaM->GetPoint(),
             SvxCharRotateItem(900, false, RES_CHRATR_ROTATE));
     }
 }
@@ -2969,7 +2969,7 @@ void WW8TabDesc::EndMiserableHackForUnsupportedDirection(short nWwCol)
 {
     OSL_ENSURE(m_pActBand, "Impossible");
     if (m_pActBand && m_pActBand->maDirections[nWwCol] == 3)
-        m_pIo->m_pCtrlStck->SetAttr(*m_pIo->m_pPaM->GetPoint(), RES_CHRATR_ROTATE);
+        m_pIo->m_xCtrlStck->SetAttr(*m_pIo->m_pPaM->GetPoint(), RES_CHRATR_ROTATE);
 }
 
 void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
@@ -3070,9 +3070,9 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
 
                 const sal_Int32 nEnd = pGridPos->nContent.GetIndex();
                 pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
-                m_pIo->m_pCtrlStck->NewAttr(*pGridPos, aGridItem);
+                m_pIo->m_xCtrlStck->NewAttr(*pGridPos, aGridItem);
                 pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), nEnd);
-                m_pIo->m_pCtrlStck->SetAttr(*pGridPos, RES_PARATR_SNAPTOGRID);
+                m_pIo->m_xCtrlStck->SetAttr(*pGridPos, RES_PARATR_SNAPTOGRID);
             }
         }
 
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index f77defc76882..3ad16e62ced7 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1881,8 +1881,8 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nActLFO,
 
                 if (const SvxLRSpaceItem *pLR = aListIndent.GetItem<SvxLRSpaceItem>(RES_LR_SPACE))
                 {
-                    m_pCtrlStck->NewAttr(*m_pPaM->GetPoint(), *pLR);
-                    m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
+                    m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), *pLR);
+                    m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
                 }
             }
         }
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 4087540c6bb9..95f30fe88a98 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -577,13 +577,13 @@ sal_uInt16 SwWW8ImplReader::End_Field()
             case 37: //REF
                 if (m_bLoadingTOXCache && !m_bLoadingTOXHyperlink)
                 {
-                    m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_TXTATR_INETFMT);
+                    m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_TXTATR_INETFMT);
                 }
                 break;
             case 88:
                 if (m_bLoadingTOXHyperlink)
                     m_bLoadingTOXHyperlink = false;
-                m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_INETFMT);
+                m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_INETFMT);
                 break;
             case 36:
             case 68:
@@ -1898,9 +1898,9 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, OUString& rStr )
         m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, OUString(cChar));
 
         if (nSize > 0)
-            m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_FONTSIZE);
+            m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_FONTSIZE);
         if (!aName.isEmpty())
-            m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_FONT);
+            m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_FONT);
     }
     else
     {
@@ -2155,7 +2155,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
                 SwStyleNameMapper::GetPoolIdFromUIName( sLinkStyle, SwGetPoolIdFromName::ChrFmt );
             aURL.SetVisitedFormatAndId( sLinkStyle, nPoolId);
             aURL.SetINetFormatAndId( sLinkStyle, nPoolId );
-            m_pCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
+            m_xCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
         }
         return eF_ResT::TEXT;
     }
@@ -2291,7 +2291,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr)
 
             SetNewFontAttr( i, true, RES_CHRATR_FONT );
             m_rDoc.getIDocumentContentOperations().InsertPoolItem( *m_pPaM, SwFormatField( aField ) );
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
             ResetCharSetVars();
         }
     }
@@ -2748,7 +2748,7 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam)
 
         NewAttr(aRuby);
         m_rDoc.getIDocumentContentOperations().InsertString( *m_pPaM, sText );
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_TXTATR_CJK_RUBY );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_TXTATR_CJK_RUBY );
     }
 }
 
@@ -3516,7 +3516,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
     //EndExtSprm in conjunction with the maFieldStack. If there are flyfrms
     //between the start and begin, their hyperlinks will be set at that time
     //as well.
-    m_pCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
+    m_xCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
     return eF_ResT::TEXT;
 }
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 188021deffea..fd24098031ed 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -312,7 +312,7 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat &rFormat, const wwSection &r
 void SwWW8ImplReader::Read_ParaBiDi(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FRAMEDIR);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FRAMEDIR);
     else
     {
         SvxFrameDirection eDir =
@@ -746,7 +746,7 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection)
             }
             aLN.SetStartValue(1 + rSection.maSep.lnnMin);
             NewAttr(aLN);
-            m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LINENUMBER);
+            m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LINENUMBER);
         }
         m_bNoLnNumYet = false;
     }
@@ -2190,9 +2190,9 @@ void WW8DupProperties::Insert(const SwPosition &rPos)
 
 void SwWW8ImplReader::MoveInsideFly(const SwFrameFormat *pFlyFormat)
 {
-    WW8DupProperties aDup(m_rDoc,m_pCtrlStck);
+    WW8DupProperties aDup(m_rDoc, m_xCtrlStck.get());
 
-    m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), 0, false);
+    m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), 0, false);
 
     // set Pam in FlyFrame
     const SwFormatContent& rContent = pFlyFormat->GetContent();
@@ -2211,8 +2211,8 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrameFormat *pFlyFormat,
         return nRetWidth;
     // Close all attributes, because otherwise attributes can appear
     // that extend out of Flys
-    WW8DupProperties aDup(m_rDoc,m_pCtrlStck);
-    m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), 0, false);
+    WW8DupProperties aDup(m_rDoc, m_xCtrlStck.get());
+    m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), 0, false);
 
     /*
     #i1291
@@ -2433,7 +2433,7 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr)
         rPam.GetPoint()->nNode = aPref;
         rPam.GetPoint()->nContent.Assign(pNode, pNode->GetText().getLength());
         if (bStealAttr)
-            m_pCtrlStck->StealAttr(rPam.GetPoint()->nNode);
+            m_xCtrlStck->StealAttr(rPam.GetPoint()->nNode);
 
         pNode->JoinNext();
 
@@ -2648,7 +2648,7 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
         }
         else
         {
-            m_pCtrlStck->NewAttr(*m_pPaM->GetPoint(), rAttr);
+            m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), rAttr);
             // #i103711#
             if ( bFirstLineOfStSet )
             {
@@ -2684,7 +2684,7 @@ const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( sal_uInt16 nWhich )
     }
     else if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
     {
-        pRet = m_pCtrlStck->GetStackAttr(*m_pPaM->GetPoint(), nWhich);
+        pRet = m_xCtrlStck->GetStackAttr(*m_pPaM->GetPoint(), nWhich);
         if (!pRet)
         {
             if (m_nAktColl < m_vColl.size() && m_vColl[m_nAktColl].m_pFormat &&
@@ -2699,7 +2699,7 @@ const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( sal_uInt16 nWhich )
             pRet = &m_rDoc.GetAttrPool().GetDefaultItem(nWhich);
     }
     else
-        pRet = m_pCtrlStck->GetFormatAttr(*m_pPaM->GetPoint(), nWhich);
+        pRet = m_xCtrlStck->GetFormatAttr(*m_pPaM->GetPoint(), nWhich);
     return pRet;
 }
 
@@ -2760,7 +2760,7 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLe
 {
     if (nLen < 0)
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_OUTLINELEVEL);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_OUTLINELEVEL);
         return;
     }
 
@@ -2791,7 +2791,7 @@ void SwWW8ImplReader::Read_Symbol(sal_uInt16, const sal_uInt8* pData, short nLen
         {
             //otherwise disable after we print the char
             if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
-                m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
+                m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
             m_bSymbol = false;
         }
         else
@@ -2880,14 +2880,14 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
             {
                 // reset the CTL Weight and Posture, because they are the same as their
                 // western equivalents in ww6
-                m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nWestern + nEastern + nI ] );
+                m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nWestern + nEastern + nI ] );
             }
             // reset the CJK Weight and Posture, because they are the same as their
             // western equivalents in word
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nWestern + nI ] );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nWestern + nI ] );
         }
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nI ] );
-        m_pCtrlStck->SetToggleAttr(nI, false);
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nEndIds[ nI ] );
+        m_xCtrlStck->SetToggleAttr(nI, false);
         return;
     }
     // value: 0 = off, 1 = on, 128 = like style, 129 contrary to style
@@ -2929,7 +2929,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
             if (pSI && pSI->m_n81Flags & nMask)       // and in StyleDef at ?
                 bOn = !bOn;                 // then invert
             // remember on stack that this is a toggle-attribute
-            m_pCtrlStck->SetToggleAttr(nI, true);
+            m_xCtrlStck->SetToggleAttr(nI, true);
         }
     }
 
@@ -2941,7 +2941,7 @@ void SwWW8ImplReader::Read_Bidi(sal_uInt16, const sal_uInt8* pData, short nLen)
     if (nLen < 1)  //Property end
     {
         m_bBidi = false;
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_BIDIRTL);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_BIDIRTL);
     }
     else    //Property start
     {
@@ -3054,8 +3054,8 @@ void SwWW8ImplReader::Read_BoldBiDiUsw(sal_uInt16 nId, const sal_uInt8* pData,
 
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),nEndIds[nI]);
-        m_pCtrlStck->SetToggleBiDiAttr(nI, false);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(),nEndIds[nI]);
+        m_xCtrlStck->SetToggleBiDiAttr(nI, false);
         return;
     }
     bool bOn = *pData & 1;
@@ -3092,7 +3092,7 @@ void SwWW8ImplReader::Read_BoldBiDiUsw(sal_uInt16 nId, const sal_uInt8* pData,
             if (pSI && pSI->m_n81BiDiFlags & nMask) // and in StyleDef at ?
                 bOn = !bOn;                     // then invert
             // remember on stack that this is a toggle-attribute
-            m_pCtrlStck->SetToggleBiDiAttr(nI, true);
+            m_xCtrlStck->SetToggleBiDiAttr(nI, true);
         }
     }
 
@@ -3189,7 +3189,7 @@ void SwWW8ImplReader::SetToggleAttr(sal_uInt8 nAttrId, bool bOn)
 void SwWW8ImplReader::ChkToggleAttr_( sal_uInt16 nOldStyle81Mask,
                                         sal_uInt16 nNewStyle81Mask )
 {
-    sal_uInt16 i = 1, nToggleAttrFlags = m_pCtrlStck->GetToggleAttrFlags();
+    sal_uInt16 i = 1, nToggleAttrFlags = m_xCtrlStck->GetToggleAttrFlags();
     for (sal_uInt8 n = 0; n < 7; ++n, i <<= 1)
     {
         if (
@@ -3205,7 +3205,7 @@ void SwWW8ImplReader::ChkToggleAttr_( sal_uInt16 nOldStyle81Mask,
 void SwWW8ImplReader::ChkToggleBiDiAttr_( sal_uInt16 nOldStyle81Mask,
                                         sal_uInt16 nNewStyle81Mask )
 {
-    sal_uInt16 i = 1, nToggleAttrFlags = m_pCtrlStck->GetToggleBiDiAttrFlags();
+    sal_uInt16 i = 1, nToggleAttrFlags = m_xCtrlStck->GetToggleBiDiAttrFlags();
     for (sal_uInt8 n = 0; n < 7; ++n, i <<= 1)
     {
         if (
@@ -3222,7 +3222,7 @@ void SwWW8ImplReader::Read_SubSuper( sal_uInt16, const sal_uInt8* pData, short n
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
         return;
     }
 
@@ -3290,11 +3290,11 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
     */
     bool bIsGraphicPlacementHack = false;
     sal_uInt16 nPos;
-    if (m_pCtrlStck->GetFormatStackAttr(RES_CHRATR_ESCAPEMENT, &nPos))
+    if (m_xCtrlStck->GetFormatStackAttr(RES_CHRATR_ESCAPEMENT, &nPos))
     {
         SwPaM aRegion(*m_pPaM->GetPoint());
 
-        SwFltPosition aMkPos((*m_pCtrlStck)[nPos].m_aMkPos);
+        SwFltPosition aMkPos((*m_xCtrlStck)[nPos].m_aMkPos);
         SwFltPosition aPtPos(*m_pPaM->GetPoint());
 
         SwFrameFormat *pFlyFormat = nullptr;
@@ -3303,7 +3303,7 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
              nullptr != (pFlyFormat = ContainsSingleInlineGraphic(aRegion))
            )
         {
-            m_pCtrlStck->DeleteAndDestroy(nPos);
+            m_xCtrlStck->DeleteAndDestroy(nPos);
             pFlyFormat->SetFormatAttr(SwFormatVertOrient(0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::CHAR));
             bIsGraphicPlacementHack = true;
         }
@@ -3318,7 +3318,7 @@ void SwWW8ImplReader::Read_SubSuperProp( sal_uInt16, const sal_uInt8* pData, sho
     if (nLen < (eVersion <= ww::eWW2 ? 1 : 2))
     {
         if (!ConvertSubToGraphicPlacement())
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
         return;
     }
 
@@ -3378,8 +3378,8 @@ void SwWW8ImplReader::Read_Underline( sal_uInt16, const sal_uInt8* pData, short
     // if necessary, mix up stack and exit!
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE );
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_WORDLINEMODE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_WORDLINEMODE );
     }
     else
     {
@@ -3402,8 +3402,8 @@ void SwWW8ImplReader::Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pData
 {
     if (nLen < 0) // close the tag
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_TWO_LINES );
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ROTATE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_TWO_LINES );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ROTATE );
     }
     else if( pData && 6 == nLen )
     {
@@ -3440,7 +3440,7 @@ void SwWW8ImplReader::Read_TextColor( sal_uInt16, const sal_uInt8* pData, short
         return;
 
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
     else
     {
         sal_uInt8 b = *pData;            // parameter: 0 = Auto, 1..16 colors
@@ -3457,7 +3457,7 @@ void SwWW8ImplReader::Read_TextColor( sal_uInt16, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_TextForeColor(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
     if (nLen < 4)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
     else
     {
         Color aColor(msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)));
@@ -3510,7 +3510,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh
         }
         else
         {
-            SvxUnderlineItem* pUnderlineAttr = const_cast<SvxUnderlineItem*>(static_cast<const SvxUnderlineItem*>(m_pCtrlStck->GetOpenStackAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE )));
+            SvxUnderlineItem* pUnderlineAttr = const_cast<SvxUnderlineItem*>(static_cast<const SvxUnderlineItem*>(m_xCtrlStck->GetOpenStackAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE )));
             if (pUnderlineAttr && nLen >= 4)
                 pUnderlineAttr->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32( pData ))));
         }
@@ -3698,7 +3698,7 @@ void SwWW8ImplReader::openFont(sal_uInt16 nFCode, sal_uInt16 nId)
 
 void SwWW8ImplReader::closeFont(sal_uInt16 nId)
 {
-    m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
+    m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
     if (nId == RES_CHRATR_CJK_FONT)
         ResetCJKCharSetVars();
     else
@@ -3778,11 +3778,11 @@ void SwWW8ImplReader::Read_FontSize( sal_uInt16 nId, const sal_uInt8* pData, sho
 
     if (nLen < (eVersion <= ww::eWW2 ? 1 : 2))          // end of attribute
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId  );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId  );
         if (eVersion <= ww::eWW6) // reset additionally the CTL size
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONTSIZE );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONTSIZE );
         if (RES_CHRATR_FONTSIZE == nId)  // reset additionally the CJK size
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONTSIZE );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONTSIZE );
     }
     else
     {
@@ -3855,7 +3855,7 @@ void SwWW8ImplReader::Read_Language( sal_uInt16 nId, const sal_uInt8* pData, sho
     }
 
     if (nLen < 2)                  // end of attribute
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
     else
     {
         sal_uInt16 nLang = SVBT16ToShort( pData );  // Language-Id
@@ -3870,7 +3870,7 @@ void SwWW8ImplReader::Read_CColl( sal_uInt16, const sal_uInt8* pData, short nLen
 {
     if (nLen < 2)    // end of attribute
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_TXTATR_CHARFMT );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_TXTATR_CHARFMT );
         m_nCharFormat = -1;
         return;
     }
@@ -3900,7 +3900,7 @@ void SwWW8ImplReader::Read_Kern( sal_uInt16, const sal_uInt8* pData, short nLen
 {
     if (nLen < 2)  // end of attribute
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_KERNING );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_KERNING );
         return;
     }
     sal_Int16 nKern = SVBT16ToShort( pData );    // Kerning in Twips
@@ -3911,7 +3911,7 @@ void SwWW8ImplReader::Read_FontKern( sal_uInt16, const sal_uInt8* pData, short n
 {
     if (nLen < 2) // end of attribute
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_AUTOKERN );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_AUTOKERN );
         return;
     }
     sal_Int16 nAutoKern = SVBT16ToShort( pData );    // Kerning in Twips
@@ -3926,7 +3926,7 @@ void SwWW8ImplReader::Read_CharShadow(  sal_uInt16, const sal_uInt8* pData, shor
 
     if (nLen < 2)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
     }
     else
     {
@@ -3948,7 +3948,7 @@ void SwWW8ImplReader::Read_TextBackColor(sal_uInt16, const sal_uInt8* pData, sho
 {
     if (nLen <= 0)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
     }
     else
     {
@@ -3970,7 +3970,7 @@ void SwWW8ImplReader::Read_CharHighlight(sal_uInt16, const sal_uInt8* pData, sho
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_HIGHLIGHT );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_HIGHLIGHT );
     }
     else
     {
@@ -3988,7 +3988,7 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short
 {
     if (nLen < 0)  // end of attribute
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_LINENUMBER );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_LINENUMBER );
         return;
     }
     SwFormatLineNumber aLN;
@@ -4020,7 +4020,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
 {
     if (nLen < 2)  // end of attribute
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
         return;
     }
 
@@ -4173,9 +4173,9 @@ void SwWW8ImplReader::Read_LineSpace( sal_uInt16, const sal_uInt8* pData, short
 
     if (nLen < (eVersion <= ww::eWW2 ? 3 : 4))
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_LINESPACING );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_LINESPACING );
         if( !( m_nIniFlags & WW8FL_NO_IMPLPASP ) )
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
         return;
     }
 
@@ -4241,7 +4241,7 @@ void SwWW8ImplReader::Read_ParaAutoBefore(sal_uInt16, const sal_uInt8 *pData, sh
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
         return;
     }
 
@@ -4268,7 +4268,7 @@ void SwWW8ImplReader::Read_ParaAutoAfter(sal_uInt16, const sal_uInt8 *pData, sho
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
         return;
     }
 
@@ -4308,7 +4308,7 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const sal_uInt8* pData, short nLe
     if (nLen < 2)
     {
         // end of attribute
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
         return;
     }
     short nPara = SVBT16ToShort( pData );
@@ -4340,7 +4340,7 @@ void SwWW8ImplReader::Read_ParaContextualSpacing( sal_uInt16, const sal_uInt8* p
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
         return;
     }
     SvxULSpaceItem aUL( *static_cast<const SvxULSpaceItem*>(GetFormatAttr( RES_UL_SPACE )));
@@ -4358,7 +4358,7 @@ void SwWW8ImplReader::Read_IdctHint( sal_uInt16, const sal_uInt8* pData, short n
     // when this value is 2, text properties bias towards complex properties.
     if (nLen < 1)  //Property end
     {
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_IDCTHINT);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_IDCTHINT);
     }
     else    //Property start
     {
@@ -4370,7 +4370,7 @@ void SwWW8ImplReader::Read_Justify( sal_uInt16, const sal_uInt8* pData, short nL
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
         return;
     }
 
@@ -4424,7 +4424,7 @@ void SwWW8ImplReader::Read_RTLJustify( sal_uInt16, const sal_uInt8* pData, short
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
         return;
     }
 
@@ -4482,7 +4482,7 @@ void SwWW8ImplReader::Read_BoolItem( sal_uInt16 nId, const sal_uInt8* pData, sho
     }
 
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
     else
     {
         SfxBoolItem* pI = static_cast<SfxBoolItem*>(GetDfltAttr( nId )->Clone());
@@ -4495,7 +4495,7 @@ void SwWW8ImplReader::Read_BoolItem( sal_uInt16 nId, const sal_uInt8* pData, sho
 void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_EMPHASIS_MARK );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_EMPHASIS_MARK );
     else
     {
         LanguageType nLang;
@@ -4553,7 +4553,7 @@ void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short n
 void SwWW8ImplReader::Read_ScaleWidth( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 2)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SCALEW );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SCALEW );
     else
     {
         sal_uInt16 nVal = SVBT16ToShort( pData );
@@ -4567,7 +4567,7 @@ void SwWW8ImplReader::Read_ScaleWidth( sal_uInt16, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_Relief( sal_uInt16 nId, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_RELIEF );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_RELIEF );
     else
     {
         if( *pData )
@@ -4594,7 +4594,7 @@ void SwWW8ImplReader::Read_Relief( sal_uInt16 nId, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_TextAnim(sal_uInt16 /*nId*/, const sal_uInt8* pData, short nLen)
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_BLINK);
+        m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_BLINK);
     else
     {
         if (*pData)
@@ -4755,7 +4755,7 @@ void SwWW8ImplReader::Read_Shade( sal_uInt16, const sal_uInt8* pData, short nLen
     if (nLen < 2)
     {
         // end of attribute
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BACKGROUND );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BACKGROUND );
     }
     else
     {
@@ -4772,7 +4772,7 @@ void SwWW8ImplReader::Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, sho
     if (nLen <= 0)
     {
         // end of attribute
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BACKGROUND );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BACKGROUND );
     }
     else
     {
@@ -4831,8 +4831,8 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8*, short nLen)
     {
         if( m_bHasBorder )
         {
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BOX );
-            m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_SHADOW );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BOX );
+            m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_SHADOW );
             m_bHasBorder = false;
         }
     }
@@ -4905,8 +4905,8 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
 
     if (nLen < 0)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BOX );
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SHADOW );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BOX );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SHADOW );
     }
     else
     {
@@ -4944,7 +4944,7 @@ void SwWW8ImplReader::Read_Hyphenation( sal_uInt16, const sal_uInt8* pData, shor
 {
     // set Hyphenation flag
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_HYPHENZONE );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_HYPHENZONE );
     else
     {
         SvxHyphenZoneItem aAttr(
@@ -4967,8 +4967,8 @@ void SwWW8ImplReader::Read_WidowControl( sal_uInt16, const sal_uInt8* pData, sho
 {
     if (nLen < 1)
     {
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_WIDOWS );
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ORPHANS );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_WIDOWS );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ORPHANS );
     }
     else
     {
@@ -4986,7 +4986,7 @@ void SwWW8ImplReader::Read_WidowControl( sal_uInt16, const sal_uInt8* pData, sho
 void SwWW8ImplReader::Read_UsePgsuSettings(sal_uInt16,const sal_uInt8* pData,short nLen)
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SNAPTOGRID);
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SNAPTOGRID);
     else
     {
         if(m_nInTable)
@@ -4999,7 +4999,7 @@ void SwWW8ImplReader::Read_UsePgsuSettings(sal_uInt16,const sal_uInt8* pData,sho
 void SwWW8ImplReader::Read_AlignFont( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 2)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_VERTALIGN);
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_VERTALIGN);
     else
     {
         sal_uInt16 nVal = SVBT16ToShort( pData );
@@ -5033,7 +5033,7 @@ void SwWW8ImplReader::Read_AlignFont( sal_uInt16, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_KeepLines( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SPLIT );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SPLIT );
     else
         NewAttr( SvxFormatSplitItem( ( *pData & 1 ) == 0, RES_PARATR_SPLIT ) );
 }
@@ -5041,7 +5041,7 @@ void SwWW8ImplReader::Read_KeepLines( sal_uInt16, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_KeepParas( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_KEEP );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_KEEP );
     else
         NewAttr( SvxFormatKeepItem( ( *pData & 1 ) != 0 , RES_KEEP) );
 }
@@ -5049,7 +5049,7 @@ void SwWW8ImplReader::Read_KeepParas( sal_uInt16, const sal_uInt8* pData, short
 void SwWW8ImplReader::Read_BreakBefore( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     if (nLen < 1)
-        m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BREAK );
+        m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BREAK );
     else
         NewAttr( SvxFormatBreakItem(
                 ( *pData & 1 ) ? SvxBreak::PageBefore : SvxBreak::NONE, RES_BREAK ) );


More information about the Libreoffice-commits mailing list