diff options
Diffstat (limited to 'sw/source/ui')
39 files changed, 230 insertions, 0 deletions
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 ) { } |