diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-04 15:28:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-04 17:46:59 +0200 |
commit | 2fbd16ed37ad0312faef79d1147d57731cfd980e (patch) | |
tree | a771441f943186f792006bcebba3958125247999 | |
parent | 61a63b97c31b33adf69ef8bf3f187dfd6762f854 (diff) |
simplify IMark hierarchy (3)
merge IDropdownFieldmark into DropDownFieldmark
Change-Id: I5dd9a166bc3f0710237b45fb0b063973547f2eb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171460
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/inc/IMark.hxx | 34 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdown.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdown.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdownlistentries.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdownlistentries.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdownlistentry.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaformfielddropdownlistentry.hxx | 4 |
7 files changed, 19 insertions, 40 deletions
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index 69aa15fd0615..75af34ca0e14 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -108,25 +108,6 @@ namespace sw::mark IFieldmark &operator =(IFieldmark const&) = delete; }; - class SW_DLLPUBLIC IDropdownFieldmark - : virtual public IFieldmark - { - protected: - IDropdownFieldmark() = default; - - public: - virtual OUString GetContent(sal_Int32* pIndex) const = 0; - virtual OUString GetContent() const override = 0; - virtual void AddContent(const OUString& rText, sal_Int32* pIndex = nullptr) = 0; - virtual void DelContent(sal_Int32 nDelIndex = -1) = 0; - virtual void ReplaceContent(const OUString* pText, sal_Int32* pIndex) = 0; - virtual void ReplaceContent(const OUString& sNewContent) override = 0; - - private: - IDropdownFieldmark(IDropdownFieldmark const &) = delete; - IDropdownFieldmark &operator =(IDropdownFieldmark const&) = delete; - }; - class SW_DLLPUBLIC IDateFieldmark : virtual public IFieldmark { @@ -378,7 +359,7 @@ namespace sw::mark }; /// Fieldmark with a drop down button (e.g. this button opens the date picker for a date field) - class FieldmarkWithDropDownButton + class SW_DLLPUBLIC FieldmarkWithDropDownButton : public NonTextFieldmark { public: @@ -394,9 +375,8 @@ namespace sw::mark }; /// Fieldmark representing a drop-down form field. - class DropDownFieldmark final - : virtual public IDropdownFieldmark - , public FieldmarkWithDropDownButton + class SW_DLLPUBLIC DropDownFieldmark final + : public FieldmarkWithDropDownButton { public: DropDownFieldmark(const SwPaM& rPaM, const OUString& rName); @@ -404,11 +384,11 @@ namespace sw::mark void ShowButton(SwEditWin* pEditWin) override; void RemoveButton() override; - OUString GetContent(sal_Int32* pIndex) const override; + OUString GetContent(sal_Int32* pIndex) const; OUString GetContent() const override; - void AddContent(const OUString& rText, sal_Int32* pIndex = nullptr) override; - void DelContent(sal_Int32 nDelIndex = -1) override; - void ReplaceContent(const OUString* pText, sal_Int32* pIndex) override; + void AddContent(const OUString& rText, sal_Int32* pIndex = nullptr); + void DelContent(sal_Int32 nDelIndex = -1); + void ReplaceContent(const OUString* pText, sal_Int32* pIndex); void ReplaceContent(const OUString& sNewContent) override; // This method should be called only by the portion so we can now the portion's painting area diff --git a/sw/source/ui/vba/vbaformfielddropdown.cxx b/sw/source/ui/vba/vbaformfielddropdown.cxx index 08648fb05065..01a219d752d3 100644 --- a/sw/source/ui/vba/vbaformfielddropdown.cxx +++ b/sw/source/ui/vba/vbaformfielddropdown.cxx @@ -26,7 +26,7 @@ SwVbaFormFieldDropDown::SwVbaFormFieldDropDown( const uno::Reference<ooo::vba::XHelperInterface>& rParent, const uno::Reference<uno::XComponentContext>& rContext, ::sw::mark::IFieldmark& rFormField) : SwVbaFormFieldDropDown_BASE(rParent, rContext) - , m_pDropDown(dynamic_cast<sw::mark::IDropdownFieldmark*>(&rFormField)) + , m_pDropDown(dynamic_cast<sw::mark::DropDownFieldmark*>(&rFormField)) { } diff --git a/sw/source/ui/vba/vbaformfielddropdown.hxx b/sw/source/ui/vba/vbaformfielddropdown.hxx index e92caa2f8e8c..d4b30c1e665c 100644 --- a/sw/source/ui/vba/vbaformfielddropdown.hxx +++ b/sw/source/ui/vba/vbaformfielddropdown.hxx @@ -19,7 +19,7 @@ typedef InheritedHelperInterfaceWeakImpl<ooo::vba::word::XDropDown> SwVbaFormFie class SwVbaFormFieldDropDown : public SwVbaFormFieldDropDown_BASE { private: - sw::mark::IDropdownFieldmark* m_pDropDown; + sw::mark::DropDownFieldmark* m_pDropDown; public: /// @throws css::uno::RuntimeException diff --git a/sw/source/ui/vba/vbaformfielddropdownlistentries.cxx b/sw/source/ui/vba/vbaformfielddropdownlistentries.cxx index 6f77079e1b6d..30af34a4988b 100644 --- a/sw/source/ui/vba/vbaformfielddropdownlistentries.cxx +++ b/sw/source/ui/vba/vbaformfielddropdownlistentries.cxx @@ -14,7 +14,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -static uno::Sequence<OUString> lcl_getListEntries(sw::mark::IDropdownFieldmark& rDropDown) +static uno::Sequence<OUString> lcl_getListEntries(sw::mark::DropDownFieldmark& rDropDown) { uno::Sequence<OUString> aSeq; (*rDropDown.GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] >>= aSeq; @@ -53,13 +53,13 @@ class ListEntryCollectionHelper private: uno::Reference<XHelperInterface> mxParent; uno::Reference<uno::XComponentContext> mxContext; - sw::mark::IDropdownFieldmark& m_rDropDown; + sw::mark::DropDownFieldmark& m_rDropDown; public: /// @throws css::uno::RuntimeException ListEntryCollectionHelper(uno::Reference<ov::XHelperInterface> xParent, uno::Reference<uno::XComponentContext> xContext, - sw::mark::IDropdownFieldmark& rFormField) + sw::mark::DropDownFieldmark& rFormField) : mxParent(std::move(xParent)) , mxContext(std::move(xContext)) , m_rDropDown(rFormField) @@ -91,8 +91,7 @@ public: SwVbaFormFieldDropDownListEntries::SwVbaFormFieldDropDownListEntries( const uno::Reference<XHelperInterface>& xParent, - const uno::Reference<uno::XComponentContext>& xContext, - sw::mark::IDropdownFieldmark& rFormField) + const uno::Reference<uno::XComponentContext>& xContext, sw::mark::DropDownFieldmark& rFormField) : SwVbaFormFieldDropDownListEntries_BASE( xParent, xContext, uno::Reference<container::XIndexAccess>( diff --git a/sw/source/ui/vba/vbaformfielddropdownlistentries.hxx b/sw/source/ui/vba/vbaformfielddropdownlistentries.hxx index ef1339127021..f8ea422678f0 100644 --- a/sw/source/ui/vba/vbaformfielddropdownlistentries.hxx +++ b/sw/source/ui/vba/vbaformfielddropdownlistentries.hxx @@ -21,14 +21,14 @@ typedef CollTestImplHelper<ooo::vba::word::XListEntries> SwVbaFormFieldDropDownL class SwVbaFormFieldDropDownListEntries : public SwVbaFormFieldDropDownListEntries_BASE { private: - sw::mark::IDropdownFieldmark& m_rDropDown; + sw::mark::DropDownFieldmark& m_rDropDown; public: /// @throws css::uno::RuntimeException SwVbaFormFieldDropDownListEntries( const css::uno::Reference<ov::XHelperInterface>& xParent, const css::uno::Reference<css::uno::XComponentContext>& xContext, - sw::mark::IDropdownFieldmark& m_rDropDown); + sw::mark::DropDownFieldmark& m_rDropDown); // XListEntries css::uno::Reference<ooo::vba::word::XListEntry> diff --git a/sw/source/ui/vba/vbaformfielddropdownlistentry.cxx b/sw/source/ui/vba/vbaformfielddropdownlistentry.cxx index 10d58e113eb7..fc3cb39b0e2c 100644 --- a/sw/source/ui/vba/vbaformfielddropdownlistentry.cxx +++ b/sw/source/ui/vba/vbaformfielddropdownlistentry.cxx @@ -14,8 +14,8 @@ using namespace ::com::sun::star; SwVbaFormFieldDropDownListEntry::SwVbaFormFieldDropDownListEntry( const uno::Reference<ooo::vba::XHelperInterface>& rParent, - const uno::Reference<uno::XComponentContext>& rContext, - sw::mark::IDropdownFieldmark& rFormField, sal_Int32 nZIndex) + const uno::Reference<uno::XComponentContext>& rContext, sw::mark::DropDownFieldmark& rFormField, + sal_Int32 nZIndex) : SwVbaFormFieldDropDownListEntry_BASE(rParent, rContext) , m_rDropDown(rFormField) , m_nZIndex(nZIndex) diff --git a/sw/source/ui/vba/vbaformfielddropdownlistentry.hxx b/sw/source/ui/vba/vbaformfielddropdownlistentry.hxx index 4ded080e632e..32d76f0d08ad 100644 --- a/sw/source/ui/vba/vbaformfielddropdownlistentry.hxx +++ b/sw/source/ui/vba/vbaformfielddropdownlistentry.hxx @@ -20,7 +20,7 @@ typedef InheritedHelperInterfaceWeakImpl<ooo::vba::word::XListEntry> class SwVbaFormFieldDropDownListEntry : public SwVbaFormFieldDropDownListEntry_BASE { private: - sw::mark::IDropdownFieldmark& m_rDropDown; + sw::mark::DropDownFieldmark& m_rDropDown; // All LO and internal UNO functions are 0-based. Convert to 1-based when sending to VBA const sal_Int32 m_nZIndex; @@ -29,7 +29,7 @@ public: SwVbaFormFieldDropDownListEntry( const css::uno::Reference<ooo::vba::XHelperInterface>& rParent, const css::uno::Reference<css::uno::XComponentContext>& rContext, - sw::mark::IDropdownFieldmark& rFormField, sal_Int32 nZIndex); + sw::mark::DropDownFieldmark& rFormField, sal_Int32 nZIndex); ~SwVbaFormFieldDropDownListEntry() override; // XListEntry |