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

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 20 17:55:28 UTC 2016


 sw/source/core/doc/htmltbl.cxx         |    4 +---
 sw/source/core/doc/notxtfrm.cxx        |    6 ------
 sw/source/core/inc/frame.hxx           |    3 ---
 sw/source/core/inc/layact.hxx          |    2 --
 sw/source/core/inc/notxtfrm.hxx        |    2 --
 sw/source/core/inc/pagefrm.hxx         |    2 --
 sw/source/core/inc/unoport.hxx         |    3 ---
 sw/source/core/layout/layact.cxx       |    4 ++--
 sw/source/core/layout/pagechg.cxx      |    4 ++--
 sw/source/core/layout/ssfrm.cxx        |    6 +++---
 sw/source/core/text/pordrop.hxx        |    1 -
 sw/source/core/text/porfld.cxx         |    6 +++---
 sw/source/core/text/porfld.hxx         |    4 ----
 sw/source/core/text/portab.hxx         |    1 -
 sw/source/core/text/txtdrop.cxx        |    2 +-
 sw/source/core/text/txttab.cxx         |    4 ++--
 sw/source/core/text/widorp.cxx         |    2 +-
 sw/source/core/text/widorp.hxx         |    2 --
 sw/source/core/unocore/unoportenum.cxx |    2 +-
 sw/source/filter/html/parcss1.cxx      |    6 +++---
 sw/source/filter/html/parcss1.hxx      |    9 ---------
 sw/source/filter/html/swhtml.cxx       |    2 +-
 sw/source/filter/html/swhtml.hxx       |    1 -
 sw/source/filter/ww8/wrtww8.hxx        |    1 -
 sw/source/filter/ww8/wrtww8gr.cxx      |    5 ++---
 25 files changed, 22 insertions(+), 62 deletions(-)

New commits:
commit e8260df1d67baf807771cd5c740164a227856515
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Oct 20 11:42:50 2016 +0200

    loplugin:expandablemethodds in sw(part2)
    
    Change-Id: Idc2118899a8063099b66c0f5db40d8402db063d1
    Reviewed-on: https://gerrit.libreoffice.org/30083
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index d3fe02c..ace49e9 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -71,8 +71,6 @@ public:
     SwHTMLTableLayoutConstraints *InsertNext( SwHTMLTableLayoutConstraints *pNxt );
     SwHTMLTableLayoutConstraints* GetNext() const { return pNext; }
 
-    sal_uInt16 GetRow() const { return nRow; }
-
     sal_uInt16 GetColSpan() const { return nColSpan; }
     sal_uInt16 GetColumn() const { return nCol; }
 };
