summaryrefslogtreecommitdiff
path: root/sw/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 /sw/source
parentf31d36966bceb90e261cbecd42634bde4448d527 (diff)
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 'sw/source')
-rw-r--r--sw/source/core/access/accmap.cxx24
-rw-r--r--sw/source/core/access/accpara.cxx8
-rw-r--r--sw/source/core/access/acctable.cxx12
-rw-r--r--sw/source/core/crsr/DateFormFieldButton.cxx3
-rw-r--r--sw/source/core/crsr/DropDownFormFieldButton.cxx3
-rw-r--r--sw/source/core/crsr/crsrsh.cxx4
-rw-r--r--sw/source/core/crsr/findattr.cxx8
-rw-r--r--sw/source/core/crsr/findcoll.cxx4
-rw-r--r--sw/source/core/crsr/findtxt.cxx8
-rw-r--r--sw/source/core/crsr/swcrsr.cxx4
-rw-r--r--sw/source/core/doc/doc.cxx4
-rw-r--r--sw/source/core/doc/docbm.cxx4
-rw-r--r--sw/source/core/doc/doccomp.cxx9
-rw-r--r--sw/source/core/doc/docedt.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx4
-rw-r--r--sw/source/core/doc/gctable.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx4
-rw-r--r--sw/source/core/doc/number.cxx8
-rw-r--r--sw/source/core/doc/swstylemanager.cxx8
-rw-r--r--sw/source/core/doc/tblrwcl.cxx16
-rw-r--r--sw/source/core/docnode/ndcopy.cxx7
-rw-r--r--sw/source/core/docnode/ndtbl.cxx16
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx8
-rw-r--r--sw/source/core/docnode/nodes.cxx4
-rw-r--r--sw/source/core/docnode/section.cxx3
-rw-r--r--sw/source/core/docnode/swthreadmanager.cxx4
-rw-r--r--sw/source/core/draw/dcontact.cxx4
-rw-r--r--sw/source/core/draw/dflyobj.cxx12
-rw-r--r--sw/source/core/draw/dview.cxx4
-rw-r--r--sw/source/core/edit/acorrect.cxx4
-rw-r--r--sw/source/core/edit/edlingu.cxx8
-rw-r--r--sw/source/core/fields/ddefld.cxx4
-rw-r--r--sw/source/core/fields/reffld.cxx4
-rw-r--r--sw/source/core/frmedt/fetab.cxx4
-rw-r--r--sw/source/core/frmedt/tblsel.cxx7
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx8
-rw-r--r--sw/source/core/layout/dbg_lay.cxx4
-rw-r--r--sw/source/core/layout/flycnt.cxx8
-rw-r--r--sw/source/core/layout/frmtool.cxx4
-rw-r--r--sw/source/core/layout/laycache.cxx4
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx44
-rw-r--r--sw/source/core/layout/sectfrm.cxx4
-rw-r--r--sw/source/core/layout/sortedobjs.cxx3
-rw-r--r--sw/source/core/layout/trvlfrm.cxx4
-rw-r--r--sw/source/core/ole/ndole.cxx4
-rw-r--r--sw/source/core/swg/SwXMLBlockImport.cxx4
-rw-r--r--sw/source/core/swg/SwXMLSectionList.cxx3
-rw-r--r--sw/source/core/table/swnewtable.cxx4
-rw-r--r--sw/source/core/text/frmcrsr.cxx4
-rw-r--r--sw/source/core/text/frmform.cxx5
-rw-r--r--sw/source/core/text/frmpaint.cxx4
-rw-r--r--sw/source/core/text/itratr.cxx8
-rw-r--r--sw/source/core/text/itrform2.cxx4
-rw-r--r--sw/source/core/text/porfld.cxx4
-rw-r--r--sw/source/core/text/pormulti.cxx7
-rw-r--r--sw/source/core/text/txtdrop.cxx4
-rw-r--r--sw/source/core/text/txtftn.cxx4
-rw-r--r--sw/source/core/text/xmldump.cxx4
-rw-r--r--sw/source/core/txtnode/SwGrammarContact.cxx4
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/fntcap.cxx24
-rw-r--r--sw/source/core/txtnode/modeltoviewhelper.cxx8
-rw-r--r--sw/source/core/txtnode/thints.cxx4
-rw-r--r--sw/source/core/undo/docundo.cxx4
-rw-r--r--sw/source/core/undo/undobj.cxx4
-rw-r--r--sw/source/core/undo/unsect.cxx4
-rw-r--r--sw/source/core/undo/untbl.cxx18
-rw-r--r--sw/source/core/unocore/unocoll.cxx12
-rw-r--r--sw/source/core/unocore/unofield.cxx8
-rw-r--r--sw/source/core/unocore/unoframe.cxx12
-rw-r--r--sw/source/core/unocore/unoidx.cxx12
-rw-r--r--sw/source/core/unocore/unoobj2.cxx15
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx3
-rw-r--r--sw/source/core/unocore/unoportenum.cxx8
-rw-r--r--sw/source/core/unocore/unorefmk.cxx8
-rw-r--r--sw/source/core/unocore/unosect.cxx4
-rw-r--r--sw/source/core/unocore/unostyle.cxx18
-rw-r--r--sw/source/core/unocore/unotbl.cxx4
-rw-r--r--sw/source/core/unocore/unotext.cxx4
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx8
-rw-r--r--sw/source/core/view/vprint.cxx4
-rw-r--r--sw/source/filter/ascii/ascatr.cxx8
-rw-r--r--sw/source/filter/ascii/parasc.cxx4
-rw-r--r--sw/source/filter/html/css1atr.cxx4
-rw-r--r--sw/source/filter/html/htmlatr.cxx12
-rw-r--r--sw/source/filter/html/htmlfld.cxx4
-rw-r--r--sw/source/filter/html/htmlform.cxx4
-rw-r--r--sw/source/filter/html/htmltab.cxx24
-rw-r--r--sw/source/filter/html/htmltabw.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.cxx8
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx9
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx3
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx4
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx8
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx4
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx7
-rw-r--r--sw/source/filter/ww8/ww8toolbar.cxx4
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx4
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx22
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx4
-rw-r--r--sw/source/filter/xml/xmlfonte.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx20
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx4
-rw-r--r--sw/source/filter/xml/xmliteme.cxx4
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx8
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx4
-rw-r--r--sw/source/filter/xml/xmltble.cxx4
-rw-r--r--sw/source/filter/xml/xmltbli.cxx20
-rw-r--r--sw/source/filter/xml/xmltext.cxx4
-rw-r--r--sw/source/filter/xml/xmltexti.cxx4
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx4
-rw-r--r--sw/source/ui/config/optpage.cxx4
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx4
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx4
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx4
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx8
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx8
-rw-r--r--sw/source/ui/frmdlg/cption.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx8
-rw-r--r--sw/source/ui/index/cnttab.cxx12
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx8
-rw-r--r--sw/source/ui/misc/outline.cxx4
-rw-r--r--sw/source/ui/table/tautofmt.cxx4
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx4
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx4
-rw-r--r--sw/source/ui/vba/vbaborders.cxx8
-rw-r--r--sw/source/ui/vba/vbacells.cxx4
-rw-r--r--sw/source/ui/vba/vbacolumns.cxx4
-rw-r--r--sw/source/ui/vba/vbadialog.cxx4
-rw-r--r--sw/source/ui/vba/vbadocument.cxx4
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.cxx24
-rw-r--r--sw/source/ui/vba/vbadocuments.cxx4
-rw-r--r--sw/source/ui/vba/vbafield.cxx12
-rw-r--r--sw/source/ui/vba/vbafont.cxx9
-rw-r--r--sw/source/ui/vba/vbaframes.cxx4
-rw-r--r--sw/source/ui/vba/vbaheadersfooters.cxx4
-rw-r--r--sw/source/ui/vba/vbalistgalleries.cxx4
-rw-r--r--sw/source/ui/vba/vbalistlevels.cxx4
-rw-r--r--sw/source/ui/vba/vbalisttemplates.cxx4
-rw-r--r--sw/source/ui/vba/vbapalette.cxx4
-rw-r--r--sw/source/ui/vba/vbapanes.cxx4
-rw-r--r--sw/source/ui/vba/vbaparagraph.cxx4
-rw-r--r--sw/source/ui/vba/vbarevisions.cxx9
-rw-r--r--sw/source/ui/vba/vbarows.cxx4
-rw-r--r--sw/source/ui/vba/vbasections.cxx4
-rw-r--r--sw/source/ui/vba/vbastyles.cxx12
-rw-r--r--sw/source/ui/vba/vbatables.cxx4
-rw-r--r--sw/source/ui/vba/vbatablesofcontents.cxx4
-rw-r--r--sw/source/ui/vba/vbatabstops.cxx4
-rw-r--r--sw/source/uibase/app/docsh2.cxx4
-rw-r--r--sw/source/uibase/app/docst.cxx4
-rw-r--r--sw/source/uibase/app/docstyle.cxx4
-rw-r--r--sw/source/uibase/app/mainwn.cxx4
-rw-r--r--sw/source/uibase/config/StoredChapterNumbering.cxx4
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx4
-rw-r--r--sw/source/uibase/dbui/mmconfigitem.cxx8
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx4
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx8
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.cxx4
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx4
-rw-r--r--sw/source/uibase/docvw/ShadowOverlayObject.cxx4
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControlAcc.cxx8
-rw-r--r--sw/source/uibase/docvw/SidebarWinAcc.cxx4
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx4
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx4
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx16
-rw-r--r--sw/source/uibase/uiview/pview.cxx4
-rw-r--r--sw/source/uibase/uiview/viewling.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
-rw-r--r--sw/source/uibase/utlui/bookctrl.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx4
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx4
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx4
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx4
-rw-r--r--sw/source/uibase/wrtsh/move.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh2.cxx4
186 files changed, 1185 insertions, 25 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 3a35b5c03e26..df641292b4f0 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -81,6 +81,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using namespace ::sw::access;
+namespace {
+
struct SwFrameFunc
{
bool operator()( const SwFrame * p1, const SwFrame * p2) const
@@ -89,6 +91,8 @@ struct SwFrameFunc
}
};
+}
+
class SwAccessibleContextMap_Impl
{
public:
@@ -122,6 +126,8 @@ public:
iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
};
+namespace {
+
class SwDrawModellListener_Impl : public SfxListener,
public ::cppu::WeakImplHelper< document::XShapeEventBroadcaster >
{
@@ -146,6 +152,8 @@ public:
void Dispose();
};
+}
+
SwDrawModellListener_Impl::SwDrawModellListener_Impl( SdrModel *pDrawModel ) :
maEventListeners( maListenerMutex ),
mpDrawModel( pDrawModel )
@@ -252,6 +260,8 @@ void SwDrawModellListener_Impl::Dispose()
mpDrawModel = nullptr;
}
+namespace {
+
struct SwShapeFunc
{
bool operator()( const SdrObject * p1, const SdrObject * p2) const
@@ -259,6 +269,9 @@ struct SwShapeFunc
return p1 < p2;
}
};
+
+}
+
typedef std::pair < const SdrObject *, ::rtl::Reference < ::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl;
class SwAccessibleShapeMap_Impl
@@ -599,6 +612,8 @@ void SwAccessibleEventList_Impl::MoveMissingXAccToEnd()
assert(size() == nSize);
}
+namespace {
+
struct SwAccessibleChildFunc
{
bool operator()( const SwAccessibleChild& r1,
@@ -618,6 +633,8 @@ struct SwAccessibleChildFunc
}
};
+}
+
class SwAccessibleEventMap_Impl
{
public:
@@ -637,6 +654,8 @@ public:
iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
};
+namespace {
+
struct SwAccessibleParaSelection
{
TextFrameIndex const nStartOfSelection;
@@ -658,6 +677,8 @@ struct SwXAccWeakRefComp
}
};
+}
+
class SwAccessibleSelectedParas_Impl
{
public:
@@ -791,6 +812,8 @@ void SwAccPreviewData::InvalidateSelection( const SwPageFrame* _pSelectedPageFra
assert(mpSelPage);
}
+namespace {
+
struct ContainsPredicate
{
const Point& mrPoint;
@@ -801,6 +824,7 @@ struct ContainsPredicate
}
};
+}
void SwAccPreviewData::AdjustMapMode( MapMode& rMapMode,
const Point& rPoint ) const
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index e50c0a3a9c7f..1df390906ce9 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1147,6 +1147,8 @@ css::uno::Sequence< css::style::TabStop > SwAccessibleParagraph::GetCurrentTabSt
return tabs;
}
+namespace {
+
struct IndexCompare
{
const PropertyValue* pValues;
@@ -1157,6 +1159,8 @@ struct IndexCompare
}
};
+}
+
OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
{
OUString strTypeName;
@@ -2694,6 +2698,8 @@ void SwAccessibleParagraph::deselectAccessibleChild(
// XAccessibleHypertext
+namespace {
+
class SwHyperlinkIter_Impl
{
SwTextFrame const& m_rFrame;
@@ -2709,6 +2715,8 @@ public:
TextFrameIndex endIdx() const { return m_nEnd; }
};
+}
+
SwHyperlinkIter_Impl::SwHyperlinkIter_Impl(const SwTextFrame & rTextFrame)
: m_rFrame(rTextFrame)
, m_Iter(rTextFrame)
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 6bb085d6a3bc..426d448327f3 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -59,6 +59,8 @@ typedef std::pair < sal_Int32, sal_Int32 > Int32Pair_Impl;
const unsigned int SELECTION_WITH_NUM = 10;
+namespace {
+
class SwAccTableSelHander_Impl
{
public:
@@ -68,6 +70,8 @@ protected:
~SwAccTableSelHander_Impl() {}
};
+}
+
class SwAccessibleTableData_Impl
{
SwAccessibleMap& mrAccMap;
@@ -474,6 +478,8 @@ void SwAccessibleTableData_Impl::GetRowColumnAndExtent(
rColumnExtent = nColumnEnd - rColumn;
}
+namespace {
+
class SwAccSingleTableSelHander_Impl : public SwAccTableSelHander_Impl
{
bool m_bSelected;
@@ -489,6 +495,8 @@ public:
virtual void Unselect( sal_Int32, sal_Int32 ) override;
};
+}
+
inline SwAccSingleTableSelHander_Impl::SwAccSingleTableSelHander_Impl() :
m_bSelected( true )
{
@@ -499,6 +507,8 @@ void SwAccSingleTableSelHander_Impl::Unselect( sal_Int32, sal_Int32 )
m_bSelected = false;
}
+namespace {
+
class SwAccAllTableSelHander_Impl : public SwAccTableSelHander_Impl
{
@@ -518,6 +528,8 @@ public:
virtual ~SwAccAllTableSelHander_Impl();
};
+}
+
SwAccAllTableSelHander_Impl::~SwAccAllTableSelHander_Impl()
{
}
diff --git a/sw/source/core/crsr/DateFormFieldButton.cxx b/sw/source/core/crsr/DateFormFieldButton.cxx
index 4ecaf15dbfba..d5c44f121f42 100644
--- a/sw/source/core/crsr/DateFormFieldButton.cxx
+++ b/sw/source/core/crsr/DateFormFieldButton.cxx
@@ -15,6 +15,8 @@
#include <tools/date.hxx>
#include <svl/zforlist.hxx>
+namespace
+{
class SwDatePickerDialog : public FloatingWindow
{
private:
@@ -30,6 +32,7 @@ public:
virtual ~SwDatePickerDialog() override;
virtual void dispose() override;
};
+}
SwDatePickerDialog::SwDatePickerDialog(SwEditWin* parent, sw::mark::DateFieldmark* pFieldmark,
SvNumberFormatter* pNumberFormatter)
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index 7a42bf7c853f..916d6ab1a8b7 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -18,6 +18,8 @@
#include <docsh.hxx>
#include <strings.hrc>
+namespace
+{
/**
* Popup dialog for drop-down form field showing the list items of the field.
* The user can select the item using this popup while filling in a form.
@@ -35,6 +37,7 @@ public:
virtual ~SwFieldDialog() override;
virtual void dispose() override;
};
+}
SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, long nMinListWidth)
: FloatingWindow(parent, WB_BORDER | WB_SYSTEMWINDOW)
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 967743a2a2dc..838159a28034 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1530,6 +1530,8 @@ static void lcl_CheckHiddenPara( SwPosition& rPos )
rPos = SwPosition( aTmp, SwIndex( pTextNd, 0 ) );
}
+namespace {
+
// #i27301# - helper class that notifies the accessibility about invalid text
// selections in its destructor
class SwNotifyAccAboutInvalidTextSelections
@@ -1548,6 +1550,8 @@ class SwNotifyAccAboutInvalidTextSelections
}
};
+}
+
void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
{
SET_CURR_SHELL( this );
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 7f35f3c37351..51518bccad35 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -174,6 +174,8 @@ static bool lcl_SearchAttr( const SwTextNode& rTextNd, SwPaM& rPam,
return false;
}
+namespace {
+
/// search for multiple text attributes
struct SwSrchChrAttr
{
@@ -221,6 +223,8 @@ public:
bool SetAttrBwd( const SwTextAttr& rAttr );
};
+}
+
SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, bool bFwd,
bool bNoCollections )
: m_nNodeStart(0)
@@ -1200,6 +1204,8 @@ static bool FindAttrsImpl(SwPaM & rSearchPam,
return bFound;
}
+namespace {
+
/// parameters for search for attributes
struct SwFindParaAttr : public SwFindParas
{
@@ -1227,6 +1233,8 @@ struct SwFindParaAttr : public SwFindParas
virtual bool IsReplaceMode() const override;
};
+}
+
int SwFindParaAttr::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove,
const SwPaM & rRegion, bool bInReadOnly)
{
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index ec033d6bb207..f80fff2c10ee 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -26,6 +26,8 @@
#include <SwRewriter.hxx>
#include <strings.hrc>
+namespace {
+
/// parameters for a search for FormatCollections
struct SwFindParaFormatColl : public SwFindParas
{
@@ -43,6 +45,8 @@ struct SwFindParaFormatColl : public SwFindParas
virtual bool IsReplaceMode() const override;
};
+}
+
int SwFindParaFormatColl::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnMove,
const SwPaM & rRegion, bool bInReadOnly)
{
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 683904754e5a..d9658bc75335 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -54,6 +54,8 @@
using namespace ::com::sun::star;
using namespace util;
+namespace {
+
/// because the Find may be called on the View or the Model, we need an index
/// afflicted by multiple personality disorder
struct AmbiguousIndex
@@ -174,6 +176,8 @@ public:
}
};
+}
+
static OUString
lcl_CleanStr(const SwTextNode& rNd,
SwTextFrame const*const pFrame,
@@ -891,6 +895,8 @@ bool DoSearch(SwPaM & rSearchPam,
return bFound;
}
+namespace {
+
/// parameters for search and replace in text
struct SwFindParaText : public SwFindParas
{
@@ -915,6 +921,8 @@ struct SwFindParaText : public SwFindParas
virtual ~SwFindParaText();
};
+}
+
SwFindParaText::~SwFindParaText()
{
}
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 5509b9f33027..611430d7113b 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -58,6 +58,8 @@ using namespace ::com::sun::star::i18n;
static const sal_uInt16 coSrchRplcThreshold = 60000;
+namespace {
+
struct PercentHdl
{
SwDocShell* const pDSh;
@@ -115,6 +117,8 @@ struct PercentHdl
}
};
+}
+
SwCursor::SwCursor( const SwPosition &rPos, SwPaM* pRing )
: SwPaM( rPos, pRing )
, m_nRowSpanOffset(0)
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 246ffc1a5c8a..4ad631e560b2 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -461,6 +461,8 @@ void SwDoc::ChgDBData(const SwDBData& rNewData)
getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DatabaseName)->UpdateFields();
}
+namespace {
+
struct PostItField_ : public SetGetExpField
{
PostItField_( const SwNodeIndex& rNdIdx, const SwTextField* pField )
@@ -476,6 +478,8 @@ struct PostItField_ : public SetGetExpField
}
};
+}
+
sal_uInt16 PostItField_::GetPageNo(
const StringRangeEnumerator &rRangeEnum,
const std::set< sal_Int32 > &rPossiblePages,
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index c0c973904bf5..dec1b3d58654 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1117,6 +1117,8 @@ namespace sw { namespace mark
lcl_DebugMarks(m_vAllMarks);
}
+ namespace {
+
struct LazyFieldmarkDeleter : public IDocumentMarkAccess::ILazyDeleter
{
std::unique_ptr<Fieldmark> m_pFieldmark;
@@ -1136,6 +1138,8 @@ namespace sw { namespace mark
}
};
+ }
+
std::unique_ptr<IDocumentMarkAccess::ILazyDeleter>
MarkManager::deleteMark(const const_iterator_t& ppMark)
{
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 534f471e9310..e3562414907d 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -47,6 +47,8 @@ using namespace ::com::sun::star;
using std::vector;
+namespace {
+
class SwCompareLine
{
const SwNode& rNode;
@@ -307,8 +309,13 @@ struct CmpOptionsContainer
int nIgnoreLen;
bool bUseRsid;
};
+
+}
+
static CmpOptionsContainer CmpOptions;
+namespace {
+
class CommonSubseq
{
private:
@@ -372,6 +379,8 @@ public:
}
};
+}
+
CompareData::~CompareData()
{
if( pDelRing )
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 7ecb764e30b5..3cc2e8b6144c 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -721,6 +721,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
return aRet;
}
+namespace {
+
class SwHyphArgs : public SwInterHyphInfo
{
const SwNode *pStart;
@@ -744,6 +746,8 @@ public:
sal_uInt16 *GetPageSt() { return pPageSt; }
};
+}
+
SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCursorPos,
sal_uInt16* pPageCount, sal_uInt16* pPageStart )
: SwInterHyphInfo( rCursorPos ), pNode(nullptr),
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index d429af8bdf89..1526f0bd347e 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -192,6 +192,8 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
getIDocumentState().SetModified();
}
+namespace {
+
/// Travel between table of content Marks
class CompareNodeContent
{
@@ -219,6 +221,8 @@ public:
( nNode == rCmp.nNode && nContent >= rCmp.nContent); }
};
+}
+
const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
SwTOXSearch eDir, bool bInReadOnly )
{
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 493ef4248c91..ddcf9e20c0f4 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -319,6 +319,8 @@ static void lcl_GC_Box_Border( const SwTableBox* pBox, SwGCLineBorder* pPara )
}
}
+namespace {
+
struct GCLinePara
{
SwTableLines* pLns;
@@ -329,6 +331,8 @@ struct GCLinePara
{}
};
+}
+
static bool lcl_MergeGCLine(SwTableLine* pLine, GCLinePara* pPara);
static bool lcl_MergeGCBox(SwTableBox* pTableBox, GCLinePara* pPara)
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 2873c98161e5..8e6f8ac1d446 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -48,6 +48,8 @@ using namespace ::com::sun::star;
#define COLFUZZY 20
#define MAX_TABWIDTH (USHRT_MAX - 2001)
+namespace {
+
class SwHTMLTableLayoutConstraints
{
sal_uInt16 const nRow; // start row
@@ -72,6 +74,8 @@ public:
sal_uInt16 GetColumn() const { return nCol; }
};
+}
+
SwHTMLTableLayoutCnts::SwHTMLTableLayoutCnts(const SwStartNode *pSttNd,
std::shared_ptr<SwHTMLTableLayout> const& rTab,
bool bNoBrTag,
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index f57933440278..44b59a283faf 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1050,6 +1050,8 @@ void SwNumRule::SetGrabBagItem(const uno::Any& rVal)
namespace numfunc
{
+ namespace {
+
/** class containing default bullet list configuration data */
class SwDefBulletConfig : private utl::ConfigItem
{
@@ -1112,8 +1114,6 @@ namespace numfunc
std::unique_ptr<vcl::Font> mpFont;
};
- namespace
- {
class theSwDefBulletConfig
: public rtl::Static<SwDefBulletConfig, theSwDefBulletConfig>{};
}
@@ -1276,6 +1276,8 @@ namespace numfunc
return SwDefBulletConfig::getInstance().GetChar( nLevel );
}
+ namespace {
+
/** class containing configuration data about user interface behavior
regarding lists and list items.
configuration item about behavior of <TAB>/<SHIFT-TAB>-key at first
@@ -1312,8 +1314,6 @@ namespace numfunc
bool mbChangeIndentOnTabAtFirstPosOfFirstListItem;
};
- namespace
- {
class theSwNumberingUIBehaviorConfig : public rtl::Static<SwNumberingUIBehaviorConfig, theSwNumberingUIBehaviorConfig>{};
}
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index abb217bcf80b..3af1b80d7596 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -26,6 +26,8 @@
typedef std::unordered_map< OUString,
std::shared_ptr<SfxItemSet> > SwStyleNameCache;
+namespace {
+
class SwStyleCache
{
SwStyleNameCache mMap;
@@ -37,6 +39,8 @@ public:
std::shared_ptr<SfxItemSet> getByName( const OUString& rName ) { return mMap[rName]; }
};
+}
+
void SwStyleCache::addCompletePool( StylePool& rPool )
{
std::unique_ptr<IStylePoolIteratorAccess> pIter = rPool.createIterator();
@@ -49,6 +53,8 @@ void SwStyleCache::addCompletePool( StylePool& rPool )
}
}
+namespace {
+
class SwStyleManager : public IStyleAccess
{
StylePool aAutoCharPool;
@@ -74,6 +80,8 @@ public:
virtual void clearCaches() override;
};
+}
+
std::unique_ptr<IStyleAccess> createStyleManager( SfxItemSet const * pIgnorableParagraphItems )
{
return std::make_unique<SwStyleManager>( pIgnorableParagraphItems );
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 1c295d097a6a..dd150db18b2a 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -69,6 +69,8 @@ using namespace com::sun::star::uno;
#define CHECK_TABLE(t)
#endif
+namespace {
+
// In order to set the Frame Formats for the Boxes, it's enough to look
// up the current one in the array. If it's already there return the new one.
struct CpyTabFrame
@@ -121,6 +123,8 @@ struct CR_SetBoxWidth
}
};
+}
+
static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
SwTwips nDist, bool bCheck );
static bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
@@ -161,6 +165,8 @@ typedef bool (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, bool
#endif // DBG_UTIL
+namespace {
+
struct CR_SetLineHeight
{
SwTableNode* pTableNd;
@@ -183,6 +189,8 @@ struct CR_SetLineHeight
{}
};
+}
+
static bool lcl_SetSelLineHeight( SwTableLine* pLine, const CR_SetLineHeight& rParam,
SwTwips nDist, bool bCheck );
static bool lcl_SetOtherLineHeight( SwTableLine* pLine, const CR_SetLineHeight& rParam,
@@ -192,6 +200,8 @@ typedef bool (*FN_lcl_SetLineHeight)(SwTableLine*, CR_SetLineHeight&, SwTwips, b
typedef o3tl::sorted_vector<CpyTabFrame> CpyTabFrames;
+namespace {
+
struct CpyPara
{
std::shared_ptr< std::vector< std::vector< sal_uLong > > > pWidths;
@@ -233,6 +243,8 @@ struct CpyPara
{}
};
+}
+
static void lcl_CopyRow(FndLine_ & rFndLine, CpyPara *const pCpyPara);
static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
@@ -1306,6 +1318,8 @@ static void lcl_CalcWidth( SwTableBox* pBox )
pFormat->ResetFormatAttr( RES_BOXATR_BEGIN, RES_BOXATR_END - 1 );
}
+namespace {
+
struct InsULPara
{
SwTableNode* pTableNd;
@@ -1331,6 +1345,8 @@ struct InsULPara
{ bUL_LR = true; bUL = false; if( pLine ) pInsLine = pLine; }
};
+}
+
static void lcl_Merge_MoveLine(FndLine_ & rFndLine, InsULPara *const pULPara);
static void lcl_Merge_MoveBox(FndBox_ & rFndBox, InsULPara *const pULPara)
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index e08835cf66e1..6f97cc44db57 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -38,6 +38,7 @@
#define CHECK_TABLE(t)
#endif
+namespace {
// Structure for the mapping from old and new frame formats to the
// boxes and lines of a table
@@ -50,6 +51,8 @@ struct MapTableFrameFormat
{}
};
+}
+
typedef std::vector<MapTableFrameFormat> MapTableFrameFormats;
SwContentNode* SwTextNode::MakeCopy(SwDoc* pDoc, const SwNodeIndex& rIdx, bool const bNewFrames) const
@@ -118,6 +121,8 @@ static bool lcl_SrchNew( const MapTableFrameFormat& rMap, SwFrameFormat** pPara
return false;
}
+namespace {
+
struct CopyTable
{
SwDoc* m_pDoc;
@@ -135,6 +140,8 @@ struct CopyTable
{}
};
+}
+
static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT );
static void lcl_CopyTableBox( SwTableBox* pBox, CopyTable* pCT )
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 00e249b9e0fb..c35ca9731936 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1485,6 +1485,8 @@ bool SwDoc::TableToText( const SwTableNode* pTableNd, sal_Unicode cCh )
return bRet;
}
+namespace {
+
/**
* Use the ForEach method from PtrArray to recreate Text from a Table.
* The Boxes can also contain Lines!
@@ -1500,6 +1502,8 @@ struct DelTabPara
pLastNd(nullptr), rNds( rNodes ), pUndo( pU ), cCh( cChar ) {}
};
+}
+
// Forward declare so that the Lines and Boxes can use recursion
static void lcl_DelBox( SwTableBox* pBox, DelTabPara* pDelPara );
@@ -2500,11 +2504,15 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
#define ROWFUZZY 25
+namespace {
+
struct FuzzyCompare
{
bool operator() ( long s1, long s2 ) const;
};
+}
+
bool FuzzyCompare::operator() ( long s1, long s2 ) const
{
return ( s1 < s2 && std::abs( s1 - s2 ) > ROWFUZZY );
@@ -3239,6 +3247,8 @@ static bool lcl_ChgTableSize( SwTable& rTable )
return true;
}
+namespace {
+
class SplitTable_Para
{
std::map<SwFrameFormat const *, SwFrameFormat*> aSrcDestMap;
@@ -3265,6 +3275,8 @@ public:
}
};
+}
+
static void lcl_SplitTable_CpyBox( SwTableBox* pBox, SplitTable_Para* pPara );
static void lcl_SplitTable_CpyLine( SwTableLine* pLn, SplitTable_Para* pPara )
@@ -3583,6 +3595,8 @@ bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev,
return true;
}
+namespace {
+
// Use the PtrArray's ForEach method
struct SetAFormatTabPara
{
@@ -3598,6 +3612,8 @@ struct SetAFormatTabPara
{}
};
+}
+
// Forward declare so that the Lines and Boxes can use recursion
static bool lcl_SetAFormatBox(FndBox_ &, SetAFormatTabPara *pSetPara, bool bResetDirect);
static bool lcl_SetAFormatLine(FndLine_ &, SetAFormatTabPara *pPara, bool bResetDirect);
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index e1b1c14159bd..c8e9db3c41a8 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -57,6 +57,8 @@ using namespace ::com::sun::star;
static bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
+namespace {
+
// SwTableLine::ChgFrameFormat may delete old format which doesn't have writer listeners anymore.
// This may invalidate my pointers, and lead to use-after-free. For this reason, I register myself
// as a writer listener for the old format here, and take care to delete formats without listeners
@@ -75,6 +77,8 @@ private:
sal_Int16 const nType;
};
+}
+
SwTableFormatCmp::SwTableFormatCmp( SwFrameFormat *pO, SwFrameFormat *pN, sal_Int16 nT )
: pOld ( pO ), pNew ( pN ), nType( nT )
{
@@ -174,6 +178,8 @@ static bool lcl_IsAnLower( const SwTableLine *pLine, const SwTableLine *pAssumed
return false;
}
+namespace {
+
struct LinesAndTable
{
std::vector<SwTableLine*> &m_rLines;
@@ -184,6 +190,8 @@ struct LinesAndTable
m_rLines(rL), m_rTable(rTable), m_bInsertLines(true) {}
};
+}
+
static bool FindLine_( FndLine_ & rLine, LinesAndTable* pPara );
static bool FindBox_( FndBox_ & rBox, LinesAndTable* pPara )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 2feef62276df..10cc05aec7af 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1395,12 +1395,16 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
}
}
+namespace {
+
struct HighLevel
{
sal_uInt16 nLevel, nTop;
explicit HighLevel( sal_uInt16 nLv ) : nLevel( nLv ), nTop( nLv ) {}
};
+}
+
static bool lcl_HighestLevel( const SwNodePtr& rpNode, void * pPara )
{
HighLevel * pHL = static_cast<HighLevel*>(pPara);
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 21e4247cfc62..5ee2c0cda4c1 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -65,6 +65,8 @@
using namespace ::com::sun::star;
+namespace {
+
class SwIntrnlSectRefLink : public SwBaseLink
{
SwSectionFormat& rSectFormat;
@@ -88,6 +90,7 @@ public:
}
};
+}
SwSectionData::SwSectionData(SectionType const eType, OUString const& rName)
: m_eType(eType)
diff --git a/sw/source/core/docnode/swthreadmanager.cxx b/sw/source/core/docnode/swthreadmanager.cxx
index cadbfda29887..4b646e8b22df 100644
--- a/sw/source/core/docnode/swthreadmanager.cxx
+++ b/sw/source/core/docnode/swthreadmanager.cxx
@@ -39,8 +39,12 @@ SwThreadManager::~SwThreadManager()
{
}
+namespace {
+
struct InitInstance : public rtl::Static<SwThreadManager, InitInstance> {};
+}
+
SwThreadManager& SwThreadManager::GetThreadManager()
{
return InitInstance::get();
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 5ffe5728fd49..82548ced5a6f 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1992,6 +1992,8 @@ namespace sdr
{
namespace contact
{
+ namespace {
+
class VOCOfDrawVirtObj : public ViewObjectContactOfSdrObj
{
protected:
@@ -2035,6 +2037,8 @@ namespace sdr
return static_cast<SwDrawVirtObj&>(mrObject);
}
};
+
+ }
} // end of namespace contact
} // end of namespace sdr
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index e21f3f35b992..37778cfd9f86 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -75,6 +75,8 @@ namespace sdr
{
namespace contact
{
+ namespace {
+
/**
* @see #i95264#
*
@@ -100,6 +102,8 @@ namespace sdr
}
};
+ }
+
drawinglayer::primitive2d::Primitive2DContainer VCOfSwFlyDrawObj::createViewIndependentPrimitive2DSequence() const
{
// currently gets not visualized, return empty sequence
@@ -148,6 +152,8 @@ namespace drawinglayer
{
namespace primitive2d
{
+ namespace {
+
class SwVirtFlyDrawObjPrimitive : public BufferedDecompositionPrimitive2D
{
private:
@@ -182,6 +188,8 @@ namespace drawinglayer
/// provide unique ID
DeclPrimitive2DIDBlock()
};
+
+ }
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -252,6 +260,8 @@ namespace sdr
{
namespace contact
{
+ namespace {
+
class VCOfSwVirtFlyDrawObj : public ViewContactOfVirtObj
{
protected:
@@ -274,6 +284,8 @@ namespace sdr
return static_cast<SwVirtFlyDrawObj&>(mrObject);
}
};
+
+ }
} // end of namespace contact
} // end of namespace sdr
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index c1a7b6a8cbbc..fd69be2ca96a 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -58,6 +58,8 @@
using namespace com::sun::star;
+namespace {
+
class SwSdrHdl : public SdrHdl
{
public:
@@ -66,6 +68,8 @@ public:
virtual bool IsFocusHdl() const override;
};
+}
+
bool SwSdrHdl::IsFocusHdl() const
{
if( SdrHdlKind::Anchor == eKind || SdrHdlKind::Anchor_TR == eKind )
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index da544315a9ff..95e3a7e98b69 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -36,6 +36,8 @@
using namespace ::com::sun::star;
+namespace {
+
class PaMIntoCursorShellRing
{
SwCursorShell& rSh;
@@ -49,6 +51,8 @@ public:
~PaMIntoCursorShellRing();
};
+}
+
PaMIntoCursorShellRing::PaMIntoCursorShellRing( SwCursorShell& rCSh,
SwPaM& rShCursor, SwPaM& rPam )
: rSh( rCSh ), rDelPam( rPam ), rCursor( rShCursor )
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index fa1078cdecf7..ef4c5af85743 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -60,6 +60,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
+namespace {
+
class SwLinguIter
{
SwEditShell *pSh;
@@ -101,8 +103,12 @@ struct SpellContentPosition
sal_Int32 nRight;
};
+}
+
typedef std::vector<SpellContentPosition> SpellContentPositions;
+namespace {
+
class SwSpellIter : public SwLinguIter
{
uno::Reference< XSpellChecker1 > xSpeller;
@@ -172,6 +178,8 @@ public:
void ShowSelection();
};
+}
+
static SwSpellIter* g_pSpellIter = nullptr;
static SwConvIter* g_pConvIter = nullptr;
static SwHyphIter* g_pHyphIter = nullptr;
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index e1e5ce3daf23..7d6c91d31d17 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -40,6 +40,8 @@ using namespace ::com::sun::star;
#define DDE_TXT_ENCODING osl_getThreadTextEncoding()
+namespace {
+
class SwIntrnlRefLink : public SwBaseLink
{
SwDDEFieldType& rFieldType;
@@ -57,6 +59,8 @@ public:
virtual bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd ) const override;
};
+}
+
::sfx2::SvBaseLink::UpdateResult SwIntrnlRefLink::DataChanged( const OUString& rMimeType,
const uno::Any & rValue )
{
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 19c258c86cd3..6ffe0c8000ec 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1249,6 +1249,8 @@ SwTextNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark
return pTextNd;
}
+namespace {
+
struct RefIdsMap
{
private:
@@ -1272,6 +1274,8 @@ public:
const OUString& GetName() const { return aName; }
};
+}
+
/// Get a sorted list of the field IDs from a document.
/// @param[in] rDoc The document to search.
/// @param[in,out] rIds The list of IDs found in the document.
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index f6bda8ebc469..41c0b9184207 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -68,6 +68,8 @@ using namespace ::com::sun::star;
static bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
+namespace {
+
class TableWait
{
const std::unique_ptr<SwWait> m_pWait;
@@ -81,6 +83,8 @@ public:
{ }
};
+}
+
void SwFEShell::ParkCursorInTab()
{
SwCursor * pSwCursor = GetSwCursor();
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 318453df4dd4..a020bb44170c 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -62,6 +62,8 @@
#undef DEL_ONLY_EMPTY_LINES
#undef DEL_EMPTY_BOXES_AT_START_AND_END
+namespace {
+
struct CmpLPt
{
Point aPos;
@@ -82,8 +84,11 @@ struct CmpLPt
long Y() const { return aPos.Y(); }
};
+}
+
typedef o3tl::sorted_vector<CmpLPt> MergePos;
+namespace {
struct Sort_CellFrame
{
@@ -93,6 +98,8 @@ struct Sort_CellFrame
: pFrame( &rCFrame ) {}
};
+}
+
static const SwLayoutFrame *lcl_FindCellFrame( const SwLayoutFrame *pLay )
{
while ( pLay && !pLay->IsCellFrame() )
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 079468fdf062..b28c9ebf317a 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -37,6 +37,8 @@
using namespace ::com::sun::star;
+namespace {
+
/// helper class for correct notification due to the positioning of
/// the anchored drawing object
class SwPosNotify
@@ -53,6 +55,8 @@ class SwPosNotify
Point const & LastObjPos() const;
};
+}
+
SwPosNotify::SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj ) :
mpAnchoredDrawObj( _pAnchoredDrawObj )
{
@@ -130,6 +134,8 @@ Point const & SwPosNotify::LastObjPos() const
return maOldObjRect.Pos();
}
+namespace {
+
// #i32795#
/// helper class for oscillation control on object positioning
class SwObjPosOscillationControl
@@ -145,6 +151,8 @@ class SwObjPosOscillationControl
bool OscillationDetected();
};
+}
+
SwObjPosOscillationControl::SwObjPosOscillationControl(
const SwAnchoredDrawObject& _rAnchoredDrawObj )
: mpAnchoredDrawObj( &_rAnchoredDrawObj )
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index a7e727fc2669..ec09f8c4305c 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -177,6 +177,8 @@ public:
virtual void Leave(); // message when leaving
};
+namespace {
+
class SwSizeEnterLeave : public SwImplEnterLeave
{
long nFrameHeight;
@@ -209,6 +211,8 @@ public:
virtual void Leave() override; // message when resizing the Frame area
};
+}
+
void SwProtocol::Record( const SwFrame* pFrame, PROT nFunction, DbgAction nAct, void* pParam )
{
if( Start() )
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 1e449338331e..262357d8d2a2 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -201,6 +201,8 @@ void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN
//We need some helper classes to monitor the oscillation and a few functions
//to not get lost.
+namespace {
+
// #i3317# - re-factoring of the position stack
class SwOszControl
{
@@ -220,6 +222,8 @@ public:
static bool IsInProgress( const SwFlyFrame *pFly );
};
+}
+
const SwFlyFrame *SwOszControl::pStack1 = nullptr;
const SwFlyFrame *SwOszControl::pStack2 = nullptr;
const SwFlyFrame *SwOszControl::pStack3 = nullptr;
@@ -539,6 +543,8 @@ bool SwFlyAtContentFrame::IsFormatPossible() const
!SwOszControl::IsInProgress( this );
}
+namespace {
+
class SwDistance
{
public:
@@ -552,6 +558,8 @@ public:
!rTwo.nSub || nSub <= rTwo.nSub ) ); }
};
+}
+
static const SwFrame * lcl_CalcDownDist( SwDistance &rRet,
const Point &rPt,
const SwContentFrame *pCnt )
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 44d1cd422c10..9c804b7c1ff8 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3501,6 +3501,8 @@ const SwFrame* FindPage( const SwRect &rRect, const SwFrame *pPage )
return pPage;
}
+namespace {
+
class SwFrameHolder : private SfxListener
{
SwFrame* pFrame;
@@ -3514,6 +3516,8 @@ public:
bool IsSet() const { return bSet; }
};
+}
+
void SwFrameHolder::SetFrame( SwFrame* pHold )
{
bSet = true;
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 58a1fc3e3391..423d63699fc9 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -944,6 +944,8 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
return bRet;
}
+namespace {
+
struct SdrObjectCompare
{
bool operator()( const SdrObject* pF1, const SdrObject* pF2 ) const
@@ -960,6 +962,8 @@ struct FlyCacheCompare
}
};
+}
+
/**
* If a new page is inserted, the last page is analysed.
* If there are text frames with default position, the fly cache
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 9d25adc56f03..cc59fdd4e15c 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -33,6 +33,8 @@
using namespace ::com::sun::star;
+namespace {
+
// little helper class to forbid follow formatting for the given text frame
class SwForbidFollowFormat
{
@@ -57,6 +59,8 @@ public:
}
};
+}
+
SwObjectFormatterTextFrame::SwObjectFormatterTextFrame( SwTextFrame& _rAnchorTextFrame,
const SwPageFrame& _rPageFrame,
SwTextFrame* _pMasterAnchorTextFrame,
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 5e69b24d94c1..a7508171ecad 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -127,10 +127,10 @@ using ::drawinglayer::primitive2d::BorderLine;
using std::pair;
using std::make_pair;
-struct SwPaintProperties;
-
namespace {
+struct SwPaintProperties;
+
//Class declaration; here because they are only used in this file
enum class SubColFlags {
Page = 0x01, //Helplines of the page
@@ -145,6 +145,8 @@ namespace o3tl {
template<> struct typed_flags<SubColFlags> : is_typed_flags<SubColFlags, 0x39> {};
}
+namespace {
+
// Classes collecting the border lines and help lines
class SwLineRect : public SwRect
{
@@ -174,6 +176,8 @@ public:
bool MakeUnion( const SwRect &rRect, SwPaintProperties const &properties );
};
+}
+
#ifdef IOS
static void dummy_function()
{
@@ -182,6 +186,8 @@ static void dummy_function()
}
#endif
+namespace {
+
class SwLineRects
{
public:
@@ -232,6 +238,8 @@ public:
}
};
+}
+
// Default zoom factor
const static double aEdgeScale = 0.5;
@@ -246,6 +254,8 @@ Color* GetActiveRetoucheColor()
}
}
+namespace {
+
/**
* Container for static properties
*/
@@ -312,6 +322,8 @@ struct SwPaintProperties {
};
+}
+
static SwPaintProperties gProp;
static bool isSubsidiaryLinesFlysEnabled()
@@ -420,6 +432,8 @@ void SwCalcPixStatics( vcl::RenderContext const *pOut )
gProp.aSScaleY = double(rMap.GetScaleY());
}
+namespace {
+
/**
* To be able to save the statics so the paint is more or less reentrant
*/
@@ -430,6 +444,8 @@ public:
~SwSavePaintStatics();
};
+}
+
SwSavePaintStatics::SwSavePaintStatics()
{
// Saving globales
@@ -2221,6 +2237,8 @@ static void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const vcl::RenderCont
// FUNCTIONS USED FOR COLLAPSING TABLE BORDER LINES START
+namespace {
+
struct SwLineEntry
{
SwTwips mnKey;
@@ -2240,6 +2258,8 @@ public:
OverlapType Overlaps( const SwLineEntry& rComp ) const;
};
+}
+
SwLineEntry::SwLineEntry( SwTwips nKey,
SwTwips nStartPos,
SwTwips nEndPos,
@@ -2300,6 +2320,8 @@ SwLineEntry::OverlapType SwLineEntry::Overlaps( const SwLineEntry& rNew ) const
return eRet;
}
+namespace {
+
struct lt_SwLineEntry
{
bool operator()( const SwLineEntry& e1, const SwLineEntry& e2 ) const
@@ -2308,9 +2330,13 @@ struct lt_SwLineEntry
}
};
+}
+
typedef std::set< SwLineEntry, lt_SwLineEntry > SwLineEntrySet;
typedef std::map< SwTwips, SwLineEntrySet > SwLineEntryMap;
+namespace {
+
class SwTabFramePainter
{
SwLineEntryMap maVertLines;
@@ -2331,6 +2357,8 @@ public:
void PaintLines( OutputDevice& rDev, const SwRect& rRect ) const;
};
+}
+
SwTabFramePainter::SwTabFramePainter( const SwTabFrame& rTabFrame )
: mrTabFrame( rTabFrame )
{
@@ -3284,6 +3312,8 @@ static void lcl_EmergencyFormatFootnoteCont( SwFootnoteContFrame *pCont )
}
}
+namespace {
+
class SwShortCut
{
SwRectDist fnCheck;
@@ -3294,6 +3324,8 @@ public:
{ return (rRect.*fnCheck)( nLimit ) > 0; }
};
+}
+
SwShortCut::SwShortCut( const SwFrame& rFrame, const SwRect& rRect )
{
bool bVert = rFrame.IsVertical();
@@ -3854,6 +3886,8 @@ void SwCellFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const&
SwLayoutFrame::PaintSwFrame( rRenderContext, rRect );
}
+namespace {
+
struct BorderLinesGuard
{
explicit BorderLinesGuard() : m_pBorderLines(std::move(gProp.pBLines))
@@ -3868,6 +3902,8 @@ private:
std::unique_ptr<BorderLines> m_pBorderLines;
};
+}
+
void SwFlyFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
{
//optimize thumbnail generation and store procedure to improve odt saving performance, #i120030#
@@ -4483,6 +4519,8 @@ namespace drawinglayer
{
namespace primitive2d
{
+ namespace {
+
class SwBorderRectanglePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
@@ -4527,6 +4565,8 @@ namespace drawinglayer
DeclPrimitive2DIDBlock()
};
+ }
+
void SwBorderRectanglePrimitive2D::create2DDecomposition(
Primitive2DContainer& rContainer,
const geometry::ViewInformation2D& /*rViewInformation*/) const
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index f4bb297b6df5..ef1fa6a39ab2 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1190,6 +1190,8 @@ void SwSectionFrame::SimpleFormat()
UnlockJoin();
}
+namespace {
+
// #i40147# - helper class to perform extra section format
// to position anchored objects and to keep the position of whose objects locked.
class ExtraFormatToPositionObjs
@@ -1322,6 +1324,8 @@ class ExtraFormatToPositionObjs
}
};
+}
+
/// "formats" the frame; Frame and PrtArea
void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttr )
{
diff --git a/sw/source/core/layout/sortedobjs.cxx b/sw/source/core/layout/sortedobjs.cxx
index 40d87c43b7bf..2e3df19104f0 100644
--- a/sw/source/core/layout/sortedobjs.cxx
+++ b/sw/source/core/layout/sortedobjs.cxx
@@ -70,7 +70,6 @@ namespace
return 1;
return 2;
}
-}
struct ObjAnchorOrder
{
@@ -198,6 +197,8 @@ struct ObjAnchorOrder
}
};
+}
+
bool SwSortedObjs::is_sorted() const
{
return std::is_sorted(maSortedObjLst.begin(), maSortedObjLst.end(), ObjAnchorOrder());
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 55c2eb66e6e1..369207a36221 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -105,6 +105,8 @@ namespace {
}
}
+namespace {
+
//For SwFlyFrame::GetCursorOfst
class SwCursorOszControl
{
@@ -140,6 +142,8 @@ public:
}
};
+}
+
static SwCursorOszControl g_OszCtrl = { nullptr, nullptr, nullptr };
/** Searches the ContentFrame owning the PrtArea containing the point. */
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 9000d6ef1b9e..c66ff319ac93 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -64,6 +64,8 @@ using namespace utl;
using namespace com::sun::star::uno;
using namespace com::sun::star;
+namespace {
+
class SwOLELRUCache
: private utl::ConfigItem
{
@@ -86,6 +88,8 @@ public:
void RemoveObj( SwOLEObj& rObj );
};
+}
+
static std::shared_ptr<SwOLELRUCache> g_pOLELRU_Cache;
class SwOLEListener_Impl : public ::cppu::WeakImplHelper< embed::XStateChangeListener >
diff --git a/sw/source/core/swg/SwXMLBlockImport.cxx b/sw/source/core/swg/SwXMLBlockImport.cxx
index 05ad9d164281..14fe001096b7 100644
--- a/sw/source/core/swg/SwXMLBlockImport.cxx
+++ b/sw/source/core/swg/SwXMLBlockImport.cxx
@@ -43,6 +43,8 @@ using namespace css::xml::sax;
class SwXMLBlockListImport;
class SwXMLTextBlockImport;
+namespace {
+
class SwXMLBlockListContext : public SvXMLImportContext
{
private:
@@ -113,6 +115,8 @@ public:
virtual ~SwXMLTextBlockParContext() override;
};
+}
+
SwXMLTextBlockTokenHandler::SwXMLTextBlockTokenHandler()
{
}
diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index 2f835bd606a3..2dfcb49e8457 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -26,6 +26,8 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
+namespace {
+
class SvXMLSectionListContext : public SvXMLImportContext
{
private:
@@ -73,6 +75,7 @@ public:
}
};
+}
SwXMLSectionList::SwXMLSectionList(const css::uno::Reference< css::uno::XComponentContext >& rContext, std::vector<OUString> &rNewSectionList)
: SvXMLImport(rContext, "")
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 04a2509b1e37..69b61fd8b447 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2091,6 +2091,8 @@ void SwTable::CleanUpBottomRowSpan( sal_uInt16 nDelLines )
#ifdef DBG_UTIL
+namespace {
+
struct RowSpanCheck
{
long nRowSpan;
@@ -2098,6 +2100,8 @@ struct RowSpanCheck
SwTwips nRight;
};
+}
+
void SwTable::CheckConsistency() const
{
if( !IsNewModel() )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 7eae6a55198e..d5252724679d 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -741,6 +741,8 @@ bool SwTextFrame::RightMargin(SwPaM *pPam, bool bAPI) const
// to the base class.
// The Cursor's horizontal justification is done afterwards by the CursorShell.
+namespace {
+
class SwSetToRightMargin
{
bool bRight;
@@ -750,6 +752,8 @@ public:
void SetRight( const bool bNew ) { bRight = bNew; }
};
+}
+
bool SwTextFrame::UnitUp_( SwPaM *pPam, const SwTwips nOffset,
bool bSetInReadOnly ) const
{
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 37543c700b76..751d9b94c59e 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -59,6 +59,8 @@
// Tolerance in formatting and text output
#define SLOPPY_TWIPS 5
+namespace {
+
class FormatLevel
{
static sal_uInt16 nLevel;
@@ -68,6 +70,9 @@ public:
static sal_uInt16 GetLevel() { return nLevel; }
static bool LastLevel() { return 10 < nLevel; }
};
+
+}
+
sal_uInt16 FormatLevel::nLevel = 0;
void ValidateText( SwFrame *pFrame ) // Friend of frame
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 393968dbd032..967925d5847c 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -59,6 +59,8 @@ using namespace ::com::sun::star;
static bool bInitFont = true;
+namespace {
+
class SwExtraPainter
{
SwSaveClip m_aClip;
@@ -93,6 +95,8 @@ public:
void PaintRedline( SwTwips nY, long nMax );
};
+}
+
SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
const SwLineNumberInfo &rLnInf, const SwRect &rRct,
sal_Int16 eHor, bool bLineNum )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index a27701186c1a..fd433adc724c 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -782,6 +782,8 @@ TextFrameIndex SwAttrIter::GetNextAttr() const
}
}
+namespace {
+
class SwMinMaxArgs
{
public:
@@ -800,6 +802,8 @@ public:
void NewWord() { nWordAdd = nWordWidth = 0; }
};
+}
+
static bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const OUString &rText,
sal_Int32 nIdx, sal_Int32 nEnd )
{
@@ -848,6 +852,8 @@ bool SwTextNode::IsSymbolAt(const sal_Int32 nBegin) const
return aIter.GetFnt()->IsSymbol( getIDocumentLayoutAccess().GetCurrentViewShell() );
}
+namespace {
+
class SwMinMaxNodeArgs
{
public:
@@ -861,6 +867,8 @@ public:
void Minimum( long nNew ) { if( nNew > nMinWidth ) nMinWidth = nNew; }
};
+}
+
static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn )
{
const SwFormatAnchor& rFormatA = pNd->GetAnchor();
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 2a1b8432ac0e..d8fa076085fc 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -817,6 +817,8 @@ void SwTextFormatter::CalcAscent( SwTextFormatInfo &rInf, SwLinePortion *pPor )
}
}
+namespace {
+
class SwMetaPortion : public SwTextPortion
{
public:
@@ -824,6 +826,8 @@ public:
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
};
+}
+
void SwMetaPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if ( Width() )
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 11338d9a8c39..3c42df910be4 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -133,6 +133,8 @@ sal_uInt16 SwFieldPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
return m_nViewWidth;
}
+namespace {
+
/**
* Never just use SetLen(0)
*/
@@ -150,6 +152,8 @@ public:
~SwFieldSlot();
};
+}
+
SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pPor )
: pOldText(nullptr)
, nIdx(0)
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 260e1921ae1a..d2486329cbc0 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -810,6 +810,7 @@ static bool lcl_HasRotation(const SwTextAttr& rAttr,
}
namespace sw {
+ namespace {
// need to use a very special attribute iterator here that returns
// both the hints and the nodes, so that GetMultiCreator() can handle
@@ -833,6 +834,8 @@ namespace sw {
}
};
+ }
+
SwTextAttr const* MergedAttrIterMulti::NextAttr(SwTextNode const*& rpNode)
{
if (m_First)
@@ -1400,6 +1403,8 @@ std::unique_ptr<SwMultiCreator> SwTextSizeInfo::GetMultiCreator(TextFrameIndex &
return nullptr;
}
+namespace {
+
// A little helper class to manage the spaceadd-arrays of the text adjustment
// during a PaintMultiPortion.
// The constructor prepares the array for the first line of multiportion,
@@ -1422,6 +1427,8 @@ public:
long GetSpaceAdd() const { return nSpaceAdd; }
};
+}
+
SwSpaceManipulator::SwSpaceManipulator( SwTextPaintInfo& rInf,
SwMultiPortion& rMult )
: rInfo(rInf)
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 7588b20d4ad9..6fa6702baebc 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -64,6 +64,8 @@ static bool lcl_IsDropFlyInter( const SwTextFormatInfo &rInf,
return false;
}
+namespace {
+
class SwDropSave
{
SwTextPaintInfo* pInf;
@@ -77,6 +79,8 @@ public:
~SwDropSave();
};
+}
+
SwDropSave::SwDropSave( const SwTextPaintInfo &rInf ) :
pInf( const_cast<SwTextPaintInfo*>(&rInf) ), nIdx( rInf.GetIdx() ),
nLen( rInf.GetLen() ), nX( rInf.X() ), nY( rInf.Y() )
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 4ca6938e82f3..5c17be3cbdb3 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1241,6 +1241,8 @@ void SwTextFormatter::MakeDummyLine()
}
}
+namespace {
+
class SwFootnoteSave
{
SwTextSizeInfo *pInf;
@@ -1258,6 +1260,8 @@ public:
~SwFootnoteSave() COVERITY_NOEXCEPT_FALSE;
};
+}
+
SwFootnoteSave::SwFootnoteSave( const SwTextSizeInfo &rInf,
const SwTextFootnote* pTextFootnote,
const bool bApplyGivenScriptType,
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 20f61111126a..2f8fd90e1d62 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -30,6 +30,8 @@
#include <view.hxx>
#include <svx/svdobj.hxx>
+namespace {
+
class XmlPortionDumper:public SwPortionHandler
{
private:
@@ -226,8 +228,6 @@ class XmlPortionDumper:public SwPortionHandler
};
-namespace
-{
xmlTextWriterPtr lcl_createDefaultWriter()
{
xmlTextWriterPtr writer = xmlNewTextWriterFilename( "layout.xml", 0 );
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index 38f095cd1996..bb26450cc31b 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -27,6 +27,8 @@
#include <rootfrm.hxx>
#include <viewsh.hxx>
+namespace {
+
/*
* This class is responsible for the delayed display of grammar checks when a paragraph is edited
* It's a client of the paragraph the cursor points to.
@@ -59,6 +61,8 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
};
+}
+
SwGrammarContact::SwGrammarContact() : mbFinished( false )
{
aTimer.SetTimeout( 2000 ); // Repaint of grammar check after 'setChecked'
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index ef37d507efae..376908cdbc8a 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -786,6 +786,8 @@ MetaFieldManager::makeMetaField(SwFormatMeta * const i_pFormat,
return pMetaField;
}
+namespace {
+
struct IsInUndo
{
bool operator()(std::weak_ptr<MetaField> const & pMetaField) {
@@ -802,6 +804,8 @@ struct MakeUnoObject
}
};
+}
+
std::vector< uno::Reference<text::XTextField> >
MetaFieldManager::getMetaFields()
{
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 6fa6b159705a..7ced0397cd17 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -246,6 +246,8 @@ static bool lcl_IsFontAdjustNecessary( const vcl::RenderContext& rOutDev,
OUTDEV_PRINTER != rOutDev.GetOutDevType() );
}
+namespace {
+
struct CalcLinePosData
{
SwDrawTextInfo& rInf;
@@ -274,6 +276,8 @@ struct CalcLinePosData
}
};
+}
+
// Computes the start and end position of an underline. This function is called
// from the DrawText-method (for underlining misspelled words or smarttag terms).
static void lcl_calcLinePos( const CalcLinePosData &rData,
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 171accf5ae5d..09695fa0c74d 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -36,6 +36,8 @@
using namespace ::com::sun::star::i18n;
+namespace {
+
// The information encapsulated in SwCapitalInfo is required
// by the ::Do functions. They contain the information about
// the original string, whereas rDo.GetInf() contains information
@@ -50,6 +52,8 @@ public:
TextFrameIndex nLen;
};
+}
+
// rFnt: required for CalcCaseMap
// rOrigString: The original string
// nOfst: Position of the substring in rOrigString
@@ -105,6 +109,8 @@ public:
void SetCapInf( SwCapitalInfo& rNew ) { pCapInf = &rNew; }
};
+namespace {
+
class SwDoGetCapitalSize : public SwDoCapitals
{
protected:
@@ -117,6 +123,8 @@ public:
const Size &GetSize() const { return aTextSize; }
};
+}
+
void SwDoGetCapitalSize::Init( SwFntObj *, SwFntObj * )
{
aTextSize.setHeight( 0 );
@@ -152,6 +160,8 @@ Size SwSubFont::GetCapitalSize( SwDrawTextInfo& rInf )
return aTextSize;
}
+namespace {
+
class SwDoGetCapitalBreak : public SwDoCapitals
{
protected:
@@ -170,6 +180,8 @@ public:
TextFrameIndex getBreak() const { return m_nBreak; }
};
+}
+
void SwDoGetCapitalBreak::Init( SwFntObj *, SwFntObj * )
{
}
@@ -231,6 +243,8 @@ TextFrameIndex SwFont::GetCapitalBreak( SwViewShell const * pSh, const OutputDev
return aDo.getBreak();
}
+namespace {
+
class SwDoDrawCapital : public SwDoCapitals
{
protected:
@@ -246,6 +260,8 @@ public:
void DrawSpace( Point &rPos );
};
+}
+
void SwDoDrawCapital::Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont )
{
pUpperFnt = pUpperFont;
@@ -313,6 +329,8 @@ void SwSubFont::DrawCapital( SwDrawTextInfo &rInf )
DoOnCapitals( aDo );
}
+namespace {
+
class SwDoCapitalCursorOfst : public SwDoCapitals
{
protected:
@@ -331,6 +349,8 @@ public:
TextFrameIndex GetCursor() const { return nCursor; }
};
+}
+
void SwDoCapitalCursorOfst::Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont )
{
pUpperFnt = pUpperFont;
@@ -386,6 +406,8 @@ TextFrameIndex SwSubFont::GetCapitalCursorOfst( SwDrawTextInfo& rInf )
return aDo.GetCursor();
}
+namespace {
+
class SwDoDrawStretchCapital : public SwDoDrawCapital
{
const TextFrameIndex nStrLen;
@@ -402,6 +424,8 @@ public:
{ }
};
+}
+
void SwDoDrawStretchCapital::Do()
{
SV_STAT( nDrawStretchText );
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index 3bc3dbb59f21..c8c9726c9a6c 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -34,6 +34,8 @@
#include <set>
#include <vector>
+namespace {
+
struct FieldResult
{
sal_Int32 const m_nFieldPos;
@@ -53,8 +55,12 @@ public:
}
};
+}
+
typedef std::set<FieldResult, sortfieldresults> FieldResultSet;
+namespace {
+
struct block
{
sal_Int32 const m_nStart;
@@ -80,6 +86,8 @@ struct containsPos
}
};
+}
+
ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode,
SwRootFrame const*const pLayout, ExpandMode eMode)
{
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 35819fa8214d..f6c0b771b52a 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2065,6 +2065,8 @@ static void lcl_MergeAttr_ExpandChrFormat( SfxItemSet& rSet, const SfxPoolItem&
rSet.Put( rAttr );
}
+namespace {
+
struct SwPoolItemEndPair
{
public:
@@ -2074,6 +2076,8 @@ public:
SwPoolItemEndPair() : mpItem( nullptr ), mnEndPos( 0 ) {};
};
+}
+
static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTextNode& rTextNode,
SfxItemSet& rSet )
{
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 2b2d3450cb34..015cec4cebd7 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -546,6 +546,8 @@ void UndoManager::AddUndoAction(std::unique_ptr<SfxUndoAction> pAction, bool bTr
}
}
+namespace {
+
class CursorGuard
{
public:
@@ -570,6 +572,8 @@ private:
bool const m_bSaveCursor;
};
+}
+
bool UndoManager::impl_DoUndoRedo(UndoOrRedoType undoOrRedo)
{
SwDoc & rDoc(*GetUndoNodes().GetDoc());
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index e54290e941b0..bc6a4c5160e6 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -187,6 +187,8 @@ SwUndo::~SwUndo()
{
}
+namespace {
+
class UndoRedoRedlineGuard
{
public:
@@ -210,6 +212,8 @@ private:
RedlineFlags const m_eMode;
};
+}
+
void SwUndo::Undo()
{
assert(false); // SwUndo::Undo(): ERROR: must call UndoWithContext instead
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 127ba5a410eb..7e05ae0e9fd7 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -414,6 +414,8 @@ void SwUndoDelSection::RedoImpl(::sw::UndoRedoContext & rContext)
rDoc.DelSectionFormat( pNd->GetSection().GetFormat() );
}
+namespace {
+
class SwUndoUpdateSection
: public SwUndo
{
@@ -431,6 +433,8 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
};
+}
+
std::unique_ptr<SwUndo>
MakeUndoUpdateSection(SwSectionFormat const& rFormat, bool const bOnlyAttr)
{
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index b3b2fdd34403..37f629c92c97 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -94,13 +94,17 @@ struct UndoTableCpyTable_Entry
explicit UndoTableCpyTable_Entry( const SwTableBox& rBox );
};
+namespace {
+
class SaveBox;
class SaveLine;
+}
+
class SaveTable
{
- friend class SaveBox;
- friend class SaveLine;
+ friend SaveBox;
+ friend SaveLine;
SfxItemSet m_aTableSet;
std::unique_ptr<SaveLine> m_pLine;
const SwTable* m_pSwTable;
@@ -129,9 +133,11 @@ public:
bool IsNewModel() const { return m_bNewModel; }
};
+namespace {
+
class SaveLine
{
- friend class SaveTable;
+ friend SaveTable;
friend class SaveBox;
SaveLine* pNext;
@@ -175,6 +181,8 @@ public:
void CreateNew( SwTable& rTable, SwTableLine& rParent, SaveTable& rSTable );
};
+}
+
#if OSL_DEBUG_LEVEL > 0
#include <shellio.hxx>
static void CheckTable( const SwTable& );
@@ -2177,6 +2185,8 @@ void SwUndoTableNumFormat::UndoImpl(::sw::UndoRedoContext & rContext)
pPam->GetPoint()->nContent.Assign( pTextNd, 0 );
}
+namespace {
+
/** switch the RedlineFlags on the given document, using
* SetRedlineFlags_intern. This class set the mode in the constructor,
* and changes it back in the destructor, i.e. it uses the
@@ -2196,6 +2206,8 @@ public:
~RedlineFlagsInternGuard();
};
+}
+
RedlineFlagsInternGuard::RedlineFlagsInternGuard(
SwDoc& rDoc,
RedlineFlags eNewRedlineFlags,
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 787f38918915..ffd3316faf7f 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -92,6 +92,8 @@ using namespace ::com::sun::star::lang;
#if HAVE_FEATURE_SCRIPTING
+namespace {
+
class SwVbaCodeNameProvider : public ::cppu::WeakImplHelper< document::XCodeNameQuery >
{
SwDocShell* const mpDocShell;
@@ -168,8 +170,12 @@ public:
}
};
+}
+
typedef std::unordered_map< OUString, OUString > StringHashMap;
+namespace {
+
class SwVbaProjectNameProvider : public ::cppu::WeakImplHelper< container::XNameContainer >
{
StringHashMap mTemplateToProject;
@@ -268,14 +274,20 @@ public:
};
+}
+
#endif
+namespace {
+
struct ProvNamesId_Type
{
const char * pName;
SwServiceType const nType;
};
+}
+
// note: this thing is indexed as an array, so do not insert/remove entries!
const ProvNamesId_Type aProvNamesId[] =
{
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index b5b7f4e1a88e..90b014202640 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -128,12 +128,16 @@ static const sal_uInt16 aDocInfoSubTypeFromService[] =
DI_DOCNO //PROPERTY_MAP_FLDTYP_DOCINFO_REVISION
};
+namespace {
+
struct ServiceIdResId
{
SwFieldIds const nResId;
SwServiceType const nServiceId;
};
+}
+
static const ServiceIdResId aServiceToRes[] =
{
{SwFieldIds::DateTime, SwServiceType::FieldTypeDateTime },
@@ -1071,6 +1075,8 @@ OUString SwXFieldMaster::LocalizeFormula(
return rFormula;
}
+namespace {
+
struct SwFieldProperties_Impl
{
OUString sPar1;
@@ -1112,6 +1118,8 @@ struct SwFieldProperties_Impl
{}
};
+}
+
class SwXTextField::Impl
: public SvtListener
{
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 294db651c919..7dbd91d656d4 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -962,6 +962,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
return bRet;
}
+namespace {
+
class SwFrameProperties_Impl : public BaseFrameProperties_Impl
{
public:
@@ -970,6 +972,8 @@ public:
bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
};
+}
+
SwFrameProperties_Impl::SwFrameProperties_Impl():
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ )
{
@@ -1026,6 +1030,8 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem
return bRet;
}
+namespace {
+
class SwGraphicProperties_Impl : public BaseFrameProperties_Impl
{
public:
@@ -1034,6 +1040,8 @@ public:
virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
};
+}
+
SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) :
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ )
{
@@ -1125,6 +1133,8 @@ bool SwGraphicProperties_Impl::AnyToItemSet(
return bRet;
}
+namespace {
+
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
public:
@@ -1134,6 +1144,8 @@ public:
virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
};
+}
+
bool SwOLEProperties_Impl::AnyToItemSet(
SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound)
{
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index ae93e9c63b07..87e06e218d7d 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -245,6 +245,8 @@ public:
};
+namespace {
+
class SwDocIndexDescriptorProperties_Impl
{
private:
@@ -259,6 +261,8 @@ public:
void SetTypeName(const OUString& rSet) { m_sUserTOXTypeName = rSet; }
};
+}
+
SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl(
SwTOXType const*const pType)
{
@@ -1884,6 +1888,8 @@ SwXDocumentIndexMark::attach(
m_pImpl->m_bIsDescriptor = false;
}
+namespace {
+
template<typename T> struct NotContainedIn
{
std::vector<T> const& m_rVector;
@@ -1895,6 +1901,8 @@ template<typename T> struct NotContainedIn
}
};
+}
+
void SwXDocumentIndexMark::Impl::InsertTOXMark(
SwTOXType & rTOXType, SwTOXMark & rMark, SwPaM & rPam,
SwXTextCursor const*const pTextCursor)
@@ -2639,11 +2647,15 @@ SwXDocumentIndex::TokenAccess_Impl::getSupportedServiceNames()
return { "com.sun.star.text.DocumentIndexLevelFormat" };
}
+namespace {
+
struct TokenType_ {
const char *pName;
enum FormTokenType const eTokenType;
};
+}
+
static const struct TokenType_ g_TokenTypes[] =
{
{ "TokenEntryNumber", TOKEN_ENTRY_NO },
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 502e2e74c2dd..e4a282212751 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -138,6 +138,8 @@ void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget)
} // namespace sw
+namespace {
+
struct FrameClientSortListLess
{
bool operator() (FrameClientSortListEntry const& r1,
@@ -148,8 +150,6 @@ struct FrameClientSortListLess
}
};
-namespace
-{
void lcl_CollectFrameAtNodeWithLayout(const SwContentFrame* pCFrame,
FrameClientSortList_t& rFrames,
const RndStdIds nAnchorType)
@@ -399,6 +399,8 @@ void SwUnoCursorHelper::GetCursorAttr(SwPaM & rPam,
}
}
+namespace {
+
struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration
{
uno::Reference< text::XText > const m_xParentText;
@@ -485,6 +487,8 @@ struct SwXParagraphEnumerationImpl final : public SwXParagraphEnumeration
bool IgnoreLastElement(SwUnoCursor& rCursor, bool bMovedFromTable);
};
+}
+
SwXParagraphEnumeration* SwXParagraphEnumeration::Create(
uno::Reference< text::XText > const& xParent,
const std::shared_ptr<SwUnoCursor>& pCursor,
@@ -1418,6 +1422,8 @@ SwXTextRange::makeRedline(
SwUnoCursorHelper::makeRedline( aPaM, rRedlineType, rRedlineProperties );
}
+namespace {
+
struct SwXTextRangesImpl final : public SwXTextRanges
{
@@ -1462,6 +1468,8 @@ struct SwXTextRangesImpl final : public SwXTextRanges
sw::UnoCursorPointer m_pUnoCursor;
};
+}
+
void SwXTextRangesImpl::MakeRanges()
{
if (GetCursor())
@@ -1540,6 +1548,8 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
}
+namespace {
+
struct SwXParaFrameEnumerationImpl final : public SwXParaFrameEnumeration
{
// XServiceInfo
@@ -1584,6 +1594,7 @@ struct SwXParaFrameEnumerationImpl final : public SwXParaFrameEnumeration
::sw::UnoCursorPointer m_pUnoCursor;
};
+}
SwXParaFrameEnumeration* SwXParaFrameEnumeration::Create(const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat)
{ return new SwXParaFrameEnumerationImpl(rPaM, eParaFrameMode, pFormat); }
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 2b632ab78e79..2d3e33922aa3 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -59,6 +59,7 @@
using namespace ::com::sun::star;
+namespace {
class SwParaSelection
{
@@ -68,6 +69,8 @@ public:
~SwParaSelection();
};
+}
+
SwParaSelection::SwParaSelection(SwCursor & rCursor)
: m_rCursor(rCursor)
{
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 42d4658138a1..9cba2c7d9dd4 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -685,6 +685,8 @@ static void lcl_ExportSoftPageBreak(
}
}
+namespace {
+
struct SwXRedlinePortion_Impl
{
const SwRangeRedline* m_pRedline;
@@ -703,9 +705,13 @@ struct SwXRedlinePortion_Impl
}
};
+}
+
typedef std::shared_ptr < SwXRedlinePortion_Impl >
SwXRedlinePortion_ImplSharedPtr;
+namespace {
+
struct RedlineCompareStruct
{
static const SwPosition& getPosition ( const SwXRedlinePortion_ImplSharedPtr &r )
@@ -720,6 +726,8 @@ struct RedlineCompareStruct
}
};
+}
+
typedef std::multiset < SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct >
SwXRedlinePortion_ImplList;
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index adab40c9d319..ee5756c761cd 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -187,6 +187,8 @@ SwXReferenceMark::getSupportedServiceNames()
};
}
+namespace {
+
template<typename T> struct NotContainedIn
{
std::vector<T> const& m_rVector;
@@ -198,6 +200,8 @@ template<typename T> struct NotContainedIn
}
};
+}
+
void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
SwXTextCursor const*const pCursor)
{
@@ -492,6 +496,8 @@ void SAL_CALL SwXReferenceMark::removeVetoableChangeListener(
OSL_FAIL("SwXReferenceMark::removeVetoableChangeListener(): not implemented");
}
+namespace {
+
class SwXMetaText : public cppu::OWeakObject, public SwXText
{
private:
@@ -530,6 +536,8 @@ public:
};
+}
+
SwXMetaText::SwXMetaText(SwDoc & rDoc, SwXMeta & rMeta)
: SwXText(&rDoc, CursorType::Meta)
, m_rMeta(rMeta)
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 05c4ba13275a..ff12dc325695 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -67,6 +67,8 @@
using namespace ::com::sun::star;
+namespace {
+
struct SwTextSectionProperties_Impl
{
uno::Sequence<sal_Int8> m_Password;
@@ -103,6 +105,8 @@ struct SwTextSectionProperties_Impl
};
+}
+
class SwXTextSection::Impl
: public SvtListener
{
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2169cb9cd285..acf2ae04d9f7 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -114,11 +114,11 @@
#include <set>
#include <limits>
+namespace {
+
class SwXStyle;
class SwStyleProperties_Impl;
-namespace
-{
struct StyleFamilyEntry
{
using GetCountOrName_t = std::function<sal_Int32 (const SwDoc&, OUString*, sal_Int32)>;
@@ -184,6 +184,8 @@ using namespace ::com::sun::star;
namespace sw
{
+ namespace {
+
class XStyleFamily : public cppu::WeakImplHelper
<
container::XNameContainer,
@@ -281,8 +283,11 @@ namespace sw
{ return { "com.sun.star.style.StyleFamily" }; }
};
+ }
}
+namespace {
+
class SwStyleBase_Impl;
class SwXStyle : public cppu::WeakImplHelper
<
@@ -454,6 +459,7 @@ public:
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
};
+}
using sw::XStyleFamily;
@@ -1114,6 +1120,8 @@ static const std::vector<ParagraphStyleCategoryEntry>* lcl_GetParagraphStyleCate
return our_pParagraphStyleCategoryEntries;
}
+namespace {
+
class SwStyleProperties_Impl
{
const PropertyEntryVector_t aPropertyEntries;
@@ -1168,6 +1176,8 @@ public:
}
};
+}
+
static SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum(SfxStyleFamily eFamily)
{
auto pEntries(lcl_GetStyleFamilyEntries());
@@ -1463,6 +1473,8 @@ void SwXStyle::ApplyDescriptorProperties()
m_pPropertiesImpl->Apply(*this);
}
+namespace {
+
class SwStyleBase_Impl
{
private:
@@ -1528,8 +1540,6 @@ public:
};
};
-namespace
-{
const char* STR_POOLPAGE_ARY[] =
{
// Page styles
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 1ad6dc454657..77330375aebf 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1805,6 +1805,8 @@ void SwXTextTableCursor::Notify( const SfxHint& rHint )
// SwXTextTable ===========================================================
+namespace {
+
class SwTableProperties_Impl
{
SwUnoCursorHelper::SwAnyMapHelper aAnyMap;
@@ -1819,6 +1821,8 @@ public:
void ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc);
};
+}
+
SwTableProperties_Impl::SwTableProperties_Impl()
{ }
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index d49b07e35cb9..7b528399a035 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1777,6 +1777,8 @@ SwXText::convertToTextFrame(
return xRet;
}
+namespace {
+
// Move previously imported paragraphs into a new text table.
struct VerticallyMergedCell
{
@@ -1793,6 +1795,8 @@ struct VerticallyMergedCell
}
};
+}
+
#define COL_POS_FUZZY 2
static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 )
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 07fe504f9b9a..a47c59d71209 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -867,6 +867,8 @@ void SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
_orNewStartPos = aNewStartPos;
}
+namespace {
+
/** checks, if given position is inside a shown document page */
struct PreviewPosInsidePagePred
{
@@ -885,6 +887,8 @@ struct PreviewPosInsidePagePred
}
};
+}
+
bool SwPagePreviewLayout::IsPreviewPosInDocPreviewPage( const Point& rPreviewPos,
Point& _orDocPos,
bool& _obPosInEmptyPage,
@@ -1302,6 +1306,8 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
// helper methods
+namespace {
+
/** get preview page by physical page number
OD 17.12.2002 #103492#
@@ -1318,6 +1324,8 @@ struct EqualsPageNumPred
}
};
+}
+
const PreviewPage* SwPagePreviewLayout::GetPreviewPageByPageNum( const sal_uInt16 _nPageNum ) const
{
auto aFoundPreviewPageIter =
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 8f0600d59a1d..7828ad97adf1 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -90,6 +90,8 @@ public:
SwQueuedPaint *SwPaintQueue::s_pPaintQueue = nullptr;
+namespace {
+
// saves some settings from the draw view
class SwDrawViewSave
{
@@ -100,6 +102,8 @@ public:
~SwDrawViewSave();
};
+}
+
void SwPaintQueue::Add( SwViewShell *pNew, const SwRect &rNew )
{
SwQueuedPaint *pPt;
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 9490e1bfc926..ddf2dec8c56d 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -45,6 +45,8 @@
* For all nodes, attributes, formats and chars.
*/
+namespace {
+
class SwASC_AttrIter
{
SwASCWriter& rWrt;
@@ -69,6 +71,8 @@ public:
bool OutAttr( sal_Int32 nSwPos );
};
+}
+
SwASC_AttrIter::SwASC_AttrIter(
SwASCWriter& rWr,
const SwTextNode& rTextNd,
@@ -168,6 +172,8 @@ bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
return bRet;
}
+namespace {
+
class SwASC_RedlineIter
{
private:
@@ -236,6 +242,8 @@ public:
}
};
+}
+
// Output of the node
static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode )
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index cbdae221ed1e..a2c0538ebf9b 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -49,6 +49,8 @@
#define ASC_BUFFLEN 4096
+namespace {
+
class SwASCIIParser
{
SwDoc* pDoc;
@@ -74,6 +76,8 @@ public:
ErrCode CallParser();
};
+}
+
// Call for the general reader interface
ErrCode AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OUString & )
{
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 909ec61ba98c..093409868ebc 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -210,6 +210,8 @@ OString GetCSS1_Color(const Color& rColor)
return "#" + lclConvToHex(rColor.GetRed()) + lclConvToHex(rColor.GetGreen()) + lclConvToHex(rColor.GetBlue());
}
+namespace {
+
class SwCSS1OutMode
{
SwHTMLWriter& rWrt;
@@ -234,6 +236,8 @@ public:
}
};
+}
+
void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
const sal_Char *pVal,
const OUString *pSVal )
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 67ca2a1b4aec..72c3e20b68e8 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -201,6 +201,8 @@ sal_uInt16 SwHTMLWriter::GetCSS1ScriptForScriptType( sal_uInt16 nScriptType )
* Otherwise, attributes of the format are output as well.
*/
+namespace {
+
struct SwHTMLTextCollOutputInfo
{
OString aToken; // End token to be output
@@ -223,6 +225,8 @@ struct SwHTMLTextCollOutputInfo
bool ShouldOutputToken() const { return bOutPara || !HasParaToken(); }
};
+}
+
SwHTMLFormatInfo::SwHTMLFormatInfo( const SwFormat *pF, SwDoc *pDoc, SwDoc *pTemplate,
bool bOutStyles,
LanguageType eDfltLang,
@@ -1029,6 +1033,8 @@ static void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& r
}
}
+namespace {
+
class HTMLStartEndPos
{
sal_Int32 nStart;
@@ -1048,6 +1054,8 @@ public:
void SetEnd( sal_Int32 nE ) { nEnd = nE; }
};
+}
+
HTMLStartEndPos::HTMLStartEndPos( const SfxPoolItem& rItem, sal_Int32 nStt,
sal_Int32 nE ) :
nStart( nStt ),
@@ -1069,8 +1077,6 @@ enum HTMLOnOffState { HTML_NOT_SUPPORTED, // unsupported Attribute
HTML_DROPCAP_VALUE, // DropCap-Attribute
HTML_AUTOFMT_VALUE }; // Attribute for automatic character styles
-}
-
class HTMLEndPosLst
{
HTMLStartEndPositions aStartLst; // list, sorted for start positions
@@ -1153,6 +1159,8 @@ public:
bool IsHTMLMode( sal_uLong nMode ) const { return (nHTMLMode & nMode) != 0; }
};
+}
+
void HTMLEndPosLst::InsertItem_( HTMLStartEndPos *pPos, HTMLStartEndPositions::size_type nEndPos )
{
// Insert the attribute in the Start list behind all attributes that
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index 92ecf5578909..e7de3fad7ee6 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -38,12 +38,16 @@
using namespace nsSwDocInfoSubType;
using namespace ::com::sun::star;
+namespace {
+
struct HTMLNumFormatTableEntry
{
const sal_Char *pName;
NfIndexTableOffset const eFormat;
};
+}
+
static HTMLOptionEnum<SwFieldIds> const aHTMLFieldTypeTable[] =
{
{ OOO_STRING_SW_HTML_FT_author, SwFieldIds::Author },
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 13f33ac57839..6f536bab0bdc 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -365,6 +365,8 @@ const uno::Reference< script::XEventAttacherManager >&
return m_xFormEventManager;
}
+namespace {
+
class SwHTMLImageWatcher :
public cppu::WeakImplHelper< awt::XImageConsumer, XEventListener >
{
@@ -408,6 +410,8 @@ public:
virtual void SAL_CALL disposing( const EventObject& Source ) override;
};
+}
+
SwHTMLImageWatcher::SwHTMLImageWatcher(
const uno::Reference< drawing::XShape >& rShape,
bool bWidth, bool bHeight ) :
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 0d659d7dfd65..12153fb74c4d 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -82,6 +82,8 @@ static HTMLOptionEnum<sal_Int16> const aHTMLTableVAlignTable[] =
// table tags options
+namespace {
+
struct HTMLTableOptions
{
sal_uInt16 nCols;
@@ -165,6 +167,8 @@ public:
size_t GetContextStAttrMin() const { return nContextStAttrMin; }
};
+}
+
// Cell content is a linked list with SwStartNodes and
// HTMLTables.
@@ -208,6 +212,8 @@ public:
const std::shared_ptr<SwHTMLTableLayoutCnts>& CreateLayoutInfo();
};
+namespace {
+
// Cell of a HTML table
class HTMLTableCell
{
@@ -271,9 +277,13 @@ public:
bool IsCovered() const { return mbCovered; }
};
+}
+
// Row of a HTML table
typedef std::vector<HTMLTableCell> HTMLTableCells;
+namespace {
+
class HTMLTableRow
{
HTMLTableCells m_aCells; ///< cells of the row
@@ -365,6 +375,8 @@ public:
std::unique_ptr<SwHTMLTableLayoutColumn> CreateLayoutInfo();
};
+}
+
// HTML table
typedef std::vector<HTMLTableRow> HTMLTableRows;
@@ -3874,6 +3886,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
xSaveStruct.reset();
}
+namespace {
+
class RowSaveStruct : public SwPendingData
{
public:
@@ -3886,6 +3900,8 @@ public:
{}
};
+}
+
void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
SvxAdjust eGrpAdjust,
sal_Int16 eGrpVertOri )
@@ -4245,6 +4261,8 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
// now we stand (perhaps) in front of <TBODY>,... or </TABLE>
}
+namespace {
+
struct TableColGrpSaveStruct : public SwPendingData
{
sal_uInt16 nColGrpSpan;
@@ -4258,6 +4276,8 @@ struct TableColGrpSaveStruct : public SwPendingData
inline void CloseColGroup( HTMLTable *pTable );
};
+}
+
inline TableColGrpSaveStruct::TableColGrpSaveStruct() :
nColGrpSpan( 1 ), nColGrpWidth( 0 ),
bRelColGrpWidth( false ), eColGrpAdjust( SvxAdjust::End ),
@@ -4677,6 +4697,8 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
*m_pPam->GetPoint() = xSaveStruct->GetPos();
}
+namespace {
+
class TableSaveStruct : public SwPendingData
{
public:
@@ -4692,6 +4714,8 @@ public:
void MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc );
};
+}
+
void TableSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc )
{
m_xCurrentTable->MakeTable(nullptr, nWidth);
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 577a9f5c7b11..b34ae8485d6e 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -56,6 +56,8 @@
using namespace ::com::sun::star;
+namespace {
+
class SwHTMLWrtTable : public SwWriteTable
{
static void Pixelize( sal_uInt16& rValue );
@@ -88,6 +90,8 @@ public:
sal_uInt16 nHSpace=0, sal_uInt16 nVSpace=0 ) const;
};
+}
+
SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth,
sal_uInt32 nBWidth, bool bRel,
sal_uInt16 nLSub, sal_uInt16 nRSub,
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 721a9e4afd59..cbfbe2e919f3 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -256,6 +256,8 @@ static sal_uInt16 const aBorderWidths[] =
#undef SBORDER_ENTRY
#undef DBORDER_ENTRY
+namespace {
+
struct SvxCSS1ItemIds
{
sal_uInt16 nFont;
@@ -295,6 +297,8 @@ struct SvxCSS1ItemIds
sal_uInt16 nDirection;
};
+}
+
static SvxCSS1ItemIds aItemIds;
struct SvxCSS1BorderInfo
@@ -3062,6 +3066,8 @@ static void ParseCSS1_so_language( const CSS1Expression *pExpr,
}
}
+namespace {
+
// the assignment of property to parsing function
struct CSS1PropEntry
{
@@ -3069,6 +3075,8 @@ struct CSS1PropEntry
FnParseCSS1Prop pFunc;
};
+}
+
#define CSS1_PROP_ENTRY(p) \
{ sCSS1_P_##p, ParseCSS1_##p }
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index e9854065b387..394da93ad3a0 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -39,12 +39,15 @@
using namespace ::com::sun::star;
+namespace
+{
/// Glue class to call RtfImport as an internal filter, needed by copy&paste support.
class SwRTFReader : public Reader
{
ErrCode Read(SwDoc& rDoc, const OUString& rBaseURL, SwPaM& rPam,
const OUString& rFileName) override;
};
+}
ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam,
const OUString& /*rFileName*/)
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b6caf17412b3..152a947c3afb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -180,6 +180,8 @@ static const sal_Int32 Tag_TableDefinition = 15;
static const sal_Int32 Tag_OutputFlyFrame = 16;
static const sal_Int32 Tag_StartSection = 17;
+namespace {
+
class FFDataWriterHelper
{
::sax_fastparser::FSHelperPtr m_pSerializer;
@@ -289,6 +291,9 @@ class FieldMarkParamsHelper
return bResult;
}
};
+
+}
+
void DocxAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 /*nScript*/ )
{
if (bIsRTL)
@@ -5749,6 +5754,8 @@ oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML()
return m_rDrawingML;
}
+namespace {
+
/// Functor to do case-insensitive ordering of OUString instances.
struct OUStringIgnoreCase
{
@@ -5758,6 +5765,8 @@ struct OUStringIgnoreCase
}
};
+}
+
/// Guesses if a style created in Writer (no grab-bag) should be qFormat or not.
static bool lcl_guessQFormat(const OUString& rName, sal_uInt16 nWwId)
{
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index f29268032ed0..db27ad412270 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1433,6 +1433,8 @@ void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, co
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
}
+namespace
+{
/// Glue class to call RtfExport as an internal filter, needed by copy&paste support.
class SwRTFWriter : public Writer
{
@@ -1444,6 +1446,7 @@ public:
ErrCode WriteStream() override;
};
+}
SwRTFWriter::SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL)
{
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index fa56ce68878e..cf2a051bd237 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -686,6 +686,8 @@ namespace sw
maStack.emplace_back(new SwFltStackEntry(rPos, std::unique_ptr<SfxPoolItem>(rAttr.Clone())));
}
+ namespace {
+
class SameOpenRedlineType
{
private:
@@ -700,6 +702,8 @@ namespace sw
}
};
+ }
+
bool RedlineStack::close(const SwPosition& rPos, RedlineType eType)
{
//Search from end for same type
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 9853bb36fee6..d2ae4e6e7b19 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -321,6 +321,8 @@ namespace myImplHelpers
return GetSubsFontName(rFont, SubsFontFlags::ONLYONE | SubsFontFlags::MS);
}
+ namespace {
+
//Utility to remove entries before a given starting position
class IfBeforeStart
{
@@ -333,6 +335,8 @@ namespace myImplHelpers
return rEntry.mnEndPos < mnStart;
}
};
+
+ }
}
/// Count what Word calls left/right margin from a format's LRSpace + Box.
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 89de28bf5182..13732268af52 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -169,6 +169,8 @@ MSWordAttrIter::~MSWordAttrIter()
m_rExport.m_pChpIter = pOld;
}
+namespace {
+
class sortswflys
{
public:
@@ -178,6 +180,8 @@ public:
}
};
+}
+
void SwWW8AttrIter::IterToCurrent()
{
OSL_ENSURE(maCharRuns.begin() != maCharRuns.end(), "Impossible");
@@ -1936,6 +1940,8 @@ bool MSWordExportBase::GetAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int3
return ( !rArr.empty() );
}
+namespace {
+
class CompareMarksEnd
{
public:
@@ -1948,6 +1954,8 @@ public:
}
};
+}
+
bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nCurrentPos, bool bNextPositionOnly )
{
bool bHasBookmark = false;
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 3c6813406420..aad292dc5b18 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -88,6 +88,8 @@ struct WW8_PdAttrDesc
{ }
};
+namespace {
+
struct WW8_SED
{
SVBT16 aBits1; // orientation change + internal, Default: 6
@@ -99,6 +101,8 @@ struct WW8_SED
// cbSED is 12 (decimal)), C (hex).
};
+}
+
// class WW8_WrPlc0 is only used for header and footer positioning
// ie there is no content support structure
class WW8_WrPlc0
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index e908cab35162..bf755c606808 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2665,6 +2665,8 @@ void WW8Export::SectionBreaksAndFrames( const SwTextNode& rNode )
OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode );
}
+namespace {
+
class TrackContentToExport
{
private:
@@ -2707,6 +2709,8 @@ public:
}
};
+}
+
void MSWordExportBase::WriteText()
{
TrackContentToExport aContentTracking(m_pCurPam.get(), m_nCurStart, m_nCurEnd);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 00dd85bdb6cd..b5cfddc8fde2 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4872,6 +4872,8 @@ void WW8AttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
m_rWW8Export.pO->push_back( rWidows.GetValue() ? 1 : 0 );
}
+namespace {
+
class SwWW8WrTabu
{
std::unique_ptr<sal_uInt8[]> pDel; // DelArray
@@ -4891,6 +4893,8 @@ public:
void PutAll(WW8Export& rWW8Wrt);
};
+}
+
SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax)
: nAdd(0), nDel(0)
{
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a49d9dea7054..b780e3ac6c66 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -574,6 +574,8 @@ static void lcl_StripFields(OUString &rString, WW8_CP &rNewStartCp)
}
}
+namespace {
+
class Chunk
{
private:
@@ -595,8 +597,6 @@ public:
}
};
-namespace
-{
bool IsValidSel(const EditEngine& rEngine, const ESelection& rSel)
{
const auto nParaCount = rEngine.GetParagraphCount();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ca2c97b2125d..bf9c2804a16a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -360,6 +360,8 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS
}
}
+namespace {
+
class BasicProjImportHelper
{
SwDocShell& mrDocShell;
@@ -373,6 +375,8 @@ public:
OUString getProjectName() const;
};
+}
+
bool BasicProjImportHelper::import( const uno::Reference< io::XInputStream >& rxIn )
{
bool bRet = false;
@@ -412,6 +416,8 @@ OUString BasicProjImportHelper::getProjectName() const
return sProjName;
}
+namespace {
+
class Sttb : public TBBase
{
struct SBBItem
@@ -436,6 +442,8 @@ public:
OUString getStringAtIndex( sal_uInt32 );
};
+}
+
Sttb::Sttb()
: fExtend(0)
, cData(0)
@@ -4870,6 +4878,8 @@ static void lcl_createTemplateToProjectEntry( const uno::Reference< container::X
}
}
+namespace {
+
class WW8Customizations
{
SvStream* mpTableStream;
@@ -4879,6 +4889,8 @@ public:
void Import( SwDocShell* pShell );
};
+}
+
WW8Customizations::WW8Customizations( SvStream* pTableStream, WW8Fib const & rFib ) : mpTableStream(pTableStream), mWw8Fib( rFib )
{
}
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index c07da7e81efb..eafe88b8392c 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -327,6 +327,8 @@ typedef sal_uInt16 WW8aIdSty[WW8ListManager::nMaxLevel];
// Character Style Pointer
typedef SwCharFormat* WW8aCFormat[WW8ListManager::nMaxLevel];
+namespace {
+
struct WW8LST // only THOSE entries, WE need!
{
WW8aIdSty aIdSty; // Style Id's for each level,
@@ -338,8 +340,12 @@ struct WW8LST // only THOSE entries, WE need!
// true if the list should start numbering over
}; // at the beginning of each section
+}
+
const sal_uInt32 cbLSTF=28;
+namespace {
+
struct WW8LFO // only THOSE entries, WE need!
{
SwNumRule* pNumRule; // Parent NumRule
@@ -388,6 +394,8 @@ struct WW8LFOLVL
nStartAt(1), nLevel(0), bStartAt(true), bFormat(false) {}
};
+}
+
// Data to be saved in ListInfo
struct WW8LSTInfo // sorted by nIdLst (in WW8 used list-Id)
@@ -457,6 +465,8 @@ SprmResult WW8ListManager::GrpprlHasSprm(sal_uInt16 nId, sal_uInt8& rSprms,
return maSprmParser.findSprmData(nId, &rSprms, nLen);
}
+namespace {
+
class ListWithId
{
private:
@@ -467,6 +477,8 @@ public:
{ return (pEntry->nIdLst == mnIdLst); }
};
+}
+
// Access via List-Id of LST Entry
WW8LSTInfo* WW8ListManager::GetLSTByListId( sal_uInt32 nIdLst ) const
{
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 3b5535ef430a..ceaed401a577 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -60,6 +60,8 @@
#include "ww8par.hxx"
#include "ww8par2.hxx"
+namespace {
+
struct OLE_MFP
{
sal_Int16 mm; // 0x6 int
@@ -68,6 +70,8 @@ struct OLE_MFP
sal_Int16 hMF; // 0xc int
};
+}
+
using namespace ::com::sun::star;
static bool SwWw8ReadScaling(long& rX, long& rY, tools::SvRef<SotStorage> const & rSrc1)
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 142d20c8ee98..4e522698dede 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -3015,6 +3015,8 @@ void WW8PLCFx::SetIdx2(sal_uInt32)
{
}
+namespace {
+
class SamePos
{
private:
@@ -3025,6 +3027,8 @@ public:
{return mnPo == pFkp->GetFilePos();}
};
+}
+
bool WW8PLCFx_Fc_FKP::NewFkp()
{
WW8_CP nPLCFStart, nPLCFEnd;
@@ -7031,7 +7035,6 @@ std::unique_ptr<WW8_STD> WW8Style::Read1Style(sal_uInt16& rSkip, OUString* pStri
namespace {
const sal_uInt16 maxStrSize = 65;
-}
struct WW8_FFN_Ver6
{
@@ -7062,6 +7065,8 @@ struct WW8_FFN_Ver8 : public WW8_FFN_BASE
// font does not exist on this system.
};
+}
+
// #i43762# check font name for illegal characters
static void lcl_checkFontname( OUString& sString )
{
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index d3b52cce6cc3..5d34c76fee6e 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -35,6 +35,8 @@ const short nVisualData = 5;
typedef std::map< sal_Int16, OUString > IdToString;
+namespace {
+
class MSOWordCommandConvertor : public MSOCommandConvertor
{
IdToString msoToOOcmd;
@@ -46,6 +48,8 @@ public:
virtual OUString MSOTCIDToOOCommand( sal_Int16 key ) override;
};
+}
+
MSOWordCommandConvertor::MSOWordCommandConvertor()
{
// mso command id to ooo command string
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index bfd4e488fcb8..1075588797ce 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -86,6 +86,8 @@ static SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> const & rRange )
// the matter that (e.g in section import) we delete a few characters,
// which may cause bookmarks (as used by XTextRange) to be deleted.
+namespace {
+
class XTextRangeOrNodeIndexPosition
{
Reference<XTextRange> xRange;
@@ -104,6 +106,8 @@ public:
bool IsValid() const;
};
+}
+
XTextRangeOrNodeIndexPosition::XTextRangeOrNodeIndexPosition()
{
}
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index b0a453d48443..fd6f957be4a1 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -64,6 +64,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
using namespace ::xmloff::token;
+namespace {
+
class SwXMLConditionParser_Impl
{
OUString const sInput;
@@ -89,6 +91,8 @@ public:
sal_uInt32 GetSubCondition() const { return nSubCondition; }
};
+}
+
inline bool SwXMLConditionParser_Impl::SkipWS()
{
while( nPos < nLength && ' ' == sInput[nPos] )
@@ -197,6 +201,8 @@ SwXMLConditionParser_Impl::SwXMLConditionParser_Impl( const OUString& rInp ) :
}
}
+namespace {
+
class SwXMLConditionContext_Impl : public SvXMLImportContext
{
Master_CollCondition nCondition;
@@ -218,6 +224,8 @@ public:
OUString const &getApplyStyle() const { return sApplyStyle; }
};
+}
+
SwXMLConditionContext_Impl::SwXMLConditionContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -258,6 +266,8 @@ SwXMLConditionContext_Impl::SwXMLConditionContext_Impl(
typedef std::vector<rtl::Reference<SwXMLConditionContext_Impl>> SwXMLConditions_Impl;
+namespace {
+
class SwXMLTextStyleContext_Impl : public XMLTextStyleContext
{
std::unique_ptr<SwXMLConditions_Impl> pConditions;
@@ -283,6 +293,7 @@ public:
const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override;
};
+}
uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create()
{
@@ -388,6 +399,8 @@ SvXMLImportContextRef SwXMLTextStyleContext_Impl::CreateChildContext(
return xContext;
}
+namespace {
+
class SwXMLItemSetStyleContext_Impl : public SvXMLStyleContext
{
OUString sMasterPageName;
@@ -442,6 +455,8 @@ public:
bool ResolveDataStyleName();
};
+}
+
void SwXMLItemSetStyleContext_Impl::SetAttribute( sal_uInt16 nPrefixKey,
const OUString& rLocalName,
const OUString& rValue )
@@ -665,6 +680,8 @@ bool SwXMLItemSetStyleContext_Impl::ResolveDataStyleName()
}
}
+namespace {
+
class SwXMLStylesContext_Impl : public SvXMLStylesContext
{
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
@@ -706,6 +723,8 @@ public:
virtual void EndElement() override;
};
+}
+
SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList )
@@ -887,6 +906,8 @@ void SwXMLStylesContext_Impl::EndElement()
GetSwImport().InsertStyles( IsAutomaticStyle() );
}
+namespace {
+
class SwXMLMasterStylesContext_Impl : public XMLTextMasterStylesContext
{
protected:
@@ -907,6 +928,7 @@ public:
virtual void EndElement() override;
};
+}
SwXMLMasterStylesContext_Impl::SwXMLMasterStylesContext_Impl(
SwXMLImport& rImport,
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 642e9d1d93fd..485bf87e764e 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -257,6 +257,8 @@ void SwXMLExport::ExportMasterStyles_()
GetPageExport()->exportMasterStyles( false );
}
+namespace {
+
class SwXMLAutoStylePoolP : public SvXMLAutoStylePoolP
{
SvXMLExport& rExport;
@@ -278,6 +280,8 @@ public:
explicit SwXMLAutoStylePoolP( SvXMLExport& rExport );
};
+}
+
void SwXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList,
sal_Int32 nFamily,
diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx
index 7b92a8c43419..1f910e60944e 100644
--- a/sw/source/filter/xml/xmlfonte.cxx
+++ b/sw/source/filter/xml/xmlfonte.cxx
@@ -30,12 +30,16 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::text;
+namespace {
+
class SwXMLFontAutoStylePool_Impl: public XMLFontAutoStylePool
{
public:
SwXMLFontAutoStylePool_Impl(SwXMLExport& rExport, bool bFontEmbedding);
};
+}
+
SwXMLFontAutoStylePool_Impl::SwXMLFontAutoStylePool_Impl(SwXMLExport& _rExport, bool bFontEmbedding)
: XMLFontAutoStylePool(_rExport, bFontEmbedding)
{
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 43040d441db3..9c983b882db5 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -135,6 +135,8 @@ static const SvXMLTokenMapEntry aDocTokenMap[] =
XML_TOKEN_MAP_END
};
+namespace {
+
class SwXMLBodyContext_Impl : public SvXMLImportContext
{
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
@@ -149,6 +151,8 @@ public:
const Reference< xml::sax::XAttributeList > & xAttrList ) override;
};
+}
+
SwXMLBodyContext_Impl::SwXMLBodyContext_Impl( SwXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName) :
SvXMLImportContext( rImport, nPrfx, rLName )
@@ -187,6 +191,8 @@ SvXMLImportContextRef SwXMLBodyContext_Impl::CreateChildContext(
return GetSwImport().CreateBodyContentContext( rLocalName );
}
+namespace {
+
// #i69629#
// enhance class <SwXMLDocContext_Impl> in order to be able to create subclasses
// NB: virtually inherit so we can multiply inherit properly
@@ -212,6 +218,8 @@ public:
sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
};
+}
+
SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName ) :
SvXMLImportContext( rImport, nPrfx, rLName )
@@ -286,6 +294,8 @@ SvXMLImportContextRef SwXMLDocContext_Impl::CreateChildContext(
return pContext;
}
+namespace {
+
// #i69629# - new subclass <SwXMLOfficeDocContext_Impl> of class <SwXMLDocContext_Impl>
class SwXMLOfficeDocContext_Impl :
public SwXMLDocContext_Impl, public SvXMLMetaDocumentContext
@@ -299,6 +309,8 @@ public:
sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
};
+}
+
SwXMLOfficeDocContext_Impl::SwXMLOfficeDocContext_Impl(
SwXMLImport& rImport,
const Reference< document::XDocumentProperties >& xDocProps) :
@@ -331,6 +343,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLOfficeDocContext_I
}
}
+namespace {
+
// #i69629# - new subclass <SwXMLDocStylesContext_Impl> of class <SwXMLDocContext_Impl>
class SwXMLDocStylesContext_Impl : public SwXMLDocContext_Impl
{
@@ -343,6 +357,8 @@ public:
virtual void EndElement() override;
};
+}
+
SwXMLDocStylesContext_Impl::SwXMLDocStylesContext_Impl(
SwXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1154,6 +1170,8 @@ void SwXMLImport::MergeListsAtDocumentInsertPosition(SwDoc *pDoc)
}
}
+namespace {
+
// Locally derive XMLTextShapeImportHelper, so we can take care of the
// form import This is Writer, but not text specific, so it should go
// here!
@@ -1175,6 +1193,8 @@ public:
virtual ~SvTextShapeImportHelper() override;
};
+}
+
SvTextShapeImportHelper::SvTextShapeImportHelper(SvXMLImport& rImp) :
XMLTextShapeImportHelper(rImp)
{
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 2436e2e4f1c8..1da664861205 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -215,6 +215,8 @@ SvXMLImportItemMapper::finished(SfxItemSet &, SvXMLUnitConverter const&) const
// nothing to do here
}
+namespace {
+
struct BoxHolder
{
std::unique_ptr<SvxBorderLine> pTop;
@@ -238,6 +240,8 @@ struct BoxHolder
}
};
+}
+
// put an XML-string value into an item
bool SvXMLImportItemMapper::PutXMLValue(
SfxPoolItem& rItem,
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index b307a5c10872..433eb1fc2397 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -46,6 +46,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::xmloff::token;
+namespace {
+
class SwXMLTableItemMapper_Impl: public SvXMLExportItemMapper
{
SwXMLBrushItemExport aBrushItemExport;
@@ -79,6 +81,8 @@ public:
inline void SetAbsWidth( sal_uInt32 nAbs );
};
+}
+
SwXMLTableItemMapper_Impl::SwXMLTableItemMapper_Impl(
SvXMLItemMapEntriesRef rMapEntries,
SwXMLExport& rExp ) :
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index e6542b33157d..7708985d0adc 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -52,6 +52,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+namespace {
+
class SwXMLImportTableItemMapper_Impl: public SvXMLImportItemMapper
{
@@ -85,6 +87,8 @@ private:
bool m_bHaveMargin[4];
};
+}
+
SwXMLImportTableItemMapper_Impl::SwXMLImportTableItemMapper_Impl(
const SvXMLItemMapEntriesRef& rMapEntries ) :
SvXMLImportItemMapper( rMapEntries )
@@ -229,6 +233,8 @@ void SwXMLImportTableItemMapper_Impl::finished(
}
}
+namespace {
+
class SwXMLItemSetContext_Impl : public SvXMLItemSetContext
{
SvXMLImportContextRef xBackground;
@@ -252,6 +258,8 @@ public:
const SvXMLUnitConverter& rUnitConv ) override;
};
+}
+
SwXMLItemSetContext_Impl::SwXMLItemSetContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 2a95dc8106cb..c8739eeafa14 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -87,8 +87,6 @@ enum SvXMLTokenMapAttrs
XML_TOK_META_STAT_END=XML_TOK_UNKNOWN
};
-}
-
struct statistic {
SvXMLTokenMapAttrs const token;
const char* name;
@@ -96,6 +94,8 @@ struct statistic {
sal_uLong SwDocStat::* target32; /* or 64, on LP64 platforms */
};
+}
+
static const struct statistic s_stats [] = {
{ XML_TOK_META_STAT_TABLE, "TableCount", &SwDocStat::nTable, nullptr },
{ XML_TOK_META_STAT_IMAGE, "ImageCount", &SwDocStat::nGrf, nullptr },
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index bef72a6f5357..13d004732c37 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -84,6 +84,8 @@ public:
sal_uInt32 GetRelWidth() const { return nRelWidth; }
};
+namespace {
+
struct SwXMLTableColumnCmpWidth_Impl
{
bool operator()( SwXMLTableColumn_Impl* const& lhs, SwXMLTableColumn_Impl* const& rhs ) const
@@ -98,6 +100,8 @@ struct SwXMLTableColumnCmpWidth_Impl
class SwXMLTableColumns_Impl : public o3tl::sorted_vector<std::unique_ptr<SwXMLTableColumn_Impl>, o3tl::less_uniqueptr_to<SwXMLTableColumn_Impl> > {
};
+}
+
class SwXMLTableColumnsSortByWidth_Impl : public o3tl::sorted_vector<SwXMLTableColumn_Impl*, SwXMLTableColumnCmpWidth_Impl> {};
class SwXMLTableLines_Impl
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 657ac47e6c4f..db95b73a328b 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -378,6 +378,8 @@ void SwXMLTableRow_Impl::Dispose()
}
}
+namespace {
+
class SwXMLTableCellContext_Impl : public SvXMLImportContext
{
OUString m_aStyleName;
@@ -422,6 +424,8 @@ public:
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
};
+}
+
SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
@@ -708,6 +712,8 @@ void SwXMLTableCellContext_Impl::EndElement()
GetImport().GetTextImport()->SetCellParaStyleDefault(m_sSaveParaDefault);
}
+namespace {
+
class SwXMLTableColContext_Impl : public SvXMLImportContext
{
SvXMLImportContextRef const xMyTable;
@@ -724,6 +730,8 @@ public:
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
};
+}
+
SwXMLTableColContext_Impl::SwXMLTableColContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
@@ -793,6 +801,8 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl(
}
}
+namespace {
+
class SwXMLTableColsContext_Impl : public SvXMLImportContext
{
SvXMLImportContextRef const xMyTable;
@@ -813,6 +823,8 @@ public:
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
};
+}
+
SwXMLTableColsContext_Impl::SwXMLTableColsContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
SwXMLTableContext *pTable ) :
@@ -841,6 +853,8 @@ SvXMLImportContextRef SwXMLTableColsContext_Impl::CreateChildContext(
return pContext;
}
+namespace {
+
class SwXMLTableRowContext_Impl : public SvXMLImportContext
{
SvXMLImportContextRef const xMyTable;
@@ -865,6 +879,8 @@ public:
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
};
+}
+
SwXMLTableRowContext_Impl::SwXMLTableRowContext_Impl( SwXMLImport& rImport,
sal_uInt16 nPrfx,
const OUString& rLName,
@@ -957,6 +973,8 @@ SvXMLImportContextRef SwXMLTableRowContext_Impl::CreateChildContext(
return pContext;
}
+namespace {
+
class SwXMLTableRowsContext_Impl : public SvXMLImportContext
{
SvXMLImportContextRef const xMyTable;
@@ -979,6 +997,8 @@ public:
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
};
+}
+
SwXMLTableRowsContext_Impl::SwXMLTableRowsContext_Impl( SwXMLImport& rImport,
sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/sw/source/filter/xml/xmltext.cxx b/sw/source/filter/xml/xmltext.cxx
index be51bf82ed68..690c3cac4d8d 100644
--- a/sw/source/filter/xml/xmltext.cxx
+++ b/sw/source/filter/xml/xmltext.cxx
@@ -24,6 +24,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::text;
+namespace {
+
class SwXMLBodyContentContext_Impl : public SvXMLImportContext
{
SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
@@ -41,6 +43,8 @@ public:
virtual void EndElement() override;
};
+}
+
SwXMLBodyContentContext_Impl::SwXMLBodyContentContext_Impl( SwXMLImport& rImport,
const OUString& rLName ) :
SvXMLImportContext( rImport, XML_NAMESPACE_OFFICE, rLName )
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 788bec5c2d47..dac99fc9c7ac 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -70,6 +70,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace xml::sax;
+namespace {
+
struct XMLServiceMapEntry_Impl
{
const sal_Char *sFilterService;
@@ -80,6 +82,8 @@ struct XMLServiceMapEntry_Impl
sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
};
+}
+
#define SERVICE_MAP_ENTRY( app, s ) \
{ XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1, \
SO3_##s##_CLASSID }
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 1e3946208233..947c39ac52cc 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -68,6 +68,8 @@ public:
virtual ~SwTestAccountSettingsDialog() override;
};
+namespace {
+
class SwAuthenticationSettingsDialog : public SfxDialogController
{
SwMailMergeConfigItem& m_rConfigItem;
@@ -103,6 +105,8 @@ public:
SwAuthenticationSettingsDialog(weld::Window* pParent, SwMailMergeConfigItem& rItem);
};
+}
+
SwMailConfigPage::SwMailConfigPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "modules/swriter/ui/mailconfigpage.ui", "MailConfigPage", &rSet)
, m_pConfigItem(new SwMailMergeConfigItem)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 7e49ff3dc2a9..ebc5ed7ae9de 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1376,6 +1376,8 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet )
}
}
+namespace {
+
// TabPage for Redlining
struct CharAttr
{
@@ -1383,6 +1385,8 @@ struct CharAttr
sal_uInt16 const nAttr;
};
+}
+
// Edit corresponds to Paste-attributes
static CharAttr const aRedlineAttr[] =
{
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index ae4d354ea29d..0d32e4980b36 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -48,6 +48,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::ui::dialogs;
+namespace {
+
struct SwAddressFragment
{
std::unique_ptr<weld::Builder> m_xBuilder;
@@ -67,6 +69,8 @@ struct SwAddressFragment
}
};
+}
+
class SwAddressControl_Impl
{
std::map<weld::Entry*, sal_Int32> m_aEditLines;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 4ead5f41f49b..f25e3f138e41 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -155,6 +155,8 @@ struct DB_Column
}
};
+namespace {
+
struct DB_ColumnConfigData
{
SwInsDBColumns aDBColumns;
@@ -177,6 +179,8 @@ struct DB_ColumnConfigData
}
};
+}
+
bool SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const
{
return 0 > GetAppCollator().compareString( sColumn, rCmp.sColumn );
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index b911b2ee31ec..a80e4eda9ae5 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -766,6 +766,8 @@ OUString SwCustomizeAddressBlockDialog::GetAddress() const
return sAddress;
}
+namespace {
+
struct SwAssignFragment
{
std::unique_ptr<weld::Builder> m_xBuilder;
@@ -790,6 +792,8 @@ struct SwAssignFragment
}
};
+}
+
class SwAssignFieldsControl
{
friend class SwAssignFieldsDialog;
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index e5d0b2e8528d..7e1855893a8e 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -114,6 +114,8 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor()
return nullptr;
}
+namespace {
+
class SwMailDispatcherListener_Impl : public IMailDispatcherListener
{
SwSendMailDialog& m_rSendMailDialog;
@@ -129,6 +131,8 @@ public:
static void DeleteAttachments( uno::Reference< mail::XMailMessage > const & xMessage );
};
+}
+
SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg)
: m_rSendMailDialog(rParentDlg)
{
@@ -178,6 +182,8 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
}
}
+namespace {
+
class SwSendWarningBox_Impl : public weld::MessageDialogController
{
std::unique_ptr<weld::TextView> m_xDetailED;
@@ -192,6 +198,8 @@ public:
}
};
+}
+
SwSendMailDialog::SwSendMailDialog(weld::Window *pParent, SwMailMergeConfigItem& rConfigItem)
: GenericDialogController(pParent, "modules/swriter/ui/mmsendmails.ui", "SendMailsDialog")
, m_sContinue(SwResId( ST_CONTINUE ))
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 53a76b8eb2bb..19047d79f974 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -153,6 +153,8 @@ static void lcl_UpdateEmailSettingsFromGlobalConfig(SwMailMergeConfigItem& rConf
rConfigItem.SetInServerPassword(aConfigItem.GetInServerPassword());
}
+namespace {
+
class SwSaveWarningBox_Impl : public SwMessageAndEditDialog
{
DECL_LINK( ModifyHdl, weld::Entry&, void);
@@ -191,6 +193,8 @@ public:
}
};
+}
+
SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(weld::Window* pParent, const OUString& rFileName)
: SwMessageAndEditDialog(pParent, "AlreadyExistsDialog",
"modules/swriter/ui/alreadyexistsdialog.ui")
@@ -224,6 +228,8 @@ IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, weld::Entry&, rEdit, void)
m_xOKPB->set_sensitive(bIsEmptyAllowed || !rEdit.get_text().isEmpty());
}
+namespace {
+
class SwCopyToDialog : public SfxDialogController
{
std::unique_ptr<weld::Entry> m_xCCED;
@@ -244,6 +250,8 @@ public:
void SetBCC(const OUString& rSet) {m_xBCCED->set_text(rSet);}
};
+}
+
SwMMResultSaveDialog::SwMMResultSaveDialog(weld::Window* pParent)
: SfxDialogController(pParent, "modules/swriter/ui/mmresultsavedialog.ui", "MMResultSaveDialog")
, m_bCancelSaving(false)
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 4320d71aa4f8..5ce3b9f4cb88 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -49,6 +49,8 @@
using namespace ::com::sun::star;
+namespace {
+
class SwSequenceOptionDialog : public weld::GenericDialogController
{
SwView& m_rView;
@@ -86,6 +88,8 @@ public:
}
};
+}
+
OUString SwCaptionDialog::our_aSepTextSave(": "); // Caption separator text
//Resolves: tdf#47427 disallow typing *or* pasting invalid content into the category box
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 836fde5344f9..89ddff3aa9c4 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -82,12 +82,16 @@ using namespace ::sfx2;
#define SwFPos SvxSwFramePosString
+namespace {
+
struct StringIdPair_Impl
{
SvxSwFramePosString::StringId const eHori;
SvxSwFramePosString::StringId const eVert;
};
+}
+
#define MAX_PERCENT_WIDTH 254
#define MAX_PERCENT_HEIGHT 254
@@ -128,6 +132,8 @@ namespace o3tl {
template<> struct typed_flags<LB> : is_typed_flags<LB, 0x00773fffL> {};
}
+namespace {
+
struct RelationMap
{
SvxSwFramePosString::StringId const eStrId;
@@ -136,6 +142,8 @@ struct RelationMap
sal_Int16 const nRelation;
};
+}
+
struct FrameMap
{
SvxSwFramePosString::StringId const eStrId;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 0238c3138638..2aa0afdf547d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -120,6 +120,8 @@ static OUString lcl_CreateAutoMarkFileDlg(weld::Window* pParent, const OUString&
return sRet;
}
+namespace {
+
struct AutoMarkEntry
{
OUString sSearch;
@@ -135,8 +137,12 @@ struct AutoMarkEntry
bWord(false){}
};
+}
+
typedef ::svt::EditBrowseBox SwEntryBrowseBox_Base;
+namespace {
+
class SwEntryBrowseBox : public SwEntryBrowseBox_Base
{
VclPtr<Edit> m_aCellEdit;
@@ -200,6 +206,8 @@ public:
virtual ~SwAutoMarkDlg_Impl() override;
};
+}
+
sal_uInt16 CurTOXType::GetFlatIndex() const
{
return static_cast< sal_uInt16 >( (eType == TOX_USER && nIndex)
@@ -475,6 +483,8 @@ bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const OUString& rName)
! rSh.GetTextCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle();
}
+namespace {
+
class SwAddStylesDlg_Impl : public SfxDialogController
{
OUString* pStyleArr;
@@ -495,6 +505,8 @@ public:
SwAddStylesDlg_Impl(weld::Window* pParent, SwWrtShell const & rWrtSh, OUString rStringArr[]);
};
+}
+
SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent,
SwWrtShell const & rWrtSh, OUString rStringArr[])
: SfxDialogController(pParent, "modules/swriter/ui/assignstylesdialog.ui", "AssignStylesDialog")
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 33a0eab8cd69..03dc2072cc5e 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -559,6 +559,8 @@ void SwIndexMarkPane::UpdateKeyBoxes()
}
}
+namespace {
+
class SwNewUserIdxDlg : public weld::GenericDialogController
{
SwIndexMarkPane* m_pDlg;
@@ -582,6 +584,8 @@ public:
OUString GetName() const { return m_xNameED->get_text(); }
};
+}
+
IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, weld::Entry&, rEdit, void)
{
m_xOKPB->set_sensitive(!rEdit.get_text().isEmpty() && !m_pDlg->IsTOXType(rEdit.get_text()));
@@ -991,6 +995,8 @@ short SwIndexMarkModalDlg::run()
return nRet;
}
+namespace {
+
class SwCreateAuthEntryDlg_Impl : public weld::GenericDialogController
{
std::vector<std::unique_ptr<weld::Builder>> m_aBuilders;
@@ -1035,6 +1041,8 @@ struct TextInfo
const char* pHelpId;
};
+}
+
static const TextInfo aTextInfoArr[] =
{
{AUTH_FIELD_IDENTIFIER, HID_AUTH_FIELD_IDENTIFIER },
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 47af1e385015..4f979bb3570b 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -55,6 +55,8 @@
using namespace ::com::sun::star;
+namespace {
+
class SwNumNamesDlg : public weld::GenericDialogController
{
std::unique_ptr<weld::Entry> m_xFormEdit;
@@ -72,6 +74,8 @@ public:
int GetCurEntryPos() const { return m_xFormBox->get_selected_index(); }
};
+}
+
// remember selected entry
IMPL_LINK( SwNumNamesDlg, SelectHdl, weld::TreeView&, rBox, void )
{
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 9f8d1e64898b..bf8a4a701d6c 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -26,6 +26,8 @@
#include <shellres.hxx>
#include <tautofmt.hxx>
+namespace {
+
class SwStringInputDlg : public SfxDialogController
{
private:
@@ -52,6 +54,8 @@ public:
}
};
+}
+
// AutoFormat-Dialogue:
SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pWrtShell,
bool bAutoFormat, const SwTableAutoFormat* pSelFormat)
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index ed0a28863f3d..dc0ae39bb33c 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -55,6 +55,8 @@ using namespace ::ooo;
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class SwVbaApplicationOutgoingConnectionPoint : public cppu::WeakImplHelper<XConnectionPoint>
{
private:
@@ -131,6 +133,8 @@ public:
virtual css::uno::Any SAL_CALL AppCount() override;
};
+}
+
SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
SwVbaApplication_BASE( xContext )
{
diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx
index ae0eaed5e89a..53c23f85e38d 100644
--- a/sw/source/ui/vba/vbabookmarks.cxx
+++ b/sw/source/ui/vba/vbabookmarks.cxx
@@ -31,6 +31,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class BookmarksEnumeration : public EnumerationHelperImpl
{
uno::Reference< frame::XModel > mxModel;
@@ -108,6 +110,8 @@ public:
}
};
+}
+
SwVbaBookmarks::SwVbaBookmarks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xBookmarks, const uno::Reference< frame::XModel >& xModel ): SwVbaBookmarks_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new BookmarkCollectionHelper( xBookmarks ) ) ), mxModel( xModel )
{
mxBookmarksSupplier.set( mxModel, uno::UNO_QUERY_THROW );
diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx
index f66b38426f82..aaea6f5c6486 100644
--- a/sw/source/ui/vba/vbaborders.cxx
+++ b/sw/source/ui/vba/vbaborders.cxx
@@ -41,6 +41,8 @@ static const sal_Int16 supportedIndexTable[] = { word::WdBorderType::wdBorderBot
// Equiv widths in 1/100 mm
const static sal_Int32 OOLineHairline = 2;
+namespace {
+
class SwVbaBorder : public SwVbaBorder_Base
{
private:
@@ -273,12 +275,16 @@ public:
}
};
+}
+
static uno::Reference< container::XIndexAccess >
rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, VbaPalette const & rPalette )
{
return new RangeBorders( xRange, xContext, rPalette );
}
+namespace {
+
class RangeBorderEnumWrapper : public EnumerationHelper_BASE
{
uno::Reference<container::XIndexAccess > m_xIndexAccess;
@@ -298,6 +304,8 @@ public:
}
};
+}
+
// for Table borders
SwVbaBorders::SwVbaBorders( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< table::XCellRange >& xRange, VbaPalette const & rPalette ): SwVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) )
{
diff --git a/sw/source/ui/vba/vbacells.cxx b/sw/source/ui/vba/vbacells.cxx
index 953abac9148a..e8c5f558e284 100644
--- a/sw/source/ui/vba/vbacells.cxx
+++ b/sw/source/ui/vba/vbacells.cxx
@@ -26,6 +26,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class CellsEnumWrapper : public EnumerationHelper_BASE
{
uno::Reference< container::XIndexAccess > mxIndexAccess;
@@ -103,6 +105,8 @@ public:
}
};
+}
+
SwVbaCells::SwVbaCells( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) : SwVbaCells_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new CellCollectionHelper( xParent, xContext, xTextTable, nLeft, nTop, nRight, nBottom ) ) ), mxTextTable( xTextTable ), mnTop( nTop ), mnBottom( nBottom )
{
}
diff --git a/sw/source/ui/vba/vbacolumns.cxx b/sw/source/ui/vba/vbacolumns.cxx
index 7fda520b6579..04131262046d 100644
--- a/sw/source/ui/vba/vbacolumns.cxx
+++ b/sw/source/ui/vba/vbacolumns.cxx
@@ -28,6 +28,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class ColumnsEnumWrapper : public EnumerationHelper_BASE
{
uno::WeakReference< XHelperInterface > mxParent;
@@ -56,6 +58,8 @@ public:
}
};
+}
+
SwVbaColumns::SwVbaColumns( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableColumns >& xTableColumns ) : SwVbaColumns_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableColumns, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable )
{
mnStartColumnIndex = 0;
diff --git a/sw/source/ui/vba/vbadialog.cxx b/sw/source/ui/vba/vbadialog.cxx
index 8ec16e181198..f47eff0e977b 100644
--- a/sw/source/ui/vba/vbadialog.cxx
+++ b/sw/source/ui/vba/vbadialog.cxx
@@ -22,12 +22,16 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
struct WordDialogTable
{
sal_Int32 const wdDialog;
const sal_Char* ooDialog;
};
+}
+
static const WordDialogTable aWordDialogTable[] =
{
{ word::WdWordDialog::wdDialogFileNew, ".uno:NewDoc" },
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 894bac0aa996..0883afe12374 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -67,6 +67,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class SwVbaDocumentOutgoingConnectionPoint : public cppu::WeakImplHelper<XConnectionPoint>
{
private:
@@ -80,6 +82,8 @@ public:
void SAL_CALL Unadvise( sal_uInt32 Cookie ) override;
};
+}
+
SwVbaDocument::SwVbaDocument( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< frame::XModel > const & xModel ): SwVbaDocument_BASE( xParent, xContext, xModel )
{
Initialize();
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index f0d00352bbdd..5d1d570f5356 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -61,6 +61,8 @@ static sal_Int8 lcl_toMSOPropType( const uno::Type& aType )
return msoType;
}
+namespace {
+
class PropertGetSetHelper
{
protected:
@@ -386,8 +388,12 @@ public:
}
};
+}
+
typedef std::unordered_map< sal_Int32, DocPropInfo > MSOIndexToOODocPropInfo;
+namespace {
+
class BuiltInIndexHelper
{
MSOIndexToOODocPropInfo m_docPropInfoMap;
@@ -433,8 +439,12 @@ public:
MSOIndexToOODocPropInfo& getDocPropInfoMap() { return m_docPropInfoMap; }
};
+}
+
typedef InheritedHelperInterfaceWeakImpl< ooo::vba::XDocumentProperty > SwVbaDocumentProperty_BASE;
+namespace {
+
class SwVbaBuiltInDocumentProperty : public SwVbaDocumentProperty_BASE
{
protected:
@@ -477,6 +487,8 @@ public:
};
+}
+
SwVbaCustomDocumentProperty::SwVbaCustomDocumentProperty( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const DocPropInfo& rInfo ) : SwVbaBuiltInDocumentProperty( xParent, xContext, rInfo )
{
}
@@ -630,6 +642,8 @@ typedef ::cppu::WeakImplHelper< css::container::XIndexAccess
typedef std::unordered_map< sal_Int32, uno::Reference< XDocumentProperty > > DocProps;
+namespace {
+
class DocPropEnumeration : public ::cppu::WeakImplHelper< css::container::XEnumeration >
{
DocProps mDocProps;
@@ -649,8 +663,12 @@ public:
}
};
+}
+
typedef std::unordered_map< OUString, uno::Reference< XDocumentProperty > > DocPropsByName;
+namespace {
+
class BuiltInPropertiesImpl : public PropertiesImpl_BASE
{
protected:
@@ -725,6 +743,8 @@ protected:
}
};
+}
+
SwVbaBuiltinDocumentProperties::SwVbaBuiltinDocumentProperties( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : SwVbaDocumentproperties_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new BuiltInPropertiesImpl( xParent, xContext, xModel ) ) )
{
}
@@ -774,6 +794,8 @@ SwVbaBuiltinDocumentProperties::getServiceNames()
return aServiceNames;
}
+namespace {
+
class CustomPropertiesImpl : public PropertiesImpl_BASE
{
uno::Reference< XHelperInterface > m_xParent;
@@ -862,6 +884,8 @@ public:
};
+}
+
SwVbaCustomDocumentProperties::SwVbaCustomDocumentProperties( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : SwVbaBuiltinDocumentProperties( xParent, xContext, xModel )
{
// replace the m_xIndexAccess implementation ( we need a virtual init )
diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index 6748dc376fb9..057b25a519ce 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -51,6 +51,8 @@ getDocument( uno::Reference< uno::XComponentContext > const & xContext, const un
return uno::Any( uno::Reference< word::XDocument > (pWb) );
}
+namespace {
+
class DocumentEnumImpl : public EnumerationHelperImpl
{
uno::Any const m_aApplication;
@@ -65,6 +67,8 @@ public:
}
};
+}
+
SwVbaDocuments::SwVbaDocuments( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : SwVbaDocuments_BASE( xParent, xContext, VbaDocumentsBase::WORD_DOCUMENT )
{
}
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 49371d794b05..2c5495cf4224 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -68,6 +68,8 @@ SwVbaField::getServiceNames()
return aServiceNames;
}
+namespace {
+
// FIXME? copy and paste code
// the codes are copied from ww8par5.cxx
class SwVbaReadFieldParams
@@ -87,6 +89,8 @@ public:
const OUString& GetFieldName()const { return aFieldName; }
};
+}
+
SwVbaReadFieldParams::SwVbaReadFieldParams( const OUString& _rData )
: aData( _rData ), nLen( _rData.getLength() ), nNext( 0 )
{
@@ -222,6 +226,8 @@ static uno::Any lcl_createField( const uno::Reference< XHelperInterface >& xPare
return uno::makeAny( xField );
}
+namespace {
+
class FieldEnumeration : public ::cppu::WeakImplHelper< css::container::XEnumeration >
{
uno::Reference< XHelperInterface > mxParent;
@@ -298,6 +304,8 @@ public:
}
};
+}
+
SwVbaFields::SwVbaFields( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) : SwVbaFields_BASE( xParent, xContext , uno::Reference< container::XIndexAccess >( new FieldCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel )
{
mxMSF.set( mxModel, uno::UNO_QUERY_THROW );
@@ -372,12 +380,16 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const OUS
return xTextField;
}
+namespace {
+
struct DocPropertyTable
{
const char* sDocPropertyName;
const char* sFieldService;
};
+}
+
static const DocPropertyTable aDocPropertyTables[] =
{
{ "Author", "com.sun.star.text.textfield.docinfo.CreateAuthor" },
diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx
index de61e8696b31..2c0b7ac09e3b 100644
--- a/sw/source/ui/vba/vbafont.cxx
+++ b/sw/source/ui/vba/vbafont.cxx
@@ -32,12 +32,16 @@ using namespace ::com::sun::star;
const uno::Any aLongAnyTrue( sal_Int16(-1) );
const uno::Any aLongAnyFalse( sal_Int16( 0 ) );
+namespace {
+
struct MapPair
{
sal_Int32 nMSOConst;
sal_Int32 nOOOConst;
};
+}
+
static MapPair const UnderLineTable[] = {
{ word::WdUnderline::wdUnderlineNone, css::awt::FontUnderline::NONE },
{ word::WdUnderline::wdUnderlineSingle, css::awt::FontUnderline::SINGLE },
@@ -60,6 +64,9 @@ static MapPair const UnderLineTable[] = {
};
typedef std::unordered_map< sal_Int32, sal_Int32 > ConstToConst;
+
+namespace {
+
class UnderLineMapper
{
ConstToConst MSO2OOO;
@@ -103,6 +110,8 @@ public:
}
};
+}
+
SwVbaFont::SwVbaFont( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPalette, uno::Reference< css::beans::XPropertySet > const & xPropertySet ) : SwVbaFont_BASE( xParent, xContext, xPalette, xPropertySet )
{
}
diff --git a/sw/source/ui/vba/vbaframes.cxx b/sw/source/ui/vba/vbaframes.cxx
index 3577bfff624e..f16c028698f2 100644
--- a/sw/source/ui/vba/vbaframes.cxx
+++ b/sw/source/ui/vba/vbaframes.cxx
@@ -27,6 +27,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class FramesEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration >
{
private:
@@ -55,6 +57,8 @@ public:
};
+}
+
SwVbaFrames::SwVbaFrames( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xFrames, const uno::Reference< frame::XModel >& xModel ): SwVbaFrames_BASE( xParent, xContext, xFrames ), mxModel( xModel )
{
mxFramesSupplier.set( mxModel, uno::UNO_QUERY_THROW );
diff --git a/sw/source/ui/vba/vbaheadersfooters.cxx b/sw/source/ui/vba/vbaheadersfooters.cxx
index 90fa4cf0fb7b..9eaafac3205c 100644
--- a/sw/source/ui/vba/vbaheadersfooters.cxx
+++ b/sw/source/ui/vba/vbaheadersfooters.cxx
@@ -24,6 +24,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
// I assume there is only one headersfooters in Writer
class HeadersFootersIndexAccess : public ::cppu::WeakImplHelper<container::XIndexAccess >
{
@@ -78,6 +80,8 @@ public:
}
};
+}
+
SwVbaHeadersFooters::SwVbaHeadersFooters( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xPageStyleProps, bool isHeader ): SwVbaHeadersFooters_BASE( xParent, xContext, new HeadersFootersIndexAccess( xParent, xContext, xModel, xPageStyleProps, isHeader ) ), mxModel( xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( isHeader )
{
}
diff --git a/sw/source/ui/vba/vbalistgalleries.cxx b/sw/source/ui/vba/vbalistgalleries.cxx
index bbe554c3900b..0a4c8084bed0 100644
--- a/sw/source/ui/vba/vbalistgalleries.cxx
+++ b/sw/source/ui/vba/vbalistgalleries.cxx
@@ -23,6 +23,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class ListGalleriesEnumWrapper : public EnumerationHelper_BASE
{
SwVbaListGalleries* pListGalleries;
@@ -42,6 +44,8 @@ public:
}
};
+}
+
SwVbaListGalleries::SwVbaListGalleries( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc ) : SwVbaListGalleries_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc )
{
}
diff --git a/sw/source/ui/vba/vbalistlevels.cxx b/sw/source/ui/vba/vbalistlevels.cxx
index 7e49e3ab84ba..a83e6fe971dc 100644
--- a/sw/source/ui/vba/vbalistlevels.cxx
+++ b/sw/source/ui/vba/vbalistlevels.cxx
@@ -23,6 +23,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class ListLevelsEnumWrapper : public EnumerationHelper_BASE
{
SwVbaListLevels* pListLevels;
@@ -42,6 +44,8 @@ public:
}
};
+}
+
SwVbaListLevels::SwVbaListLevels( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, SwVbaListHelperRef const & pHelper ) : SwVbaListLevels_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), pListHelper( pHelper )
{
}
diff --git a/sw/source/ui/vba/vbalisttemplates.cxx b/sw/source/ui/vba/vbalisttemplates.cxx
index e4d3416f09a8..ffcef424b938 100644
--- a/sw/source/ui/vba/vbalisttemplates.cxx
+++ b/sw/source/ui/vba/vbalisttemplates.cxx
@@ -22,6 +22,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class ListTemplatesEnumWrapper : public EnumerationHelper_BASE
{
SwVbaListTemplates* pListTemplates;
@@ -41,6 +43,8 @@ public:
}
};
+}
+
SwVbaListTemplates::SwVbaListTemplates( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nType ) : SwVbaListTemplates_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc ), mnGalleryType( nType )
{
}
diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx
index fa5dbe0218c7..d86235859b23 100644
--- a/sw/source/ui/vba/vbapalette.cxx
+++ b/sw/source/ui/vba/vbapalette.cxx
@@ -52,6 +52,8 @@ WdColor::wdColorGray25, // 16
typedef ::cppu::WeakImplHelper< container::XIndexAccess > XIndexAccess_BASE;
+namespace {
+
class DefaultPalette : public XIndexAccess_BASE
{
public:
@@ -82,6 +84,8 @@ public:
};
+}
+
VbaPalette::VbaPalette()
{
mxPalette = new DefaultPalette();
diff --git a/sw/source/ui/vba/vbapanes.cxx b/sw/source/ui/vba/vbapanes.cxx
index 9147111ab36a..a9e4373803f0 100644
--- a/sw/source/ui/vba/vbapanes.cxx
+++ b/sw/source/ui/vba/vbapanes.cxx
@@ -23,6 +23,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
// I assume there is only one pane in Writer
class PanesIndexAccess : public ::cppu::WeakImplHelper<container::XIndexAccess >
{
@@ -74,6 +76,8 @@ public:
}
};
+}
+
SwVbaPanes::SwVbaPanes( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ): SwVbaPanes_BASE( xParent, xContext, new PanesIndexAccess( xParent, xContext, xModel ) )
{
}
diff --git a/sw/source/ui/vba/vbaparagraph.cxx b/sw/source/ui/vba/vbaparagraph.cxx
index 957dd606ff77..b9bfe036be6d 100644
--- a/sw/source/ui/vba/vbaparagraph.cxx
+++ b/sw/source/ui/vba/vbaparagraph.cxx
@@ -71,6 +71,8 @@ SwVbaParagraph::getServiceNames()
return aServiceNames;
}
+namespace {
+
class ParagraphCollectionHelper : public ::cppu::WeakImplHelper< container::XIndexAccess,
container::XEnumerationAccess >
{
@@ -133,6 +135,8 @@ public:
}
};
+}
+
SwVbaParagraphs::SwVbaParagraphs( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDocument ) : SwVbaParagraphs_BASE( xParent, xContext, new ParagraphCollectionHelper( xDocument ) ), mxTextDocument( xDocument )
{
}
diff --git a/sw/source/ui/vba/vbarevisions.cxx b/sw/source/ui/vba/vbarevisions.cxx
index a24a155484c2..2e022e35a81e 100644
--- a/sw/source/ui/vba/vbarevisions.cxx
+++ b/sw/source/ui/vba/vbarevisions.cxx
@@ -28,6 +28,8 @@ using namespace ::com::sun::star;
typedef std::vector< uno::Reference< beans::XPropertySet > > RevisionMap;
+namespace {
+
class RedlinesEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration >
{
RevisionMap mRevisionMap;
@@ -75,6 +77,8 @@ RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const u
}
};
+}
+
RevisionCollectionHelper::RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange )
{
uno::Reference< text::XTextRangeCompare > xTRC( xTextRange->getText(), uno::UNO_QUERY_THROW );
@@ -91,6 +95,9 @@ RevisionCollectionHelper::RevisionCollectionHelper( const uno::Reference< frame:
}
}
}
+
+namespace {
+
class RevisionsEnumeration : public EnumerationHelperImpl
{
uno::Reference< frame::XModel > m_xModel;
@@ -106,6 +113,8 @@ public:
};
+}
+
SwVbaRevisions::SwVbaRevisions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ): SwVbaRevisions_BASE( xParent, xContext, new RevisionCollectionHelper( xModel, xTextRange ) ), mxModel( xModel )
{
}
diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
index 2ed1d4a4b64c..6159b076a676 100644
--- a/sw/source/ui/vba/vbarows.cxx
+++ b/sw/source/ui/vba/vbarows.cxx
@@ -31,6 +31,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class RowsEnumWrapper : public EnumerationHelper_BASE
{
uno::WeakReference< XHelperInterface > mxParent;
@@ -59,6 +61,8 @@ public:
}
};
+}
+
SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows ) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows )
{
mnStartRowIndex = 0;
diff --git a/sw/source/ui/vba/vbasections.cxx b/sw/source/ui/vba/vbasections.cxx
index 3e57eb65430a..78f4b9c1d296 100644
--- a/sw/source/ui/vba/vbasections.cxx
+++ b/sw/source/ui/vba/vbasections.cxx
@@ -30,6 +30,8 @@ using namespace ::com::sun::star;
typedef std::vector< uno::Reference< beans::XPropertySet > > XSectionVec;
+namespace {
+
class SectionEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration >
{
XSectionVec mxSections;
@@ -132,6 +134,8 @@ public:
}
};
+}
+
SwVbaSections::SwVbaSections( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ): SwVbaSections_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new SectionCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel )
{
}
diff --git a/sw/source/ui/vba/vbastyles.cxx b/sw/source/ui/vba/vbastyles.cxx
index 2c262a0f7c99..b3f927a01b5f 100644
--- a/sw/source/ui/vba/vbastyles.cxx
+++ b/sw/source/ui/vba/vbastyles.cxx
@@ -31,6 +31,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
struct BuiltinStyleTable
{
sal_Int32 const wdBuiltinStyle;
@@ -38,6 +40,8 @@ struct BuiltinStyleTable
sal_Int32 const wdStyleType;
};
+}
+
static const BuiltinStyleTable aBuiltinStyleTable[] =
{
{ word::WdBuiltinStyle::wdStyleBlockQuotation, "", word::WdStyleType::wdStyleTypeParagraph },
@@ -146,18 +150,24 @@ static const BuiltinStyleTable aBuiltinStyleTable[] =
{ 0, nullptr, 0 }
};
+namespace {
+
struct MSOStyleNameTable
{
const sal_Char* pMSOStyleName;
const sal_Char* pOOoStyleName;
};
+}
+
static const MSOStyleNameTable aMSOStyleNameTable[] =
{
{ "Normal", "Default" },
{ nullptr, nullptr }
};
+namespace {
+
class StyleCollectionHelper : public ::cppu::WeakImplHelper< container::XNameAccess,
container::XIndexAccess,
container::XEnumerationAccess >
@@ -264,6 +274,8 @@ public:
}
};
+}
+
SwVbaStyles::SwVbaStyles( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel )
: SwVbaStyles_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new StyleCollectionHelper( xModel ) ) ), mxModel( xModel )
{
diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx
index 2efbe29ca4f3..286bb25a8325 100644
--- a/sw/source/ui/vba/vbatables.cxx
+++ b/sw/source/ui/vba/vbatables.cxx
@@ -61,6 +61,8 @@ static bool lcl_isInHeaderFooter( const uno::Reference< text::XTextTable >& xTab
typedef std::vector< uno::Reference< text::XTextTable > > XTextTableVec;
+namespace {
+
class TableCollectionHelper : public ::cppu::WeakImplHelper< container::XIndexAccess,
container::XNameAccess >
{
@@ -154,6 +156,8 @@ public:
};
+}
+
SwVbaTables::SwVbaTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument ) : SwVbaTables_BASE( xParent, xContext , uno::Reference< container::XIndexAccess >( new TableCollectionHelper( xDocument ) ) ), mxDocument( xDocument )
{
}
diff --git a/sw/source/ui/vba/vbatablesofcontents.cxx b/sw/source/ui/vba/vbatablesofcontents.cxx
index ffc9503db46b..c6cc23e6e155 100644
--- a/sw/source/ui/vba/vbatablesofcontents.cxx
+++ b/sw/source/ui/vba/vbatablesofcontents.cxx
@@ -27,6 +27,8 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+namespace {
+
class TablesOfContentsEnumWrapper : public EnumerationHelper_BASE
{
uno::Reference< container::XIndexAccess > mxIndexAccess;
@@ -104,6 +106,8 @@ public:
}
};
+}
+
SwVbaTablesOfContents::SwVbaTablesOfContents( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDoc ) : SwVbaTablesOfContents_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TableOfContentsCollectionHelper( xParent, xContext, xDoc ) ) ), mxTextDocument( xDoc )
{
}
diff --git a/sw/source/ui/vba/vbatabstops.cxx b/sw/source/ui/vba/vbatabstops.cxx
index e0c71c9e94e4..567ee1234a4f 100644
--- a/sw/source/ui/vba/vbatabstops.cxx
+++ b/sw/source/ui/vba/vbatabstops.cxx
@@ -43,6 +43,8 @@ static void lcl_setTabStops( const uno::Reference< beans::XPropertySet >& xParaP
xParaProps->setPropertyValue("ParaTabStops", uno::makeAny( aSeq ) );
}
+namespace {
+
class TabStopsEnumWrapper : public EnumerationHelper_BASE
{
uno::Reference< container::XIndexAccess > mxIndexAccess;
@@ -108,6 +110,8 @@ public:
}
};
+}
+
SwVbaTabStops::SwVbaTabStops( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& xParaProps ) : SwVbaTabStops_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TabStopCollectionHelper( xParent, xContext, xParaProps ) ) ), mxParaProps( xParaProps )
{
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c69b3e2d889f..19f36171f443 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1442,6 +1442,8 @@ void SwDocShell::UpdateChildWindows()
pRed->ReInitDlg( this );
}
+namespace {
+
// #i48748#
class SwReloadFromHtmlReader : public SwReader
{
@@ -1455,6 +1457,8 @@ class SwReloadFromHtmlReader : public SwReader
}
};
+}
+
void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcView )
{
bool bModified = IsModified();
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index cb580785e8a8..ac664eb11527 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -544,6 +544,8 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
}
}
+namespace {
+
class ApplyStyle
{
public:
@@ -576,6 +578,8 @@ private:
bool const m_bModified;
};
+}
+
IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
{
SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 4326445cd8ec..61898b1f074c 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -89,6 +89,8 @@ using namespace com::sun::star;
// In addition now there is the Bit bPhysical. In case this Bit is
// TRUE, the Pool-Formatnames are not being submitted.
+namespace {
+
class SwImplShellAction
{
SwWrtShell* pSh;
@@ -100,6 +102,8 @@ public:
SwImplShellAction& operator=(const SwImplShellAction&) = delete;
};
+}
+
SwImplShellAction::SwImplShellAction( SwDoc& rDoc )
{
if( rDoc.GetDocShell() )
diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx
index 2f7c1ba08a25..9a01a8437958 100644
--- a/sw/source/uibase/app/mainwn.cxx
+++ b/sw/source/uibase/app/mainwn.cxx
@@ -25,6 +25,8 @@
class SwDocShell;
+namespace {
+
struct SwProgress
{
long nStartValue,
@@ -33,6 +35,8 @@ struct SwProgress
std::unique_ptr<SfxProgress> pProgress;
};
+}
+
static std::vector<std::unique_ptr<SwProgress>> *pProgressContainer = nullptr;
static SwProgress *lcl_SwFindProgress( SwDocShell const *pDocShell )
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index d0454dc5f20c..da6ee493a414 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -158,6 +158,8 @@ public:
}
};
+namespace {
+
class StoredChapterNumberingExport
: public SvXMLExport
{
@@ -382,6 +384,8 @@ public:
}
};
+}
+
void ExportStoredChapterNumberingRules(SwChapterNumRules & rRules,
SvStream & rStream, OUString const& rFileName)
{
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index c899b6cbd70b..32eaa13fb153 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -234,6 +234,8 @@ public:
};
+namespace {
+
/// Listens to removed data sources, and if it's one that's embedded into this document, triggers embedding removal.
class SwDataSourceRemovedListener : public cppu::WeakImplHelper<sdb::XDatabaseRegistrationsListener>
{
@@ -250,6 +252,8 @@ public:
void Dispose();
};
+}
+
SwDataSourceRemovedListener::SwDataSourceRemovedListener(SwDBManager& rDBManager)
: m_pDBManager(&rDBManager)
{
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index 7a60a41fff79..1ca6be629095 100644
--- a/sw/source/uibase/dbui/mmconfigitem.cxx
+++ b/sw/source/uibase/dbui/mmconfigitem.cxx
@@ -69,6 +69,8 @@ const char cDataCommandType[] = "DataSource/DataCommandType";
#define IMAP_PORT 143
#define IMAP_SECURE_PORT 993
+namespace {
+
struct DBAddressDataAssignment
{
SwDBData aDBData;
@@ -83,6 +85,8 @@ struct DBAddressDataAssignment
{}
};
+}
+
class SwMailMergeConfigItem_Impl : public utl::ConfigItem
{
friend class SwMailMergeConfigItem;
@@ -1593,6 +1597,8 @@ SwView* SwMailMergeConfigItem::GetSourceView()
return m_pSourceView;
}
+namespace {
+
//This implements XSelectionChangeListener and XDispatch because the
//broadcaster uses this combo to determine if to send the database-changed
//update. Its probably that listening to statusChanged at some other level is
@@ -1631,6 +1637,8 @@ public:
}
};
+}
+
void SwMailMergeConfigItem::SetSourceView(SwView* pView)
{
if (m_xDBChangedListener.is())
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 3030c714e182..31af40a2011c 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -63,6 +63,8 @@ using namespace ::com::sun::star;
const short RET_EDIT = 100;
+namespace {
+
struct TextBlockInfo_Impl
{
OUString const sTitle;
@@ -72,6 +74,8 @@ struct TextBlockInfo_Impl
: sTitle(rTitle), sLongName(rLongName), sGroupName(rGroupName) {}
};
+}
+
// Dialog for edit templates
void SwGlossaryHdl::GlossaryDlg()
{
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index bcb5f60babe1..51cc3ffdbaeb 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -176,6 +176,8 @@ void collectUIInformation(const OUString& rAction, const OUString& aParameters)
#define DDE_TXT_ENCODING osl_getThreadTextEncoding()
+namespace {
+
class SwTransferDdeLink : public ::sfx2::SvBaseLink
{
OUString sName;
@@ -205,6 +207,8 @@ public:
void Disconnect( bool bRemoveDataAdvise );
};
+}
+
/// Tracks the boundaries of pasted content and notifies listeners.
class SwPasteContext
{
@@ -221,6 +225,8 @@ private:
sal_Int32 m_nStartContent = 0;
};
+namespace {
+
// helper class for Action and Undo enclosing
class SwTrnsfrActionAndUndo
{
@@ -247,6 +253,8 @@ public:
}
};
+}
+
SwTransferable::SwTransferable( SwWrtShell& rSh )
: m_pWrtShell( &rSh ),
m_pCreatorView( nullptr ),
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.cxx b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
index ac843adaf2e7..04a785fae4ea 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
@@ -34,6 +34,8 @@
namespace sw { namespace sidebarwindows {
+namespace {
+
// helper class: Primitive for discrete visualisation
class AnchorPrimitive : public drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D
{
@@ -82,6 +84,8 @@ public:
DeclPrimitive2DIDBlock()
};
+}
+
void AnchorPrimitive::create2DDecomposition(
drawinglayer::primitive2d::Primitive2DContainer& rContainer,
const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 73950af7db24..6177ee855679 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1345,6 +1345,8 @@ void SwPostItMgr::RemoveSidebarWin()
PreparePageContainer();
}
+namespace {
+
class FilterFunctor
{
public:
@@ -1510,6 +1512,8 @@ public:
}
};
+}
+
// copy to new vector, otherwise RemoveItem would operate and delete stuff on mvPostItFields as well
// RemoveItem will clean up the core field and visible postit if necessary
// we cannot just delete everything as before, as postits could move into change tracking
diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.cxx b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
index 374d26231310..584af296928b 100644
--- a/sw/source/uibase/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
@@ -32,6 +32,8 @@ namespace sw { namespace sidebarwindows {
// helper SwPostItShadowPrimitive
+namespace {
+
// Used to allow view-dependent primitive definition. For that purpose, the
// initially created primitive (this one) always has to be view-independent,
// but the decomposition is made view-dependent. Very simple primitive which
@@ -67,6 +69,8 @@ public:
DeclPrimitive2DIDBlock()
};
+}
+
void ShadowPrimitive::create2DDecomposition(
drawinglayer::primitive2d::Primitive2DContainer& rContainer,
const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const
diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index ecce8ef56950..e20fbc4f2a4e 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -37,6 +37,8 @@
namespace sw { namespace sidebarwindows {
+namespace {
+
// declaration and implementation of <SvxEditSource>
// for <::accessibility::AccessibleTextHelper> instance
class SidebarTextEditSource : public SvxEditSource,
@@ -63,6 +65,8 @@ class SidebarTextEditSource : public SvxEditSource,
SvxDrawOutlinerViewForwarder mViewForwarder;
};
+}
+
SidebarTextEditSource::SidebarTextEditSource( SidebarTextControl& rSidebarTextControl )
: SvxEditSource()
, mrSidebarTextControl( rSidebarTextControl )
@@ -123,6 +127,8 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify&, rNotify, void)
}
}
+namespace {
+
// declaration and implementation of accessible context for <SidebarTextControl> instance
class SidebarTextControlAccessibleContext : public VCLXAccessibleComponent
{
@@ -152,6 +158,8 @@ class SidebarTextControlAccessibleContext : public VCLXAccessibleComponent
void defunc();
};
+}
+
SidebarTextControlAccessibleContext::SidebarTextControlAccessibleContext( SidebarTextControl& rSidebarTextControl )
: VCLXAccessibleComponent( rSidebarTextControl.GetWindowPeer() )
, maMutex()
diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx
index c892032b6e52..bd51ff8cea36 100644
--- a/sw/source/uibase/docvw/SidebarWinAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx
@@ -28,6 +28,8 @@
namespace sw { namespace sidebarwindows {
+namespace {
+
// declaration and implementation of accessible context for <SidebarWinAccessible> instance
class SidebarWinAccessibleContext : public VCLXAccessibleComponent
{
@@ -89,6 +91,8 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
::osl::Mutex maMutex;
};
+}
+
// implementation of accessible for <SwAnnotationWin> instance
SidebarWinAccessible::SidebarWinAccessible( sw::annotation::SwAnnotationWin& rSidebarWin,
SwViewShell& rViewShell,
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index eccca960fc43..65b70130f11a 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -288,6 +288,8 @@ static const char* FMT_USERVAR_ARY[] =
FMT_USERVAR_CMD
};
+namespace {
+
// field types and subtypes
struct SwFieldPack
{
@@ -300,6 +302,8 @@ struct SwFieldPack
size_t const nFormatLength;
};
+}
+
// strings and formats
static const SwFieldPack aSwFields[] =
{
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx
index 52ee334ec21d..f110c5f5fe7a 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -62,6 +62,8 @@ static void lcl_ActivateTextShell( SwWrtShell & rWrtSh )
rWrtSh.EnterStdMode();
}
+namespace {
+
class SwKeepConversionDirectionStateContext
{
public:
@@ -79,6 +81,8 @@ public:
}
};
+}
+
SwHHCWrapper::SwHHCWrapper(
SwView* pSwView,
const uno::Reference< uno::XComponentContext >& rxContext,
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index f62059f661e5..6ca3ce946f71 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -443,6 +443,8 @@ void SwScrollNaviPopup::statusChanged( const css::frame::FeatureStateEvent& rEve
}
}
+namespace {
+
class SwZoomBox_Impl : public ComboBox
{
sal_uInt16 const nSlotId;
@@ -461,6 +463,8 @@ protected:
};
+}
+
SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
: ComboBox(pParent, WB_HIDE | WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL)
, nSlotId(nSlot)
@@ -605,6 +609,8 @@ VclPtr<vcl::Window> SwPreviewZoomControl::CreateItemWindow( vcl::Window *pParent
return pRet.get();
}
+namespace {
+
class SwJumpToSpecificBox_Impl : public NumericField
{
sal_uInt16 const nSlotId;
@@ -617,6 +623,8 @@ protected:
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
};
+}
+
SwJumpToSpecificBox_Impl::SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
: NumericField(pParent, WB_HIDE | WB_BORDER)
, nSlotId(nSlot)
@@ -659,6 +667,8 @@ VclPtr<vcl::Window> SwJumpToSpecificPageControl::CreateItemWindow( vcl::Window *
return pRet.get();
}
+namespace {
+
class NavElementBox_Impl;
class NavElementToolBoxControl : public svt::ToolboxController,
public lang::XServiceInfo
@@ -719,6 +729,8 @@ private:
void ReleaseFocus_Impl();
};
+}
+
NavElementBox_Impl::NavElementBox_Impl(
vcl::Window* _pParent,
const uno::Reference< frame::XFrame >& _xFrame,
@@ -961,6 +973,8 @@ lo_writer_NavElementToolBoxController_get_implementation(
return cppu::acquire( new NavElementToolBoxControl( rxContext ) );
}
+namespace {
+
class PrevNextScrollToolboxController : public svt::ToolboxController,
public css::lang::XServiceInfo
{
@@ -993,6 +1007,8 @@ private:
Type const meType;
};
+}
+
PrevNextScrollToolboxController::PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index e40ee2807de4..c77d65430b12 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -140,6 +140,8 @@ static void lcl_InvalidateZoomSlots(SfxBindings& rBindings)
rBindings.Invalidate( aInval );
}
+namespace {
+
// At first the zoom dialog
class SwPreviewZoomDlg : public weld::GenericDialogController
{
@@ -167,6 +169,8 @@ public:
}
};
+}
+
// all for SwPagePreviewWin
SwPagePreviewWin::SwPagePreviewWin( vcl::Window *pParent, SwPagePreview& rPView )
: Window(pParent, WinBits(WB_CLIPCHILDREN))
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 3d85fb02edb0..e4390317d5ed 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -597,6 +597,8 @@ void SwView::StartThesaurus()
// Offer online suggestions
+namespace {
+
//!! Start of extra code for context menu modifying extensions
struct ExecuteInfo
{
@@ -611,6 +613,8 @@ public:
DECL_STATIC_LINK( AsyncExecute, ExecuteHdl_Impl, void*, void );
};
+}
+
IMPL_STATIC_LINK( AsyncExecute, ExecuteHdl_Impl, void*, p, void )
{
ExecuteInfo* pExecuteInfo = static_cast<ExecuteInfo*>(p);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index f7367f429ab9..e266692f9c9b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1366,6 +1366,8 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage()
return mxXDrawPage;
}
+namespace {
+
class SwDrawPagesObj : public cppu::WeakImplHelper<
css::drawing::XDrawPages,
css::lang::XServiceInfo>
@@ -1420,6 +1422,8 @@ public:
}
};
+}
+
// XDrawPagesSupplier
uno::Reference<drawing::XDrawPages> SAL_CALL SwXTextDocument::getDrawPages()
diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx
index 348ffb5f0297..2659f4a7e9c1 100644
--- a/sw/source/uibase/utlui/bookctrl.cxx
+++ b/sw/source/uibase/utlui/bookctrl.cxx
@@ -39,6 +39,8 @@
SFX_IMPL_STATUSBAR_CONTROL( SwBookmarkControl, SfxStringItem );
+namespace {
+
class BookmarkPopup_Impl : public PopupMenu
{
public:
@@ -52,6 +54,8 @@ private:
virtual void Select() override;
};
+}
+
BookmarkPopup_Impl::BookmarkPopup_Impl() :
PopupMenu(),
nCurId(USHRT_MAX)
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 468ba6cbfa16..c651a86df0f3 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3808,6 +3808,8 @@ bool NaviContentBookmark::Paste( TransferableDataHelper& rData )
return bRet;
}
+namespace {
+
class SwContentLBoxString : public SvLBoxString
{
public:
@@ -3817,6 +3819,8 @@ public:
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
};
+}
+
void SwContentTree::InitEntry(SvTreeListEntry* pEntry,
const OUString& rStr ,const Image& rImg1,const Image& rImg2)
{
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 1859e70579dd..788d999f21f6 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -114,6 +114,8 @@ static const char* aHelpForMenu[] =
HID_GLBLTREEUPD_ALL //CTX_UPDATE_ALL
};
+namespace {
+
class SwGlobalFrameListener_Impl : public SfxListener
{
bool bValid;
@@ -129,6 +131,8 @@ public:
bool IsValid() const {return bValid;}
};
+}
+
void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if( rHint.GetId() == SfxHintId::Dying)
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index 9dd2a26a2a03..444babfcbc36 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -37,6 +37,8 @@
#define GLOS_TIMEOUT 30000 // update every 30 seconds
#define FIND_MAX_GLOS 20
+namespace {
+
struct TripleString
{
OUString sGroup;
@@ -58,6 +60,8 @@ public:
weld::TreeView& GetTreeView() {return *m_xListLB;}
};
+}
+
SwGlossDecideDlg::SwGlossDecideDlg(weld::Window* pParent)
: GenericDialogController(pParent, "modules/swriter/ui/selectautotextdialog.ui", "SelectAutoTextDialog")
, m_xOk(m_xBuilder->weld_button("ok"))
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index 2ab9883d231f..c944f01c2602 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -37,6 +37,8 @@
SFX_IMPL_STATUSBAR_CONTROL( SwTemplateControl, SfxStringItem );
+namespace {
+
class SwTemplatePopup_Impl : public PopupMenu
{
public:
@@ -50,6 +52,8 @@ private:
virtual void Select() override;
};
+}
+
SwTemplatePopup_Impl::SwTemplatePopup_Impl() :
PopupMenu(),
nCurId(USHRT_MAX)
diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index 76f4baedaba5..14070c71ef8e 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -39,6 +39,8 @@
const long nReadOnlyScrollOfst = 10;
+namespace {
+
class ShellMoveCursor
{
SwWrtShell* pSh;
@@ -63,6 +65,8 @@ public:
}
};
+}
+
void SwWrtShell::MoveCursor( bool bWithSelect )
{
ResetCursorStack();
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 82d7c27cb0c6..a3e4d08b3e03 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -213,6 +213,8 @@ void SwWrtShell::UpdateInputFields( SwInputFieldList* pLst )
}
}
+namespace {
+
// Listener class: will close InputField dialog if input field(s)
// is(are) deleted (for instance, by an extension) after the dialog shows up.
// Otherwise, the for loop in SwWrtShell::UpdateInputFields will crash when doing:
@@ -268,6 +270,8 @@ class FieldDeletionModify : public SwModify
SwFormatField* mpFormatField;
};
+}
+
// Start input dialog for a specific field
bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton,
weld::Widget* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton)