diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-15 19:13:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-17 09:05:38 +0200 |
commit | 206b5b2661be37efdff3c6aedb6f248c4636be79 (patch) | |
tree | af385e5b4725dcfea23988d9113cced8e9ccaf3c /sc | |
parent | a85d3ba1c0de313b60324b9ecfa488bb99d69d06 (diff) |
New loplugin:external
...warning about (for now only) functions and variables with external linkage
that likely don't need it.
The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
returns 1, both moving just the struct S2 into an nunnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
namespace { struct S2: S1 { int f() { return 1; } }; }
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
as well as moving just the function f overload into an unnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
namespace { int f(S2 s) { return s.f(); } }
}
int main() { return f(N::S2()); }
would each change the program to return 0 instead.
Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
53 files changed, 99 insertions, 99 deletions
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index 60c27979477e..227a26cfb273 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -23,7 +23,7 @@ using namespace css; -inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +static inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) { rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); return rStrm; diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx index b25f8aaea7e5..f482283062f9 100644 --- a/sc/qa/unit/chart2dataprovider.cxx +++ b/sc/qa/unit/chart2dataprovider.cxx @@ -43,9 +43,9 @@ private: uno::Reference<uno::XInterface> m_xCalcComponent; }; -void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cellRange, bool hasCategories, - bool firstCellAsLabel, sal_Int32 expectedRows, - sal_Int32 expectedCols) +static void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cellRange, + bool hasCategories, bool firstCellAsLabel, + sal_Int32 expectedRows, sal_Int32 expectedCols) { uno::Reference<chart2::data::XDataProvider> xDataProvider = new ScChart2DataProvider(&rDoc); CPPUNIT_ASSERT(xDataProvider.is()); diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 1b8b99bda2db..021eeb9e9952 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -447,7 +447,7 @@ void ScFiltersTest::testSheetNamesXLSX() xDocSh->DoClose(); } -void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) +static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) { ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); CPPUNIT_ASSERT_MESSAGE("No drawing layer.", pDrawLayer); @@ -561,7 +561,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() } } -void testEnhancedProtectionImpl( const ScDocument& rDoc ) +static void testEnhancedProtectionImpl( const ScDocument& rDoc ) { const ScTableProtection* pProt = rDoc.GetTabProtection(0); diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx index b9ccf7b9cb3c..8c41318a5b1c 100644 --- a/sc/qa/unit/parallelism.cxx +++ b/sc/qa/unit/parallelism.cxx @@ -358,7 +358,7 @@ void ScParallelismTest::testSingleRef() } // Common test setup steps for testSUMIFImplicitRange*() -void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t nConstCellValue) +static void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t nConstCellValue) { pDoc->SetValue(3, 0, 0, static_cast<double>(nConstCellValue)); // D1 for (size_t i = 0; i <= (nNumRows*2); ++i) diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 77f7de435ec1..6c355d1d0e5d 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -2457,7 +2457,7 @@ void ScExportTest::testBordersExchangeXLSX() xDocSh->DoClose(); } -OUString toString( const ScBigRange& rRange ) +static OUString toString( const ScBigRange& rRange ) { OUStringBuffer aBuf; aBuf.append("(columns:"); diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 01ac014b173b..829fb379cff1 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -49,7 +49,7 @@ using namespace css; -std::ostream& operator<<(std::ostream& os, ViewShellId const & id) +static std::ostream& operator<<(std::ostream& os, ViewShellId const & id) { os << static_cast<sal_Int32>(id); return os; } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index cd8a87eca658..32ac67b0e44f 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1667,7 +1667,7 @@ void Test::testCSV() } template<typename Evaluator> -void checkMatrixElements(const ScMatrix& rMat) +static void checkMatrixElements(const ScMatrix& rMat) { SCSIZE nC, nR; rMat.GetDimensions(nC, nR); @@ -5826,7 +5826,7 @@ void Test::testCellTextWidth() m_pDoc->DeleteTab(0); } -bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChecks) +static bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChecks) { const EditTextObject* pText = rIter.first(); const char* p = *pChecks; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 342ef56f2ce1..96e94f2d42f4 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5319,7 +5319,7 @@ struct StrStrCheck { }; template<size_t DataSize, size_t FormulaSize, int Type> -void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -5358,7 +5358,7 @@ void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aCh } template<size_t DataSize, size_t FormulaSize, int Type> -void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -6361,7 +6361,7 @@ void Test::testExternalRangeName() m_pDoc->DeleteTab(0); } -void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6382,7 +6382,7 @@ void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.isEmpty()); } -void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6395,7 +6395,7 @@ void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_EQUAL(1.2, pDoc->GetValue(ScAddress(0,0,0))); } -void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6426,7 +6426,7 @@ void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_EQUAL(OUString("B2"), pDoc->GetString(ScAddress(1,0,0))); } -void testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 7f778c9a1327..85e31fcd1a66 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -689,7 +689,7 @@ void ScBroadcastAreaSlotMachine::ComputeAreaPoints( const ScRange& rRange, ScAddress( rRange.aStart.Col(), rRange.aEnd.Row(), 0 ) ) - rStart; } -inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot** & pp, +static inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot** & pp, SCSIZE & nStart, ScBroadcastAreaSlot** const & ppSlots, SCSIZE nRowBreak ) { if ( nOff < nBreak ) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index a5083210810a..38fb1edbd64b 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -78,7 +78,7 @@ // factor from font size to optimal cell height (text width) #define SC_ROT_BREAK_FACTOR 6 -inline bool IsAmbiguousScript( SvtScriptType nScript ) +static inline bool IsAmbiguousScript( SvtScriptType nScript ) { //TODO: move to a header file return ( nScript != SvtScriptType::LATIN && diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 7a417ec9061f..85db140e11ac 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -75,7 +75,7 @@ void decBlock(std::pair<Iter, size_t>& rPos) } -void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrArray*& rpArr, +static void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, const ScDocument* pDoc, ScInterpreterContext* pContext = nullptr ) { @@ -2382,7 +2382,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo } } -inline bool IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) +static inline bool IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) { return ( nRow1 > nRow2 ) || ( nRow1 == nRow2 && nCol1 > nCol2 ); } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 068d06b24392..f2b322a4c2d8 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -260,7 +260,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, SvNumFormatType& rNum } -sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +static sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { sheet::DataPilotFieldOrientation nRet = sheet::DataPilotFieldOrientation_HIDDEN; if ( xSource.is() ) @@ -2155,7 +2155,7 @@ public: } -void lcl_FillOldFields( ScPivotFieldVector& rFields, +static void lcl_FillOldFields( ScPivotFieldVector& rFields, const uno::Reference<sheet::XDimensionsSupplier>& xSource, sheet::DataPilotFieldOrientation nOrient, bool bAddData ) { diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 4eb3ff5d3c9e..7fd0e6bd6201 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -206,13 +206,13 @@ ScTabSizeChangedHint::~ScTabSizeChangedHint() #define MAXMM 10000000 -inline long TwipsToHmm (long nVal) +static inline long TwipsToHmm (long nVal) { return static_cast< long >( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0, FUNIT_TWIP, FUNIT_100TH_MM) ); } -inline long HmmToTwips (long nVal) +static inline long HmmToTwips (long nVal) { return static_cast< long > ( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0, FUNIT_100TH_MM, FUNIT_TWIP) ); @@ -511,7 +511,7 @@ void ScDrawLayer::ResetTab( SCTAB nStart, SCTAB nEnd ) } } -inline bool IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) +static inline bool IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) { return rPos.Col() >= nCol1 && rPos.Col() <= nCol2 && rPos.Row() >= nRow1 && rPos.Row() <= nRow2; @@ -1835,7 +1835,7 @@ OUString ScDrawLayer::GetVisibleName( const SdrObject* pObj ) return aName; } -inline bool IsNamedObject( const SdrObject* pObj, const OUString& rName ) +static inline bool IsNamedObject( const SdrObject* pObj, const OUString& rName ) { // sal_True if rName is the object's Name or PersistName // (used to find a named object) diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 9dbf1bf83773..2f63a6ebd0b0 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -113,12 +113,12 @@ SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const return pPattern; } -inline bool StrCmp( const OUString* pStr1, const OUString* pStr2 ) +static inline bool StrCmp( const OUString* pStr1, const OUString* pStr2 ) { return ( pStr1 ? ( pStr2 && ( *pStr1 == *pStr2 ) ) : ( pStr2 == nullptr ) ); } -inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) +static inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) { // #i62090# The SfxItemSet in the SfxSetItem base class always has the same ranges // (single range from ATTR_PATTERN_START to ATTR_PATTERN_END), and the items are pooled, @@ -1109,7 +1109,7 @@ bool ScPatternAttr::IsVisible() const return false; } -inline bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) +static inline bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) { const SfxPoolItem* pItem1 = &rSet1.Get(nId); const SfxPoolItem* pItem2 = &rSet2.Get(nId); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 05b9a76e89f3..53e9e78d66f0 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3573,7 +3573,7 @@ void ScTable::StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ) // Auto-Outline template< typename T > -short DiffSign( T a, T b ) +static short DiffSign( T a, T b ) { return (a<b) ? -1 : (a>b) ? 1 : 0; diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index c90f60bb55c1..910e66f20117 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -104,7 +104,7 @@ using namespace ::com::sun::star::i18n; @return Returns TRUE if a numeral element is found in a given string, or FALSE if no numeral element is found. */ -bool SplitString( const OUString &sWhole, +static bool SplitString( const OUString &sWhole, OUString &sPrefix, OUString &sSuffix, double &fNum ) { // Get prefix element, search for any digit and stop. @@ -164,7 +164,7 @@ bool SplitString( const OUString &sWhole, @return Returns 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if sInput2 is greater. */ -short Compare( const OUString &sInput1, const OUString &sInput2, +static short Compare( const OUString &sInput1, const OUString &sInput2, const bool bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) { OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 6a365098a5a5..3e61e4283479 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -2132,7 +2132,7 @@ private: cl_mem mpClmem2; }; -DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, +static DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, const std::string& ts, const FormulaTreeNodeRef& ft, SlidingFunctionBase* pCodeGen, int nResultSize ) { @@ -2140,7 +2140,7 @@ DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, } template<class Base> -DynamicKernelArgument* VectorRefFactory( const ScCalcConfig& config, const std::string& s, +static DynamicKernelArgument* VectorRefFactory( const ScCalcConfig& config, const std::string& s, const FormulaTreeNodeRef& ft, std::shared_ptr<SlidingFunctionBase>& pCodeGen, int index ) diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 948d4c12ade0..2f1a9372aaf9 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -624,7 +624,7 @@ bool ScUnoAddInCollection::GetCalcName( const OUString& rExcelName, OUString& rR return false; } -inline bool IsTypeName( const OUString& rName, const uno::Type& rType ) +static inline bool IsTypeName( const OUString& rName, const uno::Type& rType ) { return rName == rType.getTypeName(); } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 036ba8376a8d..ae057b346d26 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1994,7 +1994,7 @@ static inline void lcl_string_append(OStringBuffer &rString, const OUString &sSt rString.append(OUStringToOString( sString, RTL_TEXTENCODING_UTF8 )); } -template<typename T > inline void lcl_Format( T& r, SCTAB nTab, SCROW nRow, SCCOL nCol, ScRefFlags nFlags, +template<typename T > static inline void lcl_Format( T& r, SCTAB nTab, SCROW nRow, SCCOL nCol, ScRefFlags nFlags, const ScDocument* pDoc, const ScAddress::Details& rDetails) { diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 4a1d3098a542..222f30cc3758 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -273,7 +273,7 @@ void ScDetectiveFunc::Modified() pDoc->SetStreamValid(nTab, false); } -inline bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, +static inline bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, SCCOL nStartCol2, SCROW nStartRow2, SCCOL nEndCol2, SCROW nEndRow2 ) { return nEndCol1 >= nStartCol2 && nEndCol2 >= nStartCol1 && @@ -711,7 +711,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt ) #define SC_DET_TOLERANCE 50 -inline bool RectIsPoints( const tools::Rectangle& rRect, const Point& rStart, const Point& rEnd ) +static inline bool RectIsPoints( const tools::Rectangle& rRect, const Point& rStart, const Point& rEnd ) { return rRect.Left() >= rStart.X() - SC_DET_TOLERANCE && rRect.Left() <= rStart.X() + SC_DET_TOLERANCE diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a40a514873c5..9bdc5d1a805a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -8874,7 +8874,7 @@ static const UBlockScript scriptList[] = { {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT}, {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES} }; -bool IsDBCS(sal_Unicode currentChar) +static bool IsDBCS(sal_Unicode currentChar) { // for the locale of ja-JP, character U+0x005c and U+0x20ac should be ScriptType::Asian if( (currentChar == 0x005c || currentChar == 0x20ac) && @@ -8889,7 +8889,7 @@ bool IsDBCS(sal_Unicode currentChar) bRet = (i < SAL_N_ELEMENTS(scriptList) && block >= scriptList[i].from); return bRet; } -sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) +static sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) { sal_Int32 index = 0; sal_Int32 length = 0; @@ -8903,7 +8903,7 @@ sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) } return length; } -sal_Int32 getLengthB(const OUString &str) +static sal_Int32 getLengthB(const OUString &str) { if(str.isEmpty()) return 0; @@ -8914,7 +8914,7 @@ void ScInterpreter::ScLenB() { PushDouble( getLengthB(GetString().getString()) ); } -OUString lcl_RightB(const OUString &rStr, sal_Int32 n) +static OUString lcl_RightB(const OUString &rStr, sal_Int32 n) { if( n < getLengthB(rStr) ) { @@ -8965,7 +8965,7 @@ void ScInterpreter::ScRightB() PushString( aStr ); } } -OUString lcl_LeftB(const OUString &rStr, sal_Int32 n) +static OUString lcl_LeftB(const OUString &rStr, sal_Int32 n) { if( n < getLengthB(rStr) ) { diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index e1d7bf45db8e..1bd355d3af6e 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -1245,7 +1245,7 @@ double ScInterpreter::GetBinomDistPMF(double x, double n, double p) } } -double lcl_GetBinomDistRange(double n, double xs,double xe, +static double lcl_GetBinomDistRange(double n, double xs,double xe, double fFactor /* q^n */, double p, double q) //preconditions: 0.0 <= xs < xe <= n; xs,xe,n integral although double { diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index f1eb0713fc2a..f54dacf2b20f 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -399,7 +399,7 @@ public: sal_uInt32 getNumberFormat() const { return mnNumFmt; } }; -void IterateMatrix( +static void IterateMatrix( const ScMatrixRef& pMat, ScIterFunc eFunc, bool bTextAsZero, sal_uLong& rCount, SvNumFormatType& rFuncFmtType, double& fRes, double& fMem ) { diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx index 97b3ebe09101..035d6810fc64 100644 --- a/sc/source/core/tool/prnsave.cxx +++ b/sc/source/core/tool/prnsave.cxx @@ -48,7 +48,7 @@ void ScPrintSaverTab::SetRepeat( const ScRange* pCol, const ScRange* pRow ) mpRepeatRow.reset(pRow ? new ScRange(*pRow) : nullptr); } -inline bool PtrEqual( const ScRange* p1, const ScRange* p2 ) +static inline bool PtrEqual( const ScRange* p1, const ScRange* p2 ) { return ( !p1 && !p2 ) || ( p1 && p2 && *p1 == *p2 ); } diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 94a1e091a530..f65c5fe965ee 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -131,7 +131,7 @@ static void lcl_MoveItWrap( R& rRef, U nMask ) } template< typename R, typename S, typename U > -bool IsExpand( R n1, R n2, U nStart, S nD ) +static bool IsExpand( R n1, R n2, U nStart, S nD ) { // before normal Move... return nD > 0 // Insert @@ -143,7 +143,7 @@ bool IsExpand( R n1, R n2, U nStart, S nD ) } template< typename R, typename S, typename U > -void Expand( R& n1, R& n2, U nStart, S nD ) +static void Expand( R& n1, R& n2, U nStart, S nD ) { // after normal Move..., only if IsExpand was true before! // first the End if ( n2 + 1 == nStart ) diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 469731a65467..ea51929c60b6 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -384,7 +384,7 @@ struct XclExpXti { rStrm << mnSupbook << mnFirstSBTab << mnLastSBTab; } }; -inline bool operator==( const XclExpXti& rLeft, const XclExpXti& rRight ) +static inline bool operator==( const XclExpXti& rLeft, const XclExpXti& rRight ) { return (rLeft.mnSupbook == rRight.mnSupbook) && diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 62181ef8eee2..6e0ec1372973 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -337,7 +337,7 @@ void XclExpName::WriteBody( XclExpStream& rStrm ) /** Returns true (needed fixing) if FormulaToken was not absolute and 3D. So, regardless of whether the fix was successful or not, true is still returned since a fix was required.*/ -bool lcl_EnsureAbs3DToken( const SCTAB nTab, formula::FormulaToken* pTok, const bool bFix = true ) +static bool lcl_EnsureAbs3DToken( const SCTAB nTab, formula::FormulaToken* pTok, const bool bFix = true ) { bool bFixRequired = false; if ( !pTok || ( pTok->GetType() != formula::svSingleRef && pTok->GetType() != formula::svDoubleRef ) ) diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index c94145737fc9..c73a0a8b42d4 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1800,7 +1800,7 @@ XclExpDefaultRowData::XclExpDefaultRowData( const XclExpRow& rRow ) : ::set_flag( mnFlags, EXC_DEFROW_UNSYNCED, rRow.IsUnsynced() ); } -bool operator<( const XclExpDefaultRowData& rLeft, const XclExpDefaultRowData& rRight ) +static bool operator<( const XclExpDefaultRowData& rLeft, const XclExpDefaultRowData& rRight ) { return (rLeft.mnHeight < rRight.mnHeight) || ((rLeft.mnHeight == rRight.mnHeight) && (rLeft.mnFlags < rRight.mnFlags)); diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index b5e0b7ecbb99..02f0562f7fec 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -147,7 +147,7 @@ struct XclImpXti explicit XclImpXti() : mnSupbook( SAL_MAX_UINT16 ), mnSBTabFirst( SAL_MAX_UINT16 ), mnSBTabLast( SAL_MAX_UINT16 ) {} }; -inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) +static inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) { rXti.mnSupbook = rStrm.ReaduInt16(); rXti.mnSBTabFirst = rStrm.ReaduInt16(); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 401475d9fe0c..ec86f6ec778e 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1646,7 +1646,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo ) // HTML DATA QUERY PARSER template< typename Type > -inline Type getLimitedValue( const Type& rValue, const Type& rMin, const Type& rMax ) +static inline Type getLimitedValue( const Type& rValue, const Type& rMin, const Type& rMax ) { return std::max( std::min( rValue, rMax ), rMin ); } ScHTMLEntry::ScHTMLEntry( const SfxItemSet& rItemSet, ScHTMLTableId nTableId ) : diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx index ca3a33c4b13b..16ab8fe57bf3 100644 --- a/sc/source/filter/lotus/filter.cxx +++ b/sc/source/filter/lotus/filter.cxx @@ -131,7 +131,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream, return nErr; } -WKTYP ScanVersion(SvStream& aStream) +static WKTYP ScanVersion(SvStream& aStream) { // PREC: pWKFile: pointer to open file // POST: return: type of file diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index a4e764bbe538..cdd4d8ce6e07 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -323,7 +323,7 @@ void SheetDataBuffer::setMergedRange( const ScRange& rRange ) typedef std::pair<sal_Int32, sal_Int32> FormatKeyPair; -void addIfNotInMyMap( const StylesBuffer& rStyles, std::map< FormatKeyPair, ScRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ScRangeList& rRangeList ) +static void addIfNotInMyMap( const StylesBuffer& rStyles, std::map< FormatKeyPair, ScRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ScRangeList& rRangeList ) { Xf* pXf1 = rStyles.getCellXf( nXfId ).get(); if ( pXf1 ) @@ -718,7 +718,7 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel ) } } -void lcl_SetBorderLine( ScDocument& rDoc, const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine ) +static void lcl_SetBorderLine( ScDocument& rDoc, const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine ) { SCCOL nFromScCol = (nLine == SvxBoxItemLine::RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col(); SCROW nFromScRow = (nLine == SvxBoxItemLine::BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row(); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index b923e3b5d01e..b0ee21d7461a 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -833,7 +833,7 @@ bool Font::needsRichTextFormat() const return maApiData.mnEscapement != API_ESCAPE_NONE; } -::FontFamily lcl_getFontFamily( sal_Int32 nFamily ) +static ::FontFamily lcl_getFontFamily( sal_Int32 nFamily ) { ::FontFamily eScFamily = FAMILY_DONTKNOW; switch( nFamily ) diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 1a707573e78c..9b8c17f1a687 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; -bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16> &pc2) +static bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16> &pc2) { return pc1.first < pc2.first; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 15a2d21a5d10..cbbc87301491 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -478,7 +478,7 @@ void ScInputHandler::DeleteRangeFinder() } } -inline OUString GetEditText(const EditEngine* pEng) +static inline OUString GetEditText(const EditEngine* pEng) { return ScEditUtil::GetSpaceDelimitedString(*pEng); } diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index e93b23995c10..d1129fa55cd8 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -56,7 +56,7 @@ namespace scui { static ScAbstractDialogFactory_Impl* pFactory=nullptr; - ScAbstractDialogFactory_Impl* GetFactory() + static ScAbstractDialogFactory_Impl* GetFactory() { if ( !pFactory ) pFactory = new ScAbstractDialogFactory_Impl; diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 0679f5853bdc..ac3293403fd5 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -148,7 +148,7 @@ static sal_Unicode lcl_CharFromCombo( const ComboBox& rCombo, const OUString& rL return c; } -void lcl_CreatePropertiesNames ( OUString& rSepPath, Sequence<OUString>& rNames, ScImportAsciiCall eCall ) +static void lcl_CreatePropertiesNames ( OUString& rSepPath, Sequence<OUString>& rNames, ScImportAsciiCall eCall ) { sal_Int32 nProperties = 0; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 4b6fbe44e8c5..58b6c92b4ba3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3021,7 +3021,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, return true; } -uno::Reference< uno::XInterface > GetDocModuleObject( const SfxObjectShell& rDocSh, const OUString& sCodeName ) +static uno::Reference< uno::XInterface > GetDocModuleObject( const SfxObjectShell& rDocSh, const OUString& sCodeName ) { uno::Reference< lang::XMultiServiceFactory> xSF(rDocSh.GetModel(), uno::UNO_QUERY); uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess; @@ -4316,7 +4316,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark, return bSuccess; } -inline ScDirection DirFromFillDir( FillDir eDir ) +static inline ScDirection DirFromFillDir( FillDir eDir ) { if (eDir==FILL_TO_BOTTOM) return DIR_BOTTOM; diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index a80a993786af..57dcb4dee367 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> -inline long Diff( const Point& rP1, const Point& rP2 ) +static inline 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 bf96690b54f6..71e445fba3c2 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 ); } -inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder ) +static inline 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/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index afb2d471838a..169196304f51 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -58,7 +58,7 @@ using std::shared_ptr; namespace HelperNotifyChanges { - void NotifyIfChangesListeners(const ScDocShell& rDocShell, const ScAddress &rPos, + static void NotifyIfChangesListeners(const ScDocShell& rDocShell, const ScAddress &rPos, const ScUndoEnterData::ValuesType &rOldValues) { if (ScModelObj* pModelObj = getMustPropagateChangesModel(rDocShell)) diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx b/sc/source/ui/unoobj/PivotTableDataSequence.cxx index dd7cd0297d2f..ccbcd70dbbe0 100644 --- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx +++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx @@ -28,7 +28,7 @@ namespace sc SC_SIMPLE_SERVICE_INFO( PivotTableDataSequence, "PivotTableDataSequence", "com.sun.star.chart2.data.DataSequence") -const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap() { static const SfxItemPropertyMapEntry aDataSequencePropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 9bcc3e593298..d64abd57fb53 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -71,7 +71,7 @@ using namespace ::com::sun::star; -bool isInVBAMode( ScDocShell& rDocSh ) +static bool isInVBAMode( ScDocShell& rDocSh ) { uno::Reference<script::XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer(); uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY ); diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index b56ceff1c540..46dc73a71611 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -352,7 +352,7 @@ public: } }; -uno::Reference< container::XIndexAccess > +static uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx index eb493f2c9ebf..537f80290087 100644 --- a/sc/source/ui/vba/vbacomments.cxx +++ b/sc/source/ui/vba/vbacomments.cxx @@ -26,7 +26,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) +static uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) { uno::Reference< sheet::XSheetAnnotation > xAnno( aSource, uno::UNO_QUERY_THROW ); uno::Reference< container::XChild > xChild( xAnno, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx index 13b2b46c0f5f..4c22a93d808f 100644 --- a/sc/source/ui/vba/vbapivottables.cxx +++ b/sc/source/ui/vba/vbapivottables.cxx @@ -24,7 +24,7 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; -uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext ) +static uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext ) { uno::Reference< sheet::XDataPilotTable > xTable( aSource, uno::UNO_QUERY_THROW ); return uno::makeAny( uno::Reference< excel::XPivotTable > ( new ScVbaPivotTable( xContext, xTable ) ) ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index e5ee4af10a19..0dd27507bc96 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -386,7 +386,7 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& aSource ) // assume that xIf is infact a ScCellRangesBase /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) { ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf ); @@ -396,7 +396,7 @@ getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) } /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) { // need the ScCellRangesBase to get docshell @@ -405,7 +405,7 @@ getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) } /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) { // need the ScCellRangesBase to get docshell @@ -414,21 +414,21 @@ getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& } /// @throws uno::RuntimeException -uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) +static uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) { ScDocShell* pDocShell = getDocShellFromIf(xIf ); return pDocShell->GetModel(); } /// @throws uno::RuntimeException -uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) +static uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) { // the XInterface for getImplementation can be any derived interface, no need for queryInterface uno::Reference< uno::XInterface > xIf( xRange ); return getModelFromXIf( xIf ); } -ScDocument& +static ScDocument& getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange ) { ScDocShell* pDocShell = getDocShellFromRange( xRange ); @@ -1230,7 +1230,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const } /// @throws uno::RuntimeException -ScVbaRange* +static ScVbaRange* getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const OUString& sName, ScDocShell* pDocSh, const table::CellRangeAddress& pAddr, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) { ScRangeList aCellRanges; @@ -1371,7 +1371,7 @@ ScVbaRange::getRangeObjectForName( } /// @throws uno::RuntimeException -table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh ) +static table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh ) { uno::Reference< table::XCellRange > xRangeParam; switch ( aParam.getValueTypeClass() ) @@ -2263,13 +2263,13 @@ ScVbaRange::Select() } } -bool cellInRange( const table::CellRangeAddress& rAddr, sal_Int32 nCol, sal_Int32 nRow ) +static bool cellInRange( const table::CellRangeAddress& rAddr, sal_Int32 nCol, sal_Int32 nRow ) { return nCol >= rAddr.StartColumn && nCol <= rAddr.EndColumn && nRow >= rAddr.StartRow && nRow <= rAddr.EndRow; } -void setCursor( SCCOL nCol, SCROW nRow, const uno::Reference< frame::XModel >& xModel, bool bInSel = true ) +static void setCursor( SCCOL nCol, SCROW nRow, const uno::Reference< frame::XModel >& xModel, bool bInSel = true ) { ScTabViewShell* pShell = excel::getBestViewShell( xModel ); if ( pShell ) @@ -2953,7 +2953,7 @@ ScVbaRange::getComment() } /// @throws uno::RuntimeException -uno::Reference< beans::XPropertySet > +static uno::Reference< beans::XPropertySet > getRowOrColumnProps( const uno::Reference< table::XCellRange >& xCellRange, bool bRows ) { uno::Reference< table::XColumnRowRange > xColRow( xCellRange, uno::UNO_QUERY_THROW ); @@ -3280,7 +3280,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L return uno::Reference< excel::XRange >(); } -uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh ) +static uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh ) { uno::Reference< excel::XRange > xKeyRange; if ( Key.getValueType() == cppu::UnoType<excel::XRange>::get() ) @@ -3305,7 +3305,7 @@ uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno:: // helper method for Sort /// @throws uno::RuntimeException -sal_Int32 findSortPropertyIndex( const uno::Sequence< beans::PropertyValue >& props, +static sal_Int32 findSortPropertyIndex( const uno::Sequence< beans::PropertyValue >& props, const OUString& sPropName ) { const beans::PropertyValue* pProp = props.getConstArray(); @@ -3322,7 +3322,7 @@ const OUString& sPropName ) // helper method for Sort /// @throws uno::RuntimeException -void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRange, +static void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRange, const uno::Reference< table::XCellRange >& xColRowKey, sal_Int16 nOrder, table::TableSortField& aTableField, bool bIsSortColumn, bool bMatchCase ) { @@ -3744,7 +3744,7 @@ ScVbaRange::getCalcRowHeight(const table::CellRangeAddress& rAddress) } // return Char Width in points -double getDefaultCharWidth( ScDocShell* pDocShell ) +static double getDefaultCharWidth( ScDocShell* pDocShell ) { ScDocument& rDoc = pDocShell->GetDocument(); OutputDevice* pRefDevice = rDoc.GetRefDevice(); @@ -4103,7 +4103,7 @@ ScVbaRange::getTop() return uno::makeAny( lcl_hmmToPoints( aPoint.Y ) ); } -uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Reference< uno::XInterface >& xIf, const uno::Reference< table::XCellRange >& thisRange ) +static uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Reference< uno::XInterface >& xIf, const uno::Reference< table::XCellRange >& thisRange ) { uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index 25fc38d5269d..1ed953d9e778 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -40,7 +40,7 @@ static uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno: return new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext, xModel ); } -uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication ) +static uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication ) { uno::Reference< frame::XModel > xModel( aSource, uno::UNO_QUERY_THROW ); // !! TODO !! iterate over all controllers diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index fe9ed2b53448..06c33982ad4d 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -147,7 +147,7 @@ static void lcl_RemoveAttribs( EditView& rEditView ) pEngine->SetUpdateMode(bOld); } -void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) +static void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) { OUString aString( cChar ); if( pTableView ) diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 0d8b53edea74..95303e7e7664 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1346,17 +1346,17 @@ void ScOutputData::DrawClear() // Lines -long lclGetSnappedX( const OutputDevice& rDev, long nPosX, bool bSnapPixel ) +static long lclGetSnappedX( const OutputDevice& rDev, long nPosX, bool bSnapPixel ) { return (bSnapPixel && nPosX) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( nPosX, 0 ) ) ).Width() : nPosX; } -long lclGetSnappedY( const OutputDevice& rDev, long nPosY, bool bSnapPixel ) +static long lclGetSnappedY( const OutputDevice& rDev, long nPosY, bool bSnapPixel ) { return (bSnapPixel && nPosY) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( 0, nPosY ) ) ).Height() : nPosY; } -size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoFirstX, sal_uInt16 nCellInfoLastX, bool bRTL ) +static size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoFirstX, sal_uInt16 nCellInfoLastX, bool bRTL ) { return static_cast< size_t >( bRTL ? (nCellInfoLastX + 2 - nCellInfoX) : (nCellInfoX - nCellInfoFirstX) ); } diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 8b77601bcdf3..522dfba38f0b 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -280,7 +280,7 @@ bool lcl_GetBoolValue(const ScPatternAttr& rPattern, sal_uInt16 nWhich, const Sf } -bool lcl_isNumberFormatText(const ScDocument* pDoc, SCCOL nCellX, SCROW nCellY, SCTAB nTab ) +static bool lcl_isNumberFormatText(const ScDocument* pDoc, SCCOL nCellX, SCROW nCellY, SCTAB nTab ) { sal_uInt32 nCurrentNumberFormat; pDoc->GetNumberFormat( nCellX, nCellY, nTab, nCurrentNumberFormat); @@ -486,7 +486,7 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt bShrink = pPattern->GetItem( ATTR_SHRINKTOFIT, pCondSet ).GetValue(); } -inline bool SameValue( const ScRefCellValue& rCell, const ScRefCellValue& rOldCell ) +static inline 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; } -inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) +static inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) { OSL_ENSURE( pNewPattern, "pNewPattern" ); @@ -1078,7 +1078,7 @@ static inline void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDo } } -inline bool IsAmbiguousScript( SvtScriptType nScript ) +static inline bool IsAmbiguousScript( SvtScriptType nScript ) { return ( nScript != SvtScriptType::LATIN && nScript != SvtScriptType::ASIAN && diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 49db8ee8e720..12e05ed32aaa 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 } } -inline void ShowHide( vcl::Window* pWin, bool bShow ) +static inline void ShowHide( vcl::Window* pWin, bool bShow ) { OSL_ENSURE(pWin || !bShow, "window is not present"); if (pWin) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 7aa6fc9a65d9..9361c9b5cc9e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -317,7 +317,7 @@ static bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode ) namespace HelperNotifyChanges { - void NotifyIfChangesListeners(const ScDocShell &rDocShell, ScMarkData& rMark, SCCOL nCol, SCROW nRow) + static void NotifyIfChangesListeners(const ScDocShell &rDocShell, ScMarkData& rMark, SCCOL nCol, SCROW nRow) { if (ScModelObj *pModelObj = getMustPropagateChangesModel(rDocShell)) { |