summaryrefslogtreecommitdiff
path: root/writerfilter
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 /writerfilter
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 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.cxx2
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx14
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx8
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx4
-rw-r--r--writerfilter/source/dmapper/SdtHelper.cxx2
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfdispatchvalue.cxx2
8 files changed, 18 insertions, 18 deletions
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index a19a984d6e7e..f3e63a4faef2 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -50,7 +50,7 @@ CellColorHandler::~CellColorHandler()
// ST_Shd strings are converted to integers by the tokenizer, store strings in
// the InteropGrabBag
-uno::Any lcl_ConvertShd(sal_Int32 nIntValue)
+static uno::Any lcl_ConvertShd(sal_Int32 nIntValue)
{
OUString aRet;
// This should be in sync with the ST_Shd list in ooxml's model.xml.
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index f4eddffc2625..7206a7fde18a 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -37,7 +37,7 @@ namespace dmapper{
namespace ConversionHelper{
/// Convert OOXML border style to WW8 that editeng can handle.
-sal_Int32 lcl_convertBorderStyleFromToken(sal_Int32 nOOXMLType)
+static sal_Int32 lcl_convertBorderStyleFromToken(sal_Int32 nOOXMLType)
{
switch (nOOXMLType)
{
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index bf9421c3aaad..cf973bbaef9a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -78,7 +78,7 @@ void DomainMapperTableHandler::startTable(const TablePropertyMapPtr& pProps)
#endif
}
-void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const PropertyMapPtr& pDest )
+static void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const PropertyMapPtr& pDest )
{
boost::optional<PropertyMap::Property> pOrigVal = pOrig->getProperty(nId);
@@ -88,7 +88,7 @@ void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const Proper
}
}
-void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const PropertyMapPtr& pCellProps,
+static void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const PropertyMapPtr& pCellProps,
sal_Int32 nCell, sal_Int32 nRow, bool bIsEndCol, bool bIsEndRow )
{
boost::optional<PropertyMap::Property> pVerticalVal = pCellProps->getProperty(META_PROP_VERTICAL_BORDER);
@@ -170,7 +170,7 @@ void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const Property
#ifdef DEBUG_WRITERFILTER
-void lcl_debug_BorderLine(table::BorderLine const & rLine)
+static void lcl_debug_BorderLine(table::BorderLine const & rLine)
{
TagLogger::getInstance().startElement("BorderLine");
TagLogger::getInstance().attribute("Color", rLine.Color);
@@ -180,7 +180,7 @@ void lcl_debug_BorderLine(table::BorderLine const & rLine)
TagLogger::getInstance().endElement();
}
-void lcl_debug_TableBorder(table::TableBorder const & rBorder)
+static void lcl_debug_TableBorder(table::TableBorder const & rBorder)
{
TagLogger::getInstance().startElement("TableBorder");
lcl_debug_BorderLine(rBorder.TopLine);
@@ -268,7 +268,7 @@ void lcl_extractHoriOrient(std::vector<beans::PropertyValue>& rFrameProperties,
}
-void lcl_DecrementHoriOrientPosition(std::vector<beans::PropertyValue>& rFrameProperties, sal_Int32 nAmount)
+static void lcl_DecrementHoriOrientPosition(std::vector<beans::PropertyValue>& rFrameProperties, sal_Int32 nAmount)
{
// Shifts the frame left by the given value.
for (beans::PropertyValue & rPropertyValue : rFrameProperties)
@@ -837,7 +837,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
}
/// Do all cells in this row have a CellHideMark property?
-bool lcl_hideMarks(PropertyMapVector1& rCellProperties)
+static bool lcl_hideMarks(PropertyMapVector1& rCellProperties)
{
for (PropertyMapPtr & p : rCellProperties)
{
@@ -850,7 +850,7 @@ bool lcl_hideMarks(PropertyMapVector1& rCellProperties)
}
/// Are all cells in this row empty?
-bool lcl_emptyRow(std::vector<RowSequence_t>& rTableRanges, sal_Int32 nRow)
+static bool lcl_emptyRow(std::vector<RowSequence_t>& rTableRanges, sal_Int32 nRow)
{
if (nRow >= static_cast<sal_Int32>(rTableRanges.size()))
{
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 83e487c415e4..1edc514fb342 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -49,12 +49,12 @@ namespace dmapper {
//--------------------------------------------------- Utility functions
template <typename T>
-beans::PropertyValue lcl_makePropVal(PropertyIds nNameID, T const & aValue)
+static beans::PropertyValue lcl_makePropVal(PropertyIds nNameID, T const & aValue)
{
return {getPropertyName(nNameID), 0, uno::makeAny(aValue), beans::PropertyState_DIRECT_VALUE};
}
-sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps, const OUString& sName )
+static sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps, const OUString& sName )
{
sal_Int32 i = 0;
sal_Int32 nLen = aProps.getLength( );
@@ -71,7 +71,7 @@ sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps,
return nPos;
}
-void lcl_mergeProperties( uno::Sequence< beans::PropertyValue >& aSrc,
+static void lcl_mergeProperties( uno::Sequence< beans::PropertyValue >& aSrc,
uno::Sequence< beans::PropertyValue >& aDst )
{
for ( sal_Int32 i = 0, nSrcLen = aSrc.getLength( ); i < nSrcLen; i++ )
@@ -484,7 +484,7 @@ uno::Sequence<uno::Sequence<beans::PropertyValue>> ListDef::GetMergedPropertyVal
return aAbstract;
}
-uno::Reference< container::XNameContainer > lcl_getUnoNumberingStyles(
+static uno::Reference< container::XNameContainer > lcl_getUnoNumberingStyles(
uno::Reference<lang::XMultiServiceFactory> const& xFactory)
{
uno::Reference< container::XNameContainer > xStyles;
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index e788d2c95a45..691f1a00a474 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -447,7 +447,7 @@ SectionPropertyMap::SectionPropertyMap( bool bIsFirstSection )
}
}
-OUString lcl_FindUnusedPageStyleName( const uno::Sequence< OUString >& rPageStyleNames )
+static OUString lcl_FindUnusedPageStyleName( const uno::Sequence< OUString >& rPageStyleNames )
{
static const char DEFAULT_STYLE[] = "Converted";
sal_Int32 nMaxIndex = 0;
@@ -1015,7 +1015,7 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
}
}
-uno::Reference< beans::XPropertySet > lcl_GetRangeProperties( bool bIsFirstSection,
+static uno::Reference< beans::XPropertySet > lcl_GetRangeProperties( bool bIsFirstSection,
DomainMapper_Impl& rDM_Impl,
const uno::Reference< text::XTextRange >& xStartingRange )
{
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index 12c11c38798a..8c24155fbac6 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -30,7 +30,7 @@ namespace dmapper
using namespace ::com::sun::star;
/// w:sdt's w:dropDownList doesn't have width, so guess the size based on the longest string.
-awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, OUString const& rDefault, std::vector<OUString>& rItems)
+static awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, OUString const& rDefault, std::vector<OUString>& rItems)
{
OUString aLongest = rDefault;
sal_Int32 nHeight = 0;
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 34066eeca780..47b54abfd040 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -179,7 +179,7 @@ PropertyMapPtr StyleSheetEntry::GetMergedInheritedProperties(const StyleSheetTab
return pRet;
}
-void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& pToAdd, TblStyleType nStyleId )
+static void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& pToAdd, TblStyleType nStyleId )
{
static const PropertyIds pPropsToCheck[] =
{
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index cf0b4f1f6b1c..b98508f297b2 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -45,7 +45,7 @@ OUString getLODefaultLanguage()
namespace writerfilter
{
-int getNumberFormat(int nParam)
+static int getNumberFormat(int nParam)
{
static const int aMap[]
= { NS_ooxml::LN_Value_ST_NumberFormat_decimal,