summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-15 19:13:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-17 09:05:38 +0200
commit206b5b2661be37efdff3c6aedb6f248c4636be79 (patch)
treeaf385e5b4725dcfea23988d9113cced8e9ccaf3c /sc/source/ui/view
parenta85d3ba1c0de313b60324b9ecfa488bb99d69d06 (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/source/ui/view')
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/output.cxx6
-rw-r--r--sc/source/ui/view/output2.cxx8
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/viewfunc.cxx2
5 files changed, 10 insertions, 10 deletions
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))
{