summaryrefslogtreecommitdiffstats
path: root/filter/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-19 16:32:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-22 12:57:32 +0100
commitf853ec317f6af1b8c65cc5bd758371689c75118d (patch)
treeb86d729bf9a9465ee619ead3b5635efa62a1804e /filter/source
parenttdf#124513 let wizard reappear on tabbing back to document (diff)
downloadcore-f853ec317f6af1b8c65cc5bd758371689c75118d.tar.gz
core-f853ec317f6af1b8c65cc5bd758371689c75118d.zip
Extend loplugin:external to warn about classes
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/config/cache/filterfactory.cxx2
-rw-r--r--filter/source/flash/swffilter.cxx7
-rw-r--r--filter/source/flash/swfwriter2.cxx3
-rw-r--r--filter/source/graphicfilter/egif/egif.cxx2
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx4
-rw-r--r--filter/source/graphicfilter/etiff/etiff.cxx2
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx4
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx4
-rw-r--r--filter/source/graphicfilter/ipbm/ipbm.cxx4
-rw-r--r--filter/source/graphicfilter/ipcd/ipcd.cxx4
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx4
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx8
-rw-r--r--filter/source/graphicfilter/ipsd/ipsd.cxx4
-rw-r--r--filter/source/graphicfilter/iras/iras.cxx4
-rw-r--r--filter/source/graphicfilter/itga/itga.cxx4
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx4
-rw-r--r--filter/source/msfilter/escherex.cxx8
-rw-r--r--filter/source/msfilter/msdffimp.cxx13
-rw-r--r--filter/source/msfilter/msvbahelper.cxx4
-rw-r--r--filter/source/msfilter/util.cxx4
-rw-r--r--filter/source/odfflatxml/OdfFlatXml.cxx4
-rw-r--r--filter/source/pdf/pdfexport.cxx4
-rw-r--r--filter/source/pdf/pdffilter.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx5
-rw-r--r--filter/source/svg/svgfilter.cxx4
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx3
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.cxx3
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.cxx4
-rw-r--r--filter/source/xsltfilter/XSLTFilter.cxx4
29 files changed, 119 insertions, 7 deletions
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index 06d273f2cbd3..a012b5542a8a 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -320,6 +320,7 @@ std::vector<OUString> FilterFactory::impl_queryMatchByDocumentService(const Quer
return lResult;
}
+namespace {
class stlcomp_removeIfMatchFlags
{
@@ -361,6 +362,7 @@ class stlcomp_removeIfMatchFlags
}
};
+}
std::vector<OUString> FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lTokens) const
{
diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx
index eac3e9385ad9..a0cae19a890f 100644
--- a/filter/source/flash/swffilter.cxx
+++ b/filter/source/flash/swffilter.cxx
@@ -59,6 +59,8 @@ using ::com::sun::star::container::XIndexAccess;
namespace swf {
+namespace {
+
class OslOutputStreamWrapper : public ::cppu::WeakImplHelper<css::io::XOutputStream>
{
osl::File maFile;
@@ -76,6 +78,8 @@ public:
virtual void SAL_CALL closeOutput( ) override;
};
+}
+
void SAL_CALL OslOutputStreamWrapper::writeBytes( const css::uno::Sequence< sal_Int8 >& aData )
{
sal_uInt64 uBytesToWrite = aData.getLength();
@@ -132,6 +136,7 @@ void SAL_CALL OslOutputStreamWrapper::closeOutput( )
}
}
+namespace {
class FlashExportFilter : public cppu::WeakImplHelper
<
@@ -173,6 +178,8 @@ public:
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
};
+}
+
FlashExportFilter::FlashExportFilter(const Reference< XComponentContext > &rxContext)
: mxDoc()
, mxContext(rxContext)
diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx
index 428c807c50ca..3b6e57d2974e 100644
--- a/filter/source/flash/swfwriter2.cxx
+++ b/filter/source/flash/swfwriter2.cxx
@@ -531,6 +531,7 @@ void FillStyle::addTo( Tag* pTag ) const
}
}
+namespace {
struct GradRecord
{
@@ -540,6 +541,8 @@ struct GradRecord
GradRecord( sal_uInt8 nRatio, const Color& rColor ) : mnRatio( nRatio ), maColor( rColor ) {}
};
+}
+
// TODO: better emulation of our gradients
void FillStyle::Impl_addGradient( Tag* pTag ) const
{
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx
index 42ad6ce71a64..b7e4ac40fe06 100644
--- a/filter/source/graphicfilter/egif/egif.cxx
+++ b/filter/source/graphicfilter/egif/egif.cxx
@@ -30,6 +30,7 @@
#include "giflzwc.hxx"
#include <memory>
+namespace {
class GIFWriter
{
@@ -72,6 +73,7 @@ public:
bool WriteGIF( const Graphic& rGraphic, FilterConfigItem* pConfigItem );
};
+}
GIFWriter::GIFWriter(SvStream &rStream)
: m_rGIF(rStream)
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index cac944a1ec64..e933763c9140 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -64,6 +64,8 @@ using namespace ::com::sun::star::uno;
// -----------------------------field-types------------------------------
+namespace {
+
struct StackMember
{
struct StackMember * pSucc;
@@ -231,6 +233,8 @@ public:
PSWriter();
};
+}
+
//========================== methods from PSWriter ==========================
diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx
index 8e70295203e7..456088d0c234 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -44,6 +44,7 @@
#define ResolutionUnit 296
#define ColorMap 320
+namespace {
struct TIFFLZWCTreeNode
{
@@ -112,6 +113,7 @@ public:
bool WriteTIFF( const Graphic& rGraphic, FilterConfigItem const * pFilterConfigItem );
};
+}
TIFFWriter::TIFFWriter(SvStream &rStream)
: m_rOStm(rStream)
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 39c2d1fe784d..b8942d13e48c 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -269,6 +269,8 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
return bRet;
}
+namespace {
+
struct WriteData
{
oslFileHandle m_pFile;
@@ -276,6 +278,8 @@ struct WriteData
sal_uInt32 m_nBytesToWrite;
};
+}
+
extern "C" {
static void WriteFileInThread(void *wData)
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index b0426d5c47d3..1ec1754d0d71 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -213,6 +213,8 @@ enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
//============================ OS2METReader ==================================
+namespace {
+
struct OSPalette {
OSPalette * pSucc;
sal_uInt32 * p0RGB; // May be NULL!
@@ -420,6 +422,8 @@ public:
};
+}
+
//=================== Methods of OS2METReader ==============================
OS2METReader::OS2METReader()
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index f192c847ab5e..3e882aa3c884 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -26,6 +26,8 @@
//============================ PBMReader ==================================
+namespace {
+
class PBMReader {
private:
@@ -49,6 +51,8 @@ public:
bool ReadPBM(Graphic & rGraphic );
};
+}
+
//=================== Methods of PBMReader ==============================
PBMReader::PBMReader(SvStream & rPBM)
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index c1b3f0061201..9c9fc0983f30 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -42,8 +42,6 @@ enum PCDResolution {
PCDRES_16BASE // 3072 x 3072
};
-}
-
class PCDReader {
private:
@@ -95,6 +93,8 @@ public:
bool ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem );
};
+}
+
//=================== Methods of PCDReader ==============================
bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 93cebc1e6dce..e4e4575618cd 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -27,6 +27,8 @@ class FilterConfigItem;
//============================ PCXReader ==================================
+namespace {
+
class PCXReader {
private:
@@ -59,6 +61,8 @@ public:
// Reads a PCX file from the stream and fills the GDIMetaFile
};
+}
+
//=================== methods of PCXReader ==============================
PCXReader::PCXReader(SvStream &rStream)
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 8fc618bc3b10..a916f090ea4c 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -37,6 +37,8 @@
// complete FilterConfigItem for GraphicImport under -fsanitize=function
namespace PictReaderInternal {
+ namespace {
+
//! utilitary class to store a pattern, ...
class Pattern {
public:
@@ -86,6 +88,8 @@ namespace PictReaderInternal {
bool isRead;
};
+ }
+
sal_uLong Pattern::read(SvStream &stream) {
unsigned char nbyte[8];
sal_uLong nHiBytes, nLoBytes;
@@ -145,8 +149,6 @@ enum class PictDrawingMethod {
TEXT, UNDEFINED
};
-}
-
class PictReader {
typedef class PictReaderInternal::Pattern Pattern;
private:
@@ -266,6 +268,8 @@ public:
};
+}
+
static void SetByte(sal_uInt16& nx, sal_uInt16 ny, vcl::bitmap::RawBitmap& rBitmap, sal_uInt16 nPixelSize, sal_uInt8 nDat, sal_uInt16 nWidth, std::vector<Color> const & rvPalette)
{
switch (nPixelSize)
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index a404e6f63b45..0f8f0dfa3b04 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -40,6 +40,8 @@ class FilterConfigItem;
#define PSD_DUOTONE 8
#define PSD_LAB 9
+namespace {
+
struct PSDFileHeader
{
sal_uInt32 nSignature;
@@ -82,6 +84,8 @@ public:
bool ReadPSD(Graphic & rGraphic);
};
+}
+
//=================== Methods of PSDReader ==============================
PSDReader::PSDReader(SvStream &rStream)
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index f2fca2cdf960..4bafe0fe8e9c 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -38,6 +38,8 @@ class FilterConfigItem;
//============================ RASReader ==================================
+namespace {
+
class RASReader {
private:
@@ -61,6 +63,8 @@ public:
bool ReadRAS(Graphic & rGraphic);
};
+}
+
//=================== Methods of RASReader ==============================
RASReader::RASReader(SvStream &rRAS)
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index 1408bf5ff4cc..f7748022fadb 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -27,6 +27,8 @@ class FilterConfigItem;
//============================ TGAReader ==================================
+namespace {
+
struct TGAFileHeader
{
sal_uInt8 nImageIDLength;
@@ -110,6 +112,8 @@ public:
bool ReadTGA(Graphic &rGraphic);
};
+}
+
//=================== Methods of TGAReader ==============================
TGAReader::TGAReader(SvStream &rTGA)
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 0d1bf7ae059d..d81cc2d7b073 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -40,8 +40,6 @@ template< typename T > T BYTESWAP(T nByte) {
( ( nByte & 128 ) >> 7 );
}
-}
-
//============================ TIFFReader ==================================
class TIFFReader
@@ -188,6 +186,8 @@ public:
bool ReadTIFF( SvStream & rTIFF, Graphic & rGraphic );
};
+}
+
//=================== Methods of TIFFReader ==============================
sal_uInt32 TIFFReader::DataTypeSize()
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 0279bc6684e7..69559fbc98b0 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4403,6 +4403,8 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, GraphicObjec
return nBlibId;
}
+namespace {
+
struct EscherConnectorRule
{
sal_uInt32 nRuleId;
@@ -4413,6 +4415,8 @@ struct EscherConnectorRule
sal_uInt32 ncptiB; // Connection site Index of shape B
};
+}
+
struct EscherShapeListEntry
{
uno::Reference<drawing::XShape>aXShape;
@@ -4892,6 +4896,8 @@ SvStream* EscherExGlobal::ImplQueryPictureStream()
return nullptr;
}
+namespace {
+
// Implementation of an empty stream that silently succeeds, but does nothing.
//
// In fact, this is a hack. The right solution is to abstract EscherEx to be
@@ -4910,6 +4916,8 @@ public:
SvNullStream() : SvStream() {}
};
+}
+
EscherEx::EscherEx(const std::shared_ptr<EscherExGlobal>& rxGlobal, SvStream* pOutStrm, bool bOOXML)
: mxGlobal(rxGlobal)
, mpOutStrm(pOutStrm)
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 10a0ca1f6382..3d791bbb9bc8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -191,6 +191,8 @@ using namespace container ;
static sal_uInt32 nMSOleObjCntr = 0;
#define MSO_OLE_Obj "MSO_OLE_Obj"
+namespace {
+
struct SvxMSDffBLIPInfo
{
sal_uLong nFilePos; ///< offset of the BLIP in data stream
@@ -200,6 +202,8 @@ struct SvxMSDffBLIPInfo
}
};
+}
+
/// the following will be sorted by the order of their appearance:
struct SvxMSDffBLIPInfos : public std::vector<SvxMSDffBLIPInfo> {};
@@ -1123,6 +1127,8 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
rSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) );
}
+namespace {
+
struct ShadeColor
{
Color aColor;
@@ -1131,6 +1137,8 @@ struct ShadeColor
ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {};
};
+}
+
static void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors )
{
sal_uInt32 nPos = rIn.Tell();
@@ -6800,11 +6808,16 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
return xStm->GetError() == ERRCODE_NONE;
}
+namespace {
+
struct ClsIDs {
sal_uInt32 nId;
const sal_Char* pSvrName;
const sal_Char* pDspName;
};
+
+}
+
static const ClsIDs aClsIDs[] = {
{ 0x000212F0, "MSWordArt", "Microsoft Word Art" },
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index ffebbaaf70e4..736f65887764 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -643,12 +643,16 @@ static sal_uInt16 parseChar( sal_Unicode c )
return nVclKey;
}
+namespace {
+
struct KeyCodeEntry
{
const char* sName;
sal_uInt16 nCode;
};
+}
+
KeyCodeEntry const aMSKeyCodesData[] = {
{ "BACKSPACE", KEY_BACKSPACE },
{ "BS", KEY_BACKSPACE },
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index a007c709b66a..8654458b98cf 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -558,12 +558,16 @@ EquationResult ParseCombinedChars(const OUString& rStr)
return aResult;
}
+namespace {
+
struct CustomShapeTypeTranslationTable
{
const char* sOOo;
const char* sMSO;
};
+}
+
static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[] =
{
// { "non-primitive", mso_sptMin },
diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx
index 8e0a4beb076e..cf7f37b9f993 100644
--- a/filter/source/odfflatxml/OdfFlatXml.cxx
+++ b/filter/source/odfflatxml/OdfFlatXml.cxx
@@ -52,6 +52,8 @@ using namespace ::com::sun::star::xml::sax;
namespace filter {
namespace odfflatxml {
+ namespace {
+
/*
* OdfFlatXml export and imports ODF flat XML documents by plugging a pass-through
* filter implementation into XmlFilterAdaptor.
@@ -102,6 +104,8 @@ namespace filter {
static Reference< XInterface > SAL_CALL impl_createInstance(const Reference< XMultiServiceFactory >& fact);
};
+
+ }
}
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index c24e3e6581f4..039ac09de19c 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -284,6 +284,8 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
return bRet;
}
+namespace {
+
class PDFExportStreamDoc : public vcl::PDFOutputStream
{
private:
@@ -301,6 +303,8 @@ public:
virtual void write( const Reference< XOutputStream >& xStream ) override;
};
+}
+
void PDFExportStreamDoc::write( const Reference< XOutputStream >& xStream )
{
Reference< css::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY );
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 698735c969e0..b79cc7884346 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -172,6 +172,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
return bRet;
}
+namespace {
class FocusWindowWaitCursor
{
@@ -202,6 +203,7 @@ public:
DECL_LINK( DestroyedLink, VclWindowEvent&, void );
};
+}
IMPL_LINK( FocusWindowWaitCursor, DestroyedLink, VclWindowEvent&, rEvent, void )
{
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 7913d3704e73..7fbf85283d7f 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -103,6 +103,8 @@ static const char constSvgNamespace[] = "http://www.w3.org/2000/svg";
This is a set of classes for exporting text field meta info.
*/
+namespace {
+
class TextField
{
protected:
@@ -310,11 +312,12 @@ public:
};
-static bool operator==( const TextField & aLhsTextField, const TextField & aRhsTextField )
+bool operator==( const TextField & aLhsTextField, const TextField & aRhsTextField )
{
return aLhsTextField.equalTo( aRhsTextField );
}
+}
SVGExport::SVGExport(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 5677d63fcc6c..ba3e56cf045c 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -616,6 +616,8 @@ void SAL_CALL SVGFilter::setTargetDocument( const Reference< XComponent >& xDoc
mxDstDoc = xDoc;
}
+namespace {
+
// There is already another SVG-Type_Detector, see
// vcl/source/filter/graphicfilter.cxx ("DOCTYPE svg"),
// but since these start from different preconditions it is not
@@ -788,6 +790,8 @@ public:
}
};
+}
+
OUString SAL_CALL SVGFilter::detect(Sequence<PropertyValue>& rDescriptor)
{
utl::MediaDescriptor aMediaDescriptor(rDescriptor);
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index f454dfda5627..efaf7a32ff83 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -52,6 +52,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::frame;
+namespace {
class XMLFilterDialogComponentBase
{
@@ -109,6 +110,8 @@ private:
std::shared_ptr<XMLFilterSettingsDialog> mxDialog;
};
+}
+
XMLFilterDialogComponent::XMLFilterDialogComponent(const css::uno::Reference< XComponentContext >& rxContext)
: OComponentHelper(maMutex)
, mxContext(rxContext)
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index c0352343adb6..94780eef3324 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -66,6 +66,7 @@ using namespace com::sun::star::system;
using namespace com::sun::star::xml;
using namespace com::sun::star::xml::sax;
+namespace {
class GlobalEventListenerImpl : public ::cppu::WeakImplHelper< css::document::XDocumentEventListener >
{
@@ -81,6 +82,8 @@ private:
XMLFilterTestDialog* mpDialog;
};
+}
+
GlobalEventListenerImpl::GlobalEventListenerImpl( XMLFilterTestDialog* pDialog )
: mpDialog( pDialog )
{
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 42980eeeaff7..a98b6537855f 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -70,6 +70,8 @@ namespace XSLT
const sal_Int32 Reader::INPUT_BUFFER_SIZE = 4096;
+ namespace {
+
/**
* ParserInputBufferCallback forwards IO call-backs to libxml stream IO.
*/
@@ -201,6 +203,8 @@ namespace XSLT
}
};
+ }
+
Reader::Reader(LibXSLTTransformer* transformer) :
Thread("LibXSLTTransformer"), m_transformer(transformer),
m_readBuf(INPUT_BUFFER_SIZE), m_writeBuf(OUTPUT_BUFFER_SIZE),
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx
index 340414598e9c..cdc5b5497dec 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -92,6 +92,8 @@ using namespace ::com::sun::star::task;
namespace XSLT
{
+ namespace {
+
/*
* XSLTFilter reads flat XML streams from the XML filter framework and passes
* them to an XSLT transformation service. XSLT transformation errors are
@@ -163,6 +165,8 @@ namespace XSLT
endDocument() override;
};
+ }
+
XSLTFilter::XSLTFilter(const css::uno::Reference<XComponentContext> &r):
m_xContext(r), m_bTerminated(false), m_bError(false)
{}