diff options
Diffstat (limited to 'sfx2/source')
42 files changed, 230 insertions, 8 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 208c23aca8b5..8b9ca9e6f413 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -76,6 +76,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; +namespace { class SfxEventAsyncer_Impl : public SfxListener { @@ -89,6 +90,7 @@ public: DECL_LINK( IdleHdl, Timer*, void ); }; +} void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) { diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 3b2234e8545b..68ee31f76b89 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -72,6 +72,8 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star; +namespace { + class SfxTerminateListener_Impl : public ::cppu::WeakImplHelper< XTerminateListener, XServiceInfo > { public: @@ -87,6 +89,8 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; }; +} + void SAL_CALL SfxTerminateListener_Impl::disposing( const EventObject& ) { } diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 5ef87f45cc91..5f6fb65c3684 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -117,6 +117,7 @@ void SetTemplate_Impl( const OUString &rFileName, pDoc->ResetFromTemplate( rLongName, rFileName ); } +namespace { class SfxDocPasswordVerifier : public ::comphelper::IDocPasswordVerifier { @@ -134,6 +135,7 @@ private: Reference< embed::XStorage > mxStorage; }; +} ::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData ) { diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a7013fa6c530..602b24967d5c 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -64,6 +64,7 @@ struct SfxChildWindow_Impl SfxWorkWindow* pWorkWin; }; +namespace { class DisposeListener : public ::cppu::WeakImplHelper< css::lang::XEventListener > { @@ -107,6 +108,7 @@ class DisposeListener : public ::cppu::WeakImplHelper< css::lang::XEventListener SfxChildWindow_Impl* m_pData ; }; +} bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize ) { diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 25097d480440..39cd6629b12a 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -47,6 +47,8 @@ using namespace ::com::sun::star::uno; namespace sfx2 { +namespace { + class SvDDELinkEditDialog : public weld::GenericDialogController { std::unique_ptr<weld::Entry> m_xEdDdeApp; @@ -60,6 +62,8 @@ public: OUString GetCmd() const; }; +} + SvDDELinkEditDialog::SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const * pLink) : GenericDialogController(pParent, "sfx/ui/linkeditdialog.ui", "LinkEditDialog") , m_xEdDdeApp(m_xBuilder->weld_entry("app")) diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4f9c109a23d1..fb8746e834fd 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -60,6 +60,8 @@ using ::com::sun::star::util::XCloseable; namespace sfx2 { +namespace { + class SvxInternalLink : public sfx2::SvLinkSource { public: @@ -68,6 +70,8 @@ public: virtual bool Connect( sfx2::SvBaseLink* ) override; }; +} + LinkManager::LinkManager(SfxObjectShell* p) : pPersist( p ) { diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 98c347713dfb..9bfab2bfa4d8 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -33,6 +33,7 @@ using namespace ::com::sun::star::uno; namespace sfx2 { +namespace { class SvLinkSourceTimer : public Timer { @@ -42,6 +43,8 @@ public: explicit SvLinkSourceTimer( SvLinkSource * pOwn ); }; +} + SvLinkSourceTimer::SvLinkSourceTimer( SvLinkSource * pOwn ) : pOwner( pOwn ) { @@ -65,6 +68,7 @@ static void StartTimer( std::unique_ptr<SvLinkSourceTimer>& pTimer, SvLinkSource } } +namespace { struct SvLinkSource_Entry_Impl { @@ -119,6 +123,8 @@ public: bool IsValidCurrValue( SvLinkSource_Entry_Impl const * pEntry ); }; +} + SvLinkSource_EntryIter_Impl::SvLinkSource_EntryIter_Impl( const SvLinkSource_Array_Impl& rArr ) : rOrigArr( rArr ), nPos( 0 ) diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 9d234bf82c81..ab0119053021 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -40,9 +40,12 @@ using namespace ::com::sun::star::uno; namespace sfx2 { +namespace { class ImplDdeItem; +} + struct BaseLink_Impl { Link<SvBaseLink&,void> m_aEndEditLink; @@ -89,6 +92,7 @@ struct ImplBaseLinkData } }; +namespace { class ImplDdeItem : public DdeGetPutItem { @@ -119,6 +123,7 @@ public: bool IsInDTOR() const { return bIsInDTOR; } }; +} SvBaseLink::SvBaseLink() : pImpl ( new BaseLink_Impl ), diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index c34308afb72d..945d24a1f63b 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -243,6 +243,8 @@ namespace sfx2 // struct IndexEntry_Impl ------------------------------------------------ +namespace { + struct IndexEntry_Impl { bool const m_bSubEntry; @@ -263,6 +265,8 @@ struct ContentEntry_Impl aURL( rURL ), bIsFolder( bFolder ) {} }; +} + // ContentListBox_Impl --------------------------------------------------- ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle) diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index c0a14425ebc8..45e9ee0861f4 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -31,6 +31,8 @@ #include <sfx2/viewsh.hxx> #include <sfx2/strings.hrc> +namespace { + class URITools { private: @@ -47,6 +49,8 @@ public: void openURI(const OUString& sURI, bool bHandleSystemShellExecuteException); }; +} + void URITools::openURI(const OUString& sURI, bool bHandleSystemShellExecuteException) { if (comphelper::LibreOfficeKit::isActive()) diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index c4c1735f6418..2158acdcc7fd 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -102,6 +102,8 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::system; +namespace { + class NoHelpErrorBox { private: @@ -122,6 +124,8 @@ public: } }; +} + IMPL_STATIC_LINK_NOARG(NoHelpErrorBox, HelpRequestHdl, weld::Widget&, bool) { // do nothing, because no help available @@ -329,12 +333,16 @@ static bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor ) return bRet; } +namespace { + class SfxHelp_Impl { public: static OUString GetHelpText( const OUString& aCommandURL, const OUString& rModule ); }; +} + OUString SfxHelp_Impl::GetHelpText( const OUString& aCommandURL, const OUString& rModule ) { // create help url @@ -994,6 +1002,8 @@ namespace } } +namespace { + class HelpManualMessage : public weld::MessageDialogController { private: @@ -1013,6 +1023,8 @@ public: bool GetOfflineHelpPopUp() const { return !m_xHideOfflineHelpCB->get_active(); } }; +} + bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const OUString& rKeyword) { OUStringBuffer aHelpRootURL("vnd.sun.star.help://"); diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 5feb326243fc..f372857c286a 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -63,12 +63,16 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +namespace { + struct ResIdToResName { ToolbarId const eId; const char* pName; }; +} + static const ResIdToResName pToolBarResToName[] = { { ToolbarId::FullScreenToolbox, "fullscreenbar" }, diff --git a/sfx2/source/bastyp/fltlst.cxx b/sfx2/source/bastyp/fltlst.cxx index d1f1199ff7e7..ef9e333129b8 100644 --- a/sfx2/source/bastyp/fltlst.cxx +++ b/sfx2/source/bastyp/fltlst.cxx @@ -34,6 +34,7 @@ using namespace ::com::sun::star; +namespace { class SfxRefreshListener : public ::cppu::WeakImplHelper<css::util::XRefreshListener> { @@ -59,6 +60,8 @@ class SfxRefreshListener : public ::cppu::WeakImplHelper<css::util::XRefreshList } }; +} + /*-************************************************************************************************************ @short ctor @descr These initialize an instance of a SfxFilterListener class. Created object listen automatically diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 246a10d32ca5..a05abc6cb7cf 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -78,6 +78,8 @@ typedef std::vector<SfxShell*> SfxShellStack_Impl; +namespace { + struct SfxToDo_Impl { SfxShell* pCluster; @@ -104,6 +106,8 @@ struct SfxObjectBars_Impl SfxObjectBars_Impl() : eId(ToolbarId::None), nPos(0), nFlags(SfxVisibilityFlags::Invisible) {} }; +} + struct SfxDispatcher_Impl { //When the dispatched is locked, SfxRequests accumulate in aReqArr for diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index f87b4fbbb10e..3a459dd5551e 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -50,6 +50,8 @@ SfxCompareSlots_bsearch( const void* pSmaller, const void* pBigger ) } +namespace { + struct SfxObjectUI_Impl { sal_uInt16 const nPos; @@ -68,6 +70,8 @@ struct SfxObjectUI_Impl } }; +} + struct SfxInterface_Impl { std::vector<std::unique_ptr<SfxObjectUI_Impl>> diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index f9a11830e925..1eef3824302d 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -704,6 +704,8 @@ IMPL_LINK(BackingWindow, EditTemplateHdl, ThumbnailViewItem*, pItem, void) } } +namespace { + struct ImplDelayedDispatch { Reference< XDispatch > xDispatch; @@ -720,6 +722,8 @@ struct ImplDelayedDispatch } }; +} + static void implDispatchDelayed( void*, void* pArg ) { struct ImplDelayedDispatch* pDispatch = static_cast<ImplDelayedDispatch*>(pArg); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 85d46610b73a..1abf3e3d3d91 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1153,6 +1153,8 @@ CustomPropertiesYesNoButton::~CustomPropertiesYesNoButton() { } +namespace { + class DurationDialog_Impl : public weld::GenericDialogController { std::unique_ptr<weld::CheckButton> m_xNegativeCB; @@ -1169,6 +1171,8 @@ public: util::Duration GetDuration() const; }; +} + DurationDialog_Impl::DurationDialog_Impl(weld::Widget* pParent, const util::Duration& rDuration) : GenericDialogController(pParent, "sfx/ui/editdurationdialog.ui", "EditDurationDialog") , m_xNegativeCB(m_xBuilder->weld_check_button("negative")) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index faa103d55e04..ff2e65a21507 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -62,6 +62,8 @@ using namespace ::com::sun::star; // - Add new slot definitions to sfx.sdi static const int NUM_OF_DOCKINGWINDOWS = 10; +namespace { + class SfxTitleDockingWindow : public SfxDockingWindow { VclPtr<vcl::Window> m_pWrappedWindow; @@ -83,8 +85,6 @@ public: virtual void Resizing( Size& rSize ) override; }; -namespace -{ struct WindowState { OUString sTitle; diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 8db8f4f8bdad..ea77aa764317 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -134,6 +134,8 @@ namespace sfx2 // which a given filter may belong to typedef ::std::map< OUString, FilterGroup::iterator > FilterGroupEntryReferrer; + namespace { + /// a descriptor for a filter class (which in the final dialog is represented by one filter entry) struct FilterClass { @@ -141,6 +143,8 @@ namespace sfx2 Sequence< FilterName > aSubFilters; // the (logical) names of the filter which belong to the class }; + } + typedef ::std::list< FilterClass > FilterClassList; typedef ::std::map< OUString, FilterClassList::iterator > FilterClassReferrer; @@ -159,6 +163,7 @@ namespace sfx2 aClassDesc.getNodeValue( "Filters" ) >>= _rClass.aSubFilters; } + namespace { struct CreateEmptyClassRememberPos { @@ -219,6 +224,7 @@ namespace sfx2 } }; + } static void lcl_ReadGlobalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rGlobalClasses, std::vector<OUString>& _rGlobalClassNames ) { @@ -258,6 +264,7 @@ namespace sfx2 ); } + namespace { struct ReadLocalFilter { @@ -284,6 +291,7 @@ namespace sfx2 } }; + } static void lcl_ReadLocalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rLocalClasses ) { @@ -326,6 +334,7 @@ namespace sfx2 // = grouping and classifying + namespace { // a struct which adds helps remembering a reference to a class entry struct ReferToFilterEntry @@ -390,6 +399,7 @@ namespace sfx2 } }; + } static const sal_Unicode s_cWildcardSeparator( ';' ); @@ -398,6 +408,7 @@ namespace sfx2 return ";"; } + namespace { struct CheckAppendSingleWildcard { @@ -455,6 +466,7 @@ namespace sfx2 } }; + } AppendWildcardToDescriptor::AppendWildcardToDescriptor( const OUString& _rWildCard ) { @@ -519,6 +531,8 @@ namespace sfx2 MapGroupEntry2GroupEntry; // this is not really a map - it's just called this way because it is used as a map + namespace { + struct FindGroupEntry { FilterGroupEntryReferrer::mapped_type const aLookingFor; @@ -551,6 +565,7 @@ namespace sfx2 } }; + } static void lcl_GroupAndClassify( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rAllFilters ) { @@ -703,6 +718,7 @@ namespace sfx2 rGlobalFilters.swap( aNonEmptyGlobalFilters ); } + namespace { struct AppendFilter { @@ -734,6 +750,7 @@ namespace sfx2 } }; + } // = handling for the "all files" entry @@ -773,6 +790,7 @@ namespace sfx2 // = filling an XFilterManager + namespace { struct AppendFilterGroup { @@ -830,6 +848,7 @@ namespace sfx2 } }; + } TSortedFilterList::TSortedFilterList(const css::uno::Reference< css::container::XEnumeration >& xFilterList) : m_nIterator(0) @@ -927,6 +946,8 @@ namespace sfx2 } } + namespace { + struct ExportFilter { ExportFilter( const OUString& _aUIName, const OUString& _aWildcard ) : @@ -936,6 +957,7 @@ namespace sfx2 OUString aWildcard; }; + } void appendExportFilters( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 7d8e3b01f34c..c208cf21153a 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -84,6 +84,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::system; +namespace { + // - class PrepareListener_Impl ------------------------------------------ class PrepareListener_Impl : public ::cppu::WeakImplHelper< css::frame::XStatusListener > { @@ -100,6 +102,8 @@ public: bool IsSet() const {return m_bState;} }; +} + PrepareListener_Impl::PrepareListener_Impl() : m_bState( false ) { diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index a85f4ea1368e..abcdca034b42 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -56,6 +56,8 @@ struct TabPageImpl TabPageImpl() : mbStandard(false), mpSfxDialogController(nullptr) {} }; +namespace { + struct Data_Impl { OString const sId; // The ID @@ -76,6 +78,8 @@ struct Data_Impl } }; +} + SfxTabDialogItem::SfxTabDialogItem( const SfxTabDialogItem& rAttr, SfxItemPool* pItemPool ) : SfxSetItem( rAttr, pItemPool ) { diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 2bda9d438466..e1a42b0fcb90 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -553,9 +553,16 @@ void StyleTreeListBox_Impl::Recalc() } /** Internal structure for the establishment of the hierarchical view */ +namespace { + class StyleTree_Impl; + +} + typedef std::vector<std::unique_ptr<StyleTree_Impl>> StyleTreeArr_Impl; +namespace { + class StyleTree_Impl { private: @@ -574,6 +581,7 @@ public: StyleTreeArr_Impl& getChildren() { return pChildren; } }; +} static void MakeTree_Impl(StyleTreeArr_Impl& rArr) { diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 13d3021bc95f..4062fffba1b4 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -206,6 +206,8 @@ protected: // XmlIdRegistryDocument --------------------------------------------- +namespace { + /** non-clipboard documents */ class XmlIdRegistryDocument : public XmlIdRegistry { @@ -249,6 +251,8 @@ private: ::std::unique_ptr<XmlIdRegistry_Impl> m_pImpl; }; +} + // MetadatableUndo --------------------------------------------------- /** the horrible Undo Metadatable: is inserted into lists to track position */ @@ -300,6 +304,8 @@ public: // XmlIdRegistryClipboard -------------------------------------------- +namespace { + class XmlIdRegistryClipboard : public XmlIdRegistry { @@ -338,6 +344,7 @@ private: ::std::unique_ptr<XmlIdRegistry_Impl> m_pImpl; }; +} // XmlIdRegistry @@ -422,6 +429,8 @@ typedef ::std::vector< Metadatable* > XmlIdVector_t; typedef std::unordered_map< OUString, ::std::pair< XmlIdVector_t, XmlIdVector_t > > XmlIdMap_t; +namespace { + /// pointer hash template template<typename T> struct PtrHash { @@ -431,6 +440,8 @@ template<typename T> struct PtrHash } }; +} + /// element -> (stream name, idref) typedef std::unordered_map< const Metadatable*, ::std::pair< OUString, OUString>, PtrHash<Metadatable> > @@ -876,6 +887,8 @@ XmlIdRegistryDocument::JoinMetadatables( // Clipboard XML ID Registry (_Impl) +namespace { + struct RMapEntry { RMapEntry() : m_xLink() { } @@ -891,6 +904,8 @@ struct RMapEntry std::shared_ptr<MetadatableClipboard> m_xLink; }; +} + /// element -> (stream name, idref, source) typedef std::unordered_map< const Metadatable*, struct RMapEntry, diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 167caae41043..02744f627657 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -104,10 +104,16 @@ using namespace ::ucbhelper; #define COMMAND_TRANSFER "transfer" +namespace { + class RegionData_Impl; +} + namespace DocTempl { +namespace { + class DocTempl_EntryData_Impl { RegionData_Impl* mpParent; @@ -140,8 +146,11 @@ public: } +} + using namespace ::DocTempl; +namespace { class RegionData_Impl { @@ -179,6 +188,7 @@ public: int Compare( RegionData_Impl const * pCompareWith ) const; }; +} class SfxDocTemplate_Impl : public SvRefBase { @@ -229,6 +239,7 @@ public: const uno::Reference< XDocumentTemplates >& getDocTemplates() const { return mxTemplates; } }; +namespace { class DocTemplLocker_Impl { @@ -246,6 +257,8 @@ public: } }; +} + static SfxDocTemplate_Impl *gpTemplateData = nullptr; diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx index 68cefec38e1f..0d4caadb10c4 100644 --- a/sfx2/source/doc/docundomanager.cxx +++ b/sfx2/source/doc/docundomanager.cxx @@ -139,6 +139,8 @@ namespace sfx2 //= SolarMutexFacade + namespace { + /** a facade for the SolarMutex, implementing ::framework::IMutex */ class SolarMutexFacade : public ::framework::IMutex @@ -197,6 +199,7 @@ namespace sfx2 SolarMutexFacade m_solarMutexFacade; }; + } //= DocumentUndoManager diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 8837e9fb82a7..9aa966384297 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -300,12 +300,16 @@ SfxStyleSheetBasePool* SfxObjectShell::GetStyleSheetPool() return nullptr; } +namespace { + struct Styles_Impl { SfxStyleSheetBase *pSource; SfxStyleSheetBase *pDest; }; +} + void SfxObjectShell::LoadStyles ( SfxObjectShell &rSource /* the document template from which diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 5af5ddfdf2f0..64d9e1793a9d 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -130,6 +130,8 @@ using namespace ::com::sun::star::container; // class SfxHeaderAttributes_Impl ---------------------------------------- +namespace { + class SfxHeaderAttributes_Impl : public SvKeyValueIterator { private: @@ -152,6 +154,7 @@ public: void SetAttribute( const SvKeyValue& rKV ); }; +} sal_uInt16 const aTitleMap_Impl[3][2] = { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ff155a031383..21997d0c5c49 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -150,6 +150,8 @@ void SfxObjectShell::InitInterface_Impl() { } +namespace { + class SfxClosePreventer_Impl : public ::cppu::WeakImplHelper< css::util::XCloseListener > { bool m_bGotOwnership; @@ -170,6 +172,8 @@ public: } ; +} + SfxClosePreventer_Impl::SfxClosePreventer_Impl() : m_bGotOwnership( false ) , m_bPreventClose( true ) @@ -193,6 +197,7 @@ void SAL_CALL SfxClosePreventer_Impl::notifyClosing( const lang::EventObject& ) void SAL_CALL SfxClosePreventer_Impl::disposing( const lang::EventObject& ) {} +namespace { class SfxInstanceCloseGuard_Impl { @@ -207,6 +212,8 @@ public: bool Init_Impl( const uno::Reference< util::XCloseable >& xCloseable ); }; +} + bool SfxInstanceCloseGuard_Impl::Init_Impl( const uno::Reference< util::XCloseable >& xCloseable ) { bool bResult = false; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 1f1ead6642ed..d004c7a69e91 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -146,9 +146,6 @@ OUString lclGetVBAGlobalConstName( const Reference< XInterface >& rxComponent ) #endif -} // namespace - - class SfxModelListener_Impl : public ::cppu::WeakImplHelper< css::util::XCloseListener > { SfxObjectShell* mpDoc; @@ -160,6 +157,8 @@ public: }; +} // namespace + void SAL_CALL SfxModelListener_Impl::queryClosing( const css::lang::EventObject& , sal_Bool ) { } @@ -513,6 +512,7 @@ bool SfxObjectShell::IsInPrepareClose() const return pImpl->bInPrepareClose; } +namespace { struct BoolEnv_Impl { @@ -522,6 +522,7 @@ struct BoolEnv_Impl ~BoolEnv_Impl() { rImpl.bInPrepareClose = false; } }; +} bool SfxObjectShell::PrepareClose ( diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index b1299b57b832..6ff78214d802 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -42,6 +42,8 @@ using namespace ::com::sun::star; /// Invalid value for date to create invalid instance of TimeStamp. #define TIMESTAMP_INVALID_UTILDATE (util::Date(1, 1, 1601)) +namespace { + /** Property representing a signed 32-bit integer value. */ class SfxOleInt32Property : public SfxOlePropertyBase { @@ -221,6 +223,7 @@ private: uno::Sequence<sal_Int8> const mData; }; +} sal_uInt16 SfxOleTextEncoding::GetCodePage() const { diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 661074a9a102..ce69c37b6471 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -96,6 +96,8 @@ static Size impl_Size_Struct2Object( const awt::Size& aSize ) return aReturnValue ; } +namespace { + class SfxPrintJob_Impl : public cppu::WeakImplHelper < css::view::XPrintJob @@ -111,6 +113,8 @@ public: virtual void SAL_CALL cancelJob() override; }; +} + SfxPrintJob_Impl::SfxPrintJob_Impl( IMPL_PrintListener_DataContainer* pData ) : m_pData( pData ) { @@ -457,6 +461,7 @@ void SAL_CALL SfxPrintHelper::setPrinter(const uno::Sequence< beans::PropertyVal // ImplPrintWatch thread for asynchronous printing with moving temp. file to ucb location +namespace { /* This implements a thread which will be started to wait for asynchronous print jobs to temp. locally files. If they finish we move the temp. files @@ -569,6 +574,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread } }; +} // XPrintable diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 74b1497829bc..c841644cc98c 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -155,6 +155,8 @@ using ::com::sun::star::document::XUndoManager; using ::com::sun::star::document::XUndoAction; using ::com::sun::star::frame::XModel; +namespace { + /** This Listener is used to get notified when the XDocumentProperties of the XModel change. */ @@ -173,6 +175,8 @@ public: virtual void SAL_CALL modified( const lang::EventObject& ) override; }; +} + void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& ) { SolarMutexGuard aSolarGuard; @@ -316,6 +320,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument // static member initialization. sal_Int64 IMPL_SfxBaseModel_DataContainer::g_nInstanceCounter = 0; +namespace { // Listener that forwards notifications from the PrintHelper to the "real" listeners class SfxPrintHelperListener_Impl : public ::cppu::WeakImplHelper< view::XPrintJobListener > @@ -330,6 +335,8 @@ public: virtual void SAL_CALL printJobEvent( const view::PrintJobEvent& rEvent ) override; }; +} + void SAL_CALL SfxPrintHelperListener_Impl::disposing( const lang::EventObject& ) { m_pData->m_xPrintable = nullptr; @@ -346,6 +353,8 @@ void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent( const view::PrintJobEv } } +namespace { + // SfxOwnFramesLocker ==================================================================================== // allows to lock all the frames related to the provided SfxObjectShell class SfxOwnFramesLocker @@ -358,6 +367,8 @@ public: ~SfxOwnFramesLocker(); }; +} + SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell const * pObjectShell ) { if ( !pObjectShell ) @@ -440,6 +451,8 @@ vcl::Window* SfxOwnFramesLocker::GetVCLWindow( const Reference< frame::XFrame >& return pWindow; } +namespace { + // SfxSaveGuard ==================================================================================== class SfxSaveGuard { @@ -457,6 +470,8 @@ class SfxSaveGuard ~SfxSaveGuard(); }; +} + SfxSaveGuard::SfxSaveGuard(const Reference< frame::XModel >& xModel , IMPL_SfxBaseModel_DataContainer* pData) : m_xModel ( xModel ) diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index 9b2403d00e46..838e948eacda 100644 --- a/sfx2/source/doc/sfxmodelfactory.cxx +++ b/sfx2/source/doc/sfxmodelfactory.cxx @@ -57,6 +57,9 @@ namespace sfx2 typedef ::cppu::WeakImplHelper < XSingleServiceFactory , XServiceInfo > SfxModelFactory_Base; + + namespace { + /** implements a XSingleServiceFactory which can be used to created instances of classes derived from SfxBaseModel @@ -93,6 +96,7 @@ namespace sfx2 const SfxModelFactoryFunc m_pComponentFactoryFunc; }; + } //= SfxModelFactory - implementation diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 90c8c4dda017..0de62325ab66 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -89,6 +89,8 @@ static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName ); static std::vector<OUString> lcl_getAllFactoryURLs (); +namespace { + class SearchView_Keyword { public: @@ -137,6 +139,8 @@ private: FILTER_APPLICATION const meApp; }; +} + /*** * * Order items in ascending order (useful for the selection sets and move/copy operations since the associated ids diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index f2432563533f..d12a09a35a78 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -32,6 +32,7 @@ // class CntStaticPoolDefaults_Impl +namespace { class CntItemPool; @@ -69,6 +70,7 @@ public: static sal_uInt16 Release(); }; +} // static SfxItemPool* NoChaos::GetItemPool() diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx index de3eaf04ad6b..5aaacf1cb549 100644 --- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx +++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx @@ -119,6 +119,8 @@ public: } }; +namespace { + class ShortcutsToolBox : public sfx2::sidebar::SidebarToolBox { public: @@ -144,6 +146,8 @@ public: } }; +} + NotebookbarTabControl::NotebookbarTabControl( Window* pParent ) : NotebookbarTabControlBase( pParent ) , m_bInitialized( false ) diff --git a/sfx2/source/notebookbar/PriorityMergedHBox.cxx b/sfx2/source/notebookbar/PriorityMergedHBox.cxx index 328241ae67d8..0ef63410f80c 100644 --- a/sfx2/source/notebookbar/PriorityMergedHBox.cxx +++ b/sfx2/source/notebookbar/PriorityMergedHBox.cxx @@ -30,6 +30,8 @@ * PriorityMergedHBox is a VclHBox which hides its own children if there is no sufficient space. */ +namespace +{ class PriorityMergedHBox : public PriorityHBox { private: @@ -69,6 +71,7 @@ public: PriorityHBox::dispose(); } }; +} IMPL_LINK(PriorityMergedHBox, PBClickHdl, Button*, /*pButton*/, void) { diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index 2aead2974987..32c3876da73c 100644 --- a/sfx2/source/sidebar/SidebarToolBox.cxx +++ b/sfx2/source/sidebar/SidebarToolBox.cxx @@ -316,6 +316,8 @@ void SidebarToolBox::InitToolBox(VclBuilder::stringmap& rMap) } } +namespace { + class NotebookbarToolBox : public SidebarToolBox { public: @@ -331,6 +333,8 @@ public: } }; +} + extern "C" SAL_DLLPUBLIC_EXPORT void makeSidebarToolBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) { static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>, diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx index d1737912b3ca..4a61909fc4f8 100644 --- a/sfx2/source/view/classificationcontroller.cxx +++ b/sfx2/source/view/classificationcontroller.cxx @@ -36,9 +36,16 @@ using namespace com::sun::star; namespace sfx2 { +namespace { + class ClassificationCategoriesController; + +} + using ClassificationPropertyListenerBase = comphelper::ConfigurationListenerProperty<OUString>; +namespace { + /// Listens to configuration changes, so no restart is needed after setting the classification path. class ClassificationPropertyListener : public ClassificationPropertyListenerBase { @@ -49,8 +56,12 @@ public: void setProperty(const uno::Any& rProperty) override; }; +} + using ClassificationCategoriesControllerBase = cppu::ImplInheritanceHelper<svt::ToolboxController, lang::XServiceInfo>; +namespace { + class ClassificationControl; /// Controller for .uno:ClassificationApply. @@ -104,9 +115,6 @@ public: void setCategoryStateFromPolicy(const SfxClassificationHelper & rHelper); }; -namespace -{ - OUString const & getCategoryType() { return SfxClassificationHelper::policyTypeToString(SfxClassificationHelper::getPolicyType()); diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index be9b43cd9035..998ae24c2e84 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -78,6 +78,7 @@ using namespace com::sun::star; +namespace { // SfxEmbedResizeGuard class SfxBooleanFlagGuard @@ -96,6 +97,7 @@ public: } }; +} // SfxInPlaceClient_Impl diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 22ec268c9518..e2100e3f74a7 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -171,6 +171,8 @@ static void reschedule() } } +namespace { + class SfxStatusIndicator : public ::cppu::WeakImplHelper< task::XStatusIndicator, lang::XEventListener > { friend class SfxBaseController; @@ -201,6 +203,8 @@ public: virtual void SAL_CALL disposing( const lang::EventObject& Source ) override; }; +} + void SAL_CALL SfxStatusIndicator::start(const OUString& aText, sal_Int32 nRange) { SolarMutexGuard aGuard; @@ -289,6 +293,7 @@ void SAL_CALL SfxStatusIndicator::disposing( const lang::EventObject& /*Source*/ // declaration IMPL_SfxBaseController_ListenerHelper +namespace { class IMPL_SfxBaseController_ListenerHelper : public ::cppu::WeakImplHelper< frame::XFrameActionListener > { @@ -319,6 +324,8 @@ private: } ; // class IMPL_SfxBaseController_ListenerContainer +} + IMPL_SfxBaseController_CloseListenerHelper::IMPL_SfxBaseController_CloseListenerHelper( SfxBaseController* pController ) : m_pController ( pController ) { diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 2347f69584c4..793ad0458e0b 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -411,6 +411,8 @@ void SfxPrinterController::jobFinished( css::view::PrintableState nState ) } } +namespace { + /** An instance of this class is created for the life span of the printer dialogue, to create in its click handler for the additions by the @@ -435,6 +437,8 @@ public: void DisableHelp() { _bHelpDisabled = true; } }; +} + SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog& rParent ) : _pViewSh ( pViewSh ), |