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 <vmiklos@collabora.com> Tested-by: Jenkins
This commit is contained in:
committed by
Miklos Vajna
parent
20b48ed9e3
commit
a6bef55d65
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
+9
-9
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+4
-4
@@ -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
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+8
-8
@@ -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 );
|
||||
|
||||
+1
-1
@@ -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. */
|
||||
|
||||
+4
-4
@@ -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; }
|
||||
|
||||
+2
-2
@@ -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: */
|
||||
|
||||
+8
-8
@@ -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());
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+5
-5
@@ -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
|
||||
|
||||
+2
-2
@@ -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 );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+15
-15
@@ -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());
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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__"));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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) );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace sw::mark
|
||||
public:
|
||||
AnnotationMark(
|
||||
const SwPaM& rPaM,
|
||||
const ReferenceMarkerName& rName );
|
||||
const SwMarkName& rName );
|
||||
|
||||
virtual ~AnnotationMark() override;
|
||||
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
for (auto const& it : rBookmarks)
|
||||
@@ -1607,19 +1607,19 @@ TextFrameIndex SwScriptInfo::NextBookmark(TextFrameIndex const nPos) const
|
||||
return TextFrameIndex(COMPLETE_STRING);
|
||||
}
|
||||
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUString>>
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, SwMarkName, OUString>>
|
||||
SwScriptInfo::GetBookmarks(TextFrameIndex const nPos)
|
||||
{
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUString>> aColors;
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, SwMarkName, OUString>> aColors;
|
||||
for (auto const& it : m_Bookmarks)
|
||||
{
|
||||
if (nPos == std::get<0>(it))
|
||||
{
|
||||
const ReferenceMarkerName& sName = std::get<3>(it);
|
||||
const SwMarkName& sName = std::get<3>(it);
|
||||
// filter hidden bookmarks imported from OOXML
|
||||
// TODO import them as hidden bookmarks
|
||||
if ( !( sName.toString().startsWith("_Toc") || sName.toString().startsWith("_Ref") ) )
|
||||
aColors.push_back(std::tuple<MarkKind, Color, ReferenceMarkerName,
|
||||
aColors.push_back(std::tuple<MarkKind, Color, SwMarkName,
|
||||
OUString>(std::get<1>(it), std::get<2>(it), std::get<3>(it), std::get<4>(it)));
|
||||
}
|
||||
else if (nPos < std::get<0>(it))
|
||||
@@ -1632,8 +1632,8 @@ std::vector<std::tuple<SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUStr
|
||||
// mark order: ] | [
|
||||
// color order: [c1 [c2 [c3 ... c3] c2] c1]
|
||||
sort(aColors.begin(), aColors.end(),
|
||||
[](std::tuple<MarkKind, Color, ReferenceMarkerName, OUString> const a,
|
||||
std::tuple<MarkKind, Color, ReferenceMarkerName, OUString> const b) {
|
||||
[](std::tuple<MarkKind, Color, SwMarkName, OUString> const a,
|
||||
std::tuple<MarkKind, Color, SwMarkName, OUString> const b) {
|
||||
return (MarkKind::End == std::get<0>(a) && MarkKind::End != std::get<0>(b)) ||
|
||||
(MarkKind::Point == std::get<0>(a) && MarkKind::Start == std::get<0>(b)) ||
|
||||
// if both are end or start, order by color
|
||||
|
||||
@@ -186,13 +186,13 @@ public:
|
||||
class SwBookmarkPortion : public SwControlCharPortion
|
||||
{
|
||||
// custom colors defined by metadata
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUString>> m_aColors;
|
||||
std::vector<std::tuple<SwScriptInfo::MarkKind, Color, SwMarkName, OUString>> m_aColors;
|
||||
// number of MarkKind marks
|
||||
sal_Int16 m_nStart, m_nEnd, m_nPoint;
|
||||
bool m_bHasCustomColor;
|
||||
|
||||
public:
|
||||
explicit SwBookmarkPortion(sal_Unicode const cChar, std::vector<std::tuple<SwScriptInfo::MarkKind, Color, ReferenceMarkerName, OUString>> aColors)
|
||||
explicit SwBookmarkPortion(sal_Unicode const cChar, std::vector<std::tuple<SwScriptInfo::MarkKind, Color, SwMarkName, OUString>> aColors)
|
||||
: SwControlCharPortion(cChar), m_aColors(std::move(aColors)), m_nStart(0), m_nEnd(0), m_nPoint(0), m_bHasCustomColor(false)
|
||||
{
|
||||
SetWhichPor(PortionType::Bookmark);
|
||||
|
||||
@@ -40,7 +40,7 @@ SwFormatRefMark::~SwFormatRefMark( )
|
||||
{
|
||||
}
|
||||
|
||||
SwFormatRefMark::SwFormatRefMark( ReferenceMarkerName aName )
|
||||
SwFormatRefMark::SwFormatRefMark( SwMarkName aName )
|
||||
: SfxPoolItem(RES_TXTATR_REFMARK)
|
||||
, m_pTextAttr(nullptr)
|
||||
, m_aRefName(std::move(aName))
|
||||
@@ -133,7 +133,7 @@ SwTextRefMark::~SwTextRefMark()
|
||||
if (!pViewShell)
|
||||
return;
|
||||
|
||||
ReferenceMarkerName fieldCommand = GetRefMark().GetRefName();
|
||||
SwMarkName fieldCommand = GetRefMark().GetRefName();
|
||||
tools::JsonWriter aJson;
|
||||
aJson.put("commandName", ".uno:DeleteField");
|
||||
aJson.put("success", true);
|
||||
|
||||
@@ -2111,7 +2111,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
|
||||
void SwTextNode::EstablishParentChildRelationsOfComments(
|
||||
const SwTextNode* pDest,
|
||||
std::map<sal_Int32, sal_Int32>& idMapForComments,
|
||||
std::map<sal_Int32, ReferenceMarkerName>& nameMapForComments
|
||||
std::map<sal_Int32, SwMarkName>& nameMapForComments
|
||||
)
|
||||
{
|
||||
if (idMapForComments.size() > 0)
|
||||
@@ -2260,7 +2260,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
|
||||
Below map variable is for memorizing the new ids and names of parent postits in the source node, then we will use them in target node.
|
||||
*/
|
||||
std::map<sal_Int32, sal_Int32> idMapForComments;
|
||||
std::map<sal_Int32, ReferenceMarkerName> nameMapForComments;
|
||||
std::map<sal_Int32, SwMarkName> nameMapForComments;
|
||||
|
||||
sal_Int32 nDeletedDummyChars(0);
|
||||
for (size_t n = 0; n < nSize; ++n)
|
||||
|
||||
@@ -724,7 +724,7 @@ void SwHistoryNoTextFieldmark::SetInDoc(SwDoc* pDoc, bool)
|
||||
if (pPam)
|
||||
{
|
||||
IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
|
||||
pMarkAccess->makeNoTextFieldBookmark(*pPam, ReferenceMarkerName(), m_sType);
|
||||
pMarkAccess->makeNoTextFieldBookmark(*pPam, SwMarkName(), m_sType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ void SwUndoDeleteBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
|
||||
ResetInDoc( rContext.GetDoc() );
|
||||
}
|
||||
|
||||
SwUndoRenameBookmark::SwUndoRenameBookmark( ReferenceMarkerName aOldName, ReferenceMarkerName aNewName, const SwDoc& rDoc )
|
||||
SwUndoRenameBookmark::SwUndoRenameBookmark( SwMarkName aOldName, SwMarkName aNewName, const SwDoc& rDoc )
|
||||
: SwUndo( SwUndoId::BOOKMARK_RENAME, &rDoc )
|
||||
, m_sOldName(std::move( aOldName ))
|
||||
, m_sNewName(std::move( aNewName ))
|
||||
@@ -116,7 +116,7 @@ SwUndoRenameBookmark::~SwUndoRenameBookmark()
|
||||
{
|
||||
}
|
||||
|
||||
static OUString lcl_QuoteName(const ReferenceMarkerName& rName)
|
||||
static OUString lcl_QuoteName(const SwMarkName& rName)
|
||||
{
|
||||
static const OUString sStart = SwResId(STR_START_QUOTE);
|
||||
static const OUString sEnd = SwResId(STR_END_QUOTE);
|
||||
@@ -132,7 +132,7 @@ SwRewriter SwUndoRenameBookmark::GetRewriter() const
|
||||
return aRewriter;
|
||||
}
|
||||
|
||||
void SwUndoRenameBookmark::Rename(::sw::UndoRedoContext const & rContext, const ReferenceMarkerName& sFrom, const ReferenceMarkerName& sTo)
|
||||
void SwUndoRenameBookmark::Rename(::sw::UndoRedoContext const & rContext, const SwMarkName& sFrom, const SwMarkName& sTo)
|
||||
{
|
||||
IDocumentMarkAccess* const pMarkAccess = rContext.GetDoc().getIDocumentMarkAccess();
|
||||
auto ppBkmk = pMarkAccess->findMark(sFrom);
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_EventListeners;
|
||||
SwDoc* m_pDoc;
|
||||
::sw::mark::MarkBase* m_pRegisteredBookmark;
|
||||
ReferenceMarkerName m_sMarkName;
|
||||
SwMarkName m_sMarkName;
|
||||
bool m_bHidden;
|
||||
OUString m_HideCondition;
|
||||
|
||||
@@ -210,7 +210,7 @@ void SwXBookmark::attachToRangeEx(
|
||||
UnoActionContext aCont(m_pImpl->m_pDoc);
|
||||
if (m_pImpl->m_sMarkName.isEmpty())
|
||||
{
|
||||
m_pImpl->m_sMarkName = ReferenceMarkerName("Bookmark");
|
||||
m_pImpl->m_sMarkName = SwMarkName("Bookmark");
|
||||
}
|
||||
if ((eType == IDocumentMarkAccess::MarkType::BOOKMARK) &&
|
||||
::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_pImpl->m_sMarkName))
|
||||
@@ -309,7 +309,7 @@ void SAL_CALL SwXBookmark::setName(const OUString& rName)
|
||||
|
||||
if (!m_pImpl->m_pRegisteredBookmark)
|
||||
{
|
||||
m_pImpl->m_sMarkName = ReferenceMarkerName(rName);
|
||||
m_pImpl->m_sMarkName = SwMarkName(rName);
|
||||
}
|
||||
if (!m_pImpl->m_pRegisteredBookmark || (getName() == rName))
|
||||
{
|
||||
@@ -317,7 +317,7 @@ void SAL_CALL SwXBookmark::setName(const OUString& rName)
|
||||
}
|
||||
IDocumentMarkAccess *const pMarkAccess =
|
||||
m_pImpl->m_pDoc->getIDocumentMarkAccess();
|
||||
if(pMarkAccess->findMark(ReferenceMarkerName(rName)) != pMarkAccess->getAllMarksEnd())
|
||||
if(pMarkAccess->findMark(SwMarkName(rName)) != pMarkAccess->getAllMarksEnd())
|
||||
{
|
||||
throw uno::RuntimeException(
|
||||
u"SwXBookmark::setName(): name already in use"_ustr,
|
||||
@@ -331,7 +331,7 @@ void SAL_CALL SwXBookmark::setName(const OUString& rName)
|
||||
*aPam.GetMark() = m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos();
|
||||
}
|
||||
|
||||
pMarkAccess->renameMark(m_pImpl->m_pRegisteredBookmark, ReferenceMarkerName(rName));
|
||||
pMarkAccess->renameMark(m_pImpl->m_pRegisteredBookmark, SwMarkName(rName));
|
||||
}
|
||||
|
||||
OUString SAL_CALL
|
||||
|
||||
@@ -1566,7 +1566,7 @@ uno::Any SwXBookmarks::getByName(const OUString& rName)
|
||||
|
||||
auto& rDoc = GetDoc();
|
||||
IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess();
|
||||
auto ppBkmk = pMarkAccess->findBookmark(ReferenceMarkerName(rName));
|
||||
auto ppBkmk = pMarkAccess->findBookmark(SwMarkName(rName));
|
||||
if(ppBkmk == pMarkAccess->getBookmarksEnd())
|
||||
throw NoSuchElementException();
|
||||
|
||||
@@ -1601,7 +1601,7 @@ sal_Bool SwXBookmarks::hasByName(const OUString& rName)
|
||||
SolarMutexGuard aGuard;
|
||||
|
||||
IDocumentMarkAccess* const pMarkAccess = GetDoc().getIDocumentMarkAccess();
|
||||
return pMarkAccess->findBookmark(ReferenceMarkerName(rName)) != pMarkAccess->getBookmarksEnd();
|
||||
return pMarkAccess->findBookmark(SwMarkName(rName)) != pMarkAccess->getBookmarksEnd();
|
||||
}
|
||||
|
||||
uno::Type SAL_CALL SwXBookmarks::getElementType()
|
||||
@@ -1798,7 +1798,7 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName)
|
||||
{
|
||||
SolarMutexGuard aGuard;
|
||||
auto& rDoc = GetDoc();
|
||||
if (auto* const pMark = const_cast<SwFormatRefMark*>(rDoc.GetRefMark(ReferenceMarkerName(rName))))
|
||||
if (auto* const pMark = const_cast<SwFormatRefMark*>(rDoc.GetRefMark(SwMarkName(rName))))
|
||||
return uno::Any(
|
||||
uno::Reference<XTextContent>(SwXReferenceMark::CreateXReferenceMark(rDoc, pMark)));
|
||||
|
||||
@@ -1818,7 +1818,7 @@ uno::Sequence< OUString > SwXReferenceMarks::getElementNames()
|
||||
sal_Bool SwXReferenceMarks::hasByName(const OUString& rName)
|
||||
{
|
||||
SolarMutexGuard aGuard;
|
||||
return nullptr != GetDoc().GetRefMark( ReferenceMarkerName(rName) );
|
||||
return nullptr != GetDoc().GetRefMark( SwMarkName(rName) );
|
||||
}
|
||||
|
||||
uno::Type SAL_CALL SwXReferenceMarks::getElementType()
|
||||
|
||||
@@ -1380,14 +1380,14 @@ void SAL_CALL SwXTextField::attach(
|
||||
m_pImpl->m_pProps->sPar1, // author
|
||||
m_pImpl->m_pProps->sPar2, // content
|
||||
m_pImpl->m_pProps->sPar3, // author's initials
|
||||
ReferenceMarkerName(m_pImpl->m_pProps->sPar4), // name
|
||||
SwMarkName(m_pImpl->m_pProps->sPar4), // name
|
||||
aDateTime,
|
||||
m_pImpl->m_pProps->bBool1, // resolvedflag
|
||||
0, // id
|
||||
nParentId, // parent id
|
||||
nImportedId, // imported para id
|
||||
0, // PostIt Parent ID.
|
||||
ReferenceMarkerName(m_pImpl->m_pProps->sPar7)
|
||||
SwMarkName(m_pImpl->m_pProps->sPar7)
|
||||
);
|
||||
if ( m_pImpl->m_xTextObject.is() )
|
||||
{
|
||||
@@ -1514,7 +1514,7 @@ void SAL_CALL SwXTextField::attach(
|
||||
{
|
||||
SwFieldType* pFieldType = pDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::GetRef);
|
||||
xField.reset(new SwGetRefField(static_cast<SwGetRefFieldType*>(pFieldType),
|
||||
ReferenceMarkerName(m_pImpl->m_pProps->sPar1),
|
||||
SwMarkName(m_pImpl->m_pProps->sPar1),
|
||||
m_pImpl->m_pProps->sPar4,
|
||||
0,
|
||||
0,
|
||||
@@ -2973,7 +2973,7 @@ css::uno::Any SAL_CALL SwXTextFieldTypes::getByUniqueID(const OUString& ID)
|
||||
}
|
||||
|
||||
IDocumentMarkAccess& rMarksAccess(*rDoc.getIDocumentMarkAccess());
|
||||
auto it = rMarksAccess.findMark(ReferenceMarkerName(ID));
|
||||
auto it = rMarksAccess.findMark(SwMarkName(ID));
|
||||
if (it != rMarksAccess.getAllMarksEnd())
|
||||
{
|
||||
aRet <<= uno::Reference<beans::XPropertySet>(SwXFieldmark::CreateXFieldmark(rDoc, *it));
|
||||
|
||||
@@ -764,7 +764,7 @@ void SwXTextRange::SetPositions(const SwPaM& rPam)
|
||||
{
|
||||
InvalidateImpl();
|
||||
IDocumentMarkAccess* const pMA = m_rDoc.getIDocumentMarkAccess();
|
||||
auto pMark = pMA->makeMark(rPam, ReferenceMarkerName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, sw::mark::InsertMode::New);
|
||||
auto pMark = pMA->makeMark(rPam, SwMarkName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, sw::mark::InsertMode::New);
|
||||
if (pMark)
|
||||
SetMark(*pMark);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
bool m_bIsDescriptor;
|
||||
SwDoc* m_pDoc;
|
||||
const SwFormatRefMark* m_pMarkFormat;
|
||||
ReferenceMarkerName m_sMarkName;
|
||||
SwMarkName m_sMarkName;
|
||||
|
||||
Impl(SwDoc* const pDoc, SwFormatRefMark* const pRefMark)
|
||||
: m_bIsDescriptor(nullptr == pRefMark)
|
||||
@@ -364,13 +364,13 @@ void SAL_CALL SwXReferenceMark::setName(const OUString& rName)
|
||||
SolarMutexGuard aGuard;
|
||||
if (m_pImpl->m_bIsDescriptor)
|
||||
{
|
||||
m_pImpl->m_sMarkName = ReferenceMarkerName(rName);
|
||||
m_pImpl->m_sMarkName = SwMarkName(rName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_pImpl->IsValid()
|
||||
|| !m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName)
|
||||
|| m_pImpl->m_pDoc->GetRefMark(ReferenceMarkerName(rName)))
|
||||
|| m_pImpl->m_pDoc->GetRefMark(SwMarkName(rName)))
|
||||
{
|
||||
throw uno::RuntimeException();
|
||||
}
|
||||
@@ -397,7 +397,7 @@ void SAL_CALL SwXReferenceMark::setName(const OUString& rName)
|
||||
m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin( aPam );
|
||||
// The aPam will keep the correct and functional doc though
|
||||
|
||||
m_pImpl->m_sMarkName = ReferenceMarkerName(rName);
|
||||
m_pImpl->m_sMarkName = SwMarkName(rName);
|
||||
//create a new one
|
||||
m_pImpl->InsertRefMark( aPam, nullptr );
|
||||
m_pImpl->m_pDoc = &aPam.GetDoc();
|
||||
|
||||
@@ -576,7 +576,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
|
||||
IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aRegion ) )
|
||||
? IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK
|
||||
: IDocumentMarkAccess::MarkType::BOOKMARK;
|
||||
m_rDoc.getIDocumentMarkAccess()->makeMark(aRegion, ReferenceMarkerName(rName), eBookmarkType, sw::mark::InsertMode::New);
|
||||
m_rDoc.getIDocumentMarkAccess()->makeMark(aRegion, SwMarkName(rName), eBookmarkType, sw::mark::InsertMode::New);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -606,7 +606,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
|
||||
aRegion.Start()->AdjustContent(-1);
|
||||
}
|
||||
|
||||
m_rDoc.getIDocumentMarkAccess()->makeAnnotationMark(aRegion, ReferenceMarkerName());
|
||||
m_rDoc.getIDocumentMarkAccess()->makeAnnotationMark(aRegion, SwMarkName());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -641,7 +641,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, std::string_view pTa
|
||||
|
||||
SwPostItField aPostItField(
|
||||
static_cast<SwPostItFieldType*>(m_xDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Postit )),
|
||||
OUString(), aComment, OUString(), ReferenceMarkerName(), DateTime(DateTime::SYSTEM));
|
||||
OUString(), aComment, OUString(), SwMarkName(), DateTime(DateTime::SYSTEM));
|
||||
InsertAttr( SwFormatField( aPostItField ), false );
|
||||
|
||||
if( bMoveFwd )
|
||||
|
||||
@@ -2714,7 +2714,7 @@ SwViewShell *SwHTMLParser::CallEndAction( bool bChkAction, bool bChkPtr )
|
||||
const Point aVisSttPos( DOCUMENTBORDER, DOCUMENTBORDER );
|
||||
if( GetMedium() && aVisSttPos == m_pActionViewShell->VisArea().Pos() )
|
||||
::JumpToSwMark( m_pActionViewShell,
|
||||
ReferenceMarkerName(GetMedium()->GetURLObject().GetMark()) );
|
||||
SwMarkName(GetMedium()->GetURLObject().GetMark()) );
|
||||
m_bChkJumpMark = false;
|
||||
}
|
||||
}
|
||||
@@ -2926,7 +2926,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
|
||||
{
|
||||
case RES_FLTR_BOOKMARK: // insert bookmark
|
||||
{
|
||||
const ReferenceMarkerName sName( static_cast<SfxStringItem*>(pAttr->m_pItem.get())->GetValue() );
|
||||
const SwMarkName sName( static_cast<SfxStringItem*>(pAttr->m_pItem.get())->GetValue() );
|
||||
IDocumentMarkAccess* const pMarkAccess = m_xDoc->getIDocumentMarkAccess();
|
||||
auto ppBkmk = pMarkAccess->findMark( sName );
|
||||
if( ppBkmk != pMarkAccess->getAllMarksEnd() &&
|
||||
@@ -5519,7 +5519,7 @@ void SwHTMLParser::ParseMoreMetaOptions()
|
||||
|
||||
SwPostItField aPostItField(
|
||||
static_cast<SwPostItFieldType*>(m_xDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Postit )),
|
||||
OUString(), sText.makeStringAndClear(), OUString(), ReferenceMarkerName(), DateTime(DateTime::SYSTEM));
|
||||
OUString(), sText.makeStringAndClear(), OUString(), SwMarkName(), DateTime(DateTime::SYSTEM));
|
||||
SwFormatField aFormatField( aPostItField );
|
||||
InsertAttr( aFormatField, false );
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ class FieldMarkParamsHelper
|
||||
const sw::mark::Fieldmark& mrFieldmark;
|
||||
public:
|
||||
explicit FieldMarkParamsHelper( const sw::mark::Fieldmark& rFieldmark ) : mrFieldmark( rFieldmark ) {}
|
||||
ReferenceMarkerName const & getName() const { return mrFieldmark.GetName(); }
|
||||
SwMarkName const & getName() const { return mrFieldmark.GetName(); }
|
||||
template < typename T >
|
||||
bool extractParam( const OUString& rKey, T& rResult )
|
||||
{
|
||||
@@ -2490,7 +2490,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos )
|
||||
if ( rInfos.eType == ww::eFORMDROPDOWN )
|
||||
{
|
||||
uno::Sequence< OUString> vListEntries;
|
||||
ReferenceMarkerName sName;
|
||||
SwMarkName sName;
|
||||
OUString sSelected;
|
||||
|
||||
params.extractParam( ODF_FORMDROPDOWN_LISTENTRY, vListEntries );
|
||||
@@ -2510,7 +2510,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos )
|
||||
}
|
||||
else if ( rInfos.eType == ww::eFORMCHECKBOX )
|
||||
{
|
||||
const ReferenceMarkerName& sName = params.getName();
|
||||
const SwMarkName& sName = params.getName();
|
||||
bool bChecked = false;
|
||||
|
||||
const sw::mark::CheckboxFieldmark* pCheckboxFm = dynamic_cast<const sw::mark::CheckboxFieldmark*>(&rFieldmark);
|
||||
@@ -8505,7 +8505,7 @@ void DocxAttributeOutput::WritePostitFieldReference()
|
||||
|
||||
// In case this file is inside annotation marks, we want to write the
|
||||
// comment reference after the annotation mark is closed, not here.
|
||||
const ReferenceMarkerName& idname = m_postitFields[m_postitFieldsMaxId].first->GetName();
|
||||
const SwMarkName& idname = m_postitFields[m_postitFieldsMaxId].first->GetName();
|
||||
auto it = m_rOpenedAnnotationMarksIds.find( idname );
|
||||
if ( it == m_rOpenedAnnotationMarksIds.end( ) )
|
||||
m_pSerializer->singleElementNS(XML_w, XML_commentReference, FSNS(XML_w, XML_id), idstr);
|
||||
@@ -8787,8 +8787,8 @@ void DocxAttributeOutput::WriteFinalBookmarks_Impl( std::vector< OUString >& rSt
|
||||
rEnds.clear();
|
||||
}
|
||||
|
||||
void DocxAttributeOutput::WriteAnnotationMarks_Impl( std::vector< ReferenceMarkerName >& rStarts,
|
||||
std::vector< ReferenceMarkerName >& rEnds )
|
||||
void DocxAttributeOutput::WriteAnnotationMarks_Impl( std::vector< SwMarkName >& rStarts,
|
||||
std::vector< SwMarkName >& rEnds )
|
||||
{
|
||||
m_rAnnotationMarksStart.insert(m_rAnnotationMarksStart.end(), rStarts.begin(), rStarts.end());
|
||||
rStarts.clear();
|
||||
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
|
||||
void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds, const SwRedlineData* pRedlineData = nullptr );
|
||||
void WriteFinalBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
|
||||
void WriteAnnotationMarks_Impl( std::vector< ReferenceMarkerName >& rStarts, std::vector< ReferenceMarkerName >& rEnds );
|
||||
void WriteAnnotationMarks_Impl( std::vector< SwMarkName >& rStarts, std::vector< SwMarkName >& rEnds );
|
||||
/// End possibly opened paragraph sdt block.
|
||||
void EndParaSdtBlock();
|
||||
|
||||
@@ -911,8 +911,8 @@ private:
|
||||
std::vector<OUString> m_rPermissionsEnd;
|
||||
|
||||
/// Annotation marks to output
|
||||
std::vector<ReferenceMarkerName> m_rAnnotationMarksStart;
|
||||
std::vector<ReferenceMarkerName> m_rAnnotationMarksEnd;
|
||||
std::vector<SwMarkName> m_rAnnotationMarksStart;
|
||||
std::vector<SwMarkName> m_rAnnotationMarksEnd;
|
||||
|
||||
/// Maps of the bookmarks ids
|
||||
std::map<OUString, sal_Int32> m_rOpenedBookmarksIds;
|
||||
@@ -924,10 +924,10 @@ private:
|
||||
std::unordered_set<sal_Int32> m_rSavedBookmarksIds;
|
||||
|
||||
/// Maps of the annotation marks ids
|
||||
std::map<ReferenceMarkerName, sal_Int32> m_rOpenedAnnotationMarksIds;
|
||||
std::map<SwMarkName, sal_Int32> m_rOpenedAnnotationMarksIds;
|
||||
|
||||
/// Name of the last opened annotation mark.
|
||||
ReferenceMarkerName m_sLastOpenedAnnotationMark;
|
||||
SwMarkName m_sLastOpenedAnnotationMark;
|
||||
|
||||
/// Set of currently opened permissions
|
||||
std::unordered_set<OUString> m_aOpenedPermissions;
|
||||
|
||||
@@ -200,8 +200,8 @@ void DocxExport::AppendBookmark( const OUString& rName )
|
||||
|
||||
void DocxExport::AppendAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen )
|
||||
{
|
||||
std::vector< ReferenceMarkerName > aStarts;
|
||||
std::vector< ReferenceMarkerName > aEnds;
|
||||
std::vector< SwMarkName > aStarts;
|
||||
std::vector< SwMarkName > aEnds;
|
||||
|
||||
IMarkVector aMarks;
|
||||
if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
|
||||
|
||||
@@ -1946,8 +1946,8 @@ void RtfAttributeOutput::WriteBookmarks_Impl(std::vector<OUString>& rStarts,
|
||||
rEnds.clear();
|
||||
}
|
||||
|
||||
void RtfAttributeOutput::WriteAnnotationMarks_Impl(std::vector<ReferenceMarkerName>& rStarts,
|
||||
std::vector<ReferenceMarkerName>& rEnds)
|
||||
void RtfAttributeOutput::WriteAnnotationMarks_Impl(std::vector<SwMarkName>& rStarts,
|
||||
std::vector<SwMarkName>& rEnds)
|
||||
{
|
||||
for (const auto& rStart : rStarts)
|
||||
{
|
||||
@@ -4103,7 +4103,7 @@ void RtfAttributeOutput::PostitField(const SwField* pField)
|
||||
|
||||
const SwPostItField& rPField = *static_cast<const SwPostItField*>(pField);
|
||||
|
||||
ReferenceMarkerName aName = rPField.GetName();
|
||||
SwMarkName aName = rPField.GetName();
|
||||
auto it = m_rOpenedAnnotationMarksIds.find(aName);
|
||||
if (it != m_rOpenedAnnotationMarksIds.end())
|
||||
{
|
||||
|
||||
@@ -242,8 +242,8 @@ public:
|
||||
void WriteField_Impl(const SwField* pField, ww::eField eType, std::u16string_view rFieldCmd,
|
||||
FieldFlags nMode);
|
||||
void WriteBookmarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds);
|
||||
void WriteAnnotationMarks_Impl(std::vector<ReferenceMarkerName>& rStarts,
|
||||
std::vector<ReferenceMarkerName>& rEnds);
|
||||
void WriteAnnotationMarks_Impl(std::vector<SwMarkName>& rStarts,
|
||||
std::vector<SwMarkName>& rEnds);
|
||||
void WriteHeaderFooter_Impl(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
|
||||
bool bTitlepg);
|
||||
void WriteBookmarkInActParagraph(const OUString& /*rName*/, sal_Int32 /*nFirstRunPos*/,
|
||||
@@ -570,7 +570,7 @@ private:
|
||||
sal_Int32 m_nNextAnnotationMarkId;
|
||||
sal_Int32 m_nCurrentAnnotationMarkId;
|
||||
/// Maps annotation mark names to ID's.
|
||||
std::map<ReferenceMarkerName, sal_Int32> m_rOpenedAnnotationMarksIds;
|
||||
std::map<SwMarkName, sal_Int32> m_rOpenedAnnotationMarksIds;
|
||||
|
||||
/*
|
||||
* The current table helper.
|
||||
|
||||
@@ -157,8 +157,8 @@ void RtfExport::AppendBookmark(const OUString& rName)
|
||||
void RtfExport::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCurrentPos,
|
||||
sal_Int32 nLen)
|
||||
{
|
||||
std::vector<ReferenceMarkerName> aStarts;
|
||||
std::vector<ReferenceMarkerName> aEnds;
|
||||
std::vector<SwMarkName> aStarts;
|
||||
std::vector<SwMarkName> aEnds;
|
||||
|
||||
IMarkVector aMarks;
|
||||
if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
|
||||
|
||||
@@ -1961,7 +1961,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
|
||||
if ( nSubType == REF_SETREFATTR ||
|
||||
nSubType == REF_BOOKMARK )
|
||||
{
|
||||
const ReferenceMarkerName& aRefName(rRField.GetSetRefName());
|
||||
const SwMarkName& aRefName(rRField.GetSetRefName());
|
||||
aLinkStr = GetBookmarkName( nSubType, &aRefName.toString(), 0 );
|
||||
}
|
||||
else if ( nSubType == REF_FOOTNOTE ||
|
||||
@@ -2196,7 +2196,7 @@ void AttributeOutputBase::GenerateBookmarksForSequenceField(const SwTextNode& rN
|
||||
{
|
||||
SwGetRefField* pRefField = static_cast<SwGetRefField*>(pFormatField->GetField());
|
||||
// If we have a reference to the current sequence field
|
||||
if(pRefField->GetSeqNo() == nSeqFieldNumber && pRefField->GetSetRefName() == ReferenceMarkerName(sObjectName.toString()))
|
||||
if(pRefField->GetSeqNo() == nSeqFieldNumber && pRefField->GetSetRefName() == SwMarkName(sObjectName.toString()))
|
||||
{
|
||||
// Need to create a separate run for separator character
|
||||
SwWW8AttrIter aLocalAttrIter( GetExport(), rNode ); // We need a local iterator having the right number of runs
|
||||
@@ -3248,7 +3248,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
|
||||
break;
|
||||
}
|
||||
{
|
||||
const ReferenceMarkerName& aRefName(rRField.GetSetRefName());
|
||||
const SwMarkName& aRefName(rRField.GetSetRefName());
|
||||
sStr = FieldString(eField)
|
||||
+ GetExport().GetBookmarkName(nSubType, &aRefName.toString(), 0);
|
||||
}
|
||||
|
||||
@@ -2265,7 +2265,7 @@ tools::Long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
|
||||
m_xFormatOfJustInsertedApo.reset();
|
||||
SwPostItField aPostIt(
|
||||
static_cast<SwPostItFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit)), sAuthor,
|
||||
sText, sInitials, ReferenceMarkerName(), aDate );
|
||||
sText, sInitials, SwMarkName(), aDate );
|
||||
aPostIt.SetTextObject(std::move(pOutliner));
|
||||
|
||||
SwPaM aEnd(*m_pPaM->End(), *m_pPaM->End());
|
||||
@@ -5438,7 +5438,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
|
||||
IDocumentMarkAccess* const pMarkAccess = m_rDoc.getIDocumentMarkAccess();
|
||||
if ( pMarkAccess )
|
||||
{
|
||||
auto ppBkmk = pMarkAccess->findBookmark( ReferenceMarkerName(u"_PictureBullets"_ustr) );
|
||||
auto ppBkmk = pMarkAccess->findBookmark( SwMarkName(u"_PictureBullets"_ustr) );
|
||||
if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
|
||||
IDocumentMarkAccess::GetType(**ppBkmk) == IDocumentMarkAccess::MarkType::BOOKMARK )
|
||||
{
|
||||
|
||||
@@ -558,7 +558,7 @@ namespace sw
|
||||
class WW8FieldEntry
|
||||
{
|
||||
private:
|
||||
ReferenceMarkerName msBookmarkName;
|
||||
SwMarkName msBookmarkName;
|
||||
OUString msMarkType;
|
||||
OUString msMarkCode;
|
||||
::sw::mark::Fieldmark::parameter_map_t maParams;
|
||||
@@ -575,9 +575,9 @@ class WW8FieldEntry
|
||||
const SwNodeIndex& GetPtNode() const { return maStartPos.GetPtNode(); };
|
||||
sal_Int32 GetPtContent() const { return maStartPos.GetPtContent(); };
|
||||
|
||||
const ReferenceMarkerName& GetBookmarkName() const { return msBookmarkName;}
|
||||
const SwMarkName& GetBookmarkName() const { return msBookmarkName;}
|
||||
const OUString& GetBookmarkCode() const { return msMarkCode;}
|
||||
void SetBookmarkName(const ReferenceMarkerName& bookmarkName);
|
||||
void SetBookmarkName(const SwMarkName& bookmarkName);
|
||||
void SetBookmarkType(const OUString& bookmarkType);
|
||||
void SetBookmarkCode(const OUString& bookmarkCode);
|
||||
::sw::mark::Fieldmark::parameter_map_t& getParameters() { return maParams;}
|
||||
|
||||
@@ -130,7 +130,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr )
|
||||
else
|
||||
{
|
||||
WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
|
||||
ReferenceMarkerName aBookmarkName;
|
||||
SwMarkName aBookmarkName;
|
||||
if (pB!=nullptr) {
|
||||
WW8_CP currentCP=pF->nSCode;
|
||||
WW8_CP currentLen=pF->nLen;
|
||||
@@ -147,14 +147,14 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr )
|
||||
if (!aBookmarkFind.isEmpty()) {
|
||||
pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark bookmark as consumed, such that it'll not get inserted as a "normal" bookmark again
|
||||
if (!aBookmarkFind.isEmpty()) {
|
||||
aBookmarkName=ReferenceMarkerName(aBookmarkFind);
|
||||
aBookmarkName=SwMarkName(aBookmarkFind);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pB!=nullptr && aBookmarkName.isEmpty()) {
|
||||
aBookmarkName = ReferenceMarkerName(pB->GetUniqueBookmarkName(aFormula.msTitle));
|
||||
aBookmarkName = SwMarkName(pB->GetUniqueBookmarkName(aFormula.msTitle));
|
||||
}
|
||||
|
||||
if (!aBookmarkName.isEmpty()) {
|
||||
@@ -198,7 +198,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr )
|
||||
return eF_ResT::OK;
|
||||
}
|
||||
|
||||
ReferenceMarkerName aBookmarkName;
|
||||
SwMarkName aBookmarkName;
|
||||
WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
|
||||
if (pB!=nullptr) {
|
||||
WW8_CP currentCP=pF->nSCode;
|
||||
@@ -210,13 +210,13 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr )
|
||||
if (!aBookmarkFind.isEmpty()) {
|
||||
pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
|
||||
if (!aBookmarkFind.isEmpty()) {
|
||||
aBookmarkName=ReferenceMarkerName(aBookmarkFind);
|
||||
aBookmarkName=SwMarkName(aBookmarkFind);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pB!=nullptr && aBookmarkName.isEmpty()) {
|
||||
aBookmarkName = ReferenceMarkerName(pB->GetUniqueBookmarkName(aFormula.msTitle));
|
||||
aBookmarkName = SwMarkName(pB->GetUniqueBookmarkName(aFormula.msTitle));
|
||||
}
|
||||
|
||||
if (!aBookmarkName.isEmpty())
|
||||
@@ -293,7 +293,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr)
|
||||
{
|
||||
IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( );
|
||||
Fieldmark *pFieldmark =
|
||||
pMarksAccess->makeNoTextFieldBookmark( *m_pPaM, ReferenceMarkerName(aBookmarkName), ODF_FORMDROPDOWN );
|
||||
pMarksAccess->makeNoTextFieldBookmark( *m_pPaM, SwMarkName(aBookmarkName), ODF_FORMDROPDOWN );
|
||||
OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?");
|
||||
if ( pFieldmark != nullptr )
|
||||
{
|
||||
|
||||
@@ -102,18 +102,18 @@ using namespace nsSwDocInfoSubType;
|
||||
namespace
|
||||
{
|
||||
// #120879# - helper method to identify a bookmark name to match the internal TOC bookmark naming convention
|
||||
bool IsTOCBookmarkName(const ReferenceMarkerName& rName)
|
||||
bool IsTOCBookmarkName(const SwMarkName& rName)
|
||||
{
|
||||
return o3tl::starts_with(rName.toString(), u"_Toc") || o3tl::starts_with(rName.toString(), Concat2View(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc"));
|
||||
}
|
||||
|
||||
ReferenceMarkerName EnsureTOCBookmarkName(const ReferenceMarkerName& rName)
|
||||
SwMarkName EnsureTOCBookmarkName(const SwMarkName& rName)
|
||||
{
|
||||
ReferenceMarkerName sTmp = rName;
|
||||
SwMarkName sTmp = rName;
|
||||
if ( IsTOCBookmarkName ( rName ) )
|
||||
{
|
||||
if ( ! rName.toString().startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
|
||||
sTmp = ReferenceMarkerName(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() + rName.toString());
|
||||
sTmp = SwMarkName(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() + rName.toString());
|
||||
}
|
||||
return sTmp;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ tools::Long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
|
||||
aStart = rTest.maStartPos;
|
||||
}
|
||||
|
||||
const ReferenceMarkerName sOrigName( BookmarkToWriter(*pName) );
|
||||
const SwMarkName sOrigName( BookmarkToWriter(*pName) );
|
||||
m_xReffedStck->NewAttr( aStart,
|
||||
SwFltBookmark( EnsureTOCBookmarkName( sOrigName ).toString(), aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
|
||||
return 0;
|
||||
@@ -782,7 +782,7 @@ WW8FieldEntry &WW8FieldEntry::operator=(const WW8FieldEntry &rOther) noexcept
|
||||
}
|
||||
|
||||
|
||||
void WW8FieldEntry::SetBookmarkName(const ReferenceMarkerName& bookmarkName)
|
||||
void WW8FieldEntry::SetBookmarkName(const SwMarkName& bookmarkName)
|
||||
{
|
||||
msBookmarkName=bookmarkName;
|
||||
}
|
||||
@@ -2189,7 +2189,7 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, OUString& rStr )
|
||||
}
|
||||
}
|
||||
|
||||
ReferenceMarkerName sBkmName(GetMappedBookmark(sOrigBkmName));
|
||||
SwMarkName sBkmName(GetMappedBookmark(sOrigBkmName));
|
||||
|
||||
// #i120879# add cross reference bookmark name prefix, if it
|
||||
// matches internal TOC bookmark naming convention
|
||||
@@ -2257,14 +2257,14 @@ eF_ResT SwWW8ImplReader::Read_F_NoteReference( WW8FieldDesc*, OUString& rStr )
|
||||
// set Sequence No of corresponding Foot-/Endnote to Zero
|
||||
// (will be corrected in
|
||||
SwGetRefField aField( static_cast<SwGetRefFieldType*>(
|
||||
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), ReferenceMarkerName(aBkmName), u""_ustr, REF_FOOTNOTE, 0, 0,
|
||||
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), SwMarkName(aBkmName), u""_ustr, REF_FOOTNOTE, 0, 0,
|
||||
REF_ONLYNUMBER );
|
||||
m_xReffingStck->NewAttr(*m_pPaM->GetPoint(), SwFormatField(aField));
|
||||
m_xReffingStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_FIELD);
|
||||
if (bAboveBelow)
|
||||
{
|
||||
SwGetRefField aField2( static_cast<SwGetRefFieldType*>(
|
||||
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), ReferenceMarkerName(aBkmName), u""_ustr, REF_FOOTNOTE, 0, 0,
|
||||
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )), SwMarkName(aBkmName), u""_ustr, REF_FOOTNOTE, 0, 0,
|
||||
REF_UPDOWN );
|
||||
m_xReffingStck->NewAttr(*m_pPaM->GetPoint(), SwFormatField(aField2));
|
||||
m_xReffingStck->SetAttr(*m_pPaM->GetPoint(), RES_TXTATR_FIELD);
|
||||
@@ -2300,16 +2300,16 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
|
||||
{
|
||||
// #i120879# add cross reference bookmark name prefix, if it
|
||||
// matches internal TOC bookmark naming convention
|
||||
ReferenceMarkerName sBookmarkName;
|
||||
if ( IsTOCBookmarkName( ReferenceMarkerName(sName) ) )
|
||||
SwMarkName sBookmarkName;
|
||||
if ( IsTOCBookmarkName( SwMarkName(sName) ) )
|
||||
{
|
||||
sBookmarkName = EnsureTOCBookmarkName(ReferenceMarkerName(sName));
|
||||
sBookmarkName = EnsureTOCBookmarkName(SwMarkName(sName));
|
||||
// track <sBookmarkName> as referenced TOC bookmark.
|
||||
m_xReffedStck->m_aReferencedTOCBookmarks.insert( sBookmarkName.toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
sBookmarkName = ReferenceMarkerName(sName);
|
||||
sBookmarkName = SwMarkName(sName);
|
||||
}
|
||||
OUString sURL = "#" + sBookmarkName.toString();
|
||||
SwFormatINetFormat aURL( sURL, u""_ustr );
|
||||
@@ -2325,16 +2325,16 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
|
||||
|
||||
// #i120879# add cross reference bookmark name prefix, if it matches
|
||||
// internal TOC bookmark naming convention
|
||||
ReferenceMarkerName sPageRefBookmarkName;
|
||||
if ( IsTOCBookmarkName( ReferenceMarkerName(sName) ) )
|
||||
SwMarkName sPageRefBookmarkName;
|
||||
if ( IsTOCBookmarkName( SwMarkName(sName) ) )
|
||||
{
|
||||
sPageRefBookmarkName = EnsureTOCBookmarkName(ReferenceMarkerName(sName));
|
||||
sPageRefBookmarkName = EnsureTOCBookmarkName(SwMarkName(sName));
|
||||
// track <sPageRefBookmarkName> as referenced TOC bookmark.
|
||||
m_xReffedStck->m_aReferencedTOCBookmarks.insert( sPageRefBookmarkName.toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
sPageRefBookmarkName = ReferenceMarkerName(sName);
|
||||
sPageRefBookmarkName = SwMarkName(sName);
|
||||
}
|
||||
SwGetRefField aField( static_cast<SwGetRefFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::GetRef )),
|
||||
std::move(sPageRefBookmarkName), u""_ustr, REF_BOOKMARK, 0, 0, REF_PAGE );
|
||||
@@ -3594,9 +3594,9 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
|
||||
sMark = sMark.copy( 0, sMark.getLength() - 1 );
|
||||
}
|
||||
// #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
|
||||
if ( IsTOCBookmarkName( ReferenceMarkerName(sMark) ) )
|
||||
if ( IsTOCBookmarkName( SwMarkName(sMark) ) )
|
||||
{
|
||||
sMark = EnsureTOCBookmarkName(ReferenceMarkerName(sMark)).toString();
|
||||
sMark = EnsureTOCBookmarkName(SwMarkName(sMark)).toString();
|
||||
// track <sMark> as referenced TOC bookmark.
|
||||
m_xReffedStck->m_aReferencedTOCBookmarks.insert( sMark );
|
||||
}
|
||||
|
||||
@@ -1338,7 +1338,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
|
||||
GoCurrPara, fnParaStart );
|
||||
pMark = rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
ReferenceMarkerName(),
|
||||
SwMarkName(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK );
|
||||
rSh.SwCursorShell::MovePara(
|
||||
GoCurrPara, fnParaEnd );
|
||||
|
||||
@@ -1001,7 +1001,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl, weld::Entry&, void)
|
||||
bool bEnable = true;
|
||||
sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
|
||||
|
||||
if ((nTypeId == static_cast<sal_uInt16>(SwFieldTypesEnum::SetRef) && !GetFieldMgr().CanInsertRefMark(ReferenceMarkerName(aName))) ||
|
||||
if ((nTypeId == static_cast<sal_uInt16>(SwFieldTypesEnum::SetRef) && !GetFieldMgr().CanInsertRefMark(SwMarkName(aName))) ||
|
||||
(bEmptyName && (nTypeId == static_cast<sal_uInt16>(SwFieldTypesEnum::GetRef) || nTypeId == static_cast<sal_uInt16>(SwFieldTypesEnum::SetRef) ||
|
||||
nTypeId == REFFLDFLAG_BOOKMARK)))
|
||||
bEnable = false;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
class SwInsertBookmarkDlg final : public SfxDialogController
|
||||
{
|
||||
SwWrtShell& m_rSh;
|
||||
std::vector<std::pair<sw::mark::MarkBase*, ReferenceMarkerName>> m_aTableBookmarks;
|
||||
std::vector<std::pair<sw::mark::MarkBase*, SwMarkName>> m_aTableBookmarks;
|
||||
sal_Int32 m_nLastBookmarksCount;
|
||||
bool m_bSorted;
|
||||
bool m_bAreProtected;
|
||||
|
||||
@@ -105,7 +105,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, DeleteHdl, weld::Button&, void)
|
||||
// remove from model
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
|
||||
ReferenceMarkerName sRemoved = pBookmark->GetName();
|
||||
SwMarkName sRemoved = pBookmark->GetName();
|
||||
IDocumentMarkAccess* const pMarkAccess = m_rSh.getIDocumentMarkAccess();
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved), false);
|
||||
SfxRequest aReq(m_rSh.GetView().GetViewFrame(), FN_DELETE_BOOKMARK);
|
||||
@@ -161,7 +161,7 @@ void SwInsertBookmarkDlg::SelectionChanged()
|
||||
[this, &sEditBoxText, &nSelectedRows](weld::TreeIter& rEntry) {
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
|
||||
const ReferenceMarkerName& sEntryName = pBookmark->GetName();
|
||||
const SwMarkName& sEntryName = pBookmark->GetName();
|
||||
if (!sEditBoxText.isEmpty())
|
||||
sEditBoxText.append(";");
|
||||
sEditBoxText.append(sEntryName.toString());
|
||||
@@ -238,7 +238,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, RenameHdl, weld::Button&, void)
|
||||
IMPL_LINK_NOARG(SwInsertBookmarkDlg, InsertHdl, weld::Button&, void)
|
||||
{
|
||||
OUString sBookmark = m_xEditBox->get_text();
|
||||
m_rSh.SetBookmark2(vcl::KeyCode(), ReferenceMarkerName(sBookmark), m_xHideCB->get_active(),
|
||||
m_rSh.SetBookmark2(vcl::KeyCode(), SwMarkName(sBookmark), m_xHideCB->get_active(),
|
||||
m_xConditionED->get_text());
|
||||
|
||||
m_xDialog->response(RET_OK);
|
||||
@@ -528,7 +528,7 @@ void BookmarkTable::InsertBookmark(SwWrtShell& rSh, sw::mark::MarkBase* const pM
|
||||
}
|
||||
|
||||
const OUString& sHideCondition = pBookmark->GetHideCondition();
|
||||
const ReferenceMarkerName& sName = pBookmark->GetName();
|
||||
const SwMarkName& sName = pBookmark->GetName();
|
||||
OUString sHidden
|
||||
= (pBookmark->IsHidden() || !sHideCondition.isEmpty() ||
|
||||
// tdf#150955 add "hidden" status to the imported OOXML _Toc and _Ref bookmarks
|
||||
@@ -590,7 +590,7 @@ OUString BookmarkTable::GetNameProposal() const
|
||||
for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
|
||||
{
|
||||
sw::mark::MarkBase* pBookmark = weld::fromId<sw::mark::MarkBase*>(m_xControl->get_id(i));
|
||||
const ReferenceMarkerName& sName = pBookmark->GetName();
|
||||
const SwMarkName& sName = pBookmark->GetName();
|
||||
sal_Int32 nIndex = 0;
|
||||
if (o3tl::getToken(sName.toString(), 0, ' ', nIndex) == sDefaultBookmarkName)
|
||||
{
|
||||
|
||||
@@ -1455,7 +1455,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
|
||||
SwDocMergeInfo aMergeInfo;
|
||||
// Name of the mark is actually irrelevant, UNO bookmarks have internals names.
|
||||
aMergeInfo.startPageInTarget = pTargetDoc->getIDocumentMarkAccess()->makeMark(
|
||||
SwPaM(appendedDocStart), ReferenceMarkerName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
|
||||
SwPaM(appendedDocStart), SwMarkName(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
aMergeInfo.nDBRow = nStartRow;
|
||||
rMergeDescriptor.pMailMergeConfigItem->AddMergedDocument( aMergeInfo );
|
||||
|
||||
@@ -1640,7 +1640,7 @@ bool SwTransferable::Paste(SwWrtShell& rSh, const TransferableDataHelper& rData,
|
||||
// store cursor position in row mode
|
||||
::sw::mark::MarkBase* pMark = (!bRowMode || nSelectedRowsOrCols == 0) ? nullptr : rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
ReferenceMarkerName(),
|
||||
SwMarkName(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK );
|
||||
|
||||
// add a new empty row/column before the actual table row/column and go there
|
||||
@@ -4003,7 +4003,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
|
||||
::sw::mark::MarkBase* pMarkMoveFrom = bMove
|
||||
? rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
ReferenceMarkerName(),
|
||||
SwMarkName(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK )
|
||||
: nullptr;
|
||||
|
||||
@@ -4075,7 +4075,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
|
||||
// store cursor
|
||||
::sw::mark::MarkBase* pMark = rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
ReferenceMarkerName(),
|
||||
SwMarkName(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK );
|
||||
|
||||
// paste rows above/columns before
|
||||
@@ -4446,7 +4446,7 @@ SwTransferDdeLink::SwTransferDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
|
||||
|
||||
::sw::mark::MarkBase* pMark = rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
ReferenceMarkerName(),
|
||||
SwMarkName(),
|
||||
IDocumentMarkAccess::MarkType::DDE_BOOKMARK);
|
||||
if(pMark)
|
||||
{
|
||||
@@ -4505,7 +4505,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
|
||||
m_pDocShell->GetTitle(SFX_TITLE_FULLNAME), m_sName);
|
||||
|
||||
IDocumentMarkAccess* const pMarkAccess = m_pDocShell->GetDoc()->getIDocumentMarkAccess();
|
||||
auto ppMark = pMarkAccess->findMark(ReferenceMarkerName(m_sName));
|
||||
auto ppMark = pMarkAccess->findMark(SwMarkName(m_sName));
|
||||
if(ppMark != pMarkAccess->getAllMarksEnd()
|
||||
&& IDocumentMarkAccess::GetType(**ppMark) != IDocumentMarkAccess::MarkType::BOOKMARK)
|
||||
{
|
||||
@@ -4523,7 +4523,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
|
||||
aPaM.SetMark();
|
||||
*aPaM.GetMark() = pMark->GetMarkEnd();
|
||||
}
|
||||
ReferenceMarkerName sMarkName = pMark->GetName();
|
||||
SwMarkName sMarkName = pMark->GetName();
|
||||
|
||||
// remove mark
|
||||
rServerObject.SetNoServer(); // this removes the connection between SwServerObject and mark
|
||||
@@ -4563,7 +4563,7 @@ void SwTransferDdeLink::Disconnect( bool bRemoveDataAdvise )
|
||||
bool bIsModified = pDoc->getIDocumentState().IsModified();
|
||||
|
||||
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(m_sName)), false);
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(m_sName)), false);
|
||||
|
||||
if( !bIsModified )
|
||||
pDoc->getIDocumentState().ResetModified();
|
||||
|
||||
@@ -337,7 +337,7 @@ void SwAnnotationWin::SetAsRoot()
|
||||
SwPostItField* pPostIt = static_cast<SwPostItField*>(mpFormatField->GetField());
|
||||
pPostIt->SetParentId(0);
|
||||
pPostIt->SetParentPostItId(0);
|
||||
pPostIt->SetParentName(ReferenceMarkerName());
|
||||
pPostIt->SetParentName(SwMarkName());
|
||||
mrMgr.MoveSubthreadToRoot(this);
|
||||
mpFormatField->Broadcast(SwFormatFieldHint(nullptr, SwFormatFieldHintWhich::CHANGED));
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
|
||||
{
|
||||
OUString sTmpSearchStr = sText.copy( 1 );
|
||||
IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess();
|
||||
auto ppBkmk = pMarkAccess->findBookmark( ReferenceMarkerName(sTmpSearchStr) );
|
||||
auto ppBkmk = pMarkAccess->findBookmark( SwMarkName(sTmpSearchStr) );
|
||||
if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
|
||||
IDocumentMarkAccess::GetType(**ppBkmk)
|
||||
== IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK )
|
||||
|
||||
@@ -119,7 +119,7 @@ void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect )
|
||||
pSwPagePreview->RepaintCoreRect(rRect);
|
||||
}
|
||||
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, const ReferenceMarkerName& rMark )
|
||||
bool JumpToSwMark( SwViewShell const * pVwSh, const SwMarkName& rMark )
|
||||
{
|
||||
SfxViewShell *pSfxViewShell = pVwSh->GetSfxViewShell();
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ SwFieldMgr::~SwFieldMgr()
|
||||
}
|
||||
|
||||
// organise RefMark by names
|
||||
bool SwFieldMgr::CanInsertRefMark( const ReferenceMarkerName& rStr )
|
||||
bool SwFieldMgr::CanInsertRefMark( const SwMarkName& rStr )
|
||||
{
|
||||
bool bRet = false;
|
||||
SwWrtShell *pSh = m_pWrtShell ? m_pWrtShell : lcl_GetShell();
|
||||
@@ -908,7 +908,7 @@ bool SwFieldMgr::InsertField(
|
||||
rData.m_sPar1, // author
|
||||
rData.m_sPar2, // content
|
||||
aUserOpt.GetID(), // author's initials
|
||||
ReferenceMarkerName(), // name
|
||||
SwMarkName(), // name
|
||||
DateTime(DateTime::SYSTEM) ));
|
||||
if (rData.m_oParentId)
|
||||
{
|
||||
@@ -1063,7 +1063,7 @@ bool SwFieldMgr::InsertField(
|
||||
|
||||
case SwFieldTypesEnum::SetRef:
|
||||
{
|
||||
if( !rData.m_sPar1.isEmpty() && CanInsertRefMark( ReferenceMarkerName(rData.m_sPar1) ) )
|
||||
if( !rData.m_sPar1.isEmpty() && CanInsertRefMark( SwMarkName(rData.m_sPar1) ) )
|
||||
{
|
||||
const OUString& rRefmarkText = rData.m_sPar2;
|
||||
SwPaM* pCursorPos = pCurShell->GetCursor();
|
||||
@@ -1095,7 +1095,7 @@ bool SwFieldMgr::InsertField(
|
||||
}
|
||||
}
|
||||
|
||||
pCurShell->SetAttrItem( SwFormatRefMark( ReferenceMarkerName(rData.m_sPar1) ) );
|
||||
pCurShell->SetAttrItem( SwFormatRefMark( SwMarkName(rData.m_sPar1) ) );
|
||||
|
||||
if (!bHadMark && !rRefmarkText.isEmpty())
|
||||
{
|
||||
@@ -1133,7 +1133,7 @@ bool SwFieldMgr::InsertField(
|
||||
nFormatId %= SAL_N_ELEMENTS(FMT_REF_ARY);
|
||||
}
|
||||
|
||||
pField.reset(new SwGetRefField(pTyp, ReferenceMarkerName(rData.m_sPar1), sReferenceLanguage, nSubType, nSeqNo, nFlags, nFormatId));
|
||||
pField.reset(new SwGetRefField(pTyp, SwMarkName(rData.m_sPar1), sReferenceLanguage, nSubType, nSeqNo, nFlags, nFormatId));
|
||||
bExp = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class SwContentTree final : public SfxListener
|
||||
|
||||
void BringEntryToAttention(const weld::TreeIter& rEntry);
|
||||
void BringFramesToAttention(const std::vector<const SwFrameFormat*>& rFrameFormats);
|
||||
void BringBookmarksToAttention(const std::vector<ReferenceMarkerName>& rNames);
|
||||
void BringBookmarksToAttention(const std::vector<SwMarkName>& rNames);
|
||||
void BringURLFieldsToAttention(const SwGetINetAttrs& rINetAttrsArr);
|
||||
void BringReferencesToAttention(std::vector<const SwTextAttr*>& rTextAttrsArr);
|
||||
void BringPostItFieldsToAttention(std::vector<const SwTextAttr*>& rTextAttrsArr);
|
||||
|
||||
@@ -84,7 +84,7 @@ struct SwInsertField_Data
|
||||
weld::Widget* m_pParent; // parent widget used for SwWrtShell::StartInputFieldDlg()
|
||||
/// Marks the PostIt field's annotation start/end if it differs from the cursor selection.
|
||||
std::optional<SwPaM> m_oAnnotationRange;
|
||||
std::optional<std::tuple<sal_uInt32, sal_uInt32, ReferenceMarkerName>> m_oParentId;
|
||||
std::optional<std::tuple<sal_uInt32, sal_uInt32, SwMarkName>> m_oParentId;
|
||||
|
||||
SwInsertField_Data(SwFieldTypesEnum nType, sal_uInt16 nSub, OUString aPar1, OUString aPar2,
|
||||
sal_uInt32 nFormatId, SwWrtShell* pShell = nullptr, sal_Unicode cSep = ' ', bool bIsAutoLanguage = true) :
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
bool bIsTable, const OUString& rFieldName);
|
||||
|
||||
// organise RefMark with names
|
||||
bool CanInsertRefMark( const ReferenceMarkerName& rStr );
|
||||
bool CanInsertRefMark( const SwMarkName& rStr );
|
||||
|
||||
// access to field types via ResId
|
||||
size_t GetFieldTypeCount() const;
|
||||
|
||||
@@ -431,7 +431,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
|
||||
// jump to bookmark and set the "selections-flags" correctly again
|
||||
SW_DLLPUBLIC void GotoMark( const ::sw::mark::MarkBase* const pMark );
|
||||
bool GotoMark( const ::sw::mark::MarkBase* const pMark, bool bSelect );
|
||||
SW_DLLPUBLIC void GotoMark( const ReferenceMarkerName& rName );
|
||||
SW_DLLPUBLIC void GotoMark( const SwMarkName& rName );
|
||||
bool GoNextBookmark(); // true when there still was one
|
||||
bool GoPrevBookmark();
|
||||
|
||||
@@ -501,7 +501,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
|
||||
void GotoOutline( SwOutlineNodes::size_type nIdx );
|
||||
bool GotoOutline( const OUString& rName );
|
||||
bool GotoRegion( std::u16string_view rName );
|
||||
bool GotoRefMark( const ReferenceMarkerName& rRefMark, sal_uInt16 nSubType = 0,
|
||||
bool GotoRefMark( const SwMarkName& rRefMark, sal_uInt16 nSubType = 0,
|
||||
sal_uInt16 nSeqNo = 0, sal_uInt16 nFlags = 0 );
|
||||
SW_DLLPUBLIC bool GotoNextTOXBase( const UIName* pName = nullptr);
|
||||
SW_DLLPUBLIC bool GotoTable( const UIName& rName );
|
||||
|
||||
@@ -840,7 +840,7 @@ bool UpdateFieldContents(const SfxRequest& rReq, SwWrtShell& rWrtSh)
|
||||
break;
|
||||
}
|
||||
comphelper::SequenceAsHashMap aMap(aFields[nFieldIndex++]);
|
||||
pRefMark->GetRefName() = ReferenceMarkerName(aMap[u"Name"_ustr].get<OUString>());
|
||||
pRefMark->GetRefName() = SwMarkName(aMap[u"Name"_ustr].get<OUString>());
|
||||
|
||||
auto pTextRefMark = const_cast<SwTextRefMark*>(pRefMark->GetTextRefMark());
|
||||
pTextRefMark->UpdateFieldContent(pDoc, rWrtSh, aMap[u"Content"_ustr].get<OUString>());
|
||||
@@ -905,7 +905,7 @@ void UpdateFieldContent(const SfxRequest& rReq, SwWrtShell& rWrtSh)
|
||||
});
|
||||
|
||||
comphelper::SequenceAsHashMap aMap(aField);
|
||||
rRefmark.GetRefName() = ReferenceMarkerName(aMap[u"Name"_ustr].get<OUString>());
|
||||
rRefmark.GetRefName() = SwMarkName(aMap[u"Name"_ustr].get<OUString>());
|
||||
|
||||
OUString aContent = aMap[u"Content"_ustr].get<OUString>();
|
||||
auto pTextRefMark = const_cast<SwTextRefMark*>(rRefmark.GetTextRefMark());
|
||||
|
||||
@@ -294,7 +294,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
|
||||
const SfxStringItem* pName = rReq.GetArg<SfxStringItem>(FN_GOTO_MARK);
|
||||
if (pName)
|
||||
{
|
||||
rSh.GotoMark(ReferenceMarkerName(pName->GetValue()));
|
||||
rSh.GotoMark(SwMarkName(pName->GetValue()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -928,7 +928,7 @@ FIELD_INSERT:
|
||||
|
||||
IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess();
|
||||
sw::mark::Fieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(
|
||||
aFieldPam, ReferenceMarkerName(), aFieldType, aFieldPam.Start());
|
||||
aFieldPam, SwMarkName(), aFieldType, aFieldPam.Start());
|
||||
if (pFieldmark && !aFieldCode.isEmpty())
|
||||
{
|
||||
pFieldmark->GetParameters()->insert(
|
||||
@@ -950,7 +950,7 @@ FIELD_INSERT:
|
||||
if(pCursorPos)
|
||||
{
|
||||
IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess();
|
||||
pMarksAccess->makeNoTextFieldBookmark(*pCursorPos, ReferenceMarkerName(), ODF_FORMCHECKBOX);
|
||||
pMarksAccess->makeNoTextFieldBookmark(*pCursorPos, SwMarkName(), ODF_FORMCHECKBOX);
|
||||
}
|
||||
|
||||
rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_FORM_FIELD, nullptr);
|
||||
@@ -965,7 +965,7 @@ FIELD_INSERT:
|
||||
if(pCursorPos)
|
||||
{
|
||||
IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess();
|
||||
pMarksAccess->makeNoTextFieldBookmark(*pCursorPos, ReferenceMarkerName(), ODF_FORMDROPDOWN);
|
||||
pMarksAccess->makeNoTextFieldBookmark(*pCursorPos, SwMarkName(), ODF_FORMDROPDOWN);
|
||||
}
|
||||
|
||||
rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_FORM_FIELD, nullptr);
|
||||
@@ -986,7 +986,7 @@ FIELD_INSERT:
|
||||
IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess();
|
||||
SwPaM aFieldPam(pCursorPos->GetPoint()->GetNode(), pCursorPos->GetPoint()->GetContentIndex() - ODF_FORMFIELD_DEFAULT_LENGTH,
|
||||
pCursorPos->GetPoint()->GetNode(), pCursorPos->GetPoint()->GetContentIndex());
|
||||
sw::mark::Fieldmark* pFieldBM = pMarksAccess->makeFieldBookmark(aFieldPam, ReferenceMarkerName(), ODF_FORMDATE,
|
||||
sw::mark::Fieldmark* pFieldBM = pMarksAccess->makeFieldBookmark(aFieldPam, SwMarkName(), ODF_FORMDATE,
|
||||
aFieldPam.Start());
|
||||
|
||||
// Use a default date format and language
|
||||
@@ -1161,7 +1161,7 @@ FIELD_INSERT:
|
||||
const bool bFooterAlreadyOn = rDesc.GetMaster().GetFooter().IsActive();
|
||||
const bool bIsSinglePage = rDesc.GetFollow() != &rDesc;
|
||||
const size_t nMirrorPagesNeeded = rDesc.IsFirstShared() ? 2 : 3;
|
||||
const ReferenceMarkerName sBookmarkName( OUString::Concat("PageNumWizard_")
|
||||
const SwMarkName sBookmarkName( OUString::Concat("PageNumWizard_")
|
||||
+ (bHeader ? "HEADER" : "FOOTER") + "_" + rDesc.GetName().toString()
|
||||
+ OUString::number(rSh.GetVirtPageNum()) );
|
||||
IDocumentMarkAccess& rIDMA = *rSh.getIDocumentMarkAccess();
|
||||
|
||||
@@ -600,7 +600,7 @@ void UpdateBookmarks(const SfxRequest& rReq, SwWrtShell& rWrtSh)
|
||||
comphelper::SequenceAsHashMap aMap(aBookmarks[nBookmarkIndex++]);
|
||||
if (aMap[u"Bookmark"_ustr].get<OUString>() != pMark->GetName())
|
||||
{
|
||||
rIDMA.renameMark(pMark, ReferenceMarkerName(aMap[u"Bookmark"_ustr].get<OUString>()));
|
||||
rIDMA.renameMark(pMark, SwMarkName(aMap[u"Bookmark"_ustr].get<OUString>()));
|
||||
}
|
||||
|
||||
OUString aBookmarkText = aMap[u"BookmarkText"_ustr].get<OUString>();
|
||||
@@ -687,7 +687,7 @@ void UpdateBookmark(const SfxRequest& rReq, SwWrtShell& rWrtSh)
|
||||
comphelper::SequenceAsHashMap aMap(aBookmark);
|
||||
if (aMap[u"Bookmark"_ustr].get<OUString>() != pBookmark->GetName())
|
||||
{
|
||||
rIDMA.renameMark(pBookmark, ReferenceMarkerName(aMap[u"Bookmark"_ustr].get<OUString>()));
|
||||
rIDMA.renameMark(pBookmark, SwMarkName(aMap[u"Bookmark"_ustr].get<OUString>()));
|
||||
}
|
||||
|
||||
// Insert markers to remember where the paste positions are.
|
||||
@@ -1311,7 +1311,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
|
||||
}
|
||||
}
|
||||
|
||||
rWrtSh.SetBookmark( vcl::KeyCode(), ReferenceMarkerName(sName) );
|
||||
rWrtSh.SetBookmark( vcl::KeyCode(), SwMarkName(sName) );
|
||||
if (pBookmarkText)
|
||||
{
|
||||
pCursorPos->DeleteMark();
|
||||
@@ -1357,7 +1357,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
|
||||
if (pItem && !rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS))
|
||||
{
|
||||
IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess();
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(static_cast<const SfxStringItem*>(pItem)->GetValue())), false);
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(static_cast<const SfxStringItem*>(pItem)->GetValue())), false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1394,7 +1394,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
|
||||
{
|
||||
// collect and sort navigator reminder names
|
||||
IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess();
|
||||
std::vector< ReferenceMarkerName > vNavMarkNames;
|
||||
std::vector< SwMarkName > vNavMarkNames;
|
||||
for(auto ppMark = pMarkAccess->getAllMarksBegin();
|
||||
ppMark != pMarkAccess->getAllMarksEnd();
|
||||
++ppMark)
|
||||
@@ -1409,7 +1409,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
|
||||
if(vNavMarkNames.size() == MAX_MARKS)
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[0]), false);
|
||||
|
||||
rWrtSh.SetBookmark(vcl::KeyCode(), ReferenceMarkerName(), IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER);
|
||||
rWrtSh.SetBookmark(vcl::KeyCode(), SwMarkName(), IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER);
|
||||
SwView::SetActMark(vNavMarkNames.size() < MAX_MARKS ? vNavMarkNames.size() : MAX_MARKS-1);
|
||||
|
||||
break;
|
||||
|
||||
@@ -1491,7 +1491,7 @@ void SwView::Execute(SfxRequest &rReq)
|
||||
break;
|
||||
case SID_JUMPTOMARK:
|
||||
if( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_JUMPTOMARK, false, &pItem))
|
||||
JumpToSwMark( ReferenceMarkerName(static_cast<const SfxStringItem*>(pItem)->GetValue()) );
|
||||
JumpToSwMark( SwMarkName(static_cast<const SfxStringItem*>(pItem)->GetValue()) );
|
||||
break;
|
||||
case SID_GALLERY :
|
||||
// First make sure that the sidebar is visible
|
||||
@@ -2600,7 +2600,7 @@ static auto JumpToTOXMark(SwWrtShell & rSh, std::u16string_view aName) -> bool
|
||||
}
|
||||
}
|
||||
|
||||
bool SwView::JumpToSwMark( const ReferenceMarkerName& rMark )
|
||||
bool SwView::JumpToSwMark( const SwMarkName& rMark )
|
||||
{
|
||||
bool bRet = false;
|
||||
if( !rMark.toString().isEmpty() )
|
||||
@@ -2667,7 +2667,7 @@ bool SwView::JumpToSwMark( const ReferenceMarkerName& rMark )
|
||||
{
|
||||
sal_uInt16 nSeqNo = o3tl::toInt32(sName.subView( nNoPos + 1 ));
|
||||
sName = sName.copy( 0, nNoPos );
|
||||
bRet = m_pWrtShell->GotoRefMark(ReferenceMarkerName(sName), REF_SEQUENCEFLD, nSeqNo);
|
||||
bRet = m_pWrtShell->GotoRefMark(SwMarkName(sName), REF_SEQUENCEFLD, nSeqNo);
|
||||
}
|
||||
}
|
||||
else if (sCmp == "toxmark")
|
||||
@@ -2695,7 +2695,7 @@ bool SwView::JumpToSwMark( const ReferenceMarkerName& rMark )
|
||||
bRet = true;
|
||||
}
|
||||
}
|
||||
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(ReferenceMarkerName(sMark))) )
|
||||
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(SwMarkName(sMark))) )
|
||||
{
|
||||
bRet = m_pWrtShell->GotoMark( *ppMark, false );
|
||||
}
|
||||
@@ -2721,7 +2721,7 @@ bool SwView::JumpToSwMark( const ReferenceMarkerName& rMark )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(ReferenceMarkerName(sMark))))
|
||||
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(SwMarkName(sMark))))
|
||||
{
|
||||
bRet = m_pWrtShell->GotoMark( *ppMark, false );
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
|
||||
|
||||
// collect and sort navigator reminder names
|
||||
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
|
||||
std::vector< ReferenceMarkerName > vNavMarkNames;
|
||||
std::vector< SwMarkName > vNavMarkNames;
|
||||
for(auto ppMark = pMarkAccess->getAllMarksBegin();
|
||||
ppMark != pMarkAccess->getAllMarksEnd();
|
||||
++ppMark)
|
||||
|
||||
@@ -687,7 +687,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
|
||||
{
|
||||
if(lcl_IsUiVisibleBookmark(*ppBookmark))
|
||||
{
|
||||
const ReferenceMarkerName& rBkmName = (*ppBookmark)->GetName();
|
||||
const SwMarkName& rBkmName = (*ppBookmark)->GetName();
|
||||
//nYPos from 0 -> text::Bookmarks will be sorted alphabetically
|
||||
auto pCnt(std::make_unique<SwContent>(this, rBkmName.toString(),
|
||||
m_bAlphabeticSort ? 0 : nYPos++));
|
||||
@@ -4980,7 +4980,7 @@ void SwContentTree::UpdateTracking()
|
||||
if (pCursor && ppBookmark != pMarkAccess->getBookmarksEnd()
|
||||
&& !(m_bIsRoot && m_nRootType != ContentTypeId::BOOKMARK))
|
||||
{
|
||||
ReferenceMarkerName sBookmarkName;
|
||||
SwMarkName sBookmarkName;
|
||||
SwPosition* pCursorPoint = pCursor->GetPoint();
|
||||
while (ppBookmark != pMarkAccess->getBookmarksEnd())
|
||||
{
|
||||
@@ -5248,7 +5248,7 @@ bool SwContentTree::IsSelectedEntryCurrentDocCursorPosition(const weld::TreeIter
|
||||
auto ppBookmark = pMarkAccess->getBookmarksBegin();
|
||||
if (pCursor && ppBookmark != pMarkAccess->getBookmarksEnd())
|
||||
{
|
||||
ReferenceMarkerName sBookmarkName;
|
||||
SwMarkName sBookmarkName;
|
||||
SwPosition* pCursorPoint = pCursor->GetPoint();
|
||||
while (ppBookmark != pMarkAccess->getBookmarksEnd())
|
||||
{
|
||||
@@ -6315,7 +6315,7 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode)
|
||||
{
|
||||
assert(!m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS));
|
||||
IDocumentMarkAccess* const pMarkAccess = m_pActiveShell->getIDocumentMarkAccess();
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(pCnt->GetName())), false);
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(pCnt->GetName())), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6595,7 +6595,7 @@ void SwContentTree::DeleteAllContentOfEntryContentType(const weld::TreeIter& rEn
|
||||
for (size_t i = 0; i < nCount; i++)
|
||||
{
|
||||
const OUString& rName(pContentType->GetMember(i)->GetName());
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(ReferenceMarkerName(rName)), false);
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(SwMarkName(rName)), false);
|
||||
}
|
||||
m_pActiveShell->EndUndo();
|
||||
m_pActiveShell->EndAction();
|
||||
@@ -6856,7 +6856,7 @@ void SwContentTree::GotoContent(const SwContent* pCnt)
|
||||
case ContentTypeId::BOOKMARK:
|
||||
{
|
||||
m_pActiveShell->StartAction();
|
||||
m_pActiveShell->GotoMark(ReferenceMarkerName(pCnt->GetName()));
|
||||
m_pActiveShell->GotoMark(SwMarkName(pCnt->GetName()));
|
||||
m_pActiveShell->EndAction();
|
||||
m_sSelectedItem = pCnt->GetName();
|
||||
|
||||
@@ -6917,7 +6917,7 @@ void SwContentTree::GotoContent(const SwContent* pCnt)
|
||||
break;
|
||||
case ContentTypeId::REFERENCE:
|
||||
{
|
||||
m_pActiveShell->GotoRefMark(ReferenceMarkerName(pCnt->GetName()));
|
||||
m_pActiveShell->GotoRefMark(SwMarkName(pCnt->GetName()));
|
||||
}
|
||||
break;
|
||||
case ContentTypeId::INDEX:
|
||||
@@ -7132,7 +7132,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry)
|
||||
}
|
||||
else if (nType == ContentTypeId::BOOKMARK)
|
||||
{
|
||||
BringBookmarksToAttention(std::vector<ReferenceMarkerName> {ReferenceMarkerName(pCnt->GetName())});
|
||||
BringBookmarksToAttention(std::vector<SwMarkName> {SwMarkName(pCnt->GetName())});
|
||||
}
|
||||
else if (nType == ContentTypeId::REGION || nType == ContentTypeId::INDEX)
|
||||
{
|
||||
@@ -7176,7 +7176,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry)
|
||||
else if (nType == ContentTypeId::REFERENCE)
|
||||
{
|
||||
if (const SwTextAttr* pTextAttr =
|
||||
m_pActiveShell->GetDoc()->GetRefMark(ReferenceMarkerName(pCnt->GetName()))->GetTextRefMark())
|
||||
m_pActiveShell->GetDoc()->GetRefMark(SwMarkName(pCnt->GetName()))->GetTextRefMark())
|
||||
{
|
||||
std::vector<const SwTextAttr*> aTextAttrArr {pTextAttr};
|
||||
BringReferencesToAttention(aTextAttrArr);
|
||||
@@ -7260,13 +7260,13 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry)
|
||||
}
|
||||
else if (nType == ContentTypeId::BOOKMARK)
|
||||
{
|
||||
std::vector<ReferenceMarkerName> aNames;
|
||||
std::vector<SwMarkName> aNames;
|
||||
const auto nCount = pCntType->GetMemberCount();
|
||||
for (size_t i = 0; i < nCount; i++)
|
||||
{
|
||||
const SwContent* pMember = pCntType->GetMember(i);
|
||||
if (pMember && !pMember->IsInvisible())
|
||||
aNames.push_back(ReferenceMarkerName(pMember->GetName()));
|
||||
aNames.push_back(SwMarkName(pMember->GetName()));
|
||||
}
|
||||
BringBookmarksToAttention(aNames);
|
||||
}
|
||||
@@ -7432,7 +7432,7 @@ void SwContentTree::BringFramesToAttention(const std::vector<const SwFrameFormat
|
||||
OverlayObject(std::move(aRanges));
|
||||
}
|
||||
|
||||
void SwContentTree::BringBookmarksToAttention(const std::vector<ReferenceMarkerName>& rNames)
|
||||
void SwContentTree::BringBookmarksToAttention(const std::vector<SwMarkName>& rNames)
|
||||
{
|
||||
std::vector<basegfx::B2DRange> aRanges;
|
||||
IDocumentMarkAccess* const pMarkAccess = m_pActiveShell->getIDocumentMarkAccess();
|
||||
|
||||
@@ -696,7 +696,7 @@ bool SwWrtShell::GotoRegion( std::u16string_view rName )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
bool SwWrtShell::GotoRefMark( const ReferenceMarkerName& rRefMark, sal_uInt16 nSubType,
|
||||
bool SwWrtShell::GotoRefMark( const SwMarkName& rRefMark, sal_uInt16 nSubType,
|
||||
sal_uInt16 nSeqNo, sal_uInt16 nFlags )
|
||||
{
|
||||
SwPosition aPos = *GetCursor()->GetPoint();
|
||||
|
||||
@@ -135,7 +135,7 @@ bool SwWrtShell::InsertField2(SwField const& rField, SwPaM* pAnnotationRange)
|
||||
pAnnotationTextRange->Start()->AdjustContent(-1);
|
||||
}
|
||||
IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess();
|
||||
pMarksAccess->makeAnnotationMark( *pAnnotationTextRange, ReferenceMarkerName() );
|
||||
pMarksAccess->makeAnnotationMark( *pAnnotationTextRange, SwMarkName() );
|
||||
}
|
||||
pAnnotationTextRange.reset();
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ void SwWrtShell::DrawSelChanged( )
|
||||
g_bNoInterrupt = bOldVal;
|
||||
}
|
||||
|
||||
void SwWrtShell::GotoMark( const ReferenceMarkerName& rName )
|
||||
void SwWrtShell::GotoMark( const SwMarkName& rName )
|
||||
{
|
||||
auto ppMark = getIDocumentMarkAccess()->findMark( rName );
|
||||
if (ppMark == getIDocumentMarkAccess()->getAllMarksEnd())
|
||||
|
||||
Reference in New Issue
Block a user