@@ -143,7 +141,7 @@ SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
     SwHTMLTableLayoutConstraints *pConstr = this;
     while( pConstr )
     {
-        if( pConstr->GetRow() > pNxt->GetRow() ||
+        if( pConstr->nRow > pNxt->nRow ||
             pConstr->GetColumn() > pNxt->GetColumn() )
             break;
         pPrev = pConstr;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6eb7bb4..27beaa0 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -145,12 +145,6 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText,
 SwNoTextFrame::SwNoTextFrame(SwNoTextNode * const pNode, SwFrame* pSib )
     : SwContentFrame( pNode, pSib )
 {
-    InitCtor();
-}
-
-/// Initialization: Currently add the Frame to the Cache
-void SwNoTextFrame::InitCtor()
-{
     mnFrameType = SwFrameType::NoTxt;
 }
 
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index a3451ee..fb9dfec 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -438,14 +438,11 @@ public:
     inline bool IsVertical() const;
 
     inline bool IsVertLR() const;
-    inline bool GetVerticalFlag() const { return mbVertical; }
 
     inline void SetDerivedVert( bool bNew ){ mbDerivedVert = bNew; }
     inline void SetInvalidVert( bool bNew) { mbInvalidVert = bNew; }
     inline bool IsRightToLeft() const;
-    inline bool GetRightToLeftFlag() const { return mbRightToLeft; }
     inline void SetDerivedR2L( bool bNew ) { mbDerivedR2L  = bNew; }
-    inline void SetInvalidR2L( bool bNew ) { mbInvalidR2L  = bNew; }
 
     void CheckDirChange();
     // returns upper left frame position for LTR and
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 247260d7..0541a20 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -116,7 +116,6 @@ class SwLayAction
     bool RemoveEmptyBrowserPages();
 
     inline void CheckIdleEnd();
-    inline std::clock_t GetStartTicks() { return m_nStartTicks; }
 
 public:
     SwLayAction( SwRootFrame *pRt, SwViewShellImp *pImp );
@@ -130,7 +129,6 @@ public:
     bool IsWaitAllowed()        const       { return m_bWaitAllowed; }
     bool IsNextCycle()          const       { return m_bNextCycle; }
     bool IsInput()              const       { return m_bInput; }
-    bool IsWait()               const       { return nullptr != m_pWait;  }
     bool IsPaint()              const       { return m_bPaint; }
     bool IsIdle()               const       { return m_bIdle;  }
     bool IsReschedule()         const       { return m_bReschedule;  }
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 3a48616..ce44b31 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -32,8 +32,6 @@ class SwNoTextFrame: public SwContentFrame
 
     const Size& GetSize() const;
 
-    void InitCtor();
-
     void Format ( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
     void PaintPicture( vcl::RenderContext*, const SwRect& ) const;
 
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 54fed63..f1505fa 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -190,8 +190,6 @@ public:
 
     inline  sal_uInt16 GetPhyPageNum() const        { return m_nPhyPageNum;}
     inline  void SetPhyPageNum( sal_uInt16 nNum )   { m_nPhyPageNum = nNum;}
-    inline  void DecrPhyPageNum()               { --m_nPhyPageNum;     }
-    inline  void IncrPhyPageNum()               { ++m_nPhyPageNum;     }
 
     /// Validate, invalidate and query the Page status
     /// Layout/Content and Fly/non-Fly respectively are inspected separately
diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index 6c9e24a..fa82c83 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -236,9 +236,6 @@ class SwXTextPortionEnumeration
     TextRangeList_t m_Portions; // contains all portions, filled by ctor
     sw::UnoCursorPointer m_pUnoCursor;
 
-    SwUnoCursor& GetCursor() const
-        {return *m_pUnoCursor;}
-
 protected:
     virtual ~SwXTextPortionEnumeration() override;
 
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 54ce00b..152410b 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -85,8 +85,8 @@
 void SwLayAction::CheckWaitCursor()
 {
     RESCHEDULE
-    if ( !IsWait() && IsWaitAllowed() && IsPaint() &&
-         ((std::clock() - GetStartTicks()) * 1000 / CLOCKS_PER_SEC >= CLOCKS_PER_SEC/2) )
+    if ( !m_pWait && IsWaitAllowed() && IsPaint() &&
+         ((std::clock() - m_nStartTicks) * 1000 / CLOCKS_PER_SEC >= CLOCKS_PER_SEC/2) )
     {
         m_pWait = new SwWait( *m_pRoot->GetFormat()->GetDoc()->GetDocShell(), true );
     }
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 0257f12..8405280 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -828,7 +828,7 @@ void SwPageFrame::Cut()
     {
         while ( pPg )
         {
-            pPg->DecrPhyPageNum();  //inline --nPhyPageNum
+            --pPg->m_nPhyPageNum;
             pPg = static_cast<SwPageFrame*>(pPg->GetNext());
         }
     }
@@ -867,7 +867,7 @@ void SwPageFrame::Paste( SwFrame* pParent, SwFrame* pSibling )
     {
         while ( pPg )
         {
-            pPg->IncrPhyPageNum();  //inline ++nPhyPageNum
+            ++pPg->m_nPhyPageNum;
             pPg->InvalidatePos_();
             pPg->InvalidateLayout();
             pPg = static_cast<SwPageFrame*>(pPg->GetNext());
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index ecab038..1898c05 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -191,11 +191,11 @@ void SwFrame::SetRightLeftMargins( long nRight, long nLeft)
 /// checks the layout direction and invalidates the lower frames recursively, if necessary.
 void SwFrame::CheckDirChange()
 {
-    bool bOldVert = GetVerticalFlag();
+    bool bOldVert = mbVertical;
     bool bOldRev = IsReverse();
-    bool bOldR2L = GetRightToLeftFlag();
+    bool bOldR2L = mbRightToLeft;
     SetInvalidVert( true );
-    SetInvalidR2L( true );
+    mbInvalidR2L = true;
     bool bChg = bOldR2L != IsRightToLeft();
     bool bOldVertL2R = IsVertLR();
     if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev || bOldVertL2R != IsVertLR() )
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx
index 4839a8f..05ff5a6 100644
--- a/sw/source/core/text/pordrop.hxx
+++ b/sw/source/core/text/pordrop.hxx
@@ -72,7 +72,6 @@ class SwDropPortion : public SwTextPortion
     bool FormatText( SwTextFormatInfo &rInf );
     void PaintText( const SwTextPaintInfo &rInf ) const;
 
-    inline void Fix( const sal_uInt16 nNew ) { nFix = nNew; }
 public:
     SwDropPortion( const sal_uInt16 nLineCnt,
                    const sal_uInt16 nDropHeight,
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index b06affb..4f24e63 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -87,7 +87,7 @@ SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField )
     : SwExpandPortion( rField )
     , aExpand( rField.GetExp() )
     , nNextOffset( rField.GetNextOffset() )
-    , nNextScriptChg( rField.GetNextScriptChg() )
+    , nNextScriptChg( rField.nNextScriptChg )
     , nViewWidth( rField.nViewWidth )
     , bFollow( rField.IsFollow() )
     , bLeft( rField.IsLeft() )
@@ -839,7 +839,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
         if( bFly )
         {
             SetLen( 0 );
-            SetNoPaint( true );
+            bNoPaint = true;
             rInf.SetNumDone( false );
             return true;
         }
@@ -881,7 +881,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
  */
 void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
 {
-    if( DontPaint() )
+    if( bNoPaint )
         return;
     if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
     {
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 6fb6d27..740c2d9 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -92,8 +92,6 @@ public:
     inline sal_Int32 GetNextOffset() const { return nNextOffset; }
     inline void SetNextOffset( sal_Int32 nNew ) { nNextOffset = nNew; }
 
-    inline sal_Int32 GetNextScriptChg() const { return nNextScriptChg; }
-
     // Field cloner for SplitGlue
     virtual SwFieldPortion *Clone( const OUString &rExpand ) const;
 
@@ -189,8 +187,6 @@ public:
 
     inline bool IsAnimated() const { return bAnimated; }
     inline void SetAnimated( bool bNew ) { bAnimated = bNew; }
-    inline bool DontPaint() const { return bNoPaint; }
-    inline void SetNoPaint( bool bNew ) { bNoPaint = bNew; }
     inline void SetRelPos( SwTwips nNew ) { nYPos = nNew; }
     inline void SetId( long nNew ) const
         { const_cast<SwGrfNumPortion*>(this)->nId = nNew; }
diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx
index de1af65..55f00ae 100644
--- a/sw/source/core/text/portab.hxx
+++ b/sw/source/core/text/portab.hxx
@@ -37,7 +37,6 @@ public:
     bool PostFormat( SwTextFormatInfo &rInf );
     inline  bool IsFilled() const { return 0 != cFill; }
     inline  sal_uInt16 GetTabPos() const { return nTabPos; }
-    inline  bool IsAutoTabStop() const { return bAutoTabStop; }
 
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const override;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index f831297..7f36213 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -934,7 +934,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
 bool SwDropPortion::Format( SwTextFormatInfo &rInf )
 {
     bool bFull = false;
-    Fix( (sal_uInt16)rInf.X() );
+    nFix = (sal_uInt16)rInf.X();
 
     SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
     aLayoutModeModifier.SetAuto();
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 553376d..a188b3a 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -384,11 +384,11 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
                 // tab stop position is outside the frame:
                 bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetText().getLength();
                 if ( bFull && bTabCompat &&
-                     ( ( bTabOverflow && ( rInf.IsTabOverflow() || !IsAutoTabStop() ) ) || bAtParaEnd ) &&
+                     ( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) &&
                      GetTabPos() >= rInf.GetTextFrame()->Frame().Width() )
                 {
                     bFull = false;
-                    if ( bTabOverflow && !IsAutoTabStop() )
+                    if ( bTabOverflow && !bAutoTabStop )
                         rInf.SetTabOverflow( true );
                 }
 
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 02dea25..6d8c4f5 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -522,7 +522,7 @@ bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool
     //    Widow lines would have wrong width.
     // 2. Test formatting is only done up to the given space.
     //    we do not have any lines for widows at all.
-    if( bTst || nLineCnt - nMinLines >= GetWidowsLines() )
+    if( bTst || nLineCnt - nMinLines >= nWidLines )
     {
         if( rMaxHeight >= nLineSum )
         {
diff --git a/sw/source/core/text/widorp.hxx b/sw/source/core/text/widorp.hxx
index 0e65598..1063f63 100644
--- a/sw/source/core/text/widorp.hxx
+++ b/sw/source/core/text/widorp.hxx
@@ -58,8 +58,6 @@ public:
     WidowsAndOrphans( SwTextFrame *pFrame, const SwTwips nRst = 0,
         bool bCheckKeep = true );
     bool FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine );
-    sal_uInt16 GetWidowsLines() const
-    { return nWidLines; }
     sal_uInt16 GetOrphansLines() const
     { return nOrphLines; }
     void ClrOrphLines(){ nOrphLines = 0; }
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index eac6691..ff156d2 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -367,7 +367,7 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
     // find all frames, graphics and OLEs that are bound AT character in para
     FrameClientSortList_t frames;
     ::CollectFrameAtNode(m_pUnoCursor->GetPoint()->nNode, frames, true);
-    lcl_CreatePortions(m_Portions, xParentText, &GetCursor(), frames, nStart, nEnd);
+    lcl_CreatePortions(m_Portions, xParentText, &*m_pUnoCursor, frames, nStart, nEnd);
 }
 
 SwXTextPortionEnumeration::SwXTextPortionEnumeration(
diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index 4ba013d..b3d76b3 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -84,11 +84,11 @@ sal_Unicode CSS1Parser::GetNextChar()
 
     if( c == '\n' )
     {
-        IncLineNr();
-        SetLinePos( 1L );
+        ++nlLineNr;
+        nlLinePos = 1;
     }
     else
-        IncLinePos();
+        ++nlLinePos;
 
     return c;
 }
diff --git a/sw/source/filter/html/parcss1.hxx b/sw/source/filter/html/parcss1.hxx
index 51be361..30b24dd 100644
--- a/sw/source/filter/html/parcss1.hxx
+++ b/sw/source/filter/html/parcss1.hxx
@@ -205,10 +205,6 @@ class CSS1Parser
 
     bool IsEOF() const { return bEOF; }
 
-    void IncLineNr() { ++nlLineNr; }
-    sal_uInt32 IncLinePos() { return ++nlLinePos; }
-    inline void SetLinePos( sal_uInt32 nlPos ); // inline declaration below
-
     // parse parts of the grammar
     void ParseRule();
     CSS1Selector *ParseSelector();
@@ -259,11 +255,6 @@ public:
     virtual ~CSS1Parser();
 };
 
-inline void CSS1Parser::SetLinePos( sal_uInt32 nlPos )
-{
-    nlLinePos = nlPos;
-}
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 81b6417..c790123 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1055,7 +1055,7 @@ void SwHTMLParser::NextToken( int nToken )
             if( HTML_IFRAME_OFF == nToken )
             {
                 m_bCallNextToken = false;
-                EndFloatingFrame();
+                m_bInFloatingFrame = false;
             }
 
             return;
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 386f11f..6ef39ce 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -715,7 +715,6 @@ private:
     void InsertParam();     // htmlplug.cxx
 
     void InsertFloatingFrame();
-    void EndFloatingFrame() { m_bInFloatingFrame = false; }
 
     // <BODY>-Tag auswerten: Hintergrund-Grafiken und -Farben setzen (htmlgrin.cxx)
     void InsertBodyOptions();
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c1dc4de..9fdf61a 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1008,7 +1008,6 @@ public:
 
     SvxMSExportOLEObjects& GetOLEExp()      { return *m_pOLEExp; }
     SwMSConvertControls& GetOCXExp()        { return *m_pOCXExp; }
-    WW8OleMap& GetOLEMap()                  { return m_aOleMap; }
     void ExportDopTypography(WW8DopTypography &rTypo);
 
     sal_uInt16 AddRedlineAuthor( sal_uInt16 nId );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 6f00814..8834934 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -218,14 +218,13 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
         if( xObj.is() )
         {
             const embed::XEmbeddedObject *pObj = xObj.get();
-            WW8OleMap& rPointerToObjId = GetOLEMap();
             //Don't want to use pointer ids, as is traditional, because we need
             //to put this into a 32bit value, and on 64bit the bottom bits
             //might collide and two unrelated ole objects end up considered the
             //same.  Don't want to simply start at 0 which is a special value
-            sal_Int32 nPictureId = SAL_MAX_INT32 - rPointerToObjId.size();
+            sal_Int32 nPictureId = SAL_MAX_INT32 - m_aOleMap.size();
             WW8OleMap::value_type entry = std::make_pair(pObj, nPictureId);
-            std::pair<WW8OleMap::iterator, bool> aRes = rPointerToObjId.insert(entry);
+            std::pair<WW8OleMap::iterator, bool> aRes = m_aOleMap.insert(entry);
             bool bIsNotDuplicate = aRes.second; //.second is false when element already existed
             nPictureId = aRes.first->second;
             Set_UInt32(pDataAdr, nPictureId);


More information about the Libreoffice-commits mailing list