diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-19 16:32:49 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-22 12:57:32 +0100 |
commit | f853ec317f6af1b8c65cc5bd758371689c75118d (patch) | |
tree | b86d729bf9a9465ee619ead3b5635efa62a1804e /sd | |
parent | f31d36966bceb90e261cbecd42634bde4448d527 (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 'sd')
55 files changed, 335 insertions, 11 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index cfcf3241e2b9..1e40d9645627 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -944,6 +944,8 @@ void SdTiledRenderingTest::testResizeTableColumn() pXmlDoc = nullptr; } +namespace { + /// A view callback tracks callbacks invoked on one specific view. class ViewCallback { @@ -1072,6 +1074,8 @@ public: } }; +} + void SdTiledRenderingTest::testViewCursors() { // Create two views. diff --git a/sd/source/core/CustomAnimationCloner.cxx b/sd/source/core/CustomAnimationCloner.cxx index 3049abb60d5c..03e38cf7c5f5 100644 --- a/sd/source/core/CustomAnimationCloner.cxx +++ b/sd/source/core/CustomAnimationCloner.cxx @@ -51,6 +51,8 @@ using ::com::sun::star::beans::NamedValue; namespace sd { + namespace { + class CustomAnimationClonerImpl { public: @@ -69,6 +71,8 @@ namespace sd std::vector< Reference< XAnimationNode > > maCloneNodeVector; }; + } + CustomAnimationClonerImpl::CustomAnimationClonerImpl() { } diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 1a08b9b4d7de..f940e44645ae 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2692,6 +2692,8 @@ void EffectSequenceHelper::setTextGroupingAuto( const CustomAnimationTextGroupPt notify_listeners(); } +namespace { + struct ImplStlTextGroupSortHelper { explicit ImplStlTextGroupSortHelper( bool bReverse ) : mbReverse( bReverse ) {}; @@ -2700,6 +2702,8 @@ struct ImplStlTextGroupSortHelper sal_Int32 getTargetParagraph( const CustomAnimationEffectPtr& p1 ); }; +} + sal_Int32 ImplStlTextGroupSortHelper::getTargetParagraph( const CustomAnimationEffectPtr& p1 ) { const Any aTarget(p1->getTarget()); @@ -2772,12 +2776,16 @@ void EffectSequenceHelper::removeListener( ISequenceListener* pListener ) maListeners.remove( pListener ); } +namespace { + struct stl_notify_listeners_func { stl_notify_listeners_func() {} void operator()(ISequenceListener* pListener) { pListener->notify_change(); } }; +} + void EffectSequenceHelper::notify_listeners() { stl_notify_listeners_func aFunc; @@ -2928,6 +2936,8 @@ void EffectSequenceHelper::processAfterEffect( const Reference< XAnimationNode > } } +namespace { + class AnimationChangeListener : public cppu::WeakImplHelper< XChangesListener > { public: @@ -2939,6 +2949,8 @@ private: MainSequence* mpMainSequence; }; +} + void SAL_CALL AnimationChangeListener::changesOccurred( const css::util::ChangesEvent& ) { if( mpMainSequence ) diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 8f73d7bb8883..cac5a8896fd0 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -47,13 +47,17 @@ using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::drawing::XShape; using ::com::sun::star::beans::NamedValue; +namespace { + struct deprecated_FadeEffect_conversion_table_entry { FadeEffect const meFadeEffect; const sal_Char* mpPresetId; +}; + } -const deprecated_FadeEffect_conversion_table[] = +deprecated_FadeEffect_conversion_table_entry const deprecated_FadeEffect_conversion_table[] = { // OOo 1.x transitions { FadeEffect_FADE_FROM_LEFT, "wipe-right" }, @@ -213,13 +217,18 @@ FadeEffect EffectMigration::GetFadeEffect( const SdPage* pPage ) return FadeEffect_NONE; } +namespace { + struct deprecated_AnimationEffect_conversion_table_entry { AnimationEffect const meEffect; const sal_Char* mpPresetId; const sal_Char* mpPresetSubType; +}; + } -const deprecated_AnimationEffect_conversion_table[] = + +deprecated_AnimationEffect_conversion_table_entry const deprecated_AnimationEffect_conversion_table[] = { // OOo 1.x entrance effects { AnimationEffect_APPEAR, "ooo-entrance-appear",nullptr }, diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx index 554dc4318786..5edfaae9b317 100644 --- a/sd/source/core/annotations/Annotation.cxx +++ b/sd/source/core/annotations/Annotation.cxx @@ -57,6 +57,8 @@ using namespace ::com::sun::star; namespace sd { +namespace { + class Annotation : private ::cppu::BaseMutex, public ::cppu::WeakComponentImplHelper< XAnnotation>, public ::cppu::PropertySetMixin< XAnnotation > @@ -181,6 +183,8 @@ protected: AnnotationData maRedoData; }; +} + void createAnnotation( Reference< XAnnotation >& xAnnotation, SdPage* pPage ) { xAnnotation.set( diff --git a/sd/source/core/annotations/AnnotationEnumeration.cxx b/sd/source/core/annotations/AnnotationEnumeration.cxx index 669205825f58..018de9b379b2 100644 --- a/sd/source/core/annotations/AnnotationEnumeration.cxx +++ b/sd/source/core/annotations/AnnotationEnumeration.cxx @@ -33,6 +33,8 @@ using namespace ::com::sun::star::lang; namespace sd { +namespace { + class AnnotationEnumeration: public ::cppu::WeakImplHelper< css::office::XAnnotationEnumeration > { public: @@ -51,6 +53,8 @@ private: AnnotationVector::iterator maIter; }; +} + Reference< XAnnotationEnumeration > createAnnotationEnumeration( const sd::AnnotationVector& rAnnotations ) { return new AnnotationEnumeration( rAnnotations ); diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 99647b42aab0..f9942b1d3d27 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -60,6 +60,8 @@ using namespace ::com::sun::star; every page in the bookmark document/list */ +namespace { + class InsertBookmarkAsPage_FindDuplicateLayouts { public: @@ -70,6 +72,8 @@ private: std::vector<OUString> &mrLayoutsToTransfer; }; +} + void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc, SdPage const * pBMMPage, bool bRenameDuplicates, SdDrawDocument* pBookmarkDoc ) { // now check for duplicate masterpage and layout names diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index ffbd3ff1041f..cff2714a3d75 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -178,6 +178,8 @@ SdPage::~SdPage() ClearSdrObjList(); } +namespace { + struct OrdNumSorter { bool operator()( SdrObject const * p1, SdrObject const * p2 ) @@ -186,6 +188,8 @@ struct OrdNumSorter } }; +} + /** returns the nIndex'th object from the given PresObjKind, index starts with 1 */ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearch /* = false */ ) { @@ -1199,6 +1203,8 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) const int MAX_PRESOBJS = 7; // maximum number of presentation objects per layout const int VERTICAL = 0x8000; +namespace { + struct LayoutDescriptor { PresObjKind meKind[MAX_PRESOBJS]; @@ -1207,6 +1213,8 @@ struct LayoutDescriptor LayoutDescriptor( int k0 = 0, int k1 = 0, int k2 = 0, int k3 = 0, int k4 = 0, int k5 = 0, int k6 = 0 ); }; +} + LayoutDescriptor::LayoutDescriptor( int k0, int k1, int k2, int k3, int k4, int k5, int k6 ) { meKind[0] = static_cast<PresObjKind>(k0 & (~VERTICAL)); mbVertical[0] = (k0 & VERTICAL) == VERTICAL; diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx index 8689e154a614..89efeebaebd2 100644 --- a/sd/source/core/text/textapi.cxx +++ b/sd/source/core/text/textapi.cxx @@ -42,6 +42,8 @@ using namespace ::com::sun::star::container; namespace sd { +namespace { + class UndoTextAPIChanged : public SdrUndoAction { public: @@ -56,6 +58,8 @@ protected: rtl::Reference< TextApiObject > mxTextObj; }; +} + UndoTextAPIChanged::UndoTextAPIChanged(SdrModel& rModel, TextApiObject* pTextObj ) : SdrUndoAction( rModel ) , mpOldText( pTextObj->CreateText() ) @@ -79,6 +83,8 @@ void UndoTextAPIChanged::Redo() } } +namespace { + struct TextAPIEditSource_Impl { SdDrawDocument* mpDoc; @@ -86,6 +92,8 @@ struct TextAPIEditSource_Impl SvxOutlinerForwarder* mpTextForwarder; }; +} + class TextAPIEditSource : public SvxEditSource { // refcounted diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index e03db4c9ddd3..1cd19b23c1f8 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -3035,6 +3035,8 @@ void PPTWriter::WriteCString( SvStream& rSt, const OUString& rString, sal_uInt32 } } +namespace { + class ContainerGuard { private: @@ -3051,6 +3053,8 @@ public: } }; +} + void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape > const & rXShape, EscherSolverContainer& aSolverContainer, EscherPropertyContainer& aPropOpt ) { diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 9ef75df597ad..9789e20a343c 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -152,8 +152,6 @@ enum PPTXLayout LAYOUT_SIZE }; -} - struct PPTXLayoutInfo { int const nType; @@ -161,6 +159,8 @@ struct PPTXLayoutInfo const char* sType; }; +} + static const PPTXLayoutInfo aLayoutInfo[LAYOUT_SIZE] = { { 20, "Blank Slide", "blank" }, diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index d16491dff288..c1f920362b81 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -59,6 +59,8 @@ using namespace ::com::sun::star::ucb; using namespace com::sun::star::ui::dialogs; using namespace ::sfx2; +namespace { + class SdGRFFilter_ImplInteractionHdl : public ::cppu::WeakImplHelper< css::task::XInteractionHandler > { css::uno::Reference< css::task::XInteractionHandler > m_xInter; @@ -76,6 +78,8 @@ class SdGRFFilter_ImplInteractionHdl : public ::cppu::WeakImplHelper< css::task: virtual void SAL_CALL handle( const css::uno::Reference< css::task::XInteractionRequest >& ) override; }; +} + void SdGRFFilter_ImplInteractionHdl::handle( const css::uno::Reference< css::task::XInteractionRequest >& xRequest ) { if( !m_xInter.is() ) diff --git a/sd/source/filter/html/HtmlOptionsDialog.cxx b/sd/source/filter/html/HtmlOptionsDialog.cxx index ec523e2c86aa..5db49c2af647 100644 --- a/sd/source/filter/html/HtmlOptionsDialog.cxx +++ b/sd/source/filter/html/HtmlOptionsDialog.cxx @@ -38,6 +38,8 @@ using namespace com::sun::star::ui::dialogs; #include <pres.hxx> #include <sdabstdlg.hxx> +namespace { + class SdHtmlOptionsDialog : public cppu::WeakImplHelper < XExporter, @@ -80,6 +82,8 @@ public: }; +} + SdHtmlOptionsDialog::SdHtmlOptionsDialog() : meDocType ( DocumentType::Draw ) { diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx index 751e5db0b63f..cb382303287f 100644 --- a/sd/source/filter/html/buttonset.cxx +++ b/sd/source/filter/html/buttonset.cxx @@ -45,6 +45,8 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; +namespace { + class ButtonsImpl { public: @@ -60,6 +62,8 @@ private: Reference< XStorage > mxStorage; }; +} + ButtonsImpl::ButtonsImpl( const OUString& rURL ) { try diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index ad8e2a97eae6..77189e3d543d 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -114,6 +114,8 @@ const char * const pButtonNames[] = #define BTN_MORE 10 #define BTN_LESS 11 +namespace { + // Helper class for the simple creation of files local/remote class EasyFile { @@ -131,6 +133,8 @@ public: void close(); }; +} + // Helper class for the embedding of text attributes into the html output class HtmlState { diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 7623d34a115d..6026e78c67aa 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -335,6 +335,8 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes return rOut; } +namespace { + // Dialog for the entry of the name of the design class SdDesignNameDlg : public weld::GenericDialogController { @@ -348,6 +350,8 @@ public: DECL_LINK(ModifyHdl, weld::Entry&, void); }; +} + // SdPublishingDlg Methods SdPublishingDlg::SdPublishingDlg(weld::Window* pWindow, DocumentType eDocType) diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 89af5b41019c..c2f30fa880e4 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1475,12 +1475,16 @@ void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlide } } +namespace { + // Import of pages struct Ppt97AnimationStlSortHelper { bool operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 ); }; +} + bool Ppt97AnimationStlSortHelper::operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 ) { if( !p1.second.get() || !p2.second.get() ) diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index fa0cced78971..586d6ba9dbdc 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -34,6 +34,8 @@ using namespace ::com::sun::star::style; +namespace { + class SdTransformOOo2xDocument { public: @@ -65,6 +67,8 @@ public: SdrOutliner& mrOutliner; }; +} + /** transforms the given model from OOo 2.x to OOo 3.x. This maps the deprecated EE_PARA_BULLETSTATE and clears the EE_PARA_LRSPACE if used together with a EE_PARA_NUMBULLET */ diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index f23eabd0f6c8..90e0e4f120fa 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -126,6 +126,8 @@ char const sXML_import_draw_styles_ooo_service[] = "com.sun.star.comp.Draw.XMLSt char const sXML_import_draw_content_ooo_service[] = "com.sun.star.comp.Draw.XMLContentImporter"; char const sXML_import_draw_settings_ooo_service[] = "com.sun.star.comp.Draw.XMLSettingsImporter"; +namespace { + struct XML_SERVICEMAP { const sal_Char* mpService; @@ -140,6 +142,8 @@ struct XML_SERVICES const sal_Char* mpSettings; }; +} + static XML_SERVICES const * getServices( bool bImport, bool bDraw, sal_uLong nStoreVer ) { static XML_SERVICES const gServices[] = diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index ce7c3abad3f6..af0204877141 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -60,6 +60,8 @@ using namespace ::com::sun::star::accessibility; namespace accessibility { +namespace { + struct XShapePosCompareHelper { bool operator() ( const uno::Reference<drawing::XShape>& xshape1, @@ -74,6 +76,9 @@ struct XShapePosCompareHelper return false; } }; + +} + //===== internal ============================================================ AccessibleDrawDocumentView::AccessibleDrawDocumentView ( diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 1052b7b89e9c..b9015ddb4c58 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -88,6 +88,8 @@ using ::com::sun::star::beans::XPropertySet; namespace sd { +namespace { + class PresetPropertyBox : public PropertySubControl { public: @@ -105,6 +107,8 @@ private: Link<LinkParamNone*,void> const maModifyLink; }; +} + PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl( nControlType ), maModifyLink(rModifyHdl) { @@ -174,6 +178,8 @@ SdPropertySubControl::~SdPropertySubControl() { } +namespace { + class SdPresetPropertyBox : public SdPropertySubControl { public: @@ -190,6 +196,8 @@ private: DECL_LINK(OnSelect, weld::ComboBox&, void); }; +} + SdPresetPropertyBox::SdPresetPropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const OUString& aPresetId, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyLink(rModifyHdl) @@ -253,6 +261,8 @@ Any SdPresetPropertyBox::getValue() return makeAny(maPropertyValues[nIndex]); } +namespace { + class ColorPropertyBox : public PropertySubControl { public: @@ -269,6 +279,8 @@ private: Link<LinkParamNone*,void> const maModifyLink; }; +} + ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl( nControlType ), maModifyLink(rModifyHdl) { @@ -314,6 +326,8 @@ Control* ColorPropertyBox::getControl() return mpControl; } +namespace { + class SdColorPropertyBox : public SdPropertySubControl { public: @@ -329,6 +343,8 @@ private: DECL_LINK(OnSelect, ColorListBox&, void); }; +} + SdColorPropertyBox::SdColorPropertyBox(weld::Label* pLabel, weld::Container* pParent, weld::Window* pTopLevel, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyLink(rModifyHdl) @@ -366,6 +382,8 @@ Any SdColorPropertyBox::getValue() return makeAny(sal_Int32(mxControl->GetSelectEntryColor().GetRGBColor())); } +namespace { + class FontPropertyBox : public PropertySubControl { public: @@ -383,6 +401,8 @@ private: DECL_LINK(ControlSelectHdl, ComboBox&, void); }; +} + FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl( nControlType ), maModifyHdl(rModifyHdl) { @@ -446,6 +466,8 @@ Control* FontPropertyBox::getControl() return mpControl; } +namespace { + class SdFontPropertyBox : public SdPropertySubControl { public: @@ -461,6 +483,8 @@ private: DECL_LINK(ControlSelectHdl, weld::ComboBox&, void); }; +} + SdFontPropertyBox::SdFontPropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyHdl(rModifyHdl) @@ -524,6 +548,8 @@ Any SdFontPropertyBox::getValue() return makeAny(aFontName); } +namespace { + class DropdownMenuBox : public Edit { public: @@ -542,6 +568,8 @@ private: VclPtr<PopupMenu> mpMenu; }; +} + DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, PopupMenu* pMenu ) : Edit( pParent, WB_BORDER|WB_TABSTOP| WB_DIALOGCONTROL ), mpSubControl(pSubControl),mpDropdownButton(nullptr),mpMenu(pMenu) @@ -606,6 +634,8 @@ bool DropdownMenuBox::PreNotify( NotifyEvent& rNEvt ) return bResult; } +namespace { + class CharHeightPropertyBox : public PropertySubControl { public: @@ -628,6 +658,8 @@ private: Link<LinkParamNone*,void> const maModifyHdl; }; +} + CharHeightPropertyBox::CharHeightPropertyBox(sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : PropertySubControl(nControlType) , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/fontsizemenu.ui", "") @@ -685,6 +717,8 @@ Control* CharHeightPropertyBox::getControl() return mpControl; } +namespace { + class SdCharHeightPropertyBox : public SdPropertySubControl { public: @@ -703,6 +737,8 @@ private: DECL_LINK(EditModifyHdl, weld::MetricSpinButton&, void); }; +} + SdCharHeightPropertyBox::SdCharHeightPropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyHdl(rModifyHdl) @@ -748,6 +784,8 @@ Any SdCharHeightPropertyBox::getValue() return makeAny(static_cast<double>(mxMetric->get_value(FieldUnit::PERCENT)) / 100.0); } +namespace { + class TransparencyPropertyBox : public PropertySubControl { public: @@ -771,6 +809,8 @@ private: Link<LinkParamNone*,void> const maModifyHdl; }; +} + TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl( nControlType ) , maModifyHdl( rModifyHdl ) @@ -847,6 +887,8 @@ Control* TransparencyPropertyBox::getControl() return mpControl; } +namespace { + class SdTransparencyPropertyBox : public SdPropertySubControl { public: @@ -867,6 +909,8 @@ private: std::unique_ptr<weld::MenuButton> mxControl; }; +} + SdTransparencyPropertyBox::SdTransparencyPropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyHdl(rModifyHdl) @@ -932,6 +976,8 @@ Any SdTransparencyPropertyBox::getValue() return makeAny(static_cast<double>(mxMetric->get_value(FieldUnit::PERCENT)) / 100.0); } +namespace { + class RotationPropertyBox : public PropertySubControl { public: @@ -956,6 +1002,8 @@ private: Link<LinkParamNone*,void> const maModifyHdl; }; +} + RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl(nControlType) , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/rotatemenu.ui", "") @@ -1051,6 +1099,8 @@ Control* RotationPropertyBox::getControl() return mpControl; } +namespace { + class SdRotationPropertyBox : public SdPropertySubControl { public: @@ -1071,6 +1121,8 @@ private: std::unique_ptr<weld::MenuButton> mxControl; }; +} + SdRotationPropertyBox::SdRotationPropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyHdl(rModifyHdl) @@ -1150,6 +1202,8 @@ Any SdRotationPropertyBox::getValue() return makeAny(static_cast<double>(mxMetric->get_value(FieldUnit::DEGREE))); } +namespace { + class ScalePropertyBox : public PropertySubControl { public: @@ -1175,6 +1229,8 @@ private: int mnDirection; }; +} + ScalePropertyBox::ScalePropertyBox(sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : PropertySubControl( nControlType ) , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/scalemenu.ui", "") @@ -1328,6 +1384,8 @@ Control* ScalePropertyBox::getControl() return mpControl; } +namespace { + class SdScalePropertyBox : public SdPropertySubControl { public: @@ -1349,6 +1407,8 @@ private: std::unique_ptr<weld::MenuButton> mxControl; }; +} + SdScalePropertyBox::SdScalePropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl) : SdPropertySubControl(pParent) , maModifyHdl( rModifyHdl ) @@ -1487,6 +1547,8 @@ Any SdScalePropertyBox::getValue() return makeAny( aValues ); } +namespace { + class FontStylePropertyBox : public PropertySubControl { public: @@ -1514,6 +1576,8 @@ private: sal_Int16 mnFontUnderline; }; +} + FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : PropertySubControl(nControlType) , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/fontstylemenu.ui", "") @@ -1607,6 +1671,8 @@ Control* FontStylePropertyBox::getControl() return mpControl; } +namespace { + class SdFontStylePropertyBox : public SdPropertySubControl { public: @@ -1629,6 +1695,8 @@ private: std::unique_ptr<weld::MenuButton> mxControl; }; +} + SdFontStylePropertyBox::SdFontStylePropertyBox(weld::Label* pLabel, weld::Container* pParent, const Any& rValue, const Link<LinkParamNone*,void>& rModifyHdl ) : SdPropertySubControl(pParent) , maModifyHdl( rModifyHdl ) diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 717232b014e2..d312cebef4e9 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -351,6 +351,8 @@ std::unique_ptr<SvLBoxItem> CustomAnimationListEntryItem::Clone(SvLBoxItem const return nullptr; } +namespace { + class CustomAnimationListEntry : public SvTreeListEntry { public: @@ -363,6 +365,8 @@ private: CustomAnimationEffectPtr const mpEffect; }; +} + CustomAnimationListEntry::CustomAnimationListEntry() { } @@ -372,6 +376,8 @@ CustomAnimationListEntry::CustomAnimationListEntry(const CustomAnimationEffectPt { } +namespace { + class CustomAnimationTriggerEntryItem : public SvLBoxString { public: @@ -387,6 +393,8 @@ private: static const long nIconWidth = 19; }; +} + CustomAnimationTriggerEntryItem::CustomAnimationTriggerEntryItem( const OUString& aDescription ) : SvLBoxString( aDescription ), msDescription( aDescription ) { diff --git a/sd/source/ui/animations/SlideTransitionBox.cxx b/sd/source/ui/animations/SlideTransitionBox.cxx index 6e54ed52b0d6..c4ebe697f529 100644 --- a/sd/source/ui/animations/SlideTransitionBox.cxx +++ b/sd/source/ui/animations/SlideTransitionBox.cxx @@ -27,6 +27,8 @@ namespace sd { +namespace { + class SlideTransitionBox : public VclVBox { VclPtr<SlideTransitionPane> m_pPane; @@ -40,6 +42,8 @@ public: virtual void StateChanged(StateChangedType nStateChange) override; }; +} + VCL_BUILDER_FACTORY(SlideTransitionBox); SlideTransitionBox::SlideTransitionBox(vcl::Window* pParent) diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 3d616c990247..babab59d9b11 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -369,6 +369,8 @@ size_t getPresetOffset( const sd::impl::TransitionEffect &rEffect ) namespace sd { +namespace { + class TransitionPane : public ValueSet { public: @@ -389,6 +391,8 @@ public: } }; +} + // SlideTransitionPane SlideTransitionPane::SlideTransitionPane( Window * pParent, diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 53f141e80c76..3021c6616796 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -67,6 +67,8 @@ namespace sd const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32; static const int DRGPIX = 2; // Drag MinMove in Pixel +namespace { + class PathDragMove : public SdrDragMove { private: @@ -97,6 +99,8 @@ public: rtl::Reference <MotionPathTag > mxTag; }; +} + void PathDragMove::createSdrDragEntries() { // call parent @@ -130,6 +134,8 @@ bool PathDragMove::EndSdrDrag(bool /*bCopy*/) return true; } +namespace { + class PathDragResize : public SdrDragResize { private: @@ -158,6 +164,8 @@ public: rtl::Reference <MotionPathTag > mxTag; }; +} + void PathDragResize::createSdrDragEntries() { // call parent @@ -189,6 +197,8 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/) return true; } +namespace { + class PathDragObjOwn : public SdrDragObjOwn { private: @@ -212,6 +222,8 @@ public: virtual bool EndSdrDrag(bool bCopy) override; }; +} + void PathDragObjOwn::createSdrDragEntries() { // call parent @@ -241,6 +253,8 @@ bool PathDragObjOwn::EndSdrDrag(bool /*bCopy*/) } } +namespace { + class SdPathHdl : public SmartHdl { public: @@ -253,6 +267,8 @@ private: SdrPathObj* const mpPathObj; }; +} + SdPathHdl::SdPathHdl( const SmartTagReference& xTag, SdrPathObj* pPathObj ) : SmartHdl( xTag, pPathObj->GetCurrentBoundRect().TopLeft(), SdrHdlKind::SmartTag ) , mpPathObj( pPathObj ) diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index bbec5d9223c6..098a2a816cd7 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -86,6 +86,8 @@ static OUString getInitials( const OUString& rName ) return sInitials.makeStringAndClear(); } +namespace { + class AnnotationDragMove : public SdrDragMove { public: @@ -100,6 +102,8 @@ private: Point maOrigin; }; +} + AnnotationDragMove::AnnotationDragMove(SdrDragView& rNewView, const rtl::Reference <AnnotationTag >& xTag) : SdrDragMove(rNewView) , mxTag( xTag ) @@ -147,6 +151,8 @@ void AnnotationDragMove::CancelSdrDrag() Hide(); } +namespace { + class AnnotationHdl : public SmartHdl { public: @@ -160,6 +166,8 @@ private: rtl::Reference< AnnotationTag > mxTag; }; +} + AnnotationHdl::AnnotationHdl( const SmartTagReference& xTag, const Reference< XAnnotation >& xAnnotation, const Point& rPnt ) : SmartHdl( xTag, rPnt, SdrHdlKind::SmartTag ) , mxAnnotation( xAnnotation ) diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index c78f1a3ef126..fd9d27da3d1d 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -37,6 +37,8 @@ SFX_IMPL_STATUSBAR_CONTROL( SdTemplateControl, SfxStringItem ); // class SdTemplatePopup_Impl -------------------------------------------------- +namespace { + class SdTemplatePopup_Impl : public PopupMenu { public: @@ -50,6 +52,8 @@ private: virtual void Select() override; }; +} + SdTemplatePopup_Impl::SdTemplatePopup_Impl() : PopupMenu(), nCurId(USHRT_MAX) diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index 161ff808773d..8706e506472a 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -29,6 +29,8 @@ namespace sd // Composed of a dropdown button in the toolbar and a // popup menu to select the value +namespace { + class DisplayModeController : public svt::PopupWindowController { public: @@ -74,6 +76,8 @@ struct snewfoil_value_info const char* msUnoCommand; }; +} + static const snewfoil_value_info editmodes[] = { {1, diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index fc64f7439d78..12d741224787 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -48,6 +48,8 @@ using namespace ::com::sun::star::beans; namespace sd { +namespace { + class LayoutToolbarMenu : public svtools::ToolbarMenu { public: @@ -73,6 +75,8 @@ struct snewfoil_value_info_layout AutoLayout const maAutoLayout; }; +} + static const snewfoil_value_info_layout notes[] = { {BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, AUTOLAYOUT_NOTES}, diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index d30af2b22110..b53d25c72946 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -52,6 +52,8 @@ namespace sd { +namespace { + class PresLayoutPreview : public weld::CustomWidgetController { private: @@ -76,16 +78,24 @@ public: } +} + // tab page for slide & header'n'notes namespace sd { const int nDateTimeFormatsCount = 12; + +namespace { + struct DateAndTimeFormat { SvxDateFormat const meDateFormat; SvxTimeFormat const meTimeFormat; }; + +} + DateAndTimeFormat const nDateTimeFormats[nDateTimeFormatsCount] = { { SvxDateFormat::A, SvxTimeFormat::AppDefault }, diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index b9607094810c..e9fd852cb40f 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -28,6 +28,8 @@ #include <paragr.hxx> #include <sdattr.hrc> +namespace { + class SdParagraphNumTabPage : public SfxTabPage { public: @@ -48,6 +50,8 @@ private: DECL_LINK( ImplNewStartHdl, weld::Button&, void ); }; +} + SdParagraphNumTabPage::SdParagraphNumTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttr) : SfxTabPage(pPage, pController, "modules/sdraw/ui/paranumberingtab.ui", "DrawParaNumbering", &rAttr) , mbModified(false) diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index cfa6db43d316..e75508e344ac 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -664,6 +664,8 @@ void FrameworkHelper::RunOnResourceActivation( } } +namespace { + /** A callback that sets a flag to a specified value when the callback is called. */ @@ -676,6 +678,8 @@ private: bool& mrFlag; }; +} + void FrameworkHelper::RequestSynchronousUpdate() { rtl::Reference<ConfigurationController> pCC ( diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx index 83eb7c79f793..c3164529864c 100644 --- a/sd/source/ui/presenter/PresenterCanvas.cxx +++ b/sd/source/ui/presenter/PresenterCanvas.cxx @@ -46,7 +46,7 @@ namespace { typedef ::cppu::WeakComponentImplHelper < css::rendering::XCustomSprite > PresenterCustomSpriteInterfaceBase; -} + class PresenterCustomSprite : protected ::cppu::BaseMutex, public PresenterCustomSpriteInterfaceBase @@ -92,6 +92,8 @@ private: void ThrowIfDisposed(); }; +} + //===== PresenterCanvas ======================================================= PresenterCanvas::PresenterCanvas ( diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index f731d25504bd..16113f5f709f 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -57,6 +57,8 @@ using namespace sd; #ifdef LINUX_BLUETOOTH +namespace { + struct DBusObject { OString maBusName; OString maPath; @@ -83,6 +85,8 @@ struct DBusObject { } }; +} + static std::unique_ptr<DBusObject> getBluez5Adapter(DBusConnection *pConnection); struct sd::BluetoothServer::Impl { diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index bacfa1c5f261..3ac6020987b6 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -68,6 +68,8 @@ using ::sd::framework::FrameworkHelper; namespace sd { namespace sidebar { +namespace { + struct snewfoil_value_info { const char* msBmpResId; @@ -76,6 +78,8 @@ struct snewfoil_value_info AutoLayout const maAutoLayout; }; +} + static const snewfoil_value_info notes[] = { {BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB, diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index 80ce031e76b3..3dfa4204fd08 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -77,12 +77,16 @@ private: bool mbIsPrecious; }; +namespace { + class CacheHash { public: size_t operator()(const BitmapCache::CacheKey& p) const { return reinterpret_cast<size_t>(p); } }; +} + class BitmapCache::CacheBitmapContainer : public std::unordered_map<CacheKey, CacheEntry, CacheHash> { diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx index f16a4b8f6ce2..bf387210f0c8 100644 --- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx @@ -25,6 +25,8 @@ namespace sd { namespace slidesorter { namespace cache { +namespace { + /** This class extends the actual request data with additional information that is used by the priority queues. */ @@ -76,6 +78,8 @@ public: RequestPriorityClass const meClass; }; +} + class RequestQueue::Container : public ::std::set< Request, diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index f86e07942100..23378029bb91 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -174,6 +174,8 @@ private: const bool mbIsMouseOverIndicatorAllowed; }; +namespace { + /** This is the default handler for processing events. It activates the multi selection or drag-and-drop when the right conditions are met. */ @@ -280,6 +282,8 @@ private: std::unique_ptr<DragAndDropContext, o3tl::default_delete<DragAndDropContext>> mpDragAndDropContext; }; +} + //===== SelectionFunction ===================================================== diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 32a8e8c2bc6b..1772bf8c7f00 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -82,6 +82,8 @@ namespace { }; } +namespace { + class BackgroundPainter : public ILayerPainter { @@ -105,6 +107,7 @@ private: Color maBackgroundColor; }; +} SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter) : ::sd::View ( diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx index fb80dc9ec127..a4cf7fdf613f 100644 --- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx @@ -218,6 +218,8 @@ protected: InsertPosition& rPosition) const; }; +namespace { + /** The vertical layouter has one column and as many rows as there are pages. */ @@ -285,6 +287,8 @@ protected: const Size& rWindowSize) const override; }; +} + //===== Layouter ============================================================== Layouter::Layouter ( diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index c0b1be827bb8..bea6a35797f3 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -419,6 +419,8 @@ IMPL_LINK(TableDesignWidget,EventMultiplexerListener, } } +namespace { + struct CellInfo { Color maCellColor; @@ -428,6 +430,8 @@ struct CellInfo explicit CellInfo( const Reference< XStyle >& xStyle ); }; +} + CellInfo::CellInfo( const Reference< XStyle >& xStyle ) : maBorder(std::make_shared<SvxBoxItem>(SDRATTR_TABLE_BORDER)) { @@ -457,6 +461,8 @@ CellInfo::CellInfo( const Reference< XStyle >& xStyle ) typedef std::vector< std::shared_ptr< CellInfo > > CellInfoVector; typedef std::shared_ptr< CellInfo > CellInfoMatrix[nPreviewColumns * nPreviewRows]; +namespace { + struct TableStyleSettings { bool mbUseFirstRow; @@ -475,6 +481,8 @@ struct TableStyleSettings , mbUseColumnBanding(false) {} }; +} + static void FillCellInfoVector( const Reference< XIndexAccess >& xTableStyle, CellInfoVector& rVector ) { DBG_ASSERT( xTableStyle.is() && (xTableStyle->getCount() == sdr::table::style_count ), "sd::FillCellInfoVector(), invalid table style!" ); diff --git a/sd/source/ui/uitest/uiobject.cxx b/sd/source/ui/uitest/uiobject.cxx index 1e18071092c9..e1bb16b8dd1c 100644 --- a/sd/source/ui/uitest/uiobject.cxx +++ b/sd/source/ui/uitest/uiobject.cxx @@ -16,6 +16,8 @@ #include <svx/uiobject.hxx> +namespace { + class ImpressSdrObject : public SdrUIObject { public: @@ -29,8 +31,6 @@ private: OUString const maName; }; -namespace { - sd::DrawViewShell* getViewShell(const VclPtr<sd::Window>& xWindow) { sd::DrawViewShell* pViewShell = dynamic_cast<sd::DrawViewShell*>(xWindow->GetViewShell()); diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 701c5462bae6..e30b28a740b1 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -66,6 +66,8 @@ using namespace ::com::sun::star::i18n; namespace sd { + namespace { + class DocumentSettings : public WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >, public comphelper::PropertySetHelper, public DocumentSettingsSerializer @@ -121,6 +123,8 @@ namespace sd rtl::Reference<SdXImpressDocument> mxModel; }; + } + Reference< XInterface > DocumentSettings_createInstance( SdXImpressDocument* pModel ) throw () { diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx index 64fcfd6b32b5..84b66f19bc05 100644 --- a/sd/source/ui/unoidl/randomnode.cxx +++ b/sd/source/ui/unoidl/randomnode.cxx @@ -66,6 +66,9 @@ namespace sd { typedef ::cppu::WeakImplHelper< XTimeContainer, XEnumerationAccess, XCloneable, XServiceInfo, XInitialization > RandomAnimationNodeBase; + +namespace { + class RandomAnimationNode : public RandomAnimationNodeBase { public: @@ -151,6 +154,8 @@ private: Reference< XAnimate > mxFirstNode; }; +} + Reference< XInterface > RandomAnimationNode_createInstance( sal_Int16 nPresetClass ) { Reference< XInterface > xInt( static_cast<XWeak*>( new RandomAnimationNode( nPresetClass ) ) ); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6f7510488a30..ca60d3821e88 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -126,6 +126,8 @@ using namespace ::cppu; using namespace ::com::sun::star; using namespace ::sd; +namespace { + class SdUnoForbiddenCharsTable : public SvxUnoForbiddenCharsTable, public SfxListener { @@ -142,6 +144,8 @@ private: SdrModel* mpModel; }; +} + SdUnoForbiddenCharsTable::SdUnoForbiddenCharsTable( SdrModel* pModel ) : SvxUnoForbiddenCharsTable( pModel->GetForbiddenCharsTable() ), mpModel( pModel ) { @@ -1484,6 +1488,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SdXImpressDocument::getRenderer( return aRenderer; } +namespace { + class ImplRenderPaintProc : public sdr::contact::ViewObjectContactRedirector { const SdrLayerAdmin& rLayerAdmin; @@ -1505,6 +1511,8 @@ public: const sdr::contact::DisplayInfo& rDisplayInfo) override; }; +} + ImplRenderPaintProc::ImplRenderPaintProc( const SdrLayerAdmin& rLA, SdrPageView* pView, vcl::PDFExtOutDevData* pData ) : ViewObjectContactRedirector(), rLayerAdmin ( rLA ), diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 328e50f0aba0..534bdbd29981 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2538,6 +2538,8 @@ void SdGenericDrawPage::setNavigationOrder( const Any& rValue ) throw IllegalArgumentException(); } +namespace { + class SdNavigationOrderAccess : public ::cppu::WeakImplHelper< XIndexAccess > { public: @@ -2555,6 +2557,8 @@ private: std::vector< Reference< XShape > > maShapes; }; +} + SdNavigationOrderAccess::SdNavigationOrderAccess( SdrPage const * pPage ) : maShapes( pPage ? pPage->GetObjCount() : 0 ) { diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx index 6b91088aeab2..7345dc45dfb7 100644 --- a/sd/source/ui/unoidl/unopool.cxx +++ b/sd/source/ui/unoidl/unopool.cxx @@ -42,6 +42,8 @@ static LanguageType SdUnoGetLanguage( const lang::Locale& rLocale ) return eRet; } +namespace { + class SdUnoDrawPool : public SvxUnoDrawPool { public: @@ -54,6 +56,8 @@ private: SdDrawDocument* mpDrawModel; }; +} + SdUnoDrawPool::SdUnoDrawPool(SdDrawDocument* pModel) : SvxUnoDrawPool( pModel ), mpDrawModel( pModel ) { diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 45177d2adfd4..0312bb56d413 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -52,6 +52,8 @@ static const SfxItemPropertyMapEntry* ImplGetSearchPropertyMap() return aSearchPropertyMap_Impl; } +namespace { + class SearchContext_impl { uno::Reference< drawing::XShapes > mxShapes; @@ -79,6 +81,8 @@ public: } }; +} + /* ================================================================= */ /** this class implements a search or replace operation on a given page or a given sdrobj diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 664609e87597..d1f037bf2b69 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -230,8 +230,6 @@ OUString getWeightString(SfxItemSet const & rItemSet) return sWeightString; } -} // end anonymous namespace - class ClassificationCommon { protected: @@ -539,8 +537,6 @@ public: } }; -namespace -{ void lcl_convertStringArguments(sal_uInt16 nSlot, std::unique_ptr<SfxItemSet>& pArgs) { Color aColor; diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 53fc3cfa941d..789d46eafce3 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -76,6 +76,7 @@ namespace sd { bool DrawViewShell::mbPipette = false; +namespace { class ScannerEventListener : public ::cppu::WeakImplHelper< lang::XEventListener > { @@ -93,6 +94,8 @@ public: void ParentDestroyed() { mpParent = nullptr; } }; +} + void SAL_CALL ScannerEventListener::disposing( const lang::EventObject& /*rEventObject*/ ) { if( mpParent ) diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 0abaff31fc9f..56df6e5d2caf 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -149,6 +149,8 @@ View::~View() } } +namespace { + class ViewRedirector : public sdr::contact::ViewObjectContactRedirector { public: @@ -161,6 +163,8 @@ public: const sdr::contact::DisplayInfo& rDisplayInfo) override; }; +} + ViewRedirector::ViewRedirector() { } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index ef22fde0f15b..825094382c98 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -60,6 +60,7 @@ namespace sd { using namespace ::com::sun::star; +namespace { struct SdNavigatorDropEvent : public ExecuteDropEvent { @@ -73,6 +74,8 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent {} }; +} + css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDataObject() { // since SdTransferable::CopyToClipboard is called, this diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index d1873a6b73aa..c74845cc836d 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -84,12 +84,16 @@ namespace sd { |* \************************************************************************/ +namespace { + struct ImpRememberOrigAndClone { SdrObject* pOrig; SdrObject* pClone; }; +} + static SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone>& aConnectorContainer, SdrObject const * pConnObj) { for(const ImpRememberOrigAndClone& rImp : aConnectorContainer) diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 8b5814749529..3dc5260944a2 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -51,8 +51,12 @@ using namespace ::com::sun::star::uno; namespace sd { +namespace { + class ImageButtonHdl; +} + static const sal_uInt16 gButtonSlots[] = { SID_INSERT_TABLE, SID_INSERT_DIAGRAM, SID_INSERT_GRAPHIC, SID_INSERT_AVMEDIA }; static const char* gButtonToolTips[] = { STR_INSERT_TABLE, STR_INSERT_CHART, STR_INSERT_PICTURE, STR_INSERT_MOVIE }; @@ -108,6 +112,8 @@ static BitmapEx* getButtonImage( int index, bool large ) const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32; +namespace { + class ChangePlaceholderTag : public SmartTag { friend class ImageButtonHdl; @@ -154,6 +160,8 @@ private: Size maImageSize; }; +} + ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag /*, sal_uInt16 nSID, const Image& rImage, const Image& rImageMO*/, const Point& rPnt ) : SmartHdl( xTag, rPnt, SdrHdlKind::SmartTag ) , mxChangePlaceholderTag( dynamic_cast< ChangePlaceholderTag* >( xTag.get() ) ) diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 5df5c54de71e..9697c3de8461 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -1154,6 +1154,8 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const } } +namespace { + class KeepSlideSorterInSyncWithPageChanges { sd::slidesorter::view::SlideSorterView::DrawLock m_aDrawLock; @@ -1171,6 +1173,8 @@ public: } }; +} + void ViewShell::ImpSidUndo(SfxRequest& rReq) { //The xWatcher keeps the SlideSorter selection in sync |