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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 22 09:20:45 UTC 2021


 sw/source/core/text/porfly.hxx  |    8 ++++----
 sw/source/core/text/porglue.cxx |    8 ++++----
 sw/source/core/text/porglue.hxx |   18 +++++++++---------
 sw/source/core/text/portab.hxx  |   10 +++++-----
 sw/source/core/text/txttab.cxx  |   16 ++++++++--------
 5 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 905f8e51280cc42a81960c9dc6e6102bcbbaa1ca
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 22 09:05:04 2021 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Feb 22 10:20:05 2021 +0100

    sw: prefix members of SwFixPortion, SwFlyPortion, SwGluePortion and ...
    
    ... SwTabPortion
    
    See tdf#94879 for motivation.
    
    Change-Id: Ic3918caa922cfd99e361010b44fe9d0c95e28b1b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111298
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 7227c76b95da..480492f7a829 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -30,12 +30,12 @@ struct SwCursorMoveState;
 
 class SwFlyPortion : public SwFixPortion
 {
-    sal_uInt16 nBlankWidth;
+    sal_uInt16 m_nBlankWidth;
 public:
     explicit SwFlyPortion( const SwRect &rFlyRect )
-        : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( PortionType::Fly ); }
-    sal_uInt16 GetBlankWidth( ) const { return nBlankWidth; }
-    void SetBlankWidth( const sal_uInt16 nNew ) { nBlankWidth = nNew; }
+        : SwFixPortion(rFlyRect), m_nBlankWidth( 0 ) { SetWhichPor( PortionType::Fly ); }
+    sal_uInt16 GetBlankWidth( ) const { return m_nBlankWidth; }
+    void SetBlankWidth( const sal_uInt16 nNew ) { m_nBlankWidth = nNew; }
     virtual void Paint( const SwTextPaintInfo &rInf ) const override;
     virtual bool Format( SwTextFormatInfo &rInf ) override;
 };
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 84688c69f3f5..7c09ded23a2f 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -26,9 +26,9 @@
 #include <comphelper/string.hxx>
 
 SwGluePortion::SwGluePortion( const sal_uInt16 nInitFixWidth )
-    : nFixWidth( nInitFixWidth )
+    : m_nFixWidth( nInitFixWidth )
 {
-    PrtWidth( nFixWidth );
+    PrtWidth( m_nFixWidth );
     SetWhichPor( PortionType::Glue );
 }
 
@@ -132,14 +132,14 @@ void SwGluePortion::Join( SwGluePortion *pVictim )
  * We're expecting a frame-local SwRect!
  */
 SwFixPortion::SwFixPortion( const SwRect &rRect )
-       :SwGluePortion( sal_uInt16(rRect.Width()) ), nFix( sal_uInt16(rRect.Left()) )
+       :SwGluePortion( sal_uInt16(rRect.Width()) ), m_nFix( sal_uInt16(rRect.Left()) )
 {
     Height( sal_uInt16(rRect.Height()) );
     SetWhichPor( PortionType::Fix );
 }
 
 SwFixPortion::SwFixPortion()
-       : SwGluePortion(0), nFix(0)
+       : SwGluePortion(0), m_nFix(0)
 {
     SetWhichPor( PortionType::Fix );
 }
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index c022caddcb36..05f72beb9fb3 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -27,15 +27,15 @@ class SwLineLayout;
 class SwGluePortion : public SwLinePortion
 {
 private:
-    sal_uInt16 nFixWidth;
+    sal_uInt16 m_nFixWidth;
 public:
     explicit SwGluePortion( const sal_uInt16 nInitFixWidth );
 
     void Join( SwGluePortion *pVictim );
 
     inline tools::Long GetPrtGlue() const;
-    sal_uInt16 GetFixWidth() const { return nFixWidth; }
-    void SetFixWidth( const sal_uInt16 nNew ) { nFixWidth = nNew; }
+    sal_uInt16 GetFixWidth() const { return m_nFixWidth; }
+    void SetFixWidth( const sal_uInt16 nNew ) { m_nFixWidth = nNew; }
     void MoveGlue( SwGluePortion *pTarget, const tools::Long nPrtGlue );
     inline void MoveAllGlue( SwGluePortion *pTarget );
     inline void MoveHalfGlue( SwGluePortion *pTarget );
@@ -48,12 +48,12 @@ public:
 
 class SwFixPortion : public SwGluePortion
 {
-    sal_uInt16 nFix;        // The width offset in the line
+    sal_uInt16 m_nFix;        // The width offset in the line
 public:
     explicit SwFixPortion( const SwRect &rFlyRect );
     SwFixPortion();
-    void   SetFix( const sal_uInt16 nNewFix ) { nFix = nNewFix; }
-    sal_uInt16 GetFix() const { return nFix; }
+    void   SetFix( const sal_uInt16 nNewFix ) { m_nFix = nNewFix; }
+    sal_uInt16 GetFix() const { return m_nFix; }
 };
 
 class SwMarginPortion : public SwGluePortion
@@ -64,13 +64,13 @@ public:
 };
 
 inline tools::Long SwGluePortion::GetPrtGlue() const
