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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 7 08:52:41 UTC 2020


 sw/inc/dpage.hxx                   |    4 +--
 sw/source/core/docnode/section.cxx |   28 ++++++++++-----------
 sw/source/core/draw/dpage.cxx      |   30 +++++++++++------------
 sw/source/core/edit/acorrect.cxx   |   24 +++++++++---------
 sw/source/core/inc/frminf.hxx      |    8 +++---
 sw/source/core/text/frminf.cxx     |   48 ++++++++++++++++++-------------------
 6 files changed, 70 insertions(+), 72 deletions(-)

New commits:
commit eacb86d332563a5651793f1aaa687528736a7bfb
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Sep 7 09:10:03 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Sep 7 10:51:52 2020 +0200

    sw: prefix members of PaMIntoCursorShellRing, SwDPage, ...
    
    ... SwIntrnlSectRefLink and SwTextFrameInfo
    
    See tdf#94879 for motivation.
    
    Change-Id: Iecf5a06b020488fae6f209133bcaed016feeb44f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102142
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx
index a599a462d2bb..f144663ebac9 100644
--- a/sw/inc/dpage.hxx
+++ b/sw/inc/dpage.hxx
@@ -32,8 +32,8 @@ class SwDPage final : public FmFormPage, public SdrObjUserCall
     SwDPage &operator=(const SwDPage&) = delete;
     SwDPage(const SwDPage&) = delete;
 
