summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8par6.cxx
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 /sw/source/filter/ww8/ww8par6.cxx
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 'sw/source/filter/ww8/ww8par6.cxx')
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 51547066ef96..3cb699a0a0d3 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -130,7 +130,7 @@ Color SwWW8ImplReader::GetCol(sal_uInt8 nIco)
return nIco < SAL_N_ELEMENTS(eSwWW8ColA) ? eSwWW8ColA[nIco] : COL_AUTO;
}
-inline sal_uInt32 MSRoundTweak(sal_uInt32 x)
+static inline sal_uInt32 MSRoundTweak(sal_uInt32 x)
{
return x;
}
@@ -1378,7 +1378,7 @@ static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRCVer9* brc, WW8PLCFx_Cp_FKP*
return nBorder;
}
-void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace,
+static void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace,
sal_uInt32 cv, short nIdx, SvxBoxItemLine nOOIndex, sal_uInt16 nWWIndex,
short *pSize)
{
@@ -1411,7 +1411,7 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace,
}
-void Set1Border(SvxBoxItem &rBox, const WW8_BRCVer9& rBor, SvxBoxItemLine nOOIndex,
+static void Set1Border(SvxBoxItem &rBox, const WW8_BRCVer9& rBor, SvxBoxItemLine nOOIndex,
sal_uInt16 nWWIndex, short *pSize, const bool bIgnoreSpace)
{
short nSpace;
@@ -1542,7 +1542,7 @@ static void FlySecur1(short& rSize, const bool bBorder)
rSize = nMin;
}
-inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId )
+static inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId )
{
SprmResult aS = pPap->HasSprm(nId);
if (aS.pSprm && aS.nRemainingData >= 2)
@@ -1550,7 +1550,7 @@ inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId )
return aS.pSprm != nullptr;
}
-inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId )
+static inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId )
{
SprmResult aS = pStyle->HasParaSprm(nId);
if (aS.pSprm && aS.nRemainingData >= 2)
@@ -4060,7 +4060,7 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short
NewAttr( aLN );
}
-bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67)
+static bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67)
{
WW8PLCFx_Cp_FKP *pPap = pPlcxMan ? pPlcxMan->GetPapPLCF() : nullptr;
if (pPap)
@@ -5222,14 +5222,14 @@ struct SprmReadInfo
FNReadRecord pReadFnc;
};
-bool operator<(const SprmReadInfo &rFirst, const SprmReadInfo &rSecond)
+static bool operator<(const SprmReadInfo &rFirst, const SprmReadInfo &rSecond)
{
return (rFirst.nId < rSecond.nId);
}
typedef ww::SortedArray<SprmReadInfo> wwSprmDispatcher;
-const wwSprmDispatcher *GetWW2SprmDispatcher()
+static const wwSprmDispatcher *GetWW2SprmDispatcher()
{
static SprmReadInfo aSprms[] =
{
@@ -5385,7 +5385,7 @@ const wwSprmDispatcher *GetWW2SprmDispatcher()
return &aSprmSrch;
}
-const wwSprmDispatcher *GetWW6SprmDispatcher()
+static const wwSprmDispatcher *GetWW6SprmDispatcher()
{
static SprmReadInfo aSprms[] =
{
@@ -5597,7 +5597,7 @@ const wwSprmDispatcher *GetWW6SprmDispatcher()
return &aSprmSrch;
}
-const wwSprmDispatcher *GetWW8SprmDispatcher()
+static const wwSprmDispatcher *GetWW8SprmDispatcher()
{
static SprmReadInfo aSprms[] =
{