sw/inc/IDocumentFieldsAccess.hxx | 2 sw/inc/IDocumentMarkAccess.hxx | 20 +++--- sw/inc/IMark.hxx | 18 +++--- sw/inc/SwRewriter.hxx | 5 - sw/inc/crsrsh.hxx | 8 +- sw/inc/doc.hxx | 4 - sw/inc/docufld.hxx | 16 ++--- sw/inc/editsh.hxx | 2 sw/inc/fmtrfmrk.hxx | 8 +- sw/inc/mdiexp.hxx | 4 - sw/inc/names.hxx | 16 ++--- sw/inc/ndtxt.hxx | 4 - sw/inc/reffld.hxx | 10 +-- sw/inc/view.hxx | 4 - sw/qa/core/layout/layout.cxx | 2 sw/qa/core/macros-test.cxx | 4 - sw/qa/core/uwriter.cxx | 30 +++++----- sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2 sw/qa/extras/uiwriter/uiwriter.cxx | 48 ++++++++-------- sw/qa/extras/uiwriter/uiwriter3.cxx | 12 ++-- sw/qa/extras/uiwriter/uiwriter4.cxx | 14 ++-- sw/qa/extras/uiwriter/uiwriter6.cxx | 4 - sw/qa/extras/uiwriter/uiwriter7.cxx | 36 ++++++------ sw/qa/extras/uiwriter/uiwriter9.cxx | 2 sw/qa/extras/ww8export/ww8export4.cxx | 2 sw/qa/uibase/shells/shells.cxx | 24 +++----- sw/source/core/bastyp/init.cxx | 2 sw/source/core/crsr/annotationmark.cxx | 2 sw/source/core/crsr/bookmark.cxx | 18 +++--- sw/source/core/crsr/crbm.cxx | 4 - sw/source/core/crsr/crossrefbookmark.cxx | 10 +-- sw/source/core/crsr/crstrvl.cxx | 2 sw/source/core/doc/DocumentContentOperationsManager.cxx | 8 +- sw/source/core/doc/doc.cxx | 4 - sw/source/core/doc/docbm.cxx | 44 +++++++------- sw/source/core/edit/editsh.cxx | 2 sw/source/core/fields/docufld.cxx | 12 ++-- sw/source/core/fields/reffld.cxx | 16 ++--- sw/source/core/inc/MarkManager.hxx | 24 ++++---- sw/source/core/inc/UndoBookmark.hxx | 11 +-- sw/source/core/inc/annotationmark.hxx | 2 sw/source/core/inc/crossrefbookmark.hxx | 10 +-- sw/source/core/inc/mvsave.hxx | 2 sw/source/core/inc/rolbck.hxx | 10 +-- sw/source/core/inc/scriptinfo.hxx | 4 - sw/source/core/text/EnhancedPDFExportHelper.cxx | 10 +-- sw/source/core/text/porlay.cxx | 14 ++-- sw/source/core/text/porrst.hxx | 4 - sw/source/core/txtnode/atrref.cxx | 4 - sw/source/core/txtnode/ndtxt.cxx | 4 - sw/source/core/undo/rolbck.cxx | 2 sw/source/core/undo/unbkmk.cxx | 6 +- sw/source/core/unocore/unobkm.cxx | 10 +-- sw/source/core/unocore/unocoll.cxx | 8 +- sw/source/core/unocore/unofield.cxx | 8 +- sw/source/core/unocore/unoobj2.cxx | 2 sw/source/core/unocore/unorefmk.cxx | 8 +- sw/source/filter/basflt/fltshell.cxx | 4 - sw/source/filter/html/htmlfld.cxx | 2 sw/source/filter/html/swhtml.cxx | 6 +- sw/source/filter/ww8/docxattributeoutput.cxx | 12 ++-- sw/source/filter/ww8/docxattributeoutput.hxx | 10 +-- sw/source/filter/ww8/docxexport.cxx | 4 - sw/source/filter/ww8/rtfattributeoutput.cxx | 6 +- sw/source/filter/ww8/rtfattributeoutput.hxx | 6 +- sw/source/filter/ww8/rtfexport.cxx | 4 - sw/source/filter/ww8/ww8atr.cxx | 6 +- sw/source/filter/ww8/ww8par.cxx | 4 - sw/source/filter/ww8/ww8par.hxx | 6 +- sw/source/filter/ww8/ww8par3.cxx | 14 ++-- sw/source/filter/ww8/ww8par5.cxx | 38 ++++++------ sw/source/ui/dbui/dbinsdlg.cxx | 2 sw/source/ui/fldui/fldref.cxx | 2 sw/source/ui/inc/bookmark.hxx | 2 sw/source/ui/misc/bookmark.cxx | 10 +-- sw/source/uibase/dbui/dbmgr.cxx | 2 sw/source/uibase/dochdl/swdtflvr.cxx | 14 ++-- sw/source/uibase/docvw/AnnotationWin.cxx | 2 sw/source/uibase/docvw/edtwin2.cxx | 2 sw/source/uibase/docvw/edtwin3.cxx | 2 sw/source/uibase/fldui/fldmgr.cxx | 10 +-- sw/source/uibase/inc/conttree.hxx | 2 sw/source/uibase/inc/fldmgr.hxx | 4 - sw/source/uibase/inc/wrtsh.hxx | 4 - sw/source/uibase/shells/basesh.cxx | 4 - sw/source/uibase/shells/textfld.cxx | 12 ++-- sw/source/uibase/shells/textsh1.cxx | 12 ++-- sw/source/uibase/uiview/view2.cxx | 10 +-- sw/source/uibase/uiview/viewmdi.cxx | 2 sw/source/uibase/utlui/content.cxx | 24 ++++---- sw/source/uibase/wrtsh/move.cxx | 2 sw/source/uibase/wrtsh/wrtsh2.cxx | 2 sw/source/uibase/wrtsh/wrtsh3.cxx | 2 93 files changed, 406 insertions(+), 412 deletions(-)
New commits: commit a6bef55d650d5221f2b86dcd0116d8db7ebe79a4 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Apr 25 10:57:37 2025 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Apr 25 13:14:05 2025 +0200 rename ReferenceMarkerName to SwMarkName as per vmiklos request at https://gerrit.libreoffice.org/c/core/+/184192/comment/dcdeab88_b56fb1ce?usp=email Change-Id: I57883da79db3ffb9c2f0e5c1ca3eaa535610eb7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184615 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx index 5ebebb2076e8..045b3c290525 100644 --- a/sw/inc/IDocumentFieldsAccess.hxx +++ b/sw/inc/IDocumentFieldsAccess.hxx @@ -63,7 +63,7 @@ namespace com::sun::star::uno { class Any; } // convenience methods SwFieldType* GetFieldType(SwFieldIds nResId, const UIName& rName, bool bDbFieldMatching) const { return GetFieldType(nResId, rName.toString(), bDbFieldMatching); } - SwFieldType* GetFieldType(SwFieldIds nResId, const ReferenceMarkerName& rName, bool bDbFieldMatching) const + SwFieldType* GetFieldType(SwFieldIds nResId, const SwMarkName& rName, bool bDbFieldMatching) const { return GetFieldType(nResId, rName.toString(), bDbFieldMatching); } virtual void RemoveFieldType(size_t nField) = 0; diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 1093aa497581..7fd13295c484 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -82,21 +82,21 @@ class IDocumentMarkAccess a pointer to the new mark (name might have changed). */ virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM, - const ReferenceMarkerName& rProposedName, + const SwMarkName& rProposedName, MarkType eMark, ::sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) = 0; virtual sw::mark::Fieldmark* makeFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType, SwPosition const* pSepPos = nullptr) = 0; virtual sw::mark::Fieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType) = 0; virtual sw::mark::MarkBase* makeAnnotationMark( const SwPaM& rPaM, - const ReferenceMarkerName& rName ) = 0; + const SwMarkName& rName ) = 0; /** Returns a mark in the document for a paragraph. If there is none, a mark will be created. @@ -134,7 +134,7 @@ class IDocumentMarkAccess @returns false, if renaming failed (because the name is already in use) */ virtual bool renameMark(::sw::mark::MarkBase* io_pMark, - const ReferenceMarkerName& rNewName) =0; + const SwMarkName& rNewName) =0; /** Corrects marks (absolute) This method ignores the previous position of the mark in the paragraph @@ -236,7 +236,7 @@ class IDocumentMarkAccess @returns an iterator pointing to the mark, or pointing to getAllMarksEnd() if nothing was found. */ - virtual const_iterator findMark(const ReferenceMarkerName& rMark) const =0; + virtual const_iterator findMark(const SwMarkName& rMark) const =0; /** Find the first Bookmark that does not start before. @@ -270,7 +270,7 @@ class IDocumentMarkAccess @returns an iterator pointing to the bookmark, or getBookmarksEnd() if nothing was found. */ - virtual std::vector<sw::mark::Bookmark*>::const_iterator findBookmark(const ReferenceMarkerName& rMark) const =0; + virtual std::vector<sw::mark::Bookmark*>::const_iterator findBookmark(const SwMarkName& rMark) const =0; /** Finds the first mark that is starting after. @@ -313,12 +313,12 @@ class IDocumentMarkAccess virtual std::vector<sw::mark::AnnotationMark*>::const_iterator getAnnotationMarksBegin() const = 0; virtual std::vector<sw::mark::AnnotationMark*>::const_iterator getAnnotationMarksEnd() const = 0; virtual sal_Int32 getAnnotationMarksCount() const = 0; - virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findAnnotationMark( const ReferenceMarkerName& rName ) const = 0; + virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findAnnotationMark( const SwMarkName& rName ) const = 0; virtual sw::mark::AnnotationMark* getAnnotationMarkFor(const SwPosition& rPosition) const = 0; // handle and restore text ranges of annotations of tracked deletions // based on the helper bookmarks (which can survive I/O and hiding redlines) virtual ::sw::mark::Bookmark* makeAnnotationBookmark(const SwPaM& rPaM, - const ReferenceMarkerName& rProposedName, + const SwMarkName& rProposedName, ::sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) = 0; /** Find the first AnnotationMark that does not start before. @@ -328,7 +328,7 @@ class IDocumentMarkAccess */ virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findFirstAnnotationMarkNotStartsBefore(const SwPosition& rPos) const =0; virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findFirstAnnotationMarkNotStartsBefore(const SwNode& rPos) const =0; - virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const ReferenceMarkerName& rName ) const = 0; + virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const SwMarkName& rName ) const = 0; virtual void restoreAnnotationMarks(bool bDelete = true) = 0; /** Returns the MarkType used to create the mark diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index 5976a9c5b35b..a0208b311cd6 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -62,7 +62,7 @@ namespace sw::mark //getters SwPosition& GetMarkPos() const { return const_cast<SwPosition&>(*m_oPos1); } - const ReferenceMarkerName& GetName() const + const SwMarkName& GetName() const { return m_aName; } // GetOtherMarkPos() is only guaranteed to return a valid // reference if IsExpanded() returned true @@ -109,7 +109,7 @@ namespace sw::mark virtual bool IsExpanded() const { return m_oPos2.has_value(); } - void SetName(const ReferenceMarkerName& rName) + void SetName(const SwMarkName& rName) { m_aName = rName; } virtual void SetMarkPos(const SwPosition& rNewPos); virtual void SetOtherMarkPos(const SwPosition& rNewPos); @@ -137,15 +137,15 @@ namespace sw::mark { return m_wXBookmark; } void SetXBookmark(rtl::Reference<SwXBookmark> const& xBkmk); - static ReferenceMarkerName GenerateNewName(std::u16string_view rPrefix); + static SwMarkName GenerateNewName(std::u16string_view rPrefix); protected: // SwClient void SwClientNotify(const SwModify&, const SfxHint&) override; - MarkBase(const SwPaM& rPaM, ReferenceMarkerName aName); + MarkBase(const SwPaM& rPaM, SwMarkName aName); std::optional<SwPosition> m_oPos1; std::optional<SwPosition> m_oPos2; - ReferenceMarkerName m_aName; + SwMarkName m_aName; unotools::WeakReference<SwXBookmark> m_wXBookmark; }; @@ -191,7 +191,7 @@ namespace sw::mark public: Bookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName); + const SwMarkName& rName); void InitDoc(SwDoc& io_Doc, sw::mark::InsertMode eMode, SwPosition const* pSepPos) override; void DeregisterFromDoc(SwDoc& io_rDoc) override; @@ -272,7 +272,7 @@ namespace sw::mark : public Fieldmark { public: - TextFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName); + TextFieldmark(const SwPaM& rPaM, const SwMarkName& rName); ~TextFieldmark(); void InitDoc(SwDoc& io_rDoc, sw::mark::InsertMode eMode, SwPosition const* pSepPos) override; void ReleaseDoc(SwDoc& rDoc) override; @@ -301,7 +301,7 @@ namespace sw::mark : public NonTextFieldmark { public: - CheckboxFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName); + CheckboxFieldmark(const SwPaM& rPaM, const SwMarkName& rName); bool IsChecked() const; void SetChecked(bool checked); OUString GetContent() const override; @@ -329,7 +329,7 @@ namespace sw::mark : public FieldmarkWithDropDownButton { public: - DropDownFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName); + DropDownFieldmark(const SwPaM& rPaM, const SwMarkName& rName); ~DropDownFieldmark() override; void ShowButton(SwEditWin* pEditWin) override; diff --git a/sw/inc/SwRewriter.hxx b/sw/inc/SwRewriter.hxx index 8857b5393526..97f374713b24 100644 --- a/sw/inc/SwRewriter.hxx +++ b/sw/inc/SwRewriter.hxx @@ -42,10 +42,7 @@ public: void AddRule(SwUndoArg eWhat, const OUString& rWith); // convenience methods void AddRule(SwUndoArg eWhat, const UIName& rWith) { AddRule(eWhat, rWith.toString()); } - void AddRule(SwUndoArg eWhat, const ReferenceMarkerName& rWith) - { - AddRule(eWhat, rWith.toString()); - } + void AddRule(SwUndoArg eWhat, const SwMarkName& rWith) { AddRule(eWhat, rWith.toString()); } OUString Apply(const OUString& rStr) const; diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 485a5aefe60c..0eebfb673cc2 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -62,7 +62,7 @@ class SwPostItField; class SwTextField; class SwTextFootnote; class SwTextContentControl; -class ReferenceMarkerName; +class SwMarkName; namespace i18nutil { struct SearchOptions2; @@ -593,11 +593,11 @@ public: // at CurrentCursor.SPoint SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark( const vcl::KeyCode&, - const ReferenceMarkerName& rName, + const SwMarkName& rName, IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::MarkType::BOOKMARK); SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark2( const vcl::KeyCode&, - const ReferenceMarkerName& rName, + const SwMarkName& rName, bool bHide, const OUString& rCondition); SW_DLLPUBLIC bool GotoMark( const ::sw::mark::MarkBase* const pMark ); // sets CurrentCursor.SPoint @@ -725,7 +725,7 @@ public: // on graphics bool SelectNxtPrvHyperlink( bool bNext ); - bool GotoRefMark( const ReferenceMarkerName& rRefMark, sal_uInt16 nSubType, + bool GotoRefMark( const SwMarkName& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags ); // get the nth character from the start or end of the current selection diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index ae0ed7e852e2..8e599232aedb 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -138,7 +138,7 @@ class SwContentControlManager; enum class SvMacroItemId : sal_uInt16; enum class SvxFrameDirection; enum class RndStdIds; -class ReferenceMarkerName; +class SwMarkName; namespace sw::mark { class MarkManager; } namespace sw { @@ -1329,7 +1329,7 @@ public: void SetTableName( SwFrameFormat& rTableFormat, const UIName &rNewName ); // @return the reference in document that is set for name. - const SwFormatRefMark* GetRefMark( const ReferenceMarkerName& rName ) const; + const SwFormatRefMark* GetRefMark( const SwMarkName& rName ) const; // @return RefMark via index - for UNO. const SwFormatRefMark* GetRefMark( sal_uInt16 nIndex ) const; diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 9e3d66e53970..03cb353f2375 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -455,7 +455,7 @@ class SW_DLLPUBLIC SwPostItField final : public SwField OUString m_sText; OUString m_sAuthor; OUString m_sInitials; ///< Initials of the author. - ReferenceMarkerName m_sName; ///< Name of the comment. + SwMarkName m_sName; ///< Name of the comment. DateTime m_aDateTime; bool m_bResolved; std::optional<OutlinerParaObject> mpText; @@ -464,7 +464,7 @@ class SW_DLLPUBLIC SwPostItField final : public SwField sal_uInt32 m_nParentId; sal_uInt32 m_nParaId; sal_uInt32 m_nParentPostItId; - ReferenceMarkerName m_sParentName; /// Parent comment's name. + SwMarkName m_sParentName; /// Parent comment's name. public: static sal_uInt32 s_nLastPostItId; @@ -473,14 +473,14 @@ public: OUString aAuthor, OUString aText, OUString aInitials, - ReferenceMarkerName aName, + SwMarkName aName, const DateTime& rDate, const bool bResolved = false, const sal_uInt32 nPostItId = 0, const sal_uInt32 nParentId = 0, const sal_uInt32 nParaId = 0, const sal_uInt32 nParentPostItId = 0, - const ReferenceMarkerName aParentName = ReferenceMarkerName()); + const SwMarkName aParentName = SwMarkName()); SwPostItField(const SwPostItField&) = delete; SwPostItField* operator=(const SwPostItField&) = delete; @@ -511,10 +511,10 @@ public: virtual void SetPar2(const OUString& rStr) override; const OUString& GetText() const { return m_sText; } const OUString& GetInitials() const { return m_sInitials;} - void SetName(const ReferenceMarkerName& rStr); - const ReferenceMarkerName& GetName() const { return m_sName;} - const ReferenceMarkerName& GetParentName() const { return m_sParentName; } - void SetParentName(const ReferenceMarkerName& rStr); + void SetName(const SwMarkName& rStr); + const SwMarkName& GetName() const { return m_sName;} + const SwMarkName& GetParentName() const { return m_sParentName; } + void SetParentName(const SwMarkName& rStr); const OutlinerParaObject* GetTextObject() const { return mpText ? &*mpText : nullptr;} void SetTextObject( std::optional<OutlinerParaObject> pText ); diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 69b5d3cba0af..4210180c006f 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -835,7 +835,7 @@ public: void SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd ); /// @return reference set in document according to given name. - const SwFormatRefMark* GetRefMark( const ReferenceMarkerName& rName ) const; + const SwFormatRefMark* GetRefMark( const SwMarkName& rName ) const; /** @return names of all references set in document. If ArrayPointer == 0 then return only whether a RefMark is set in document. */ diff --git a/sw/inc/fmtrfmrk.hxx b/sw/inc/fmtrfmrk.hxx index 8eeca942c6cf..9f9fb30bc7bc 100644 --- a/sw/inc/fmtrfmrk.hxx +++ b/sw/inc/fmtrfmrk.hxx @@ -44,13 +44,13 @@ class SAL_DLLPUBLIC_RTTI SwFormatRefMark final : public SfxPoolItem SwTextRefMark* m_pTextAttr; SwFormatRefMark& operator=(const SwFormatRefMark& rRefMark) = delete; - ReferenceMarkerName m_aRefName; + SwMarkName m_aRefName; unotools::WeakReference<SwXReferenceMark> m_wXReferenceMark; public: DECLARE_ITEM_TYPE_FUNCTION(SwFormatRefMark) - SwFormatRefMark( ReferenceMarkerName aText ); + SwFormatRefMark( SwMarkName aText ); SwFormatRefMark( const SwFormatRefMark& rRefMark ); virtual ~SwFormatRefMark( ) override; @@ -62,8 +62,8 @@ public: const SwTextRefMark *GetTextRefMark() const { return m_pTextAttr; } - ReferenceMarkerName &GetRefName() { return m_aRefName; } - const ReferenceMarkerName &GetRefName() const { return m_aRefName; } + SwMarkName &GetRefName() { return m_aRefName; } + const SwMarkName &GetRefName() const { return m_aRefName; } unotools::WeakReference<SwXReferenceMark> const& GetXRefMark() const { return m_wXReferenceMark; } diff --git a/sw/inc/mdiexp.hxx b/sw/inc/mdiexp.hxx index 59b245f0bbac..f1eecb8c5086 100644 --- a/sw/inc/mdiexp.hxx +++ b/sw/inc/mdiexp.hxx @@ -30,7 +30,7 @@ class SwRect; class Size; class SwViewShell; class SwDocShell; -class ReferenceMarkerName; +class SwMarkName; extern void ScrollMDI(SwViewShell const & rVwSh, const SwRect &, sal_uInt16 nRangeX, sal_uInt16 nRangeY , ScrollSizeMode eScrollSizeMode = ScrollSizeMode::ScrollSizeDefault); @@ -53,6 +53,6 @@ void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect ); // Read ChgMode for tables from configuration. TableChgMode GetTableChgDefaultMode(); -bool JumpToSwMark( SwViewShell const * pVwSh, const ReferenceMarkerName& rMark ); +bool JumpToSwMark( SwViewShell const * pVwSh, const SwMarkName& rMark ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/names.hxx b/sw/inc/names.hxx index 37559fd86510..ce6351eca4da 100644 --- a/sw/inc/names.hxx +++ b/sw/inc/names.hxx @@ -60,21 +60,21 @@ private: OUString m_s; }; -class ReferenceMarkerName +class SwMarkName { public: - ReferenceMarkerName() {} - explicit ReferenceMarkerName(const OUString& s) + SwMarkName() {} + explicit SwMarkName(const OUString& s) : m_s(s) { } const OUString& toString() const { return m_s; } bool isEmpty() const { return m_s.isEmpty(); } - bool operator==(const ReferenceMarkerName& s) const = default; + bool operator==(const SwMarkName& s) const = default; bool operator==(const OUString& s) const { return m_s == s; } bool operator==(std::u16string_view s) const { return m_s == s; } - bool operator<(const ReferenceMarkerName& s) const { return m_s < s.m_s; } - bool operator>(const ReferenceMarkerName& s) const { return m_s > s.m_s; } + bool operator<(const SwMarkName& s) const { return m_s < s.m_s; } + bool operator>(const SwMarkName& s) const { return m_s > s.m_s; } private: OUString m_s; @@ -82,9 +82,9 @@ private: namespace std { -template <> struct hash<ReferenceMarkerName> +template <> struct hash<SwMarkName> { - std::size_t operator()(ReferenceMarkerName const& s) const + std::size_t operator()(SwMarkName const& s) const { return std::hash<OUString>()(s.toString()); } diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 86f106644974..78115ffadf8b 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -46,7 +46,7 @@ class SvxFirstLineIndentItem; class SvxTextLeftMarginItem; struct SvxFontUnitMetrics; class SwXParagraph; -class ReferenceMarkerName; +class SwMarkName; namespace utl { class TransliterationWrapper; @@ -394,7 +394,7 @@ public: */ static void EstablishParentChildRelationsOfComments(const SwTextNode* pDest, std::map<sal_Int32, sal_Int32>& idMapForComments, - std::map<sal_Int32, ReferenceMarkerName>& nameMapForComments); + std::map<sal_Int32, SwMarkName>& nameMapForComments); void CutText(SwTextNode * const pDest, const SwContentIndex & rStart, const sal_Int32 nLen); diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index 1ce70d6eca35..9812ec5b19eb 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -95,7 +95,7 @@ public: void MergeWithOtherDoc( SwDoc& rDestDoc ); - static SwTextNode* FindAnchor( SwDoc* pDoc, const ReferenceMarkerName& rRefMark, + static SwTextNode* FindAnchor( SwDoc* pDoc, const SwMarkName& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, sal_Int32* pStart, sal_Int32* pEnd = nullptr, SwRootFrame const* pLayout = nullptr, @@ -104,7 +104,7 @@ public: void UpdateStyleReferences(); private: - static SwTextNode* FindAnchorRefStyle( SwDoc* pDoc, const ReferenceMarkerName& rRefMark, + static SwTextNode* FindAnchorRefStyle( SwDoc* pDoc, const SwMarkName& rRefMark, sal_uInt16 nFlags, sal_Int32* pStart, sal_Int32* pEnd, SwRootFrame const* pLayout, @@ -123,7 +123,7 @@ private: class SAL_DLLPUBLIC_RTTI SwGetRefField final : public SwField { private: - ReferenceMarkerName m_sSetRefName; + SwMarkName m_sSetRefName; OUString m_sSetReferenceLanguage; OUString m_sText; ///< result OUString m_sTextRLHidden; ///< result for layout with redlines hidden @@ -135,14 +135,14 @@ private: virtual OUString ExpandImpl(SwRootFrame const* pLayout) const override; virtual std::unique_ptr<SwField> Copy() const override; public: - SW_DLLPUBLIC SwGetRefField( SwGetRefFieldType*, ReferenceMarkerName aSetRef, OUString aReferenceLanguage, + SW_DLLPUBLIC SwGetRefField( SwGetRefFieldType*, SwMarkName aSetRef, OUString aReferenceLanguage, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, sal_uLong nFormat ); SW_DLLPUBLIC virtual ~SwGetRefField() override; virtual OUString GetFieldName() const override; - const ReferenceMarkerName& GetSetRefName() const { return m_sSetRefName; } + const SwMarkName& GetSetRefName() const { return m_sSetRefName; } // #i81002# /** The <SwTextField> instance, which represents the text attribute for the diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index d123b88090eb..2152092c589c 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -72,7 +72,7 @@ class SwCursorShell; enum class SvxSearchCmd; enum class SelectionType : sal_Int32; class SwNode; -class ReferenceMarkerName; +class SwMarkName; namespace com::sun::star::view { class XSelectionSupplier; } namespace sfx2 { class FileDialogHelper; } @@ -618,7 +618,7 @@ public: void SetCursorAtTop( bool bFlag, bool bCenter = false ) { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; } - bool JumpToSwMark( const ReferenceMarkerName& rMark ); + bool JumpToSwMark( const SwMarkName& rMark ); tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion = 0 ); diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 046243bcd3f5..33e219fa051c 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -967,7 +967,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testPageRemoveFlyTable) pWrtShell->Reformat(); // Then make sure that the 2nd table below the bookmark has no unwanted top margin: - pWrtShell->GotoMark(ReferenceMarkerName(u"test"_ustr)); + pWrtShell->GotoMark(SwMarkName(u"test"_ustr)); pWrtShell->Down(/*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); pWrtShell->Down(/*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); SwCursor* pCursor = pWrtShell->GetCursor(); diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 5afa86b459e8..c4147d8893b5 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -193,7 +193,7 @@ void SwMacrosTest::testBookmarkDeleteAndJoin() aPaM.Move(fnMoveForward, GoInDoc); IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess(); sw::mark::MarkBase *pMark = - rIDMA.makeMark(aPaM, ReferenceMarkerName(u"test"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + rIDMA.makeMark(aPaM, SwMarkName(u"test"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT(pMark); // select so pMark start position is on a node that is fully deleted @@ -228,7 +228,7 @@ void SwMacrosTest::testBookmarkDeleteTdf90816() aPaM.Move(fnMoveBackward, GoInContent); IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess(); sw::mark::MarkBase *pMark = - rIDMA.makeMark(aPaM, ReferenceMarkerName(u"test"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + rIDMA.makeMark(aPaM, SwMarkName(u"test"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT(pMark); diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index ed82e1bb1695..dcd5b6a70091 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -355,7 +355,7 @@ static SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc) pDoc->getIDocumentContentOperations().InsertString(aPaM, u"AAAAA"_ustr); IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess(); sw::mark::Fieldmark *pFieldmark = - pMarksAccess->makeNoTextFieldBookmark(aPaM, ReferenceMarkerName(u"test"_ustr), ODF_FORMDROPDOWN); + pMarksAccess->makeNoTextFieldBookmark(aPaM, SwMarkName(u"test"_ustr), ODF_FORMDROPDOWN); CPPUNIT_ASSERT(pFieldmark); uno::Sequence< OUString > vListEntries { u"BBBBB"_ustr }; (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] <<= vListEntries; @@ -718,7 +718,7 @@ void SwDocTest::testSwScanner() const sal_Int32 nNextPos = aPaM.GetPoint()->GetContentIndex(); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(nPos+1), nNextPos); - SwFormatRefMark aRef(ReferenceMarkerName(u"refmark"_ustr)); + SwFormatRefMark aRef(SwMarkName(u"refmark"_ustr)); pTA = pTextNode->InsertItem(aRef, nNextPos, nNextPos); CPPUNIT_ASSERT(pTA); @@ -734,7 +734,7 @@ void SwDocTest::testSwScanner() DateTime aDate(DateTime::SYSTEM); SwPostItField aPostIt( static_cast<SwPostItFieldType*>(m_pDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit)), u"An Author"_ustr, - u"Some Text"_ustr, u"Initials"_ustr, ReferenceMarkerName(u"Name"_ustr), aDate ); + u"Some Text"_ustr, u"Initials"_ustr, SwMarkName(u"Name"_ustr), aDate ); m_pDoc->getIDocumentContentOperations().InsertPoolItem(aPaM, SwFormatField(aPostIt)); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, u"Apple"_ustr); @@ -1457,21 +1457,21 @@ void SwDocTest::testMarkMove() m_pDoc->getIDocumentContentOperations().InsertString(aPaM, u"Paragraph 1"_ustr); aPaM.SetMark(); aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); - pMarksAccess->makeMark(aPaM, ReferenceMarkerName(u"Para1"_ustr), + pMarksAccess->makeMark(aPaM, SwMarkName(u"Para1"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, u"Paragraph 2"_ustr); aPaM.SetMark(); aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); - pMarksAccess->makeMark(aPaM, ReferenceMarkerName(u"Para2"_ustr), + pMarksAccess->makeMark(aPaM, SwMarkName(u"Para2"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, u"Paragraph 3"_ustr); aPaM.SetMark(); aPaM.GetMark()->nContent -= aPaM.GetMark()->GetContentIndex(); - pMarksAccess->makeMark(aPaM, ReferenceMarkerName(u"Para3"_ustr), + pMarksAccess->makeMark(aPaM, SwMarkName(u"Para3"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); } @@ -1481,9 +1481,9 @@ void SwDocTest::testMarkMove() SwTextNode& rParaNode2 = dynamic_cast<SwTextNode&>(aIdx.GetNode()); rParaNode2.JoinNext(); } - ::sw::mark::MarkBase* pBM1 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para1"_ustr)); - ::sw::mark::MarkBase* pBM2 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para2"_ustr)); - ::sw::mark::MarkBase* pBM3 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para3"_ustr)); + ::sw::mark::MarkBase* pBM1 = *pMarksAccess->findMark(SwMarkName(u"Para1"_ustr)); + ::sw::mark::MarkBase* pBM2 = *pMarksAccess->findMark(SwMarkName(u"Para2"_ustr)); + ::sw::mark::MarkBase* pBM3 = *pMarksAccess->findMark(SwMarkName(u"Para3"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().GetContentIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().GetContentIndex()); @@ -1518,9 +1518,9 @@ void SwDocTest::testMarkMove() aPaM.GetMark()->nContent += 6; m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPaM); } - pBM1 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para1"_ustr)); - pBM2 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para2"_ustr)); - pBM3 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para3"_ustr)); + pBM1 = *pMarksAccess->findMark(SwMarkName(u"Para1"_ustr)); + pBM2 = *pMarksAccess->findMark(SwMarkName(u"Para2"_ustr)); + pBM3 = *pMarksAccess->findMark(SwMarkName(u"Para3"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().GetContentIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().GetContentIndex()); @@ -1554,9 +1554,9 @@ void SwDocTest::testMarkMove() aPos.nContent += 8; m_pDoc->getIDocumentContentOperations().SplitNode(aPos, false); } - pBM1 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para1"_ustr)); - pBM2 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para2"_ustr)); - pBM3 = *pMarksAccess->findMark(ReferenceMarkerName(u"Para3"_ustr)); + pBM1 = *pMarksAccess->findMark(SwMarkName(u"Para1"_ustr)); + pBM2 = *pMarksAccess->findMark(SwMarkName(u"Para2"_ustr)); + pBM3 = *pMarksAccess->findMark(SwMarkName(u"Para3"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().GetContentIndex()); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().GetContentIndex()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 6589dd76d03d..9fd9e51f5380 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -1022,7 +1022,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf151548_activeContentDemo, "tdf151548_activeConte IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); for(auto aIter = pMarkAccess->getFieldmarksBegin(); aIter != pMarkAccess->getFieldmarksEnd(); ++aIter) { - const ReferenceMarkerName sName = (*aIter)->GetName(); + const SwMarkName sName = (*aIter)->GetName(); CPPUNIT_ASSERT(sName == "Check1" || sName == "Text1" || sName == "Dropdown1"); } } diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 338e7820f8bd..d6e09ff3c44f 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -446,7 +446,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkCopy) rIDCO.InsertString(aPaM, u"bar"_ustr); aPaM.SetMark(); aPaM.MovePara(GoCurrPara, fnParaStart); - rIDMA.makeMark(aPaM, ReferenceMarkerName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + rIDMA.makeMark(aPaM, SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); aPaM.Exchange(); aPaM.DeleteMark(); @@ -1513,7 +1513,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkUndo) IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); SwPaM aPaM( SwNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1) ); - pMarkAccess->makeMark(aPaM, ReferenceMarkerName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + pMarkAccess->makeMark(aPaM, SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); rUndoManager.Undo(); @@ -1521,20 +1521,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkUndo) rUndoManager.Redo(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); - auto ppBkmk = pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)); + auto ppBkmk = pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)); CPPUNIT_ASSERT(ppBkmk != pMarkAccess->getAllMarksEnd()); - pMarkAccess->renameMark(*ppBkmk, ReferenceMarkerName(u"Mark_"_ustr)); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); + pMarkAccess->renameMark(*ppBkmk, SwMarkName(u"Mark_"_ustr)); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); rUndoManager.Undo(); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) != pMarkAccess->getAllMarksEnd()); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) != pMarkAccess->getAllMarksEnd()); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) == pMarkAccess->getAllMarksEnd())); rUndoManager.Redo(); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); - pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)), false); + pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)), false); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount()); rUndoManager.Undo(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); @@ -1553,7 +1553,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf148389_Left) pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 3, /*bBasicCall=*/false); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - auto pMark = pMarkAccess->makeMark(*pWrtShell->GetCursor(), ReferenceMarkerName(u"Mark"_ustr), + auto pMark = pMarkAccess->makeMark(*pWrtShell->GetCursor(), SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); @@ -1616,7 +1616,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf148389_Right) pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 3, /*bBasicCall=*/false); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - auto pMark = pMarkAccess->makeMark(*pWrtShell->GetCursor(), ReferenceMarkerName(u"Mark"_ustr), + auto pMark = pMarkAccess->makeMark(*pWrtShell->GetCursor(), SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); @@ -1918,7 +1918,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf63214) aPaM.SetMark(); aPaM.Move(fnMoveForward, GoInContent); //Inserting a crossRefBookmark - pMarkAccess->makeMark(aPaM, ReferenceMarkerName(u"Bookmark"_ustr), + pMarkAccess->makeMark(aPaM, SwMarkName(u"Bookmark"_ustr), IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); @@ -1950,7 +1950,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf51741) IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); SwPaM aPaM( SwNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1) ); //Modification 1 - pMarkAccess->makeMark(aPaM, ReferenceMarkerName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + pMarkAccess->makeMark(aPaM, SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); @@ -1965,28 +1965,28 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf51741) CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); - auto ppBkmk = pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)); + auto ppBkmk = pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)); CPPUNIT_ASSERT(ppBkmk != pMarkAccess->getAllMarksEnd()); //Modification 4 - pMarkAccess->renameMark(*ppBkmk, ReferenceMarkerName(u"Mark_"_ustr)); + pMarkAccess->renameMark(*ppBkmk, SwMarkName(u"Mark_"_ustr)); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); //Modification 5 rUndoManager.Undo(); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) != pMarkAccess->getAllMarksEnd()); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) != pMarkAccess->getAllMarksEnd()); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) == pMarkAccess->getAllMarksEnd())); //Modification 6 rUndoManager.Redo(); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); - CPPUNIT_ASSERT(bool(pMarkAccess->findMark(ReferenceMarkerName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); - CPPUNIT_ASSERT(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); + CPPUNIT_ASSERT(bool(pMarkAccess->findMark(SwMarkName(u"Mark"_ustr)) == pMarkAccess->getAllMarksEnd())); + CPPUNIT_ASSERT(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)) != pMarkAccess->getAllMarksEnd()); //Modification 7 - pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(u"Mark_"_ustr)), false); + pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(u"Mark_"_ustr)), false); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount()); diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 49afbdbb4296..7362108c18ad 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1841,7 +1841,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#1%19the%20tocmark%19C%7Ctoxmark"_ustr, url); rView.JumpToSwMark( - ReferenceMarkerName(url.copy(1))); // SfxApplication::OpenDocExec_Impl eats the "#" + SwMarkName(url.copy(1))); // SfxApplication::OpenDocExec_Impl eats the "#" CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "tocmark"), pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); @@ -1856,7 +1856,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) pWrtShell->Push(); OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#__RefHeading___Toc105_706348105"_ustr, url); - rView.JumpToSwMark(ReferenceMarkerName(url.copy(1))); + rView.JumpToSwMark(SwMarkName(url.copy(1))); CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); @@ -1877,7 +1877,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#1%19the%20udmark%19UUser-Defined%20Index%7Ctoxmark"_ustr, url); // User-Defined => User-Defined Index, tdf#161574 - rView.JumpToSwMark(ReferenceMarkerName(url.copy(1))); + rView.JumpToSwMark(SwMarkName(url.copy(1))); CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the first"), pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); @@ -1893,7 +1893,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#2%19the%20udmark%19UUser-Defined%20Index%7Ctoxmark"_ustr, url); // User-Defined => User-Defined Index, tdf#161574 - rView.JumpToSwMark(ReferenceMarkerName(url.copy(1))); + rView.JumpToSwMark(SwMarkName(url.copy(1))); CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(CH_TXTATR_INWORD) + "udmark the 2nd"), pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); @@ -1908,7 +1908,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) pWrtShell->Push(); OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#__RefHeading___Toc105_706348105"_ustr, url); - rView.JumpToSwMark(ReferenceMarkerName(url.copy(1))); + rView.JumpToSwMark(SwMarkName(url.copy(1))); CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); @@ -1928,7 +1928,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) pWrtShell->Push(); OUString const url(aSet.GetItem<SwFormatINetFormat>(RES_TXTATR_INETFMT)->GetValue()); CPPUNIT_ASSERT_EQUAL(u"#1%19the%20udmark%19UNewUD!%7C%7Ctoxmark"_ustr, url); - rView.JumpToSwMark(ReferenceMarkerName(url.copy(1))); + rView.JumpToSwMark(SwMarkName(url.copy(1))); CPPUNIT_ASSERT_EQUAL(u"the udmark"_ustr, pWrtShell->GetCursor()->GetPointNode().GetTextNode()->GetText()); pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index 88a7fbfe9331..61fa43e0c01d 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -542,7 +542,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479) SwPaM aPaM(aIdx); IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess(); sw::mark::MarkBase* pMark - = rIDMA.makeMark(aPaM, ReferenceMarkerName(u"original"_ustr), + = rIDMA.makeMark(aPaM, SwMarkName(u"original"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); CPPUNIT_ASSERT(!pMark->IsExpanded()); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), rIDMA.getBookmarksCount()); @@ -696,9 +696,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkText) lcl_selectCharacters(aPaM, 0, 3); IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess(); - sw::mark::MarkBase* pMark = rIDMA.makeMark( - aPaM, ReferenceMarkerName(u"testBookmark"_ustr), - IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); + sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, SwMarkName(u"testBookmark"_ustr), + IDocumentMarkAccess::MarkType::BOOKMARK, + ::sw::mark::InsertMode::New); // verify CPPUNIT_ASSERT(pMark->IsExpanded()); @@ -774,9 +774,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew) lcl_selectCharacters(aPaM, 0, 3); IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess(); - sw::mark::MarkBase* pMark = rIDMA.makeMark( - aPaM, ReferenceMarkerName(u"testBookmark"_ustr), - IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); + sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, SwMarkName(u"testBookmark"_ustr), + IDocumentMarkAccess::MarkType::BOOKMARK, + ::sw::mark::InsertMode::New); // verify CPPUNIT_ASSERT(pMark->IsExpanded()); diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index c2f1dc5cfd79..2718663b5bea 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -2479,8 +2479,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInconsistentBookmark) aPaM.SetMark(); aPaM.MovePara(GoCurrPara, fnParaStart); aPaM.MovePara(GoCurrPara, fnParaEnd); - rIDMA.makeMark(aPaM, ReferenceMarkerName(u"Mark"_ustr), - IDocumentMarkAccess::MarkType::BOOKMARK, ::sw::mark::InsertMode::New); + rIDMA.makeMark(aPaM, SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, + ::sw::mark::InsertMode::New); aPaM.Exchange(); aPaM.DeleteMark(); } diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index d72e4f57e020..c7a8f36061e5 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -821,16 +821,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) //moving cursor to the starting of document pWrtShell->StartOfSection(); //inserting reference field 1 - SwGetRefField aField1(pRefType, ReferenceMarkerName(u""_ustr), u""_ustr, REF_FOOTNOTE, - sal_uInt16(0), sal_uInt16(0), REF_CONTENT); + SwGetRefField aField1(pRefType, SwMarkName(u""_ustr), u""_ustr, REF_FOOTNOTE, sal_uInt16(0), + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aField1); //inserting second footnote pWrtShell->InsertFootnote(u""_ustr); pWrtShell->StartOfSection(); pCursor->Move(fnMoveForward); //inserting reference field 2 - SwGetRefField aField2(pRefType, ReferenceMarkerName(u""_ustr), u""_ustr, REF_FOOTNOTE, - sal_uInt16(1), sal_uInt16(0), REF_CONTENT); + SwGetRefField aField2(pRefType, SwMarkName(u""_ustr), u""_ustr, REF_FOOTNOTE, sal_uInt16(1), + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aField2); //inserting third footnote pWrtShell->InsertFootnote(u""_ustr); @@ -838,8 +838,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342) pCursor->Move(fnMoveForward); pCursor->Move(fnMoveForward); //inserting reference field 3 - SwGetRefField aField3(pRefType, ReferenceMarkerName(u""_ustr), u""_ustr, REF_FOOTNOTE, - sal_uInt16(2), sal_uInt16(0), REF_CONTENT); + SwGetRefField aField3(pRefType, SwMarkName(u""_ustr), u""_ustr, REF_FOOTNOTE, sal_uInt16(2), + sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aField3); //updating the fields IDocumentFieldsAccess& rField(pDoc->getIDocumentFieldsAccess()); @@ -1080,8 +1080,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) //moving cursor to the starting of document pWrtShell->StartOfSection(); //inserting reference field 1 - SwGetRefField aGetField1(pRefType, ReferenceMarkerName(u"Illustration"_ustr), u""_ustr, - REF_SEQUENCEFLD, sal_uInt16(0), sal_uInt16(0), REF_CONTENT); + SwGetRefField aGetField1(pRefType, SwMarkName(u"Illustration"_ustr), u""_ustr, REF_SEQUENCEFLD, + sal_uInt16(0), sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField1); //now we have ref1-seq1 //moving the cursor @@ -1093,8 +1093,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) pWrtShell->StartOfSection(); pCursor->Move(fnMoveForward); //inserting reference field 2 - SwGetRefField aGetField2(pRefType, ReferenceMarkerName(u"Illustration"_ustr), u""_ustr, - REF_SEQUENCEFLD, sal_uInt16(1), sal_uInt16(0), REF_CONTENT); + SwGetRefField aGetField2(pRefType, SwMarkName(u"Illustration"_ustr), u""_ustr, REF_SEQUENCEFLD, + sal_uInt16(1), sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField2); //now we have ref1-ref2-seq1-seq2 //moving the cursor @@ -1107,8 +1107,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553) pCursor->Move(fnMoveForward); pCursor->Move(fnMoveForward); //inserting reference field 3 - SwGetRefField aGetField3(pRefType, ReferenceMarkerName(u"Illustration"_ustr), u""_ustr, - REF_SEQUENCEFLD, sal_uInt16(2), sal_uInt16(0), REF_CONTENT); + SwGetRefField aGetField3(pRefType, SwMarkName(u"Illustration"_ustr), u""_ustr, REF_SEQUENCEFLD, + sal_uInt16(2), sal_uInt16(0), REF_CONTENT); pWrtShell->InsertField2(aGetField3); //now after insertion we have ref1-ref2-ref3-seq1-seq2-seq3 //updating the fields @@ -2354,18 +2354,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804) IDocumentMarkAccess* pIDMAccess(pDoc->getIDocumentMarkAccess()); //make first bookmark, CROSSREF_HEADING, with *empty* name sw::mark::MarkBase* pMark1(pIDMAccess->makeMark( - *pCrsr, ReferenceMarkerName(u""_ustr), - IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK, ::sw::mark::InsertMode::New)); + *pCrsr, SwMarkName(u""_ustr), IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK, + ::sw::mark::InsertMode::New)); //get the new(autogenerated) bookmark name - ReferenceMarkerName bookmark1name = pMark1->GetName(); + SwMarkName bookmark1name = pMark1->GetName(); //match the bookmark name, it should be like "__RefHeading__**" CPPUNIT_ASSERT(bookmark1name.toString().match("__RefHeading__")); //make second bookmark, CROSSREF_NUMITEM, with *empty* name sw::mark::MarkBase* pMark2(pIDMAccess->makeMark( - *pCrsr, ReferenceMarkerName(u""_ustr), - IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK, ::sw::mark::InsertMode::New)); + *pCrsr, SwMarkName(u""_ustr), IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK, + ::sw::mark::InsertMode::New)); //get the new(autogenerated) bookmark name - ReferenceMarkerName bookmark2name = pMark2->GetName(); + SwMarkName bookmark2name = pMark2->GetName(); //match the bookmark name, it should be like "__RefNumPara__**" CPPUNIT_ASSERT(bookmark2name.toString().match("__RefNumPara__")); } diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 40b26510fb54..5f92150cfa8a 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -387,7 +387,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf159816) // Add a bookmark at the very end IDocumentMarkAccess& rIDMA(*pDoc->getIDocumentMarkAccess()); - rIDMA.makeMark(*pWrtShell->GetCursor(), ReferenceMarkerName(u"Mark"_ustr), + rIDMA.makeMark(*pWrtShell->GetCursor(), SwMarkName(u"Mark"_ustr), IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); // Get coordinates of the end point in the document diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index e03baf51bba4..a6bfe4652972 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -112,7 +112,7 @@ DECLARE_WW8EXPORT_TEST(testTdf151548_formFieldMacros, "tdf151548_formFieldMacros IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); for(auto aIter = pMarkAccess->getFieldmarksBegin(); aIter != pMarkAccess->getFieldmarksEnd(); ++aIter) { - const ReferenceMarkerName sName = (*aIter)->GetName(); + const SwMarkName sName = (*aIter)->GetName(); CPPUNIT_ASSERT(sName == "Check1" || sName == "Check2" || sName == "Text1" || sName == "Dropdown1"); } } diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index 7fde600d2b17..24b7b92361c7 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testGotoMark) SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); pWrtShell->SplitNode(); pWrtShell->SttEndDoc(/*bStt=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"mybookmark"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"mybookmark"_ustr)); SwNodeOffset nExpected = pWrtShell->GetCursor()->GetPointNode().GetIndex(); // When jumping to that mark from the doc start: @@ -498,10 +498,10 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmarks) pWrtShell->SttEndDoc(/*bStt=*/true); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"ZOTERO_BREF_PRxDGUb4SWXF"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"ZOTERO_BREF_PRxDGUb4SWXF"_ustr)); // When updating the content of bookmarks: pWrtShell->SttEndDoc(/*bStt=*/true); @@ -552,8 +552,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmarks) // Without the accompanying fix in place, this test would have failed, ZOTERO_BREF_GiQ7DAWQYWLy // was not renamed to ZOTERO_BREF_new1. - auto it - = pDoc->getIDocumentMarkAccess()->findMark(ReferenceMarkerName(u"ZOTERO_BREF_new1"_ustr)); + auto it = pDoc->getIDocumentMarkAccess()->findMark(SwMarkName(u"ZOTERO_BREF_new1"_ustr)); CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAllMarksEnd()); } @@ -1114,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmark) pWrtShell->SttEndDoc(/*bStt=*/true); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"ZOTERO_BREF_old"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"ZOTERO_BREF_old"_ustr)); // When updating the content of the bookmark under the cursor: pWrtShell->SttEndDoc(/*bStt=*/true); @@ -1151,8 +1150,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmark) // - Actual : ABCD // i.e. it was not possible to update just the bookmark under cursor. CPPUNIT_ASSERT_EQUAL(u"Anew resultD"_ustr, aActual); - auto it - = pDoc->getIDocumentMarkAccess()->findMark(ReferenceMarkerName(u"ZOTERO_BREF_new"_ustr)); + auto it = pDoc->getIDocumentMarkAccess()->findMark(SwMarkName(u"ZOTERO_BREF_new"_ustr)); CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAllMarksEnd()); } @@ -1217,10 +1215,10 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteBookmarks) pWrtShell->SttEndDoc(/*bStt=*/true); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); - pWrtShell->SetBookmark(vcl::KeyCode(), ReferenceMarkerName(u"other"_ustr)); + pWrtShell->SetBookmark(vcl::KeyCode(), SwMarkName(u"other"_ustr)); // When deleting 1 matching bookmark: pWrtShell->SttEndDoc(/*bStt=*/true); @@ -1236,12 +1234,12 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteBookmarks) dispatchCommand(mxComponent, u".uno:DeleteBookmarks"_ustr, aArgs); // Then make sure that only the other bookmark is kept: - auto it = pDoc->getIDocumentMarkAccess()->findMark( - ReferenceMarkerName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); + auto it + = pDoc->getIDocumentMarkAccess()->findMark(SwMarkName(u"ZOTERO_BREF_GiQ7DAWQYWLy"_ustr)); // Without the accompanying fix in place, this test would have failed, the matching bookmark was // not removed. CPPUNIT_ASSERT(bool(it == pDoc->getIDocumentMarkAccess()->getAllMarksEnd())); - it = pDoc->getIDocumentMarkAccess()->findMark(ReferenceMarkerName(u"other"_ustr)); + it = pDoc->getIDocumentMarkAccess()->findMark(SwMarkName(u"other"_ustr)); CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAllMarksEnd()); } diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 3661e792015d..ddc11722c656 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -330,7 +330,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_CHRATR_BIDIRTL, new SfxInt16Item( RES_CHRATR_BIDIRTL, sal_Int16(-1) ), 0, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_IDCTHINT, new SfxInt16Item( RES_CHRATR_IDCTHINT, sal_Int16(-1) ), 0, SFX_ITEMINFOFLAG_NONE }, - { RES_TXTATR_REFMARK, new SwFormatRefMark( ReferenceMarkerName() ), 0, SFX_ITEMINFOFLAG_NONE }, + { RES_TXTATR_REFMARK, new SwFormatRefMark( SwMarkName() ), 0, SFX_ITEMINFOFLAG_NONE }, { RES_TXTATR_TOXMARK, createSwTOXMarkForItemInfoPackage(), 0, SFX_ITEMINFOFLAG_NONE }, { RES_TXTATR_META, SwFormatMeta::CreatePoolDefault(RES_TXTATR_META), 0, SFX_ITEMINFOFLAG_NONE }, { RES_TXTATR_METAFIELD, SwFormatMeta::CreatePoolDefault(RES_TXTATR_METAFIELD), 0, SFX_ITEMINFOFLAG_NONE }, diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx index c6ff8f9103e8..a5c88506ceba 100644 --- a/sw/source/core/crsr/annotationmark.cxx +++ b/sw/source/core/crsr/annotationmark.cxx @@ -35,7 +35,7 @@ namespace sw::mark { AnnotationMark::AnnotationMark( const SwPaM& rPaM, - const ReferenceMarkerName& rName ) + const SwMarkName& rName ) : MarkBase( rPaM, rName ) { if ( rName.toString().getLength() == 0 ) diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 0584568639f5..7ab8d12bf585 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -270,7 +270,7 @@ namespace namespace sw::mark { MarkBase::MarkBase(const SwPaM& aPaM, - ReferenceMarkerName aName) + SwMarkName aName) : m_oPos1(*aPaM.GetPoint()) , m_aName(std::move(aName)) { @@ -333,14 +333,14 @@ namespace sw::mark MarkBase::~MarkBase() { } - ReferenceMarkerName MarkBase::GenerateNewName(std::u16string_view rPrefix) + SwMarkName MarkBase::GenerateNewName(std::u16string_view rPrefix) { static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr); if (bHack) { static sal_Int64 nIdCounter = SAL_CONST_INT64(6000000000); - return ReferenceMarkerName(rPrefix + OUString::number(nIdCounter++)); + return SwMarkName(rPrefix + OUString::number(nIdCounter++)); } else { @@ -354,7 +354,7 @@ namespace sw::mark nCount = 0; } // putting the counter in front of the random parts will speed up string comparisons - return ReferenceMarkerName(rPrefix + OUString::number(nCount++) + sUniquePostfix); + return SwMarkName(rPrefix + OUString::number(nCount++) + sUniquePostfix); } } @@ -408,7 +408,7 @@ namespace sw::mark Bookmark::Bookmark(const SwPaM& aPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName) + const SwMarkName& rName) : DdeBookmark(aPaM) , m_aCode(rCode) , m_bHidden(false) @@ -425,7 +425,7 @@ namespace sw::mark if (!pViewShell) return; - ReferenceMarkerName fieldCommand = GetName(); + SwMarkName fieldCommand = GetName(); tools::JsonWriter aJson; aJson.put("commandName", ".uno:DeleteBookmark"); aJson.put("success", true); @@ -572,7 +572,7 @@ namespace sw::mark (void)xmlTextWriterEndElement(pWriter); } - TextFieldmark::TextFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName) + TextFieldmark::TextFieldmark(const SwPaM& rPaM, const SwMarkName& rName) : Fieldmark(rPaM) , m_pDocumentContentOperationsManager(nullptr) { @@ -705,7 +705,7 @@ namespace sw::mark } - CheckboxFieldmark::CheckboxFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName) + CheckboxFieldmark::CheckboxFieldmark(const SwPaM& rPaM, const SwMarkName& rName) : NonTextFieldmark(rPaM) { if (!rName.isEmpty()) @@ -769,7 +769,7 @@ namespace sw::mark m_pButton->LaunchPopup(); } - DropDownFieldmark::DropDownFieldmark(const SwPaM& rPaM, const ReferenceMarkerName& rName) + DropDownFieldmark::DropDownFieldmark(const SwPaM& rPaM, const SwMarkName& rName) : FieldmarkWithDropDownButton(rPaM) { if (!rName.isEmpty()) diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx index 3fad19ae7caf..73d723a6c39e 100644 --- a/sw/source/core/crsr/crbm.cxx +++ b/sw/source/core/crsr/crbm.cxx @@ -77,7 +77,7 @@ namespace // at CurrentCursor.SPoint ::sw::mark::MarkBase* SwCursorShell::SetBookmark( const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName, + const SwMarkName& rName, IDocumentMarkAccess::MarkType eMark) { StartAction(); @@ -99,7 +99,7 @@ namespace // at CurrentCursor.SPoint ::sw::mark::MarkBase* SwCursorShell::SetBookmark2( const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName, + const SwMarkName& rName, bool bHide, const OUString& rCondition) { diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 992b0c072faf..b1e403c9178b 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -35,7 +35,7 @@ namespace sw::mark { CrossRefBookmark::CrossRefBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName, + const SwMarkName& rName, std::u16string_view rPrefix) : Bookmark( // ensure that m_pPos2 is null by only passing start to super @@ -70,22 +70,22 @@ namespace sw::mark CrossRefHeadingBookmark::CrossRefHeadingBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName) + const SwMarkName& rName) : CrossRefBookmark(rPaM, rCode, rName, Concat2View(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")) { } - bool CrossRefHeadingBookmark::IsLegalName(const ReferenceMarkerName& rName) + bool CrossRefHeadingBookmark::IsLegalName(const SwMarkName& rName) { return o3tl::starts_with(rName.toString(), IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()); } CrossRefNumItemBookmark::CrossRefNumItemBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName) + const SwMarkName& rName) : CrossRefBookmark(rPaM, rCode, rName, CrossRefNumItemBookmark_NamePrefix) { } - bool CrossRefNumItemBookmark::IsLegalName(const ReferenceMarkerName& rName) + bool CrossRefNumItemBookmark::IsLegalName(const SwMarkName& rName) { return o3tl::starts_with(rName.toString(), CrossRefNumItemBookmark_NamePrefix); } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 48f1fab3aae6..48665ea86359 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1451,7 +1451,7 @@ void SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineN } /// jump to reference marker -bool SwCursorShell::GotoRefMark( const ReferenceMarkerName& rRefMark, sal_uInt16 nSubType, +bool SwCursorShell::GotoRefMark( const SwMarkName& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags ) { CurrShell aCurr( this ); diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 5150541aba18..ade87b32b466 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -298,14 +298,14 @@ namespace sw lcl_SetCpyPos(pMark->GetOtherMarkPos(), rStt, *pCpyStt, *aTmpPam.GetMark(), nDelCount); } - ReferenceMarkerName sRequestedName = pMark->GetName(); + SwMarkName sRequestedName = pMark->GetName(); if (flags & SwCopyFlags::IsMoveToFly) { assert(&rSrcDoc == &rDestDoc); // Ensure the name can be given to NewMark, since this is ultimately a move auto pSoonToBeDeletedMark = const_cast<sw::mark::MarkBase*>(pMark); rDestDoc.getIDocumentMarkAccess()->renameMark(pSoonToBeDeletedMark, - ReferenceMarkerName(sRequestedName.toString() + "COPY_IS_MOVE")); + SwMarkName(sRequestedName.toString() + "COPY_IS_MOVE")); } ::sw::mark::MarkBase* const pNewMark = rDestDoc.getIDocumentMarkAccess()->makeMark( @@ -4759,7 +4759,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt // If any Redline will change (split!) the node const ::sw::mark::MarkBase* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, - ReferenceMarkerName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, + SwMarkName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, ::sw::mark::InsertMode::New); m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( @@ -4860,7 +4860,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt // If any Redline will change (split!) the node const ::sw::mark::MarkBase* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, - ReferenceMarkerName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, + SwMarkName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, ::sw::mark::InsertMode::New); aDelPam.GetPoint()->Assign( SwNodeOffset(0) ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 3f415c717f9d..03794f311cec 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1070,7 +1070,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( } /// @return the reference in the doc for the name -const SwFormatRefMark* SwDoc::GetRefMark( const ReferenceMarkerName& rName ) const +const SwFormatRefMark* SwDoc::GetRefMark( const SwMarkName& rName ) const { const SwFormatRefMark* pRet = nullptr; ForEachRefMark( @@ -1118,7 +1118,7 @@ sal_uInt16 SwDoc::GetRefMarks( std::vector<OUString>* pNames ) const { if( pNames ) { - ReferenceMarkerName aTmp(rRefMark.GetRefName()); + SwMarkName aTmp(rRefMark.GetRefName()); pNames->insert(pNames->begin() + nCount, aTmp.toString()); } ++nCount; diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 224b2aba3851..135dbc561bba 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -379,7 +379,7 @@ namespace }; template <class container_t> - auto lcl_FindMarkByName(const ReferenceMarkerName& rName, const container_t& container) + auto lcl_FindMarkByName(const SwMarkName& rName, const container_t& container) { return find_if(begin(container), end(container), [&rName](const auto* item) { return item->GetName() == rName; }); @@ -501,7 +501,7 @@ namespace sw::mark { } ::sw::mark::MarkBase* MarkManager::makeMark(const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const IDocumentMarkAccess::MarkType eType, sw::mark::InsertMode const eMode, SwPosition const*const pSepPos) @@ -674,7 +674,7 @@ namespace sw::mark ::sw::mark::Fieldmark* MarkManager::makeFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType, SwPosition const*const pSepPos) { @@ -714,7 +714,7 @@ namespace sw::mark ::sw::mark::Fieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType) { // Disable undo, because we handle it using SwUndoInsNoTextFieldmark @@ -770,12 +770,12 @@ namespace sw::mark if(ppExistingMark != m_vBookmarks.end()) return *ppExistingMark; const SwPaM aPaM(aPos); - return makeMark(aPaM, ReferenceMarkerName(), eType, sw::mark::InsertMode::New); + return makeMark(aPaM, SwMarkName(), eType, sw::mark::InsertMode::New); } sw::mark::MarkBase* MarkManager::makeAnnotationMark( const SwPaM& rPaM, - const ReferenceMarkerName& rName ) + const SwMarkName& rName ) { return makeMark(rPaM, rName, IDocumentMarkAccess::MarkType::ANNOTATIONMARK, sw::mark::InsertMode::New); @@ -810,7 +810,7 @@ namespace sw::mark bool MarkManager::renameMark( ::sw::mark::MarkBase* io_pMark, - const ReferenceMarkerName& rNewName ) + const SwMarkName& rNewName ) { assert(&io_pMark->GetMarkPos().GetDoc() == &m_rDoc && "<MarkManager::renameMark(..)>" @@ -819,7 +819,7 @@ namespace sw::mark return true; if (lcl_FindMarkByName(rNewName, m_vAllMarks) != m_vAllMarks.end()) return false; - const ReferenceMarkerName sOldName(io_pMark->GetName()); + const SwMarkName sOldName(io_pMark->GetName()); io_pMark->SetName(rNewName); if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark)) @@ -1330,12 +1330,12 @@ namespace sw::mark m_vAllMarks.clear(); } - IDocumentMarkAccess::const_iterator MarkManager::findMark(const ReferenceMarkerName& rName) const + IDocumentMarkAccess::const_iterator MarkManager::findMark(const SwMarkName& rName) const { return lcl_FindMarkByName(rName, m_vAllMarks); } - std::vector<sw::mark::Bookmark*>::const_iterator MarkManager::findBookmark(const ReferenceMarkerName& rName) const + std::vector<sw::mark::Bookmark*>::const_iterator MarkManager::findBookmark(const SwMarkName& rName) const { return lcl_FindMarkByName(rName, m_vBookmarks); } @@ -1514,7 +1514,7 @@ namespace sw::mark return nullptr; // Store attributes needed to create the new fieldmark - ReferenceMarkerName sName = pFieldmark->GetName(); + SwMarkName sName = pFieldmark->GetName(); SwPaM const aPaM(pFieldmark->GetMarkStart()); // Remove the old fieldmark and create a new one with the new type @@ -1674,7 +1674,7 @@ namespace sw::mark return m_vAnnotationMarks.size(); } - std::vector<sw::mark::AnnotationMark*>::const_iterator MarkManager::findAnnotationMark( const ReferenceMarkerName& rName ) const + std::vector<sw::mark::AnnotationMark*>::const_iterator MarkManager::findAnnotationMark( const SwMarkName& rName ) const { return lcl_FindMarkByName( rName, m_vAnnotationMarks ); } @@ -1692,11 +1692,11 @@ namespace sw::mark // create helper bookmark for annotations on tracked deletions ::sw::mark::Bookmark* MarkManager::makeAnnotationBookmark(const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, sw::mark::InsertMode const eMode, SwPosition const*const pSepPos) { - ReferenceMarkerName sAnnotationBookmarkName(rName.toString() + S_ANNOTATION_BOOKMARK); + SwMarkName sAnnotationBookmarkName(rName.toString() + S_ANNOTATION_BOOKMARK); return static_cast<sw::mark::Bookmark*>(makeMark( rPaM, sAnnotationBookmarkName, MarkType::BOOKMARK, eMode, pSepPos)); } @@ -1721,9 +1721,9 @@ namespace sw::mark } // find helper bookmark of annotations on tracked deletions - std::vector<sw::mark::Bookmark*>::const_iterator MarkManager::findAnnotationBookmark(const ReferenceMarkerName& rName) const + std::vector<sw::mark::Bookmark*>::const_iterator MarkManager::findAnnotationBookmark(const SwMarkName& rName) const { - ReferenceMarkerName sAnnotationBookmarkName(rName.toString() + S_ANNOTATION_BOOKMARK); + SwMarkName sAnnotationBookmarkName(rName.toString() + S_ANNOTATION_BOOKMARK); return findBookmark(sAnnotationBookmarkName); } @@ -1734,13 +1734,13 @@ namespace sw::mark for (auto iter = getBookmarksBegin(); iter != getBookmarksEnd(); ) { - const ReferenceMarkerName & rBookmarkName = (**iter).GetName(); + const SwMarkName & rBookmarkName = (**iter).GetName(); sal_Int32 nPos; if ( rBookmarkName.toString().startsWith("__Annotation__") && (nPos = rBookmarkName.toString().indexOf(S_ANNOTATION_BOOKMARK)) > -1 ) { ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo()); - auto pMark = findAnnotationMark(ReferenceMarkerName(rBookmarkName.toString().copy(0, nPos))); + auto pMark = findAnnotationMark(SwMarkName(rBookmarkName.toString().copy(0, nPos))); if ( pMark != getAnnotationMarksEnd() ) { const SwPaM aPam((**iter).GetMarkStart(), (**pMark).GetMarkEnd()); @@ -1760,7 +1760,7 @@ namespace sw::mark } } - ReferenceMarkerName MarkManager::getUniqueMarkName(const ReferenceMarkerName& rName) const + SwMarkName MarkManager::getUniqueMarkName(const SwMarkName& rName) const { OSL_ENSURE(rName.toString().getLength(), "<MarkManager::getUniqueMarkName(..)> - a name should be proposed"); @@ -1769,7 +1769,7 @@ namespace sw::mark OUString newName = rName.toString() + "MailMergeMark" + DateTimeToOUString( DateTime( DateTime::SYSTEM ) ) + OUString::number( m_vAllMarks.size() + 1 ); - return ReferenceMarkerName(newName); + return SwMarkName(newName); } if (lcl_FindMarkByName(rName, m_vAllMarks) == m_vAllMarks.end()) @@ -1790,14 +1790,14 @@ namespace sw::mark { sTmp = aPrefix + OUString::number(nCnt); nCnt++; - if (lcl_FindMarkByName(ReferenceMarkerName(sTmp), m_vAllMarks) == m_vAllMarks.end()) + if (lcl_FindMarkByName(SwMarkName(sTmp), m_vAllMarks) == m_vAllMarks.end()) { break; } } m_aMarkBasenameMapUniqueOffset[rName] = nCnt; - return ReferenceMarkerName(sTmp); + return SwMarkName(sTmp); } void MarkManager::assureSortedMarkContainers() const diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 1ad6360aa50f..58ea61e5c21d 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -432,7 +432,7 @@ const SwDocStat& SwEditShell::GetUpdatedDocStat() } /// get the reference of a given name in the Doc -const SwFormatRefMark* SwEditShell::GetRefMark( const ReferenceMarkerName& rName ) const +const SwFormatRefMark* SwEditShell::GetRefMark( const SwMarkName& rName ) const { return GetDoc()->GetRefMark( rName ); } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 5c60bbeac639..bfe5f65c876f 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1790,14 +1790,14 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT, OUString aAuthor, OUString aText, OUString aInitials, - ReferenceMarkerName aName, + SwMarkName aName, const DateTime& rDateTime, const bool bResolved, const sal_uInt32 nPostItId, const sal_uInt32 nParentId, const sal_uInt32 nParaId, const sal_uInt32 nParentPostItId, - ReferenceMarkerName aParentName + SwMarkName aParentName ) : SwField( pT ) , m_sText( std::move(aText) ) @@ -1886,12 +1886,12 @@ OUString SwPostItField::GetPar2() const } -void SwPostItField::SetName(const ReferenceMarkerName& rName) +void SwPostItField::SetName(const SwMarkName& rName) { m_sName = rName; } -void SwPostItField::SetParentName(const ReferenceMarkerName& rName) +void SwPostItField::SetParentName(const SwMarkName& rName) { m_sParentName = rName; } @@ -2021,14 +2021,14 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) { OUString tmp; if (rAny >>= tmp) - m_sName = ReferenceMarkerName(tmp); + m_sName = SwMarkName(tmp); } break; case FIELD_PROP_PAR7: // PAR5 (Parent Para Id) and PAR6 (Para Id) are skipped - they are not written into xml. Used for file conversion. { OUString tmp; if (rAny >>= tmp) - m_sParentName = ReferenceMarkerName(tmp); + m_sParentName = SwMarkName(tmp); } break; case FIELD_PROP_BOOL1: diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 1d45681226bb..20dccd31999e 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -351,7 +351,7 @@ static void lcl_formatReferenceLanguage( OUString& rRefText, /// get references SwGetRefField::SwGetRefField( SwGetRefFieldType* pFieldType, - ReferenceMarkerName aSetRef, OUString aSetReferenceLanguage, sal_uInt16 nSubTyp, + SwMarkName aSetRef, OUString aSetReferenceLanguage, sal_uInt16 nSubTyp, sal_uInt16 nSequenceNo, sal_uInt16 nFlags, sal_uLong nFormat ) : SwField(pFieldType, nFormat), m_sSetRefName(std::move(aSetRef)), @@ -889,7 +889,7 @@ OUString SwGetRefField::GetPar1() const /// set reference name void SwGetRefField::SetPar1( const OUString& rName ) { - m_sSetRefName = ReferenceMarkerName(rName); + m_sSetRefName = SwMarkName(rName); } OUString SwGetRefField::GetPar2() const @@ -1328,7 +1328,7 @@ namespace } } -SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const ReferenceMarkerName& rRefMark, +SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const SwMarkName& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nFlags, sal_Int32* pStart, sal_Int32* pEnd, SwRootFrame const* const pLayout, const SwTextNode* pSelf, SwFrame* pContentFrame) @@ -1455,7 +1455,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const ReferenceMarkerName return pTextNd; } -SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* pDoc, const ReferenceMarkerName& rRefMark, +SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* pDoc, const SwMarkName& rRefMark, sal_uInt16 nFlags, sal_Int32* pStart, sal_Int32* pEnd, SwRootFrame const* const pLayout, const SwTextNode* pSelf, SwFrame* pContentFrame) @@ -1680,7 +1680,7 @@ namespace { struct RefIdsMap { private: - ReferenceMarkerName aName; + SwMarkName aName; std::set<sal_uInt16> aIds; std::set<sal_uInt16> aDstIds; std::map<sal_uInt16, sal_uInt16> sequencedIds; /// ID numbers sorted by sequence number. @@ -1693,11 +1693,11 @@ private: static sal_uInt16 GetFirstUnusedId( std::set<sal_uInt16> &rIds ); public: - explicit RefIdsMap( ReferenceMarkerName _aName ) : aName(std::move( _aName )), bInit( false ) {} + explicit RefIdsMap( SwMarkName _aName ) : aName(std::move( _aName )), bInit( false ) {} void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rField, bool bField ); - const ReferenceMarkerName& GetName() const { return aName; } + const SwMarkName& GetName() const { return aName; } }; } @@ -1844,7 +1844,7 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc ) // then there are RefFields in the DescDox - so all RefFields in the SourceDoc // need to be converted to have unique IDs for both documents - RefIdsMap aFntMap { ReferenceMarkerName() }; + RefIdsMap aFntMap { SwMarkName() }; std::vector<std::unique_ptr<RefIdsMap>> aFieldMap; std::vector<SwFormatField*> vFields; diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 55ad5920f074..68ad0c17d780 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -29,7 +29,7 @@ class SwCursorShell; class SfxViewShell; namespace sw::mark { - typedef std::unordered_map<ReferenceMarkerName, sal_Int32> MarkBasenameMapUniqueOffset_t; + typedef std::unordered_map<SwMarkName, sal_Int32> MarkBasenameMapUniqueOffset_t; class AnnotationMark; class FieldmarkWithDropDownButton; @@ -41,26 +41,26 @@ namespace sw::mark { MarkManager(/*[in/out]*/ SwDoc& rDoc); // IDocumentMarkAccess virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM, - const ReferenceMarkerName& rName, IDocumentMarkAccess::MarkType eMark, + const SwMarkName& rName, IDocumentMarkAccess::MarkType eMark, sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) override; virtual sw::mark::Fieldmark* makeFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType, SwPosition const* pSepPos = nullptr) override; virtual sw::mark::Fieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, const OUString& rType) override; virtual ::sw::mark::MarkBase* getMarkForTextNode(const SwTextNode& rTextNode, IDocumentMarkAccess::MarkType eMark) override; virtual sw::mark::MarkBase* makeAnnotationMark( const SwPaM& rPaM, - const ReferenceMarkerName& rName ) override; + const SwMarkName& rName ) override; virtual void repositionMark(::sw::mark::MarkBase* io_pMark, const SwPaM& rPaM) override; - virtual bool renameMark(::sw::mark::MarkBase* io_pMark, const ReferenceMarkerName& rNewName) override; + virtual bool renameMark(::sw::mark::MarkBase* io_pMark, const SwMarkName& rNewName) override; virtual void correctMarksAbsolute(const SwNode& rOldNode, const SwPosition& rNewPos, const sal_Int32 nOffset) override; virtual void correctMarksRelative(const SwNode& rOldNode, const SwPosition& rNewPos, const sal_Int32 nOffset) override; @@ -81,7 +81,7 @@ namespace sw::mark { virtual const_iterator getAllMarksBegin() const override; virtual const_iterator getAllMarksEnd() const override; virtual sal_Int32 getAllMarksCount() const override; - virtual const_iterator findMark(const ReferenceMarkerName& rName) const override; + virtual const_iterator findMark(const SwMarkName& rName) const override; virtual std::vector<sw::mark::Bookmark*>::const_iterator findFirstBookmarkNotStartsBefore(const SwPosition& rPos) const override; // bookmarks @@ -89,7 +89,7 @@ namespace sw::mark { virtual std::vector<sw::mark::Bookmark*>::const_iterator getBookmarksBegin() const override; virtual std::vector<sw::mark::Bookmark*>::const_iterator getBookmarksEnd() const override; virtual sal_Int32 getBookmarksCount() const override; - virtual std::vector<sw::mark::Bookmark*>::const_iterator findBookmark(const ReferenceMarkerName& rName) const override; + virtual std::vector<sw::mark::Bookmark*>::const_iterator findBookmark(const SwMarkName& rName) const override; virtual std::vector<sw::mark::Bookmark*>::const_iterator findFirstBookmarkStartsAfter(const SwPosition& rPos) const override; virtual ::sw::mark::Bookmark* getOneInnermostBookmarkFor(const SwPosition& rPos) const override; @@ -118,7 +118,7 @@ namespace sw::mark { virtual std::vector<sw::mark::AnnotationMark*>::const_iterator getAnnotationMarksBegin() const override; virtual std::vector<sw::mark::AnnotationMark*>::const_iterator getAnnotationMarksEnd() const override; virtual sal_Int32 getAnnotationMarksCount() const override; - virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findAnnotationMark( const ReferenceMarkerName& rName ) const override; + virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findAnnotationMark( const SwMarkName& rName ) const override; virtual sw::mark::AnnotationMark* getAnnotationMarkFor(const SwPosition& rPos) const override; virtual void assureSortedMarkContainers() const override; @@ -128,12 +128,12 @@ namespace sw::mark { // helper bookmark to store annotation range of redlines virtual ::sw::mark::Bookmark* makeAnnotationBookmark(const SwPaM& rPaM, - const ReferenceMarkerName& rName, + const SwMarkName& rName, sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) override; virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findFirstAnnotationMarkNotStartsBefore(const SwPosition& rPos) const override; virtual std::vector<sw::mark::AnnotationMark*>::const_iterator findFirstAnnotationMarkNotStartsBefore(const SwNode& rPos) const override; - virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const ReferenceMarkerName& rName ) const override; + virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const SwMarkName& rName ) const override; virtual void restoreAnnotationMarks(bool bDelete = true) override; private: @@ -142,7 +142,7 @@ namespace sw::mark { MarkManager& operator=(MarkManager const&) = delete; // make names - ReferenceMarkerName getUniqueMarkName(const ReferenceMarkerName& rName) const; + SwMarkName getUniqueMarkName(const SwMarkName& rName) const; void sortSubsetMarks(); void sortMarks(); diff --git a/sw/source/core/inc/UndoBookmark.hxx b/sw/source/core/inc/UndoBookmark.hxx index e26e0f749a41..863092aaaea7 100644 --- a/sw/source/core/inc/UndoBookmark.hxx +++ b/sw/source/core/inc/UndoBookmark.hxx @@ -84,18 +84,17 @@ public: class SwUndoRenameBookmark final : public SwUndo { - const ReferenceMarkerName m_sOldName; - const ReferenceMarkerName m_sNewName; + const SwMarkName m_sOldName; + const SwMarkName m_sNewName; public: - SwUndoRenameBookmark(ReferenceMarkerName aOldName, ReferenceMarkerName aNewName, - const SwDoc& rDoc); + SwUndoRenameBookmark(SwMarkName aOldName, SwMarkName aNewName, const SwDoc& rDoc); virtual ~SwUndoRenameBookmark() override; private: virtual SwRewriter GetRewriter() const override; - static void Rename(::sw::UndoRedoContext const&, const ReferenceMarkerName& sFrom, - const ReferenceMarkerName& sTo); + static void Rename(::sw::UndoRedoContext const&, const SwMarkName& sFrom, + const SwMarkName& sTo); virtual void UndoImpl(::sw::UndoRedoContext&) override; virtual void RedoImpl(::sw::UndoRedoContext&) override; }; diff --git a/sw/source/core/inc/annotationmark.hxx b/sw/source/core/inc/annotationmark.hxx index 3d1707da9810..f444031ab296 100644 --- a/sw/source/core/inc/annotationmark.hxx +++ b/sw/source/core/inc/annotationmark.hxx @@ -32,7 +32,7 @@ namespace sw::mark public: AnnotationMark( const SwPaM& rPaM, - const ReferenceMarkerName& rName ); + const SwMarkName& rName ); virtual ~AnnotationMark() override; diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx index 898f2b8377a2..4b80df422b15 100644 --- a/sw/source/core/inc/crossrefbookmark.hxx +++ b/sw/source/core/inc/crossrefbookmark.hxx @@ -35,7 +35,7 @@ namespace sw::mark { public: CrossRefBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName, + const SwMarkName& rName, std::u16string_view rPrefix); // getters @@ -70,8 +70,8 @@ namespace sw::mark { public: CrossRefHeadingBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName); - static bool IsLegalName(const ReferenceMarkerName& rName); + const SwMarkName& rName); + static bool IsLegalName(const SwMarkName& rName); }; class CrossRefNumItemBookmark final @@ -80,8 +80,8 @@ namespace sw::mark { public: CrossRefNumItemBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, - const ReferenceMarkerName& rName); - static bool IsLegalName(const ReferenceMarkerName& rName); + const SwMarkName& rName); + static bool IsLegalName(const SwMarkName& rName); }; } diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index 999f0c444768..11c926edd6be 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -57,7 +57,7 @@ namespace sw::mark std::optional<sal_Int32> oContentIdx = std::nullopt); private: - ReferenceMarkerName m_aName; + SwMarkName m_aName; OUString m_aShortName; bool m_bHidden; OUString m_aHideCondition; diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index 0eee5c4aaf5b..50915839ec0b 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -154,7 +154,7 @@ public: class SwHistorySetRefMark final : public SwHistoryHint { - const ReferenceMarkerName m_RefName; + const SwMarkName m_RefName; const SwNodeOffset m_nNodeIndex; const sal_Int32 m_nStart; const sal_Int32 m_nEnd; @@ -162,7 +162,7 @@ class SwHistorySetRefMark final : public SwHistoryHint public: SwHistorySetRefMark( const SwTextRefMark* pTextHt, SwNodeOffset nNode ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ) override; - const ReferenceMarkerName& GetRefName() {return m_RefName;} + const SwMarkName& GetRefName() {return m_RefName;} }; class SwHistorySetTOXMark final : public SwHistoryHint @@ -251,10 +251,10 @@ class SwHistoryBookmark final : public SwHistoryHint virtual void SetInDoc(SwDoc * pDoc, bool) override; bool IsEqualBookmark(const ::sw::mark::MarkBase& rBkmk); - const ReferenceMarkerName& GetName() const { return m_aName;} + const SwMarkName& GetName() const { return m_aName;} private: - const ReferenceMarkerName m_aName; + const SwMarkName m_aName; OUString m_aShortName; bool m_bHidden; OUString m_aHideCondition; @@ -295,7 +295,7 @@ class SwHistoryTextFieldmark final : public SwHistoryHint void ResetInDoc(SwDoc& rDoc); private: - const ReferenceMarkerName m_sName; + const SwMarkName m_sName; const OUString m_sType; const SwNodeOffset m_nStartNode; const sal_Int32 m_nStartContent; diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index d12ebf3299aa..b6d6c9f4b9d0 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -68,7 +68,7 @@ private: std::vector<DirectionChangeInfo> m_DirectionChanges; std::vector<TextFrameIndex> m_Kashida; std::vector<TextFrameIndex> m_HiddenChg; - std::vector<std::tuple<TextFrameIndex, MarkKind, Color, ReferenceMarkerName, OUString>> m_Bookmarks; + std::vector<std::tuple<TextFrameIndex, MarkKind, Color, SwMarkName, OUString>> m_Bookmarks; //! Records a single change in compression. struct CompressionChangeInfo { @@ -169,7 +169,7 @@ public: } TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const; TextFrameIndex NextBookmark(TextFrameIndex nPos) const; - std::vector<std::tuple<MarkKind, Color, ReferenceMarkerName, OUString>> + std::vector<std::tuple<MarkKind, Color, SwMarkName, OUString>> GetBookmarks(TextFrameIndex const nPos); static void CalcHiddenRanges(const SwTextNode& rNode, MultiSelection& rHiddenMulti, diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 9ea0d87efe03..1df25c7f89d2 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -2456,7 +2456,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe { aURL = aURL.copy( 1 ); mrSh.SwCursorShell::ClearMark(); - if (! JumpToSwMark( &mrSh, ReferenceMarkerName(aURL) )) + if (! JumpToSwMark( &mrSh, SwMarkName(aURL) )) { continue; // target deleted } @@ -2544,7 +2544,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe { aURL = aURL.copy( 1 ); mrSh.SwCursorShell::ClearMark(); - if (! JumpToSwMark( &mrSh, ReferenceMarkerName(aURL) )) + if (! JumpToSwMark( &mrSh, SwMarkName(aURL) )) { continue; // target deleted } @@ -2681,7 +2681,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe // Destination Rectangle const SwGetRefField* pField = static_cast<SwGetRefField*>(pFormatField->GetField()); - const ReferenceMarkerName& rRefName = pField->GetSetRefName(); + const SwMarkName& rRefName = pField->GetSetRefName(); mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo(), pField->GetFlags() ); const SwRect& rDestRect = mrSh.GetCharRect(); @@ -2987,7 +2987,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe //get the name const ::sw::mark::MarkBase* pBkmk = *ppMark; mrSh.SwCursorShell::ClearMark(); - const ReferenceMarkerName& sBkName = pBkmk->GetName(); + const SwMarkName& sBkName = pBkmk->GetName(); //jump to it if (! JumpToSwMark( &mrSh, sBkName )) @@ -3028,7 +3028,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe if ( bInternal ) { aBookmarkName = aBookmarkName.copy( 1 ); - JumpToSwMark( &mrSh, ReferenceMarkerName(aBookmarkName) ); + JumpToSwMark( &mrSh, SwMarkName(aBookmarkName) ); // Destination Rectangle const SwRect& rDestRect = mrSh.GetCharRect(); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 66553f8ef708..65924e3bfd14 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -955,7 +955,7 @@ static void InitBookmarks( std::vector<sw::Extent>::const_iterator const end, TextFrameIndex nOffset, std::vector<std::pair<sw::mark::Bookmark*, SwScriptInfo::MarkKind>> & rBookmarks, - std::vector<std::tuple<TextFrameIndex, SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUString>> & o_rBookmarks) + std::vector<std::tuple<TextFrameIndex, SwScriptInfo::MarkKind, Color, SwMarkName, OUString>> & o_rBookmarks) { SwTextNode const*const pNode(iter->pNode); -e ... etc. - the rest is truncated