-    std::unique_ptr<SdrPageGridFrameList>   pGridLst;
-    SwDoc*                                  pDoc;
+    std::unique_ptr<SdrPageGridFrameList>   m_pGridLst;
+    SwDoc*                                  m_pDoc;
 
 public:
     explicit SwDPage(SwDrawModel& rNewModel, bool bMasterPage);
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 51067dbd21d0..3fe5129b4215 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -69,11 +69,12 @@ namespace {
 
 class SwIntrnlSectRefLink : public SwBaseLink
 {
-    SwSectionFormat& rSectFormat;
+    SwSectionFormat& m_rSectFormat;
+
 public:
-    SwIntrnlSectRefLink( SwSectionFormat& rFormat, SfxLinkUpdateMode nUpdateType )
-        : SwBaseLink( nUpdateType, SotClipboardFormatId::RTF ),
-        rSectFormat( rFormat )
+    SwIntrnlSectRefLink(SwSectionFormat& rFormat, SfxLinkUpdateMode nUpdateType)
+        : SwBaseLink(nUpdateType, SotClipboardFormatId::RTF)
+        , m_rSectFormat(rFormat)
     {}
 
     virtual void Closed() override;
@@ -1172,8 +1173,8 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
 ::sfx2::SvBaseLink::UpdateResult SwIntrnlSectRefLink::DataChanged(
     const OUString& rMimeType, const uno::Any & rValue )
 {
-    SwSectionNode* pSectNd = rSectFormat.GetSectionNode();
-    SwDoc* pDoc = rSectFormat.GetDoc();
+    SwSectionNode* pSectNd = m_rSectFormat.GetSectionNode();
+    SwDoc* pDoc = m_rSectFormat.GetDoc();
 
     SotClipboardFormatId nDataFormat = SotExchange::GetFormatIdFromMimeType( rMimeType );
 
@@ -1443,14 +1444,14 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
 
 void SwIntrnlSectRefLink::Closed()
 {
-    SwDoc* pDoc = rSectFormat.GetDoc();
+    SwDoc* pDoc = m_rSectFormat.GetDoc();
     if( pDoc && !pDoc->IsInDtor() )
     {
         // Advise says goodbye: mark the Section as not protected
         // and change the Flag
         const SwSectionFormats& rFormats = pDoc->GetSections();
         for( auto n = rFormats.size(); n; )
-            if( rFormats[ --n ] == &rSectFormat )
+            if (rFormats[--n] == &m_rSectFormat)
             {
                 SwViewShell* pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
                 SwEditShell* pESh = pDoc->GetEditShell();
@@ -1460,7 +1461,7 @@ void SwIntrnlSectRefLink::Closed()
                 else
                     pSh->StartAction();
 
-                SwSectionData aSectionData(*rSectFormat.GetSection());
+                SwSectionData aSectionData(*m_rSectFormat.GetSection());
                 aSectionData.SetType( SectionType::Content );
                 aSectionData.SetLinkFileName( OUString() );
                 aSectionData.SetProtectFlag( false );
@@ -1472,7 +1473,7 @@ void SwIntrnlSectRefLink::Closed()
                 pDoc->UpdateSection( n, aSectionData );
 
                 // Make all Links within the Section visible again
-                SwSectionNode* pSectNd = rSectFormat.GetSectionNode();
+                SwSectionNode* pSectNd = m_rSectFormat.GetSectionNode();
                 if( pSectNd )
                     SwSection::MakeChildLinksVisible( *pSectNd );
 
@@ -1578,14 +1579,11 @@ void SwSection::BreakLink()
     SetLinkFilePassword( OUString() );
 }
 
-const SwNode* SwIntrnlSectRefLink::GetAnchor() const
-{
-    return rSectFormat.GetSectionNode();
-}
+const SwNode* SwIntrnlSectRefLink::GetAnchor() const { return m_rSectFormat.GetSectionNode(); }
 
 bool SwIntrnlSectRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd ) const
 {
-    SwStartNode* pSttNd = rSectFormat.GetSectionNode();
+    SwStartNode* pSttNd = m_rSectFormat.GetSectionNode();
     return pSttNd &&
             nSttNd < pSttNd->GetIndex() &&
             pSttNd->EndOfSectionIndex() < nEndNd;
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 39e5f93e37fe..4601d8f2e7a6 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -46,7 +46,7 @@ using namespace ::com::sun::star::frame;
 
 SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage)
 :   FmFormPage(rNewModel, bMasterPage),
-    pDoc(&rNewModel.GetDoc())
+    m_pDoc(&rNewModel.GetDoc())
 {
 }
 
@@ -58,11 +58,11 @@ void SwDPage::lateInit(const SwDPage& rSrcPage)
 {
     FmFormPage::lateInit( rSrcPage );
 
-    if ( rSrcPage.pGridLst )
+    if ( rSrcPage.m_pGridLst )
     {
-        pGridLst.reset( new SdrPageGridFrameList );
-        for ( sal_uInt16 i = 0; i != rSrcPage.pGridLst->GetCount(); ++i )
-            pGridLst->Insert( ( *rSrcPage.pGridLst )[ i ] );
+        m_pGridLst.reset( new SdrPageGridFrameList );
+        for ( sal_uInt16 i = 0; i != rSrcPage.m_pGridLst->GetCount(); ++i )
+            m_pGridLst->Insert( ( *rSrcPage.m_pGridLst )[ i ] );
     }
 }
 
@@ -111,10 +111,10 @@ const SdrPageGridFrameList*  SwDPage::GetGridFrameList(
                 break;
             }
         }
-        if ( pGridLst )
-            const_cast<SwDPage*>(this)->pGridLst->Clear();
+        if ( m_pGridLst )
+            const_cast<SwDPage*>(this)->m_pGridLst->Clear();
         else
-            const_cast<SwDPage*>(this)->pGridLst.reset( new SdrPageGridFrameList );
+            const_cast<SwDPage*>(this)->m_pGridLst.reset( new SdrPageGridFrameList );
 
         if ( pRect )
         {
@@ -123,7 +123,7 @@ const SdrPageGridFrameList*  SwDPage::GetGridFrameList(
             const SwFrame *pPg = pSh->GetLayout()->Lower();
             do
             {   if ( pPg->getFrameArea().IsOver( aRect ) )
-                    ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst.get(), pPg );
+                    ::InsertGridFrame( const_cast<SwDPage*>(this)->m_pGridLst.get(), pPg );
                 pPg = pPg->GetNext();
             } while ( pPg );
         }
@@ -133,18 +133,18 @@ const SdrPageGridFrameList*  SwDPage::GetGridFrameList(
             const SwFrame *pPg = pSh->Imp()->GetFirstVisPage(pSh->GetOut());
             if ( pPg )
                 do
-                {   ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst.get(), pPg );
+                {   ::InsertGridFrame( const_cast<SwDPage*>(this)->m_pGridLst.get(), pPg );
                     pPg = pPg->GetNext();
                 } while ( pPg && pPg->getFrameArea().IsOver( pSh->VisArea() ) );
         }
     }
-    return pGridLst.get();
+    return m_pGridLst.get();
 }
 
 bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView,
                            const HelpEvent& rEvt )
 {
-    assert( pDoc );
+    assert( m_pDoc );
 
     bool bContinue = true;
 
@@ -214,7 +214,7 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView,
         if (!sText.isEmpty())
         {
             // #i80029#
-            bool bExecHyperlinks = pDoc->GetDocShell()->IsReadOnly();
+            bool bExecHyperlinks = m_pDoc->GetDocShell()->IsReadOnly();
             if (!bExecHyperlinks)
                 sText = SfxHelp::GetURLHelpText(sText);
 
@@ -238,10 +238,10 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView,
 
 Reference< XInterface > SwDPage::createUnoPage()
 {
-    assert( pDoc );
+    assert( m_pDoc );
 
     Reference < XInterface > xRet;
-    SwDocShell* pDocShell = pDoc->GetDocShell();
+    SwDocShell* pDocShell = m_pDoc->GetDocShell();
     if ( pDocShell )
     {
         Reference<XModel> xModel = pDocShell->GetBaseModel();
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 8986d0a3f20c..f516b365b575 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -47,9 +47,9 @@ namespace {
 
 class PaMIntoCursorShellRing
 {
-    SwPaM &rDelPam, &rCursor;
-    SwPaM* pPrevDelPam;
-    SwPaM* pPrevCursor;
+    SwPaM &m_rDelPam, &m_rCursor;
+    SwPaM* m_pPrevDelPam;
+    SwPaM* m_pPrevCursor;
 
     static void RemoveFromRing( SwPaM& rPam, SwPaM const * pPrev );
 public:
@@ -59,24 +59,24 @@ public:
 
 }
 
-PaMIntoCursorShellRing::PaMIntoCursorShellRing( SwCursorShell& rCSh,
-                                            SwPaM& rShCursor, SwPaM& rPam )
-    : rDelPam( rPam ), rCursor( rShCursor )
+PaMIntoCursorShellRing::PaMIntoCursorShellRing(SwCursorShell& rCSh, SwPaM& rShCursor, SwPaM& rPam)
+    : m_rDelPam(rPam)
+    , m_rCursor(rShCursor)
 {
     SwPaM* pShCursor = rCSh.GetCursor_();
 
-    pPrevDelPam = rDelPam.GetPrev();
-    pPrevCursor = rCursor.GetPrev();
+    m_pPrevDelPam = m_rDelPam.GetPrev();
+    m_pPrevCursor = m_rCursor.GetPrev();
 
-    rDelPam.GetRingContainer().merge( pShCursor->GetRingContainer() );
-    rCursor.GetRingContainer().merge( pShCursor->GetRingContainer() );
+    m_rDelPam.GetRingContainer().merge(pShCursor->GetRingContainer());
+    m_rCursor.GetRingContainer().merge(pShCursor->GetRingContainer());
 }
 
 PaMIntoCursorShellRing::~PaMIntoCursorShellRing()
 {
     // and take out the Pam again:
-    RemoveFromRing( rDelPam, pPrevDelPam );
-    RemoveFromRing( rCursor, pPrevCursor );
+    RemoveFromRing(m_rDelPam, m_pPrevDelPam);
+    RemoveFromRing(m_rCursor, m_pPrevCursor);
 }
 
 void PaMIntoCursorShellRing::RemoveFromRing( SwPaM& rPam, SwPaM const * pPrev )
diff --git a/sw/source/core/inc/frminf.hxx b/sw/source/core/inc/frminf.hxx
index ab7ce6a5c00c..1e1d433c47ef 100644
--- a/sw/source/core/inc/frminf.hxx
+++ b/sw/source/core/inc/frminf.hxx
@@ -31,13 +31,13 @@ class SwTextCursor;
 
 class SwTextFrameInfo
 {
-    const SwTextFrame *pFrame;
+    const SwTextFrame *m_pFrame;
 
     // Where does the text (w/o whitespaces) start (document is global!)?
     static SwTwips GetLineStart( const SwTextCursor &rLine );
 
 public:
-    SwTextFrameInfo( const SwTextFrame *pTextFrame ) : pFrame(pTextFrame) { }
+    SwTextFrameInfo( const SwTextFrame *pTextFrame ) : m_pFrame(pTextFrame) { }
 
     // Does the paragraph fit into a single line?
     bool IsOneLine() const;
@@ -61,9 +61,9 @@ public:
     // determine indentation for first line
     SwTwips GetFirstIndent() const;
 
-    const SwTextFrame* GetFrame() const { return pFrame; }
+    const SwTextFrame* GetFrame() const { return m_pFrame; }
     SwTextFrameInfo& SetFrame( const SwTextFrame* pNew )
-        { pFrame = pNew; return *this; }
+        { m_pFrame = pNew; return *this; }
 
     // Is it a comparison? Returns position in frame.
     sal_Int32 GetBigIndent( TextFrameIndex & rFndPos,
diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index f42fef6954b0..4879cd1159be 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -54,12 +54,12 @@ TextFrameIndex SwTextMargin::GetTextEnd() const
 // Does the paragraph fit into one line?
 bool SwTextFrameInfo::IsOneLine() const
 {
-    const SwLineLayout *pLay = pFrame->GetPara();
+    const SwLineLayout *pLay = m_pFrame->GetPara();
     if( !pLay )
         return false;
 
     // For follows false of course
-    if( pFrame->GetFollow() )
+    if( m_pFrame->GetFollow() )
         return false;
 
     pLay = pLay->GetNext();
@@ -75,11 +75,11 @@ bool SwTextFrameInfo::IsOneLine() const
 // Is the line filled for X percent?
 bool SwTextFrameInfo::IsFilled( const sal_uInt8 nPercent ) const
 {
-    const SwLineLayout *pLay = pFrame->GetPara();
+    const SwLineLayout *pLay = m_pFrame->GetPara();
     if( !pLay )
         return false;
 
-    long nWidth = pFrame->getFramePrintArea().Width();
+    long nWidth = m_pFrame->getFramePrintArea().Width();
     nWidth *= nPercent;
     nWidth /= 100;
     return o3tl::make_unsigned(nWidth) <= pLay->Width();
@@ -100,38 +100,38 @@ SwTwips SwTextFrameInfo::GetLineStart( const SwTextCursor &rLine )
 // Where does the text start (without whitespace)? (relative in the Frame)
 SwTwips SwTextFrameInfo::GetLineStart() const
 {
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextCursor aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
-    return GetLineStart( aLine ) - pFrame->getFrameArea().Left() - pFrame->getFramePrintArea().Left();
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextCursor aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
+    return GetLineStart( aLine ) - m_pFrame->getFrameArea().Left() - m_pFrame->getFramePrintArea().Left();
 }
 
 // Calculates the character's position and returns the middle position
 SwTwips SwTextFrameInfo::GetCharPos(TextFrameIndex const nChar, bool bCenter) const
 {
-    SwRectFnSet aRectFnSet(pFrame);
-    SwFrameSwapper aSwapper( pFrame, true );
+    SwRectFnSet aRectFnSet(m_pFrame);
+    SwFrameSwapper aSwapper( m_pFrame, true );
 
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextCursor aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextCursor aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
 
     SwTwips nStt, nNext;
     SwRect aRect;
     aLine.GetCharRect( &aRect, nChar );
     if ( aRectFnSet.IsVert() )
-        pFrame->SwitchHorizontalToVertical( aRect );
+        m_pFrame->SwitchHorizontalToVertical( aRect );
 
     nStt = aRectFnSet.GetLeft(aRect);
 
     if( !bCenter )
-        return nStt - aRectFnSet.GetLeft(pFrame->getFrameArea());
+        return nStt - aRectFnSet.GetLeft(m_pFrame->getFrameArea());
 
     aLine.GetCharRect( &aRect, nChar + TextFrameIndex(1) );
     if ( aRectFnSet.IsVert() )
-        pFrame->SwitchHorizontalToVertical( aRect );
+        m_pFrame->SwitchHorizontalToVertical( aRect );
 
     nNext = aRectFnSet.GetLeft(aRect);
 
-    return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(pFrame->getFrameArea());
+    return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(m_pFrame->getFrameArea());
 }
 
 static void
@@ -157,8 +157,8 @@ void SwTextFrameInfo::GetSpaces(
     std::vector<std::pair<TextFrameIndex, TextFrameIndex>> & rRanges,
     bool const bWithLineBreak) const
 {
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextMargin aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextMargin aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
     bool bFirstLine = true;
     do {
 
@@ -194,8 +194,8 @@ void SwTextFrameInfo::GetSpaces(
 // Fonts: CharSet, SYMBOL and DONTKNOW
 bool SwTextFrameInfo::IsBullet(TextFrameIndex const nTextStart) const
 {
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextMargin aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextMargin aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
     aInf.SetIdx( nTextStart );
     return aLine.IsSymbol( nTextStart );
 }
@@ -206,8 +206,8 @@ bool SwTextFrameInfo::IsBullet(TextFrameIndex const nTextStart) const
 // We do not want to be so picky and work with a tolerance of TOLERANCE twips.
 SwTwips SwTextFrameInfo::GetFirstIndent() const
 {
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextCursor aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextCursor aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
     const SwTwips nFirst = GetLineStart( aLine );
     const SwTwips TOLERANCE = 20;
 
@@ -239,8 +239,8 @@ SwTwips SwTextFrameInfo::GetFirstIndent() const
 sal_Int32 SwTextFrameInfo::GetBigIndent(TextFrameIndex& rFndPos,
                                     const SwTextFrame *pNextFrame ) const
 {
-    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) );
-    SwTextCursor aLine( const_cast<SwTextFrame*>(pFrame), &aInf );
+    SwTextSizeInfo aInf( const_cast<SwTextFrame*>(m_pFrame) );
+    SwTextCursor aLine( const_cast<SwTextFrame*>(m_pFrame), &aInf );
     SwTwips nNextIndent = 0;
 
     if( pNextFrame )
@@ -287,7 +287,7 @@ sal_Int32 SwTextFrameInfo::GetBigIndent(TextFrameIndex& rFndPos,
 
     SwRect aRect;
     aLine.GetCharRect( &aRect, rFndPos );
-    return static_cast<sal_Int32>(aRect.Left() - pFrame->getFrameArea().Left() - pFrame->getFramePrintArea().Left());
+    return static_cast<sal_Int32>(aRect.Left() - m_pFrame->getFrameArea().Left() - m_pFrame->getFramePrintArea().Left());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list