diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-03 13:54:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-04 14:49:08 +0200 |
commit | 6f2edd4514dc59f5cbac8c653c6e4b1a96ec28a2 (patch) | |
tree | 3dda70a8a50943514c82c7c7493416fc84fc9cd7 /svtools | |
parent | 866a4436d3cfac1ff42d7996250bf96fb703aeaa (diff) |
new loplugin: inlinesimpleaccessmethods
Create a rewriting plugin for finding methods that simply return
object fields, and should therefore be declared in the header,
so that the compiler can reduce method calls into a simple
fixed-offset load instruction.
Change-Id: I7a620fc54250b79681918dc31ed9a8f21118c037
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/optionsdrawinglayer.cxx | 150 | ||||
-rw-r--r-- | svtools/source/contnr/treelistentry.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/viewdataentry.cxx | 24 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 12 | ||||
-rw-r--r-- | svtools/source/control/fmtfield.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/ruler.cxx | 4 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol_impl.cxx | 8 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol_impl.hxx | 4 |
8 files changed, 29 insertions, 185 deletions
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index d0cc92b027b4..07fa25c54f6c 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -181,48 +181,48 @@ public: // public interface - bool IsOverlayBuffer() const; - bool IsPaintBuffer() const; + bool IsOverlayBuffer() const { return m_bOverlayBuffer;} + bool IsPaintBuffer() const { return m_bPaintBuffer;} Color GetStripeColorA() const; Color GetStripeColorB() const; - sal_uInt16 GetStripeLength() const; + sal_uInt16 GetStripeLength() const { return m_nStripeLength;} // #i73602# - bool IsOverlayBuffer_Calc() const; - bool IsOverlayBuffer_Writer() const; - bool IsOverlayBuffer_DrawImpress() const; + bool IsOverlayBuffer_Calc() const { return m_bOverlayBuffer_Calc;} + bool IsOverlayBuffer_Writer() const { return m_bOverlayBuffer_Writer;} + bool IsOverlayBuffer_DrawImpress() const { return m_bOverlayBuffer_DrawImpress;} // #i74769#, #i75172# - bool IsPaintBuffer_Calc() const; - bool IsPaintBuffer_Writer() const; - bool IsPaintBuffer_DrawImpress() const; + bool IsPaintBuffer_Calc() const { return m_bPaintBuffer_Calc;} + bool IsPaintBuffer_Writer() const { return m_bPaintBuffer_Writer;} + bool IsPaintBuffer_DrawImpress() const { return m_bPaintBuffer_DrawImpress;} // #i4219# - sal_uInt32 GetMaximumPaperWidth() const; - sal_uInt32 GetMaximumPaperHeight() const; - sal_uInt32 GetMaximumPaperLeftMargin() const; - sal_uInt32 GetMaximumPaperRightMargin() const; - sal_uInt32 GetMaximumPaperTopMargin() const; - sal_uInt32 GetMaximumPaperBottomMargin() const; + sal_uInt32 GetMaximumPaperWidth() const { return m_nMaximumPaperWidth;} + sal_uInt32 GetMaximumPaperHeight() const { return m_nMaximumPaperHeight;} + sal_uInt32 GetMaximumPaperLeftMargin() const { return m_nMaximumPaperLeftMargin;} + sal_uInt32 GetMaximumPaperRightMargin() const { return m_nMaximumPaperRightMargin;} + sal_uInt32 GetMaximumPaperTopMargin() const { return m_nMaximumPaperTopMargin;} + sal_uInt32 GetMaximumPaperBottomMargin() const { return m_nMaximumPaperBottomMargin;} // helper bool IsAAPossibleOnThisSystem() const; // primitives - bool IsAntiAliasing() const; - bool IsSnapHorVerLinesToDiscrete() const; - bool IsSolidDragCreate() const; - bool IsRenderDecoratedTextDirect() const; - bool IsRenderSimpleTextDirect() const; - sal_uInt32 GetQuadratic3DRenderLimit() const; - sal_uInt32 GetQuadraticFormControlRenderLimit() const; + bool IsAntiAliasing() const { return m_bAntiAliasing;} + bool IsSnapHorVerLinesToDiscrete() const { return m_bSnapHorVerLinesToDiscrete;} + bool IsSolidDragCreate() const { return m_bSolidDragCreate;} + bool IsRenderDecoratedTextDirect() const { return m_bRenderDecoratedTextDirect;} + bool IsRenderSimpleTextDirect() const { return m_bRenderSimpleTextDirect;} + sal_uInt32 GetQuadratic3DRenderLimit() const { return m_nQuadratic3DRenderLimit;} + sal_uInt32 GetQuadraticFormControlRenderLimit() const { return m_nQuadraticFormControlRenderLimit;} void SetAntiAliasing( bool bState ); // #i97672# selection settings - bool IsTransparentSelection() const; - sal_uInt16 GetTransparentSelectionPercent() const; - sal_uInt16 GetSelectionMaximumLuminancePercent() const; + bool IsTransparentSelection() const { return m_bTransparentSelection;} + sal_uInt16 GetTransparentSelectionPercent() const { return m_nTransparentSelectionPercent;} + sal_uInt16 GetSelectionMaximumLuminancePercent() const { return m_nSelectionMaximumLuminancePercent;} void SetTransparentSelection( bool bState ); void SetTransparentSelectionPercent( sal_uInt16 nPercent ); @@ -693,18 +693,10 @@ void SvtOptionsDrawinglayer_Impl::Notify( const com::sun::star::uno::Sequence<OU // public method -bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer() const -{ - return m_bOverlayBuffer; -} // public method -bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer() const -{ - return m_bPaintBuffer; -} // public method @@ -725,73 +717,21 @@ Color SvtOptionsDrawinglayer_Impl::GetStripeColorB() const // public method -sal_uInt16 SvtOptionsDrawinglayer_Impl::GetStripeLength() const -{ - return m_nStripeLength; -} // #i73602# -bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Calc() const -{ - return m_bOverlayBuffer_Calc; -} -bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Writer() const -{ - return m_bOverlayBuffer_Writer; -} -bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_DrawImpress() const -{ - return m_bOverlayBuffer_DrawImpress; -} // #i74769#, #i75172# -bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Calc() const -{ - return m_bPaintBuffer_Calc; -} -bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Writer() const -{ - return m_bPaintBuffer_Writer; -} -bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_DrawImpress() const -{ - return m_bPaintBuffer_DrawImpress; -} // #i4219# -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperWidth() const -{ - return m_nMaximumPaperWidth; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperHeight() const -{ - return m_nMaximumPaperHeight; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperLeftMargin() const -{ - return m_nMaximumPaperLeftMargin; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperRightMargin() const -{ - return m_nMaximumPaperRightMargin; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperTopMargin() const -{ - return m_nMaximumPaperTopMargin; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperBottomMargin() const -{ - return m_nMaximumPaperBottomMargin; -} // helper bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const @@ -819,40 +759,12 @@ bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const } // primitives -bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const -{ - return m_bAntiAliasing; -} -bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const -{ - return m_bSnapHorVerLinesToDiscrete; -} -bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const -{ - return m_bSolidDragCreate; -} -bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const -{ - return m_bRenderDecoratedTextDirect; -} -bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const -{ - return m_bRenderSimpleTextDirect; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const -{ - return m_nQuadratic3DRenderLimit; -} -sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadraticFormControlRenderLimit() const -{ - return m_nQuadraticFormControlRenderLimit; -} void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( bool bState ) { @@ -864,10 +776,6 @@ void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( bool bState ) } // #i97672# selection settings -bool SvtOptionsDrawinglayer_Impl::IsTransparentSelection() const -{ - return m_bTransparentSelection; -} void SvtOptionsDrawinglayer_Impl::SetTransparentSelection( bool bState ) { @@ -887,15 +795,7 @@ void SvtOptionsDrawinglayer_Impl::SetTransparentSelectionPercent( sal_uInt16 nPe } } -sal_uInt16 SvtOptionsDrawinglayer_Impl::GetTransparentSelectionPercent() const -{ - return m_nTransparentSelectionPercent; -} -sal_uInt16 SvtOptionsDrawinglayer_Impl::GetSelectionMaximumLuminancePercent() const -{ - return m_nSelectionMaximumLuminancePercent; -} // private method diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx index 26d7dcd20112..af348256d0b1 100644 --- a/svtools/source/contnr/treelistentry.cxx +++ b/svtools/source/contnr/treelistentry.cxx @@ -216,10 +216,6 @@ size_t SvTreeListEntry::GetPos( const SvLBoxItem* pItem ) const return it == maItems.end() ? ITEM_NOT_FOUND : std::distance(maItems.begin(), it); } -void* SvTreeListEntry::GetUserData() const -{ - return pUserData; -} void SvTreeListEntry::SetUserData( void* pPtr ) { @@ -236,10 +232,6 @@ bool SvTreeListEntry::HasInUseEmphasis() const return (bool)((nEntryFlags & SV_ENTRYFLAG_IN_USE)!=0); } -sal_uInt16 SvTreeListEntry::GetFlags() const -{ - return nEntryFlags; -} void SvTreeListEntry::SetFlags( sal_uInt16 nFlags ) { diff --git a/svtools/source/contnr/viewdataentry.cxx b/svtools/source/contnr/viewdataentry.cxx index 3aeab97fe8c9..fc8869fa28e5 100644 --- a/svtools/source/contnr/viewdataentry.cxx +++ b/svtools/source/contnr/viewdataentry.cxx @@ -51,35 +51,11 @@ SvViewDataEntry::~SvViewDataEntry() #endif } -bool SvViewDataEntry::IsSelected() const -{ - return mbSelected; -} -bool SvViewDataEntry::IsHighlighted() const -{ - return mbHighlighted; -} -bool SvViewDataEntry::IsExpanded() const -{ - return mbExpanded; -} -bool SvViewDataEntry::HasFocus() const -{ - return mbFocused; -} -bool SvViewDataEntry::IsCursored() const -{ - return mbCursored; -} -bool SvViewDataEntry::IsSelectable() const -{ - return mbSelectable; -} void SvViewDataEntry::SetFocus( bool bFocus ) { diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 412715514b1e..dfc086e7de83 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -453,8 +453,8 @@ public: Color GetColorDist( const Color& aMain, const Color& rDefault ); /** Returns the minimum width in twips */ - long GetMinWidth( ); - sal_uInt16 GetStyle( ); + long GetMinWidth( ) { return m_nMinWidth;} + sal_uInt16 GetStyle( ) { return m_nStyle;} }; ImpLineListData::ImpLineListData( BorderWidthImpl aWidthImpl, @@ -469,10 +469,6 @@ ImpLineListData::ImpLineListData( BorderWidthImpl aWidthImpl, { } -long ImpLineListData::GetMinWidth( ) -{ - return m_nMinWidth; -} Color ImpLineListData::GetColorLine1( const Color& rMain ) { @@ -503,10 +499,6 @@ sal_uInt16 LineListBox::GetSelectEntryStyle( sal_Int32 nSelIndex ) const return nStyle; } -sal_uInt16 ImpLineListData::GetStyle( ) -{ - return m_nStyle; -} void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, sal_uInt16 nDashing ) { diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index e31bc1187ee4..272955d97b75 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -1023,10 +1023,6 @@ void FormattedField::UseInputStringForFormatting( bool bUseInputStr /* = true */ m_bUseInputStringForFormatting = bUseInputStr; } -bool FormattedField::IsUsingInputStringForFormatting() const -{ - return m_bUseInputStringForFormatting; -} DoubleNumericField::~DoubleNumericField() { diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 4332966babe5..bf719a328fa3 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -2779,10 +2779,6 @@ long Ruler::GetMargin2() const return mpData->nMargin2; } -long Ruler::GetRulerVirHeight() const -{ - return mnVirHeight; -} bool Ruler::GetTextRTL() { diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 344a2f2eb999..f2b1b1533f91 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -2453,16 +2453,8 @@ namespace svt { namespace table } - ScrollBar* TableControl_Impl::getHorzScrollbar() - { - return m_pHScroll; - } - ScrollBar* TableControl_Impl::getVertScrollbar() - { - return m_pVScroll; - } bool TableControl_Impl::isRowSelected( RowPos i_row ) const diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index db3ff9f3f5d1..7a6191f4e4eb 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -300,8 +300,8 @@ namespace svt { namespace table TableDataWindow& getDataWindow() { return *m_pDataWindow; } const TableDataWindow& getDataWindow() const { return *m_pDataWindow; } - ScrollBar* getHorzScrollbar(); - ScrollBar* getVertScrollbar(); + ScrollBar* getHorzScrollbar() { return m_pHScroll; } + ScrollBar* getVertScrollbar() { return m_pVScroll; } Rectangle calcHeaderRect( bool bColHeader ); Rectangle calcHeaderCellRect( bool bColHeader, sal_Int32 nPos ); |