diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 10:28:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 14:47:17 +0200 |
commit | 7ceee0f1ec0e349d0df4980d7fdedbd13c7917c5 (patch) | |
tree | 616ab419fe0f01e94740de7faacb393775420589 /sc/source/ui | |
parent | 664db0d945fbb23e115eeea8377e3a4e88541da1 (diff) |
Extend loplugin:redundantinline to catch inline functions w/o external linkage
...where "inline" (in its meaning of "this function can be defined in multiple
translation units") thus doesn't make much sense. (As discussed in
compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions
in include files for now.)
All the rewriting has been done automatically by the plugin, except for one
instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus
some subsequent solenv/clang-format/reformat-formatted-files.
Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224
Reviewed-on: https://gerrit.libreoffice.org/61573
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/autostyl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/datastream.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fusel2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/autofmt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbasheetobjects.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 4 |
18 files changed, 30 insertions, 33 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 1c569b9a7a5d..d97b5e6dad49 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -295,7 +295,7 @@ static sal_Int32 lcl_GetRulerPos( sal_Int32 nApiPos ) } /** Expands the sequence's size and returns the base index of the new inserted elements. */ -static inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 nExp ) +static sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 nExp ) { OSL_ENSURE( nExp > 0, "lcl_ExpandSequence - invalid value" ); rSeq.realloc( rSeq.getLength() + nExp ); @@ -303,7 +303,7 @@ static inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal } /** Fills the property value rVal with the specified name and value from the item. */ -static inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropName, const SfxPoolItem& rItem, sal_uInt8 nMID ) +static void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropName, const SfxPoolItem& rItem, sal_uInt8 nMID ) { rVal.Name = rPropName; rItem.QueryValue( rVal.Value, nMID ); @@ -822,13 +822,13 @@ sal_Int32 ScAccessibleCsvRuler::implGetLastEqualFormatted( sal_Int32 nApiPos ) // Grid ======================================================================= /** Converts a grid columnm index to an API column index. */ -static inline sal_Int32 lcl_GetApiColumn( sal_uInt32 nGridColumn ) +static sal_Int32 lcl_GetApiColumn( sal_uInt32 nGridColumn ) { return (nGridColumn != CSV_COLUMN_HEADER) ? static_cast< sal_Int32 >( nGridColumn + 1 ) : 0; } /** Converts an API columnm index to a ScCsvGrid column index. */ -static inline sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) +static sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) { return (nApiColumn > 0) ? static_cast< sal_uInt32 >( nApiColumn - 1 ) : CSV_COLUMN_HEADER; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index cbbc87301491..34e4cd1732bb 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -478,7 +478,7 @@ void ScInputHandler::DeleteRangeFinder() } } -static inline OUString GetEditText(const EditEngine* pEng) +static OUString GetEditText(const EditEngine* pEng) { return ScEditUtil::GetSpaceDelimitedString(*pEng); } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index b24f53f47564..4824e0dc8f63 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1519,7 +1519,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm ) } } -static inline SfxChildWindow* lcl_GetChildWinFromCurrentView( sal_uInt16 nId ) +static SfxChildWindow* lcl_GetChildWinFromCurrentView( sal_uInt16 nId ) { SfxViewFrame* pViewFrm = SfxViewFrame::Current(); diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index 8fd3930b67ea..a60ef3f4aaf7 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -24,7 +24,7 @@ #include <docsh.hxx> #include <sc.hrc> -static inline sal_uLong TimeNow() // seconds +static sal_uLong TimeNow() // seconds { return static_cast<sal_uLong>(time(nullptr)); } diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index dcae0094c8b0..698d99e3e55f 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -44,7 +44,7 @@ double datastream_get_time(DebugTime nIdx) namespace { -inline double getNow() +double getNow() { TimeValue now; osl_getSystemTime(&now); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 0d25a473db1a..02eb818caaf7 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4316,7 +4316,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark, return bSuccess; } -static inline ScDirection DirFromFillDir( FillDir eDir ) +static ScDirection DirFromFillDir( FillDir eDir ) { if (eDir==FILL_TO_BOTTOM) return DIR_BOTTOM; diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 24fe3c674fb6..4c6d682b45b2 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -717,7 +717,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc ) // Merge (combine documents) -static inline bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, bool bIgnore100Sec ) +static bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, bool bIgnore100Sec ) { return pA && pB && pA->GetActionNumber() == pB->GetActionNumber() && diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index ce54a91532d9..23af4d5af667 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -705,7 +705,7 @@ void lcl_GetColumnTypes( } } -inline void lcl_getLongVarCharEditString( OUString& rString, +void lcl_getLongVarCharEditString( OUString& rString, const ScRefCellValue& rCell, ScFieldEditEngine& rEditEngine ) { if (!rCell.mpEditText) @@ -715,7 +715,7 @@ inline void lcl_getLongVarCharEditString( OUString& rString, rString = rEditEngine.GetText( LINEEND_CRLF ); } -inline void lcl_getLongVarCharString( +void lcl_getLongVarCharString( OUString& rString, ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, SvNumberFormatter& rNumFmt ) { Color* pColor; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index f82630e600b1..86e17e3b6e52 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -77,7 +77,7 @@ namespace { const char SYLK_LF[] = "\x1b :"; - inline bool lcl_IsEndianSwap( const SvStream& rStrm ) + bool lcl_IsEndianSwap( const SvStream& rStrm ) { #ifdef OSL_BIGENDIAN return rStrm.GetEndian() != SvStreamEndian::BIG; @@ -847,7 +847,7 @@ static void lcl_WriteString( SvStream& rStrm, OUString& rString, sal_Unicode cQu ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); } -static inline void lcl_WriteSimpleString( SvStream& rStrm, const OUString& rString ) +static void lcl_WriteSimpleString( SvStream& rStrm, const OUString& rString ) { ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); } @@ -2363,7 +2363,7 @@ ScFormatFilterPlugin &ScFormatFilter::Get() // Precondition: pStr is guaranteed to be non-NULL and points to a 0-terminated // array. -static inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, +static const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c ) { while (*pStr) diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index 57dcb4dee367..85989355a41e 100644 --- a/sc/source/ui/drawfunc/fusel2.cxx +++ b/sc/source/ui/drawfunc/fusel2.cxx @@ -37,7 +37,7 @@ #include <drawview.hxx> #include <svx/sdrhittesthelper.hxx> -static inline long Diff( const Point& rP1, const Point& rP2 ) +static long Diff( const Point& rP1, const Point& rP2 ) { long nX = rP1.X() - rP2.X(); if (nX<0) nX = -nX; diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 71e445fba3c2..65b67242a5bb 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -450,7 +450,7 @@ void ScAutoFmtPreview::CalcCellArray( bool bFitWidthP ) aPrvSize.setHeight( maArray.GetHeight() + 4 ); } -static inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder ) +static void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder ) { rStyle.Set( pBorder, 1.0 / TWIPS_PER_POINT, 5 ); } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 7c1f78aad522..f7bf1d0cbcf3 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -163,7 +163,7 @@ const SfxItemPropertyMapEntry* lcl_GetDataPilotItemMap() return aDataPilotItemMap_Impl; } -inline bool lclCheckValidDouble( double fValue, bool bAuto ) +bool lclCheckValidDouble( double fValue, bool bAuto ) { return bAuto || ::rtl::math::isFinite( fValue ); } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index a323618f47c2..e36dfc298e77 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1254,7 +1254,7 @@ namespace { /// @throws uno::RuntimeException template< typename RangeType > -inline table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeType >& rxCellRange ) +table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeType >& rxCellRange ) { return uno::Reference< sheet::XCellRangeAddressable >( rxCellRange, uno::UNO_QUERY_THROW )->getRangeAddress(); } @@ -4826,7 +4826,7 @@ sal_Unicode lclGetPrefixChar( const uno::Reference< sheet::XSheetCellRangeContai return cCurrPrefix; } -inline uno::Any lclGetPrefixVariant( sal_Unicode cPrefixChar ) +uno::Any lclGetPrefixVariant( sal_Unicode cPrefixChar ) { return uno::Any( (cPrefixChar == 0) ? OUString() : OUString( cPrefixChar ) ); } diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index 1876b30e9127..e70dd8220bb4 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -41,7 +41,7 @@ using namespace ::ooo::vba; namespace { template< typename Type > -inline bool lclGetProperty( Type& orValue, const uno::Reference< beans::XPropertySet >& rxPropSet, const OUString& rPropName ) +bool lclGetProperty( Type& orValue, const uno::Reference< beans::XPropertySet >& rxPropSet, const OUString& rPropName ) { try { @@ -57,7 +57,7 @@ inline bool lclGetProperty( Type& orValue, const uno::Reference< beans::XPropert @throws uno::RuntimeException */ -inline double lclPointsToHmm( const uno::Any& rPoints ) +double lclPointsToHmm( const uno::Any& rPoints ) { return PointsToHmm( ::rtl::math::approxFloor( rPoints.get< double >() / 0.75 ) * 0.75 ); } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 595b7a325d28..37f7ce828fbb 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1058,7 +1058,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI namespace { template<typename IndexType> - inline void lcl_getBoundingRowColumnforTile(ScViewData* pViewData, long nTileStartPosPx, long nTileEndPosPx, sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin, diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 2a381039cad0..dbe5bb107e94 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -486,7 +486,7 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt bShrink = pPattern->GetItem( ATTR_SHRINKTOFIT, pCondSet ).GetValue(); } -static inline bool SameValue( const ScRefCellValue& rCell, const ScRefCellValue& rOldCell ) +static bool SameValue( const ScRefCellValue& rCell, const ScRefCellValue& rOldCell ) { return rOldCell.meType == CELLTYPE_VALUE && rCell.meType == CELLTYPE_VALUE && rCell.mfValue == rOldCell.mfValue; @@ -991,7 +991,7 @@ bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY, return true; } -static inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) +static bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) { OSL_ENSURE( pNewPattern, "pNewPattern" ); @@ -1068,7 +1068,7 @@ static inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPat } } -static inline void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDoc, +static void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDoc, const ScFormulaCell* pFCell ) { if ( !bProgress && pFCell->GetDirty() ) @@ -1078,7 +1078,7 @@ static inline void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDo } } -static inline bool IsAmbiguousScript( SvtScriptType nScript ) +static bool IsAmbiguousScript( SvtScriptType nScript ) { return ( nScript != SvtScriptType::LATIN && nScript != SvtScriptType::ASIAN && diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 6087ef2bee21..d3011c54caed 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -78,17 +78,17 @@ namespace{ -inline bool lcl_GetBool(const SfxItemSet* pSet, sal_uInt16 nWhich) +bool lcl_GetBool(const SfxItemSet* pSet, sal_uInt16 nWhich) { return static_cast<const SfxBoolItem&>(pSet->Get(nWhich)).GetValue(); } -inline sal_uInt16 lcl_GetUShort(const SfxItemSet* pSet, sal_uInt16 nWhich) +sal_uInt16 lcl_GetUShort(const SfxItemSet* pSet, sal_uInt16 nWhich) { return static_cast<const SfxUInt16Item&>(pSet->Get(nWhich)).GetValue(); } -inline bool lcl_GetShow(const SfxItemSet* pSet, sal_uInt16 nWhich) +bool lcl_GetShow(const SfxItemSet* pSet, sal_uInt16 nWhich) { return ScVObjMode::VOBJ_MODE_SHOW == static_cast<const ScViewObjectModeItem&>(pSet->Get(nWhich)).GetValue(); } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index f9b0ae4b7d8b..acb9a8ba3d57 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1426,7 +1426,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY } } -static inline void ShowHide( vcl::Window* pWin, bool bShow ) +static void ShowHide( vcl::Window* pWin, bool bShow ) { OSL_ENSURE(pWin || !bShow, "window is not present"); if (pWin) @@ -2310,14 +2310,12 @@ void ScTabView::SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<ed namespace { -inline long lcl_GetRowHeightPx(const ScDocument* pDoc, SCROW nRow, SCTAB nTab) { const sal_uInt16 nSize = pDoc->GetRowHeight(nRow, nTab); return ScViewData::ToPixel(nSize, 1.0 / TWIPS_PER_PIXEL); } -inline long lcl_GetColWidthPx(const ScDocument* pDoc, SCCOL nCol, SCTAB nTab) { const sal_uInt16 nSize = pDoc->GetColWidth(nCol, nTab); |