-{ return Width() - nFixWidth; }
+{ return Width() - m_nFixWidth; }
 
 // The FixWidth MUST NEVER be larger than the accumulated width!
 inline void SwGluePortion::AdjFixWidth()
 {
-    if( nFixWidth > PrtWidth() )
-        nFixWidth = PrtWidth();
+    if( m_nFixWidth > PrtWidth() )
+        m_nFixWidth = PrtWidth();
 }
 
 inline void SwGluePortion::MoveAllGlue( SwGluePortion *pTarget )
diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx
index 3c6e7a5df137..d10cd4cd1a71 100644
--- a/sw/source/core/text/portab.hxx
+++ b/sw/source/core/text/portab.hxx
@@ -23,9 +23,9 @@
 
 class SwTabPortion : public SwFixPortion
 {
-    const sal_uInt16 nTabPos;
-    const sal_Unicode cFill;
-    const bool bAutoTabStop;
+    const sal_uInt16 m_nTabPos;
+    const sal_Unicode m_cFill;
+    const bool m_bAutoTabStop;
 
     // Format() branches either into PreFormat() or PostFormat()
     bool PreFormat( SwTextFormatInfo &rInf );
@@ -35,8 +35,8 @@ public:
     virtual bool Format( SwTextFormatInfo &rInf ) override;
     virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
     bool PostFormat( SwTextFormatInfo &rInf );
-    bool IsFilled() const { return 0 != cFill; }
-    sal_uInt16 GetTabPos() const { return nTabPos; }
+    bool IsFilled() const { return 0 != m_cFill; }
+    sal_uInt16 GetTabPos() const { return m_nTabPos; }
 
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const override;
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 51cf0567ad81..7ec721b73010 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -290,10 +290,10 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
  * The base class is initialized without setting anything
  */
 SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab )
-    : SwFixPortion(), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab )
+    : SwFixPortion(), m_nTabPos(nTabPosition), m_cFill(cFillChar), m_bAutoTabStop( bAutoTab )
 {
     mnLineLength = TextFrameIndex(1);
-    OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!");
+    OSL_ENSURE(!IsFilled() || ' ' != m_cFill, "SwTabPortion::CTOR: blanks ?!");
     SetWhichPor( PortionType::Table );
 }
 
@@ -376,7 +376,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
             case PortionType::TabLeft:
             {
                 // handle this case in PostFormat
-                if( bTabOverMargin && !bAutoTabStop && GetTabPos() > rInf.Width() )
+                if( bTabOverMargin && !m_bAutoTabStop && GetTabPos() > rInf.Width() )
                 {
                     rInf.SetLastTab( this );
                     break;
@@ -390,11 +390,11 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
                 // tab stop position is outside the frame:
                 bool bAtParaEnd = rInf.GetIdx() + GetLen() == TextFrameIndex(rInf.GetText().getLength());
                 if ( bFull && bTabCompat &&
-                     ( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) &&
+                     ( ( bTabOverflow && ( rInf.IsTabOverflow() || !m_bAutoTabStop ) ) || bAtParaEnd ) &&
                      GetTabPos() >= rInf.GetTextFrame()->getFrameArea().Width() )
                 {
                     bFull = false;
-                    if ( bTabOverflow && !bAutoTabStop )
+                    if ( bTabOverflow && !m_bAutoTabStop )
                         rInf.SetTabOverflow( true );
                 }
 
@@ -571,7 +571,7 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
         return;
 
     // Tabs with filling/filled tabs
-    const sal_uInt16 nCharWidth = rInf.GetTextSize(OUString(cFill)).Width();
+    const sal_uInt16 nCharWidth = rInf.GetTextSize(OUString(m_cFill)).Width();
     OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
 
     // Robust:
@@ -579,10 +579,10 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
     {
         // Always with kerning, also on printer!
         sal_uInt16 nChar = Width() / nCharWidth;
-        if ( cFill == '_' )
+        if ( m_cFill == '_' )
             ++nChar; // to avoid gaps
         OUStringBuffer aBuf;
-        comphelper::string::padToLength(aBuf, nChar, cFill);
+        comphelper::string::padToLength(aBuf, nChar, m_cFill);
         rInf.DrawText(aBuf.makeStringAndClear(), *this, TextFrameIndex(0),
                         TextFrameIndex(nChar), true);
     }


More information about the Libreoffice-commits mailing list