simplify IMark hierarchy (6)
merge IMark into MarkBase Change-Id: I5d3c648c950f97497c96912c25081906de434056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171464 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@@ -55,7 +55,7 @@ class IDocumentMarkAccess
|
||||
};
|
||||
|
||||
/** wrapper iterator: wraps iterator of implementation while hiding
|
||||
MarkBase class; only IMark instances can be retrieved directly.
|
||||
MarkBase class; only MarkBase instances can be retrieved directly.
|
||||
*/
|
||||
class SW_DLLPUBLIC iterator
|
||||
{
|
||||
@@ -67,9 +67,9 @@ class IDocumentMarkAccess
|
||||
std::vector<::sw::mark::MarkBase*>::const_iterator const& get() const;
|
||||
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef ::sw::mark::IMark* value_type;
|
||||
typedef ::sw::mark::IMark* const* pointer;
|
||||
typedef ::sw::mark::IMark* const& reference;
|
||||
typedef ::sw::mark::MarkBase* value_type;
|
||||
typedef ::sw::mark::MarkBase* const* pointer;
|
||||
typedef ::sw::mark::MarkBase* const& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
|
||||
iterator();
|
||||
@@ -84,9 +84,9 @@ class IDocumentMarkAccess
|
||||
// possible because we have to return a temp value;
|
||||
// let's try value_type instead, perhaps it's sufficient,
|
||||
// for a const_iterator...
|
||||
::sw::mark::IMark* /*const&*/ operator*() const;
|
||||
::sw::mark::MarkBase* /*const&*/ operator*() const;
|
||||
// nope can't do that :(
|
||||
//::sw::mark::IMark* /* const* */ operator->() const;
|
||||
//::sw::mark::MarkBase* /* const* */ operator->() const;
|
||||
iterator& operator++();
|
||||
iterator operator++(int);
|
||||
bool operator==(iterator const& rOther) const;
|
||||
@@ -129,7 +129,7 @@ class IDocumentMarkAccess
|
||||
@returns
|
||||
a pointer to the new mark (name might have changed).
|
||||
*/
|
||||
virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM,
|
||||
virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM,
|
||||
const OUString& rProposedName,
|
||||
MarkType eMark, ::sw::mark::InsertMode eMode,
|
||||
SwPosition const* pSepPos = nullptr) = 0;
|
||||
@@ -142,7 +142,7 @@ class IDocumentMarkAccess
|
||||
const OUString& rName,
|
||||
const OUString& rType) = 0;
|
||||
|
||||
virtual sw::mark::IMark* makeAnnotationMark(
|
||||
virtual sw::mark::MarkBase* makeAnnotationMark(
|
||||
const SwPaM& rPaM,
|
||||
const OUString& rName ) = 0;
|
||||
|
||||
@@ -158,7 +158,7 @@ class IDocumentMarkAccess
|
||||
@returns
|
||||
a pointer to the new mark (name might have changed).
|
||||
*/
|
||||
virtual ::sw::mark::IMark* getMarkForTextNode(const SwTextNode& rTextNode,
|
||||
virtual ::sw::mark::MarkBase* getMarkForTextNode(const SwTextNode& rTextNode,
|
||||
MarkType eMark) =0;
|
||||
|
||||
/** Moves an existing mark to a new selection and performs needed updates.
|
||||
@@ -169,7 +169,7 @@ class IDocumentMarkAccess
|
||||
[in] new selection to be marked
|
||||
*/
|
||||
|
||||
virtual void repositionMark(::sw::mark::IMark* io_pMark,
|
||||
virtual void repositionMark(::sw::mark::MarkBase* io_pMark,
|
||||
const SwPaM& rPaM) =0;
|
||||
|
||||
/** Renames an existing Mark, if possible.
|
||||
@@ -181,7 +181,7 @@ class IDocumentMarkAccess
|
||||
|
||||
@returns false, if renaming failed (because the name is already in use)
|
||||
*/
|
||||
virtual bool renameMark(::sw::mark::IMark* io_pMark,
|
||||
virtual bool renameMark(::sw::mark::MarkBase* io_pMark,
|
||||
const OUString& rNewName) =0;
|
||||
|
||||
/** Corrects marks (absolute)
|
||||
@@ -247,7 +247,7 @@ class IDocumentMarkAccess
|
||||
@param ppMark
|
||||
[in] the name of the mark to be deleted.
|
||||
*/
|
||||
virtual void deleteMark(const ::sw::mark::IMark* const pMark) =0;
|
||||
virtual void deleteMark(const ::sw::mark::MarkBase* const pMark) =0;
|
||||
|
||||
/** Clear (deletes) all marks.
|
||||
*/
|
||||
@@ -321,7 +321,7 @@ class IDocumentMarkAccess
|
||||
virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition& rPos) const =0;
|
||||
|
||||
/// Get the innermost bookmark that contains rPos.
|
||||
virtual sw::mark::IMark* getOneInnermostBookmarkFor(const SwPosition& rPos) const = 0;
|
||||
virtual sw::mark::MarkBase* getOneInnermostBookmarkFor(const SwPosition& rPos) const = 0;
|
||||
|
||||
// Fieldmarks
|
||||
/** returns a STL-like random access iterator to the begin of the sequence of fieldmarks.
|
||||
@@ -355,10 +355,10 @@ class IDocumentMarkAccess
|
||||
virtual const_iterator_t getAnnotationMarksEnd() const = 0;
|
||||
virtual sal_Int32 getAnnotationMarksCount() const = 0;
|
||||
virtual const_iterator_t findAnnotationMark( const OUString& rName ) const = 0;
|
||||
virtual sw::mark::IMark* getAnnotationMarkFor(const SwPosition& rPosition) const = 0;
|
||||
virtual sw::mark::MarkBase* 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::IMark* makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
virtual ::sw::mark::MarkBase* makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
const OUString& rProposedName,
|
||||
MarkType eMark, ::sw::mark::InsertMode eMode,
|
||||
SwPosition const* pSepPos = nullptr) = 0;
|
||||
@@ -373,7 +373,7 @@ class IDocumentMarkAccess
|
||||
|
||||
/** Returns the MarkType used to create the mark
|
||||
*/
|
||||
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark& rMark);
|
||||
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::MarkBase& rMark);
|
||||
|
||||
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix();
|
||||
static SW_DLLPUBLIC bool IsLegalPaMForCrossRefHeadingBookmark( const SwPaM& rPaM );
|
||||
|
||||
+12
-40
@@ -51,51 +51,23 @@ namespace sw::mark
|
||||
CopyText,
|
||||
};
|
||||
|
||||
class SW_DLLPUBLIC IMark
|
||||
: virtual public sw::BroadcastingModify // inherited as interface
|
||||
{
|
||||
protected:
|
||||
IMark() = default;
|
||||
|
||||
public:
|
||||
//getters
|
||||
virtual const SwPosition& GetMarkPos() const =0;
|
||||
// GetOtherMarkPos() is only guaranteed to return a valid
|
||||
// reference if IsExpanded() returned true
|
||||
virtual const SwPosition& GetOtherMarkPos() const =0;
|
||||
virtual const SwPosition& GetMarkStart() const =0;
|
||||
virtual const SwPosition& GetMarkEnd() const =0;
|
||||
virtual const OUString& GetName() const =0;
|
||||
virtual bool IsExpanded() const =0;
|
||||
virtual bool IsCoveringPosition(const SwPosition& rPos) const =0;
|
||||
|
||||
//setters
|
||||
// not available in IMark
|
||||
// inside core, you can cast to MarkBase and use its setters,
|
||||
// make sure to update the sorting in Markmanager in this case
|
||||
|
||||
virtual OUString ToString( ) const =0;
|
||||
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const = 0;
|
||||
private:
|
||||
IMark(IMark const &) = delete;
|
||||
IMark &operator =(IMark const&) = delete;
|
||||
};
|
||||
|
||||
class SW_DLLPUBLIC MarkBase
|
||||
: virtual public IMark
|
||||
: virtual public sw::BroadcastingModify // inherited as interface
|
||||
{
|
||||
public:
|
||||
//getters
|
||||
SwPosition& GetMarkPos() const override
|
||||
SwPosition& GetMarkPos() const
|
||||
{ return const_cast<SwPosition&>(*m_oPos1); }
|
||||
const OUString& GetName() const override
|
||||
const OUString& GetName() const
|
||||
{ return m_aName; }
|
||||
SwPosition& GetOtherMarkPos() const override
|
||||
// GetOtherMarkPos() is only guaranteed to return a valid
|
||||
// reference if IsExpanded() returned true
|
||||
virtual SwPosition& GetOtherMarkPos() const
|
||||
{
|
||||
OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I have no other Pos set." );
|
||||
return const_cast<SwPosition&>(*m_oPos2);
|
||||
}
|
||||
SwPosition& GetMarkStart() const override
|
||||
virtual SwPosition& GetMarkStart() const
|
||||
{
|
||||
if( !IsExpanded() ) return GetMarkPos( );
|
||||
if ( GetMarkPos( ) < GetOtherMarkPos( ) )
|
||||
@@ -103,7 +75,7 @@ namespace sw::mark
|
||||
else
|
||||
return GetOtherMarkPos( );
|
||||
}
|
||||
SwPosition& GetMarkEnd() const override
|
||||
virtual SwPosition& GetMarkEnd() const
|
||||
{
|
||||
if( !IsExpanded() ) return GetMarkPos();
|
||||
if ( GetMarkPos( ) >= GetOtherMarkPos( ) )
|
||||
@@ -112,8 +84,8 @@ namespace sw::mark
|
||||
return GetOtherMarkPos( );
|
||||
}
|
||||
|
||||
bool IsCoveringPosition(const SwPosition& rPos) const override;
|
||||
bool IsExpanded() const override
|
||||
bool IsCoveringPosition(const SwPosition& rPos) const;
|
||||
virtual bool IsExpanded() const
|
||||
{ return m_oPos2.has_value(); }
|
||||
|
||||
void SetName(const OUString& rName)
|
||||
@@ -125,8 +97,8 @@ namespace sw::mark
|
||||
|
||||
virtual auto InvalidateFrames() -> void;
|
||||
|
||||
OUString ToString( ) const override;
|
||||
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
|
||||
virtual OUString ToString( ) const;
|
||||
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
|
||||
|
||||
void Swap()
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ class SwContentIndexReg;
|
||||
struct SwPosition;
|
||||
class SwRangeRedline;
|
||||
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
/// Marks a character position inside a document model content node (SwContentNode)
|
||||
class SAL_WARN_UNUSED SW_DLLPUBLIC SwContentIndex
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
SwRangeRedline * m_pRangeRedline = nullptr;
|
||||
|
||||
/// Pointer to a mark that owns this position to allow fast lookup of marks of an SwContentIndexReg.
|
||||
const sw::mark::IMark* m_pMark;
|
||||
const sw::mark::MarkBase* m_pMark;
|
||||
|
||||
SwContentIndex& ChgValue( const SwContentIndex& rIdx, sal_Int32 nNewValue );
|
||||
void Init(sal_Int32 const nIdx);
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
const SwContentNode* GetContentNode() const { return m_pContentNode; }
|
||||
const SwContentIndex* GetNext() const { return m_pNext; }
|
||||
|
||||
const sw::mark::IMark* GetMark() const { return m_pMark; }
|
||||
void SetMark(const sw::mark::IMark* pMark);
|
||||
const sw::mark::MarkBase* GetMark() const { return m_pMark; }
|
||||
void SetMark(const sw::mark::MarkBase* pMark);
|
||||
|
||||
SwRangeRedline* GetRedline() const { return m_pRangeRedline; }
|
||||
void SetRedline(SwRangeRedline* pRangeRedline) { m_pRangeRedline = pRangeRedline; }
|
||||
|
||||
+4
-4
@@ -588,17 +588,17 @@ public:
|
||||
void GoNextPrevCursorSetSearchLabel(const bool bNext);
|
||||
|
||||
// at CurrentCursor.SPoint
|
||||
SW_DLLPUBLIC ::sw::mark::IMark* SetBookmark(
|
||||
SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark(
|
||||
const vcl::KeyCode&,
|
||||
const OUString& rName,
|
||||
IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::MarkType::BOOKMARK);
|
||||
SW_DLLPUBLIC ::sw::mark::IMark* SetBookmark2(
|
||||
SW_DLLPUBLIC ::sw::mark::MarkBase* SetBookmark2(
|
||||
const vcl::KeyCode&,
|
||||
const OUString& rName,
|
||||
bool bHide,
|
||||
const OUString& rCondition);
|
||||
SW_DLLPUBLIC bool GotoMark( const ::sw::mark::IMark* const pMark ); // sets CurrentCursor.SPoint
|
||||
bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart );
|
||||
SW_DLLPUBLIC bool GotoMark( const ::sw::mark::MarkBase* const pMark ); // sets CurrentCursor.SPoint
|
||||
bool GotoMark( const ::sw::mark::MarkBase* const pMark, bool bAtStart );
|
||||
bool GoNextBookmark(); // true, if there was one
|
||||
bool GoPrevBookmark();
|
||||
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
|
||||
|
||||
const SwContentNode* GetContentNode() const { return nContent.GetContentNode(); }
|
||||
sal_Int32 GetContentIndex() const { return nContent.GetIndex(); }
|
||||
void SetMark(const sw::mark::IMark* pMark) { nContent.SetMark(pMark); }
|
||||
void SetMark(const sw::mark::MarkBase* pMark) { nContent.SetMark(pMark); }
|
||||
void SetRedline(SwRangeRedline* pRangeRedline) { nContent.SetRedline(pRangeRedline); }
|
||||
|
||||
/// These all set both nNode and nContent
|
||||
|
||||
@@ -33,7 +33,7 @@ class SwEditWin;
|
||||
class SwFrame;
|
||||
class IDocumentRedlineAccess;
|
||||
namespace sw::annotation { class SwAnnotationWin; }
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
struct SwPosition;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace SwPostItHelper
|
||||
SwLayoutStatus getLayoutInfos(
|
||||
SwLayoutInfo& o_rInfo,
|
||||
const SwPosition& rAnchorPos,
|
||||
const sw::mark::IMark* pAnnotationMark = nullptr );
|
||||
const sw::mark::MarkBase* pAnnotationMark = nullptr );
|
||||
|
||||
tools::Long getLayoutHeight( const SwRootFrame* pRoot );
|
||||
void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode );
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ class SwPaM;
|
||||
class SwTextBlocks;
|
||||
struct SwPosition;
|
||||
struct Writer_Impl;
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
namespace com::sun::star::embed { class XStorage; }
|
||||
|
||||
// Defines the count of chars at which a paragraph read via ASCII/W4W-Reader
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
// Search all Bookmarks in the range and return it in the Array.
|
||||
bool GetBookmarks( const SwContentNode& rNd,
|
||||
sal_Int32 nStt, sal_Int32 nEnd,
|
||||
std::vector< const ::sw::mark::IMark* >& rArr );
|
||||
std::vector< const ::sw::mark::MarkBase* >& rArr );
|
||||
|
||||
// Create new PaM at position.
|
||||
static std::shared_ptr<SwUnoCursor> NewUnoCursor(SwDoc & rDoc,
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@ class SwBaseLink;
|
||||
class SwTableNode;
|
||||
struct SwPosition;
|
||||
class SwPaM;
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
class SwServerObject final : public ::sfx2::SvLinkSource
|
||||
{
|
||||
@@ -34,13 +34,13 @@ class SwServerObject final : public ::sfx2::SvLinkSource
|
||||
|
||||
enum ServerModes { BOOKMARK_SERVER, TABLE_SERVER, SECTION_SERVER, NONE_SERVER } m_eType;
|
||||
union {
|
||||
::sw::mark::IMark* pBkmk;
|
||||
::sw::mark::MarkBase* pBkmk;
|
||||
SwTableNode* pTableNd;
|
||||
SwSectionNode* pSectNd;
|
||||
} m_CNTNT_TYPE;
|
||||
|
||||
public:
|
||||
SwServerObject( ::sw::mark::IMark& rBookmark )
|
||||
SwServerObject( ::sw::mark::MarkBase& rBookmark )
|
||||
: m_eType( BOOKMARK_SERVER )
|
||||
{
|
||||
m_CNTNT_TYPE.pBkmk = &rBookmark;
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
bool IsLinkInServer( const SwBaseLink* ) const;
|
||||
|
||||
void SetNoServer();
|
||||
void SetDdeBookmark( ::sw::mark::IMark& rBookmark);
|
||||
void SetDdeBookmark( ::sw::mark::MarkBase& rBookmark);
|
||||
};
|
||||
|
||||
#endif // INCLUDED_SW_INC_SWSERV_HXX
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "txtfld.hxx"
|
||||
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
class SwTextAnnotationField final : public SwTextField
|
||||
{
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
virtual ~SwTextAnnotationField() override;
|
||||
|
||||
::sw::mark::IMark* GetAnnotationMark() const;
|
||||
::sw::mark::MarkBase* GetAnnotationMark() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,7 @@ struct SwSortOptions;
|
||||
class SwDoc;
|
||||
class SwRootFrame;
|
||||
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
namespace com::sun::star{
|
||||
namespace beans{
|
||||
@@ -235,7 +235,7 @@ namespace SwUnoCursorHelper
|
||||
SwDoc & rTargetDoc,
|
||||
std::optional<SwPaM>& o_rpPaM, std::pair<OUString, FlyCntType> & o_rFrame,
|
||||
OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor,
|
||||
::sw::mark::IMark const*& o_rpMark,
|
||||
::sw::mark::MarkBase const*& o_rpMark,
|
||||
std::vector<SdrObject *> & o_rSdrObjects);
|
||||
|
||||
css::uno::Reference<css::text::XFlatParagraphIterator>
|
||||
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
std::u16string_view aText, ::sw::DeleteAndInsertMode eMode);
|
||||
void Invalidate();
|
||||
void GetStartPaM(std::optional<SwPaM>& roPaM);
|
||||
void SetMark(::sw::mark::IMark& rMark);
|
||||
void SetMark(::sw::mark::MarkBase& rMark);
|
||||
void InvalidateImpl();
|
||||
|
||||
virtual ~SwXTextRange() override;
|
||||
@@ -211,7 +211,7 @@ private:
|
||||
SwDoc& m_rDoc;
|
||||
css::uno::Reference<css::text::XText> m_xParentText;
|
||||
const SwFrameFormat* m_pTableOrSectionFormat;
|
||||
const ::sw::mark::IMark* m_pMark;
|
||||
const ::sw::mark::MarkBase* m_pMark;
|
||||
struct MySvtListener : public SvtListener
|
||||
{
|
||||
SwXTextRange& mrTextRange;
|
||||
|
||||
@@ -190,7 +190,7 @@ void SwMacrosTest::testBookmarkDeleteAndJoin()
|
||||
aPaM.SetMark();
|
||||
aPaM.Move(fnMoveForward, GoInDoc);
|
||||
IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
|
||||
sw::mark::IMark *pMark =
|
||||
sw::mark::MarkBase *pMark =
|
||||
rIDMA.makeMark(aPaM, u"test"_ustr, IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
CPPUNIT_ASSERT(pMark);
|
||||
@@ -225,7 +225,7 @@ void SwMacrosTest::testBookmarkDeleteTdf90816()
|
||||
aPaM.SetMark();
|
||||
aPaM.Move(fnMoveBackward, GoInContent);
|
||||
IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
|
||||
sw::mark::IMark *pMark =
|
||||
sw::mark::MarkBase *pMark =
|
||||
rIDMA.makeMark(aPaM, u"test"_ustr, IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
CPPUNIT_ASSERT(pMark);
|
||||
|
||||
@@ -1474,9 +1474,9 @@ void SwDocTest::testMarkMove()
|
||||
SwTextNode& rParaNode2 = dynamic_cast<SwTextNode&>(aIdx.GetNode());
|
||||
rParaNode2.JoinNext();
|
||||
}
|
||||
::sw::mark::IMark* pBM1 = *pMarksAccess->findMark(u"Para1"_ustr);
|
||||
::sw::mark::IMark* pBM2 = *pMarksAccess->findMark(u"Para2"_ustr);
|
||||
::sw::mark::IMark* pBM3 = *pMarksAccess->findMark(u"Para3"_ustr);
|
||||
::sw::mark::MarkBase* pBM1 = *pMarksAccess->findMark(u"Para1"_ustr);
|
||||
::sw::mark::MarkBase* pBM2 = *pMarksAccess->findMark(u"Para2"_ustr);
|
||||
::sw::mark::MarkBase* pBM3 = *pMarksAccess->findMark(u"Para3"_ustr);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().GetContentIndex());
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().GetContentIndex());
|
||||
|
||||
@@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479)
|
||||
SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
|
||||
SwPaM aPaM(aIdx);
|
||||
IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
|
||||
sw::mark::IMark* pMark
|
||||
sw::mark::MarkBase* pMark
|
||||
= rIDMA.makeMark(aPaM, u"original"_ustr, IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
CPPUNIT_ASSERT(!pMark->IsExpanded());
|
||||
@@ -704,9 +704,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkText)
|
||||
|
||||
lcl_selectCharacters(aPaM, 0, 3);
|
||||
IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
|
||||
sw::mark::IMark* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
|
||||
// verify
|
||||
CPPUNIT_ASSERT(pMark->IsExpanded());
|
||||
@@ -782,9 +782,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew)
|
||||
|
||||
lcl_selectCharacters(aPaM, 0, 3);
|
||||
IDocumentMarkAccess& rIDMA = *pDoc->getIDocumentMarkAccess();
|
||||
sw::mark::IMark* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
sw::mark::MarkBase* pMark = rIDMA.makeMark(aPaM, u"testBookmark"_ustr,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
|
||||
// verify
|
||||
CPPUNIT_ASSERT(pMark->IsExpanded());
|
||||
|
||||
@@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageCommentAtChar)
|
||||
// Get the annotation mark doc model start.
|
||||
auto it = pDoc->getIDocumentMarkAccess()->getAnnotationMarksBegin();
|
||||
CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAnnotationMarksEnd());
|
||||
const sw::mark::IMark* pMark = *it;
|
||||
const sw::mark::MarkBase* pMark = *it;
|
||||
const SwPosition& rAnnotationMarkStart = pMark->GetMarkPos();
|
||||
|
||||
// Without the accompanying fix in place, this test would have failed with:
|
||||
|
||||
@@ -2365,7 +2365,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804)
|
||||
SwPaM* pCrsr = pShell->GetCursor();
|
||||
IDocumentMarkAccess* pIDMAccess(pDoc->getIDocumentMarkAccess());
|
||||
//make first bookmark, CROSSREF_HEADING, with *empty* name
|
||||
sw::mark::IMark* pMark1(pIDMAccess->makeMark(
|
||||
sw::mark::MarkBase* pMark1(pIDMAccess->makeMark(
|
||||
*pCrsr, u""_ustr, IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK,
|
||||
::sw::mark::InsertMode::New));
|
||||
//get the new(autogenerated) bookmark name
|
||||
@@ -2373,7 +2373,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804)
|
||||
//match the bookmark name, it should be like "__RefHeading__**"
|
||||
CPPUNIT_ASSERT(bookmark1name.match("__RefHeading__"));
|
||||
//make second bookmark, CROSSREF_NUMITEM, with *empty* name
|
||||
sw::mark::IMark* pMark2(pIDMAccess->makeMark(
|
||||
sw::mark::MarkBase* pMark2(pIDMAccess->makeMark(
|
||||
*pCrsr, u""_ustr, IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK,
|
||||
::sw::mark::InsertMode::New));
|
||||
//get the new(autogenerated) bookmark name
|
||||
|
||||
@@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertBookmark)
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), rIDMA.getBookmarksCount());
|
||||
for (auto it = rIDMA.getBookmarksBegin(); it != rIDMA.getBookmarksEnd(); ++it)
|
||||
{
|
||||
sw::mark::IMark* pMark = *it;
|
||||
sw::mark::MarkBase* pMark = *it;
|
||||
CPPUNIT_ASSERT_EQUAL(aExpectedBookmarkName, pMark->GetName());
|
||||
SwPaM aPam(pMark->GetMarkStart(), pMark->GetMarkEnd());
|
||||
OUString aActualResult = aPam.GetText();
|
||||
|
||||
@@ -219,7 +219,7 @@ SwContentIndex& SwContentIndex::Assign( const SwContentNode* pArr, sal_Int32 nId
|
||||
return *this;
|
||||
}
|
||||
|
||||
void SwContentIndex::SetMark(const sw::mark::IMark* pMark)
|
||||
void SwContentIndex::SetMark(const sw::mark::MarkBase* pMark)
|
||||
{
|
||||
m_pMark = pMark;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace
|
||||
, m_aSaveState(*m_pCursor)
|
||||
{ }
|
||||
|
||||
void SetCursorToMark(::sw::mark::IMark const * const pMark)
|
||||
void SetCursorToMark(::sw::mark::MarkBase const * const pMark)
|
||||
{
|
||||
*(m_pCursor->GetPoint()) = pMark->GetMarkStart();
|
||||
if(pMark->IsExpanded())
|
||||
@@ -62,26 +62,26 @@ namespace
|
||||
SwCursorSaveState m_aSaveState;
|
||||
};
|
||||
|
||||
bool lcl_ReverseMarkOrderingByEnd(const ::sw::mark::IMark* pFirst,
|
||||
const ::sw::mark::IMark* pSecond)
|
||||
bool lcl_ReverseMarkOrderingByEnd(const ::sw::mark::MarkBase* pFirst,
|
||||
const ::sw::mark::MarkBase* pSecond)
|
||||
{
|
||||
return pFirst->GetMarkEnd() > pSecond->GetMarkEnd();
|
||||
}
|
||||
|
||||
bool lcl_IsInvisibleBookmark(const ::sw::mark::IMark* pMark)
|
||||
bool lcl_IsInvisibleBookmark(const ::sw::mark::MarkBase* pMark)
|
||||
{
|
||||
return IDocumentMarkAccess::GetType(*pMark) != IDocumentMarkAccess::MarkType::BOOKMARK;
|
||||
}
|
||||
}
|
||||
|
||||
// at CurrentCursor.SPoint
|
||||
::sw::mark::IMark* SwCursorShell::SetBookmark(
|
||||
::sw::mark::MarkBase* SwCursorShell::SetBookmark(
|
||||
const vcl::KeyCode& rCode,
|
||||
const OUString& rName,
|
||||
IDocumentMarkAccess::MarkType eMark)
|
||||
{
|
||||
StartAction();
|
||||
::sw::mark::IMark* pMark = getIDocumentMarkAccess()->makeMark(
|
||||
::sw::mark::MarkBase* pMark = getIDocumentMarkAccess()->makeMark(
|
||||
*GetCursor(),
|
||||
rName,
|
||||
eMark, sw::mark::InsertMode::New);
|
||||
@@ -97,14 +97,14 @@ namespace
|
||||
// set CurrentCursor.SPoint
|
||||
|
||||
// at CurrentCursor.SPoint
|
||||
::sw::mark::IMark* SwCursorShell::SetBookmark2(
|
||||
::sw::mark::MarkBase* SwCursorShell::SetBookmark2(
|
||||
const vcl::KeyCode& rCode,
|
||||
const OUString& rName,
|
||||
bool bHide,
|
||||
const OUString& rCondition)
|
||||
{
|
||||
StartAction();
|
||||
::sw::mark::IMark* pMark = getIDocumentMarkAccess()->makeMark(
|
||||
::sw::mark::MarkBase* pMark = getIDocumentMarkAccess()->makeMark(
|
||||
*GetCursor(),
|
||||
rName,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New);
|
||||
@@ -122,7 +122,7 @@ namespace
|
||||
|
||||
namespace sw {
|
||||
|
||||
bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark)
|
||||
bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::MarkBase const& rMark)
|
||||
{
|
||||
if (!rLayout.HasMergedParas())
|
||||
{
|
||||
@@ -165,7 +165,7 @@ bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark)
|
||||
} // namespace sw
|
||||
|
||||
// set CurrentCursor.SPoint
|
||||
bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark, bool bAtStart)
|
||||
bool SwCursorShell::GotoMark(const ::sw::mark::MarkBase* const pMark, bool bAtStart)
|
||||
{
|
||||
if (sw::IsMarkHidden(*GetLayout(), *pMark))
|
||||
{
|
||||
@@ -184,7 +184,7 @@ bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark, bool bAtStart
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark)
|
||||
bool SwCursorShell::GotoMark(const ::sw::mark::MarkBase* const pMark)
|
||||
{
|
||||
if (sw::IsMarkHidden(*GetLayout(), *pMark))
|
||||
{
|
||||
@@ -203,7 +203,7 @@ bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark)
|
||||
bool SwCursorShell::GoNextBookmark()
|
||||
{
|
||||
IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
|
||||
std::vector<::sw::mark::IMark*> vCandidates;
|
||||
std::vector<::sw::mark::MarkBase*> vCandidates;
|
||||
remove_copy_if(
|
||||
pMarkAccess->findFirstBookmarkStartsAfter(*GetCursor()->GetPoint()),
|
||||
pMarkAccess->getBookmarksEnd(),
|
||||
@@ -238,7 +238,7 @@ bool SwCursorShell::GoPrevBookmark()
|
||||
IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
|
||||
// candidates from which to choose the mark before
|
||||
// no need to consider marks starting after rPos
|
||||
std::vector<::sw::mark::IMark*> vCandidates;
|
||||
std::vector<::sw::mark::MarkBase*> vCandidates;
|
||||
remove_copy_if(
|
||||
pMarkAccess->getBookmarksBegin(),
|
||||
pMarkAccess->findFirstBookmarkStartsAfter(*GetCursor()->GetPoint()),
|
||||
|
||||
@@ -1494,7 +1494,7 @@ bool SwCursor::SelectWordWT( SwViewShell const * pViewShell, sal_Int16 nWordType
|
||||
{
|
||||
SetMark();
|
||||
GetMark()->Assign(*pStartNode, nStartIndex);
|
||||
if (sw::mark::IMark* pAnnotationMark = pMarksAccess->getAnnotationMarkFor(*GetPoint()))
|
||||
if (sw::mark::MarkBase* pAnnotationMark = pMarksAccess->getAnnotationMarkFor(*GetPoint()))
|
||||
{
|
||||
// An annotation mark covers the selected word. Check
|
||||
// if it covers only the word: in that case we select
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace
|
||||
void RestoreUnoCursors(updater_t const & rUpdater);
|
||||
void SaveShellCursors(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent);
|
||||
void RestoreShellCursors(updater_t const & rUpdater);
|
||||
static const SwPosition& GetRightMarkPos(::sw::mark::IMark const * pMark, bool bOther)
|
||||
static const SwPosition& GetRightMarkPos(::sw::mark::MarkBase const * pMark, bool bOther)
|
||||
{ return bOther ? pMark->GetOtherMarkPos() : pMark->GetMarkPos(); };
|
||||
static void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos)
|
||||
{ bOther ? pMark->SetOtherMarkPos(*pPos) : pMark->SetMarkPos(*pPos); };
|
||||
@@ -227,7 +227,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 n
|
||||
ppBkmk != ppBkmkEnd;
|
||||
++ppBkmk)
|
||||
{
|
||||
const ::sw::mark::IMark* pBkmk = *ppBkmk;
|
||||
const ::sw::mark::MarkBase* pBkmk = *ppBkmk;
|
||||
bool bMarkPosEqual = false;
|
||||
if(pBkmk->GetMarkPos().GetNodeIndex() == nNode
|
||||
&& pBkmk->GetMarkPos().GetContentIndex() <= nContent)
|
||||
|
||||
@@ -245,12 +245,12 @@ namespace sw
|
||||
const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
|
||||
SwPosition const*const pCpyStt = &rCpyPam;
|
||||
|
||||
std::vector< const ::sw::mark::IMark* > vMarksToCopy;
|
||||
std::vector< const ::sw::mark::MarkBase* > vMarksToCopy;
|
||||
for ( IDocumentMarkAccess::const_iterator_t ppMark = pSrcMarkAccess->getAllMarksBegin();
|
||||
ppMark != pSrcMarkAccess->getAllMarksEnd();
|
||||
++ppMark )
|
||||
{
|
||||
const ::sw::mark::IMark* const pMark = *ppMark;
|
||||
const ::sw::mark::MarkBase* const pMark = *ppMark;
|
||||
|
||||
const SwPosition& rMarkStart = pMark->GetMarkStart();
|
||||
const SwPosition& rMarkEnd = pMark->GetMarkEnd();
|
||||
@@ -286,7 +286,7 @@ namespace sw
|
||||
// We have to count the "non-copied" nodes...
|
||||
SwNodeOffset nDelCount;
|
||||
SwNodeIndex aCorrIdx(InitDelCount(rPam, nDelCount));
|
||||
for(const sw::mark::IMark* const pMark : vMarksToCopy)
|
||||
for(const sw::mark::MarkBase* const pMark : vMarksToCopy)
|
||||
{
|
||||
SwPaM aTmpPam(*pCpyStt);
|
||||
lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetMarkPos().GetNodeIndex(), nDelCount);
|
||||
@@ -303,12 +303,12 @@ namespace sw
|
||||
{
|
||||
assert(&rSrcDoc == &rDestDoc);
|
||||
// Ensure the name can be given to NewMark, since this is ultimately a move
|
||||
auto pSoonToBeDeletedMark = const_cast<sw::mark::IMark*>(pMark);
|
||||
auto pSoonToBeDeletedMark = const_cast<sw::mark::MarkBase*>(pMark);
|
||||
rDestDoc.getIDocumentMarkAccess()->renameMark(pSoonToBeDeletedMark,
|
||||
sRequestedName + "COPY_IS_MOVE");
|
||||
}
|
||||
|
||||
::sw::mark::IMark* const pNewMark = rDestDoc.getIDocumentMarkAccess()->makeMark(
|
||||
::sw::mark::MarkBase* const pNewMark = rDestDoc.getIDocumentMarkAccess()->makeMark(
|
||||
aTmpPam,
|
||||
sRequestedName,
|
||||
IDocumentMarkAccess::GetType(*pMark),
|
||||
@@ -4677,7 +4677,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
|
||||
m_rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
|
||||
|
||||
// If any Redline will change (split!) the node
|
||||
const ::sw::mark::IMark* pBkmk =
|
||||
const ::sw::mark::MarkBase* pBkmk =
|
||||
m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam,
|
||||
OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
@@ -4779,7 +4779,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
|
||||
m_rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
|
||||
|
||||
// If any Redline will change (split!) the node
|
||||
const ::sw::mark::IMark* pBkmk =
|
||||
const ::sw::mark::MarkBase* pBkmk =
|
||||
m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam,
|
||||
OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK,
|
||||
::sw::mark::InsertMode::New);
|
||||
|
||||
@@ -88,10 +88,10 @@ auto IDocumentMarkAccess::iterator::operator=(iterator && rOther) noexcept -> it
|
||||
}
|
||||
|
||||
// ARGH why does it *need* to return const& ?
|
||||
::sw::mark::IMark* /*const&*/
|
||||
::sw::mark::MarkBase* /*const&*/
|
||||
IDocumentMarkAccess::iterator::operator*() const
|
||||
{
|
||||
return static_cast<sw::mark::IMark*>(**m_pIter);
|
||||
return **m_pIter;
|
||||
}
|
||||
|
||||
auto IDocumentMarkAccess::iterator::operator++() -> iterator&
|
||||
@@ -163,7 +163,7 @@ auto IDocumentMarkAccess::iterator::operator-(iterator const& rOther) const -> d
|
||||
|
||||
auto IDocumentMarkAccess::iterator::operator[](difference_type const n) const -> value_type
|
||||
{
|
||||
return static_cast<sw::mark::IMark*>((*m_pIter)[n]);
|
||||
return (*m_pIter)[n];
|
||||
}
|
||||
|
||||
bool IDocumentMarkAccess::iterator::operator<(iterator const& rOther) const
|
||||
@@ -302,11 +302,11 @@ namespace
|
||||
struct CompareIMarkStartsBefore
|
||||
{
|
||||
bool operator()(SwPosition const& rPos,
|
||||
const sw::mark::IMark* pMark)
|
||||
const sw::mark::MarkBase* pMark)
|
||||
{
|
||||
return rPos < pMark->GetMarkStart();
|
||||
}
|
||||
bool operator()(const sw::mark::IMark* pMark,
|
||||
bool operator()(const sw::mark::MarkBase* pMark,
|
||||
SwPosition const& rPos)
|
||||
{
|
||||
return pMark->GetMarkStart() < rPos;
|
||||
@@ -318,7 +318,7 @@ namespace
|
||||
struct CompareIMarkStartsAfter
|
||||
{
|
||||
bool operator()(SwPosition const& rPos,
|
||||
const sw::mark::IMark* pMark)
|
||||
const sw::mark::MarkBase* pMark)
|
||||
{
|
||||
return pMark->GetMarkStart() > rPos;
|
||||
}
|
||||
@@ -326,13 +326,13 @@ namespace
|
||||
|
||||
struct CompareIMarkStartsAfterReverse
|
||||
{
|
||||
bool operator()(const sw::mark::IMark* pMark, SwPosition const& rPos)
|
||||
bool operator()(const sw::mark::MarkBase* pMark, SwPosition const& rPos)
|
||||
{
|
||||
return pMark->GetMarkStart() > rPos;
|
||||
}
|
||||
};
|
||||
|
||||
IMark* lcl_getMarkAfter(const MarkManager::container_t& rMarks, const SwPosition& rPos,
|
||||
MarkBase* lcl_getMarkAfter(const MarkManager::container_t& rMarks, const SwPosition& rPos,
|
||||
bool bLoop)
|
||||
{
|
||||
auto const pMarkAfter = upper_bound(
|
||||
@@ -350,7 +350,7 @@ namespace
|
||||
return *pMarkAfter;
|
||||
};
|
||||
|
||||
IMark* lcl_getMarkBefore(const MarkManager::container_t& rMarks, const SwPosition& rPos,
|
||||
MarkBase* lcl_getMarkBefore(const MarkManager::container_t& rMarks, const SwPosition& rPos,
|
||||
bool bLoop)
|
||||
{
|
||||
// candidates from which to choose the mark before
|
||||
@@ -488,7 +488,7 @@ namespace
|
||||
ppMark != rMarks.end();
|
||||
++ppMark)
|
||||
{
|
||||
IMark* pMark = *ppMark;
|
||||
MarkBase* pMark = *ppMark;
|
||||
const SwPosition* const pStPos = &pMark->GetMarkStart();
|
||||
const SwPosition* const pEndPos = &pMark->GetMarkEnd();
|
||||
SAL_INFO("sw.core",
|
||||
@@ -506,7 +506,7 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk)
|
||||
IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const MarkBase& rBkmk)
|
||||
{
|
||||
const std::type_info* const pMarkTypeInfo = &typeid(rBkmk);
|
||||
// not using dynamic_cast<> here for performance
|
||||
@@ -572,7 +572,7 @@ namespace sw::mark
|
||||
, m_pLastActiveFieldmark(nullptr)
|
||||
{ }
|
||||
|
||||
::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM,
|
||||
::sw::mark::MarkBase* MarkManager::makeMark(const SwPaM& rPaM,
|
||||
const OUString& rName,
|
||||
const IDocumentMarkAccess::MarkType eType,
|
||||
sw::mark::InsertMode const eMode,
|
||||
@@ -755,7 +755,7 @@ namespace sw::mark
|
||||
bool bUndoIsEnabled = m_rDoc.GetIDocumentUndoRedo().DoesUndo();
|
||||
m_rDoc.GetIDocumentUndoRedo().DoUndo(false);
|
||||
|
||||
sw::mark::IMark* pMark = nullptr;
|
||||
sw::mark::MarkBase* pMark = nullptr;
|
||||
if(rType == ODF_FORMDATE)
|
||||
{
|
||||
pMark = makeMark(rPaM, rName,
|
||||
@@ -796,7 +796,7 @@ namespace sw::mark
|
||||
bool bEnableSetModified = m_rDoc.getIDocumentState().IsEnableSetModified();
|
||||
m_rDoc.getIDocumentState().SetEnableSetModified(false);
|
||||
|
||||
sw::mark::IMark* pMark = nullptr;
|
||||
sw::mark::MarkBase* pMark = nullptr;
|
||||
if(rType == ODF_FORMCHECKBOX)
|
||||
{
|
||||
pMark = makeMark( rPaM, rName,
|
||||
@@ -833,7 +833,7 @@ namespace sw::mark
|
||||
return pFieldMark;
|
||||
}
|
||||
|
||||
::sw::mark::IMark* MarkManager::getMarkForTextNode(
|
||||
::sw::mark::MarkBase* MarkManager::getMarkForTextNode(
|
||||
const SwTextNode& rTextNode,
|
||||
const IDocumentMarkAccess::MarkType eType )
|
||||
{
|
||||
@@ -845,7 +845,7 @@ namespace sw::mark
|
||||
return makeMark(aPaM, OUString(), eType, sw::mark::InsertMode::New);
|
||||
}
|
||||
|
||||
sw::mark::IMark* MarkManager::makeAnnotationMark(
|
||||
sw::mark::MarkBase* MarkManager::makeAnnotationMark(
|
||||
const SwPaM& rPaM,
|
||||
const OUString& rName )
|
||||
{
|
||||
@@ -854,13 +854,13 @@ namespace sw::mark
|
||||
}
|
||||
|
||||
void MarkManager::repositionMark(
|
||||
::sw::mark::IMark* const io_pMark,
|
||||
::sw::mark::MarkBase* const io_pMark,
|
||||
const SwPaM& rPaM)
|
||||
{
|
||||
assert(&io_pMark->GetMarkPos().GetDoc() == &m_rDoc &&
|
||||
"<MarkManager::repositionMark(..)>"
|
||||
" - Mark is not in my doc.");
|
||||
MarkBase* const pMarkBase = dynamic_cast< MarkBase* >(io_pMark);
|
||||
MarkBase* const pMarkBase = io_pMark;
|
||||
if (!pMarkBase)
|
||||
return;
|
||||
|
||||
@@ -881,7 +881,7 @@ namespace sw::mark
|
||||
}
|
||||
|
||||
bool MarkManager::renameMark(
|
||||
::sw::mark::IMark* io_pMark,
|
||||
::sw::mark::MarkBase* io_pMark,
|
||||
const OUString& rNewName )
|
||||
{
|
||||
assert(&io_pMark->GetMarkPos().GetDoc() == &m_rDoc &&
|
||||
@@ -891,20 +891,17 @@ namespace sw::mark
|
||||
return true;
|
||||
if (lcl_FindMarkByName(rNewName, m_vAllMarks.begin(), m_vAllMarks.end()) != m_vAllMarks.end())
|
||||
return false;
|
||||
if (::sw::mark::MarkBase* pMarkBase = dynamic_cast< ::sw::mark::MarkBase* >(io_pMark))
|
||||
{
|
||||
const OUString sOldName(pMarkBase->GetName());
|
||||
pMarkBase->SetName(rNewName);
|
||||
const OUString sOldName(io_pMark->GetName());
|
||||
io_pMark->SetName(rNewName);
|
||||
|
||||
if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark))
|
||||
if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark))
|
||||
{
|
||||
if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
|
||||
{
|
||||
if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
|
||||
{
|
||||
m_rDoc.GetIDocumentUndoRedo().AppendUndo(
|
||||
std::make_unique<SwUndoRenameBookmark>(sOldName, rNewName, m_rDoc));
|
||||
}
|
||||
m_rDoc.getIDocumentState().SetModified();
|
||||
m_rDoc.GetIDocumentUndoRedo().AppendUndo(
|
||||
std::make_unique<SwUndoRenameBookmark>(sOldName, rNewName, m_rDoc));
|
||||
}
|
||||
m_rDoc.getIDocumentState().SetModified();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1279,7 +1276,7 @@ namespace sw::mark
|
||||
std::unique_ptr<ILazyDeleter> ret;
|
||||
if (ppMark.get() == m_vAllMarks.end())
|
||||
return ret;
|
||||
IMark* pMark = *ppMark;
|
||||
MarkBase* pMark = *ppMark;
|
||||
|
||||
switch(IDocumentMarkAccess::GetType(*pMark))
|
||||
{
|
||||
@@ -1374,7 +1371,7 @@ namespace sw::mark
|
||||
return ret;
|
||||
}
|
||||
|
||||
void MarkManager::deleteMark(const IMark* const pMark)
|
||||
void MarkManager::deleteMark(const MarkBase* const pMark)
|
||||
{
|
||||
assert(&pMark->GetMarkPos().GetDoc() == &m_rDoc &&
|
||||
"<MarkManager::deleteMark(..)>"
|
||||
@@ -1522,7 +1519,7 @@ namespace sw::mark
|
||||
return dynamic_cast<Fieldmark*>(pMark);
|
||||
}
|
||||
|
||||
IMark* MarkManager::getOneInnermostBookmarkFor(const SwPosition& rPos) const
|
||||
MarkBase* MarkManager::getOneInnermostBookmarkFor(const SwPosition& rPos) const
|
||||
{
|
||||
auto it = std::find_if(m_vBookmarks.begin(), m_vBookmarks.end(),
|
||||
[&rPos](const sw::mark::MarkBase* pMark)
|
||||
@@ -1531,7 +1528,7 @@ namespace sw::mark
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
sw::mark::IMark* pBookmark = *it;
|
||||
sw::mark::MarkBase* pBookmark = *it;
|
||||
|
||||
// See if any bookmarks after the first hit are closer to rPos.
|
||||
++it;
|
||||
@@ -1707,7 +1704,7 @@ namespace sw::mark
|
||||
for (auto aI = m_vFieldmarks.begin(),
|
||||
aEnd = m_vFieldmarks.end(); aI != aEnd; ++aI)
|
||||
{
|
||||
::sw::mark::IMark* pI = *aI;
|
||||
::sw::mark::MarkBase* pI = *aI;
|
||||
const SwPosition &rStart = pI->GetMarkPos();
|
||||
if (!rPaM.ContainsPosition(rStart))
|
||||
continue;
|
||||
@@ -1752,7 +1749,7 @@ namespace sw::mark
|
||||
return IDocumentMarkAccess::iterator(ret);
|
||||
}
|
||||
|
||||
IMark* MarkManager::getAnnotationMarkFor(const SwPosition& rPos) const
|
||||
MarkBase* MarkManager::getAnnotationMarkFor(const SwPosition& rPos) const
|
||||
{
|
||||
auto const pAnnotationMark = find_if(
|
||||
m_vAnnotationMarks.begin(),
|
||||
@@ -1774,7 +1771,7 @@ namespace sw::mark
|
||||
}
|
||||
|
||||
// create helper bookmark for annotations on tracked deletions
|
||||
::sw::mark::IMark* MarkManager::makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
::sw::mark::MarkBase* MarkManager::makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
const OUString& rName,
|
||||
const IDocumentMarkAccess::MarkType eType,
|
||||
sw::mark::InsertMode const eMode,
|
||||
@@ -1930,7 +1927,7 @@ const IDocumentMarkAccess* SwDoc::getIDocumentMarkAccess() const
|
||||
{ return static_cast< IDocumentMarkAccess* >(mpMarkManager.get()); }
|
||||
|
||||
SaveBookmark::SaveBookmark(
|
||||
const IMark& rBkmk,
|
||||
const MarkBase& rBkmk,
|
||||
const SwNode& rMvPos,
|
||||
std::optional<sal_Int32> oContentIdx)
|
||||
: m_aName(rBkmk.GetName())
|
||||
|
||||
@@ -1135,18 +1135,18 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
|
||||
--aNodeIndex;
|
||||
SwPaM aPaM(aNodeIndex);
|
||||
// Collect the marks starting or ending at this text node.
|
||||
o3tl::sorted_vector<sw::mark::IMark*> aSeenMarks;
|
||||
o3tl::sorted_vector<sw::mark::MarkBase*> aSeenMarks;
|
||||
IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
|
||||
for (const SwContentIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
|
||||
{
|
||||
sw::mark::IMark* pMark = const_cast<sw::mark::IMark*>(pIndex->GetMark());
|
||||
sw::mark::MarkBase* pMark = const_cast<sw::mark::MarkBase*>(pIndex->GetMark());
|
||||
if (!pMark)
|
||||
continue;
|
||||
if (!aSeenMarks.insert(pMark).second)
|
||||
continue;
|
||||
}
|
||||
// And move them back.
|
||||
for (sw::mark::IMark* pMark : aSeenMarks)
|
||||
for (sw::mark::MarkBase* pMark : aSeenMarks)
|
||||
pMarkAccess->repositionMark(pMark, aPaM);
|
||||
}
|
||||
|
||||
|
||||
@@ -1804,7 +1804,7 @@ static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStt, const
|
||||
sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
|
||||
SwPaM aPam( rStartPos.GetNode(), rStartPos.GetContentIndex(),
|
||||
rStartPos.GetNode(), rStartPos.GetContentIndex() + nLen);
|
||||
::sw::mark::IMark* pMark = rDMA.makeAnnotationBookmark(
|
||||
::sw::mark::MarkBase* pMark = rDMA.makeAnnotationBookmark(
|
||||
aPam,
|
||||
(**iter).GetName(),
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New);
|
||||
|
||||
@@ -261,7 +261,7 @@ void SwServerObject::SetNoServer()
|
||||
}
|
||||
}
|
||||
|
||||
void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark)
|
||||
void SwServerObject::SetDdeBookmark( ::sw::mark::MarkBase& rBookmark)
|
||||
{
|
||||
::sw::mark::DdeBookmark* const pDdeBookmark = dynamic_cast< ::sw::mark::DdeBookmark* >(&rBookmark);
|
||||
if(pDdeBookmark)
|
||||
|
||||
@@ -43,7 +43,7 @@ class Point;
|
||||
namespace
|
||||
{
|
||||
/// Checks if pAnnotationMark covers exactly rAnchorPos (the comment anchor).
|
||||
bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark,
|
||||
bool AnnotationMarkCoversCommentAnchor(const sw::mark::MarkBase* pAnnotationMark,
|
||||
const SwPosition& rAnchorPos)
|
||||
{
|
||||
if (!pAnnotationMark)
|
||||
@@ -86,7 +86,7 @@ bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark,
|
||||
* Finds the first draw object of rTextFrame which has the same anchor position as the start of
|
||||
* rAnnotationMark.
|
||||
*/
|
||||
SwAnchoredObject* GetAnchoredObjectOfAnnotationMark(const sw::mark::IMark& rAnnotationMark,
|
||||
SwAnchoredObject* GetAnchoredObjectOfAnnotationMark(const sw::mark::MarkBase& rAnnotationMark,
|
||||
const SwTextFrame& rTextFrame)
|
||||
{
|
||||
const SwSortedObjs* pAnchored = rTextFrame.GetDrawObjs();
|
||||
@@ -128,7 +128,7 @@ SwSidebarItem::~SwSidebarItem() {}
|
||||
SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
|
||||
SwLayoutInfo& o_rInfo,
|
||||
const SwPosition& rAnchorPos,
|
||||
const sw::mark::IMark* pAnnotationMark )
|
||||
const sw::mark::MarkBase* pAnnotationMark )
|
||||
{
|
||||
SwLayoutStatus aRet = INVISIBLE;
|
||||
SwTextNode* pTextNode = rAnchorPos.GetNode().GetTextNode();
|
||||
|
||||
@@ -1335,7 +1335,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark,
|
||||
&& (!pLayout || !pLayout->IsHideRedlines()
|
||||
|| !sw::IsMarkHidden(*pLayout, **ppMark)))
|
||||
{
|
||||
const ::sw::mark::IMark* pBkmk = *ppMark;
|
||||
const ::sw::mark::MarkBase* pBkmk = *ppMark;
|
||||
const SwPosition* pPos = &pBkmk->GetMarkStart();
|
||||
|
||||
pTextNd = pPos->GetNode().GetTextNode();
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace sw::mark {
|
||||
public:
|
||||
MarkManager(/*[in/out]*/ SwDoc& rDoc);
|
||||
// IDocumentMarkAccess
|
||||
virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM,
|
||||
virtual ::sw::mark::MarkBase* makeMark(const SwPaM& rPaM,
|
||||
const OUString& rName, IDocumentMarkAccess::MarkType eMark,
|
||||
sw::mark::InsertMode eMode,
|
||||
SwPosition const* pSepPos = nullptr) override;
|
||||
@@ -52,14 +52,14 @@ namespace sw::mark {
|
||||
const OUString& rName,
|
||||
const OUString& rType) override;
|
||||
|
||||
virtual ::sw::mark::IMark* getMarkForTextNode(const SwTextNode& rTextNode, IDocumentMarkAccess::MarkType eMark) override;
|
||||
virtual ::sw::mark::MarkBase* getMarkForTextNode(const SwTextNode& rTextNode, IDocumentMarkAccess::MarkType eMark) override;
|
||||
|
||||
virtual sw::mark::IMark* makeAnnotationMark(
|
||||
virtual sw::mark::MarkBase* makeAnnotationMark(
|
||||
const SwPaM& rPaM,
|
||||
const OUString& rName ) override;
|
||||
|
||||
virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM) override;
|
||||
virtual bool renameMark(::sw::mark::IMark* io_pMark, const OUString& rNewName) override;
|
||||
virtual void repositionMark(::sw::mark::MarkBase* io_pMark, const SwPaM& rPaM) override;
|
||||
virtual bool renameMark(::sw::mark::MarkBase* io_pMark, const OUString& 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;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace sw::mark {
|
||||
// deleters
|
||||
virtual std::unique_ptr<ILazyDeleter>
|
||||
deleteMark(const const_iterator_t& ppMark, bool isMoveNodes) override;
|
||||
virtual void deleteMark(const ::sw::mark::IMark* const pMark) override;
|
||||
virtual void deleteMark(const ::sw::mark::MarkBase* const pMark) override;
|
||||
virtual void clearAllMarks() override;
|
||||
|
||||
// marks
|
||||
@@ -90,7 +90,7 @@ namespace sw::mark {
|
||||
virtual sal_Int32 getBookmarksCount() const override;
|
||||
virtual const_iterator_t findBookmark(const OUString& rName) const override;
|
||||
virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition& rPos) const override;
|
||||
virtual ::sw::mark::IMark* getOneInnermostBookmarkFor(const SwPosition& rPos) const override;
|
||||
virtual ::sw::mark::MarkBase* getOneInnermostBookmarkFor(const SwPosition& rPos) const override;
|
||||
|
||||
// Fieldmarks
|
||||
virtual const_iterator_t getFieldmarksBegin() const override;
|
||||
@@ -118,7 +118,7 @@ namespace sw::mark {
|
||||
virtual const_iterator_t getAnnotationMarksEnd() const override;
|
||||
virtual sal_Int32 getAnnotationMarksCount() const override;
|
||||
virtual const_iterator_t findAnnotationMark( const OUString& rName ) const override;
|
||||
virtual sw::mark::IMark* getAnnotationMarkFor(const SwPosition& rPos) const override;
|
||||
virtual sw::mark::MarkBase* getAnnotationMarkFor(const SwPosition& rPos) const override;
|
||||
virtual const_iterator_t findFirstAnnotationStartsAfter(const SwPosition& rPos) const override;
|
||||
|
||||
virtual void assureSortedMarkContainers() const override;
|
||||
@@ -126,7 +126,7 @@ namespace sw::mark {
|
||||
typedef std::vector<sw::mark::MarkBase*> container_t;
|
||||
|
||||
// helper bookmark to store annotation range of redlines
|
||||
virtual ::sw::mark::IMark* makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
virtual ::sw::mark::MarkBase* makeAnnotationBookmark(const SwPaM& rPaM,
|
||||
const OUString& rName, IDocumentMarkAccess::MarkType eMark,
|
||||
sw::mark::InsertMode eMode,
|
||||
SwPosition const* pSepPos = nullptr) override;
|
||||
|
||||
@@ -41,7 +41,7 @@ class SwUndoBookmark : public SwUndo
|
||||
const std::unique_ptr<SwHistoryBookmark> m_pHistoryBookmark;
|
||||
|
||||
protected:
|
||||
SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark&);
|
||||
SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::MarkBase&);
|
||||
|
||||
void SetInDoc(SwDoc*);
|
||||
void ResetInDoc(SwDoc&);
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
class SwUndoInsBookmark final : public SwUndoBookmark
|
||||
{
|
||||
public:
|
||||
SwUndoInsBookmark(const ::sw::mark::IMark&);
|
||||
SwUndoInsBookmark(const ::sw::mark::MarkBase&);
|
||||
|
||||
virtual void UndoImpl(::sw::UndoRedoContext&) override;
|
||||
virtual void RedoImpl(::sw::UndoRedoContext&) override;
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
class SwUndoDeleteBookmark final : public SwUndoBookmark
|
||||
{
|
||||
public:
|
||||
SwUndoDeleteBookmark(const ::sw::mark::IMark&);
|
||||
SwUndoDeleteBookmark(const ::sw::mark::MarkBase&);
|
||||
|
||||
virtual void UndoImpl(::sw::UndoRedoContext&) override;
|
||||
virtual void RedoImpl(::sw::UndoRedoContext&) override;
|
||||
|
||||
@@ -43,13 +43,13 @@ struct SwPosition;
|
||||
|
||||
namespace sw::mark
|
||||
{
|
||||
class IMark;
|
||||
class MarkBase;
|
||||
|
||||
class SaveBookmark
|
||||
{
|
||||
public:
|
||||
SaveBookmark(
|
||||
const ::sw::mark::IMark& rBkmk,
|
||||
const ::sw::mark::MarkBase& rBkmk,
|
||||
const SwNode& rMvPos,
|
||||
std::optional<sal_Int32> oContentIdx);
|
||||
void SetInDoc(SwDoc* pDoc,
|
||||
|
||||
@@ -246,11 +246,11 @@ public:
|
||||
class SwHistoryBookmark final : public SwHistoryHint
|
||||
{
|
||||
public:
|
||||
SwHistoryBookmark(const ::sw::mark::IMark& rBkmk,
|
||||
SwHistoryBookmark(const ::sw::mark::MarkBase& rBkmk,
|
||||
bool bSavePos, bool bSaveOtherPos);
|
||||
virtual void SetInDoc(SwDoc * pDoc, bool) override;
|
||||
|
||||
bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk);
|
||||
bool IsEqualBookmark(const ::sw::mark::MarkBase& rBkmk);
|
||||
const OUString& GetName() const { return m_aName;}
|
||||
|
||||
private:
|
||||
@@ -372,7 +372,7 @@ public:
|
||||
SwNodeOffset nNodeIdx );
|
||||
void AddTextAttr(SwTextAttr* pTextHt, SwNodeOffset nNodeIdx, bool bNewAttr);
|
||||
void AddColl(SwFormatColl*, SwNodeOffset nNodeIdx, SwNodeType nWhichNd);
|
||||
void AddIMark(const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos);
|
||||
void AddIMark(const ::sw::mark::MarkBase&, bool bSavePos, bool bSaveOtherPos);
|
||||
void AddChangeFlyAnchor(sw::SpzFrameFormat& rFormat);
|
||||
void AddDeleteFly( SwFrameFormat&, sal_uInt16& rSetPos );
|
||||
void AddFootnote( const SwTextFootnote& );
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
namespace com::sun::star::linguistic2 { class XHyphenatedWord; }
|
||||
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
class SwCharRange;
|
||||
class SwTextNode;
|
||||
class SwTextAttrEnd;
|
||||
@@ -146,7 +146,7 @@ OUString GetExpandTextMerged(SwRootFrame const* pLayout,
|
||||
SwTextNode const& rNode, bool bWithNumber,
|
||||
bool bWithSpacesForLevel, ExpandMode i_mode);
|
||||
|
||||
bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::IMark const& rMark);
|
||||
bool IsMarkHidden(SwRootFrame const& rLayout, ::sw::mark::MarkBase const& rMark);
|
||||
bool IsMarkHintHidden(SwRootFrame const& rLayout,
|
||||
SwTextNode const& rNode, SwTextAttrEnd const& rHint);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ typedef ::cppu::ImplInheritanceHelper
|
||||
, css::text::XTextContent
|
||||
> SwXBookmark_Base;
|
||||
|
||||
/// UNO API wrapper around an internal sw::mark::IMark.
|
||||
/// UNO API wrapper around an internal sw::mark::MarkBase.
|
||||
class SAL_DLLPUBLIC_RTTI SwXBookmark
|
||||
: public SwXBookmark_Base
|
||||
{
|
||||
@@ -67,13 +67,13 @@ protected:
|
||||
virtual void attachToRange(
|
||||
const css::uno::Reference< css::text::XTextRange > & xTextRange);
|
||||
|
||||
::sw::mark::IMark* GetBookmark() const;
|
||||
::sw::mark::MarkBase* GetBookmark() const;
|
||||
|
||||
IDocumentMarkAccess* GetIDocumentMarkAccess();
|
||||
|
||||
SwDoc * GetDoc();
|
||||
|
||||
void registerInMark( SwXBookmark& rXMark, ::sw::mark::IMark* const pMarkBase );
|
||||
void registerInMark( SwXBookmark& rXMark, ::sw::mark::MarkBase* const pMarkBase );
|
||||
|
||||
virtual ~SwXBookmark() override;
|
||||
|
||||
@@ -85,10 +85,10 @@ protected:
|
||||
public:
|
||||
|
||||
static rtl::Reference<SwXBookmark>
|
||||
CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark * pBookmark);
|
||||
CreateXBookmark(SwDoc & rDoc, ::sw::mark::MarkBase * pBookmark);
|
||||
|
||||
/// @return IMark for this, but only if it lives in pDoc
|
||||
static ::sw::mark::IMark const* GetBookmarkInDoc(SwDoc const*const pDoc,
|
||||
static ::sw::mark::MarkBase const* GetBookmarkInDoc(SwDoc const*const pDoc,
|
||||
const css::uno::Reference<css::uno::XInterface> & xUT);
|
||||
|
||||
// MetadatableMixin
|
||||
@@ -195,7 +195,7 @@ class SwXFieldmark final
|
||||
|
||||
public:
|
||||
static rtl::Reference<SwXBookmark>
|
||||
CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark * pMark,
|
||||
CreateXFieldmark(SwDoc & rDoc, ::sw::mark::MarkBase * pMark,
|
||||
bool isReplacementObject = false);
|
||||
|
||||
virtual void attachToRange(
|
||||
|
||||
@@ -463,7 +463,7 @@ void SwTextFrame::RegisterToNode(SwTextNode & rNode, bool const isForceNodeAsFir
|
||||
assert(std::find_if(
|
||||
rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksBegin(),
|
||||
rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksEnd(),
|
||||
[this](::sw::mark::IMark const*const pMark) {
|
||||
[this](::sw::mark::MarkBase const*const pMark) {
|
||||
return pMark->GetMarkStart().GetNode() == *m_pMergedPara->pFirstNode
|
||||
&& pMark->GetMarkEnd().GetNode() != *m_pMergedPara->pFirstNode;
|
||||
}) == rNode.GetDoc().getIDocumentMarkAccess()->getFieldmarksEnd());
|
||||
|
||||
@@ -2718,7 +2718,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe
|
||||
++ppMark)
|
||||
{
|
||||
//get the name
|
||||
const ::sw::mark::IMark* pBkmk = *ppMark;
|
||||
const ::sw::mark::MarkBase* pBkmk = *ppMark;
|
||||
mrSh.SwCursorShell::ClearMark();
|
||||
const OUString& sBkName = pBkmk->GetName();
|
||||
|
||||
|
||||
@@ -1176,7 +1176,7 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
|
||||
if(aIntersect.HasArea())
|
||||
{
|
||||
SwPosition const aPosition(m_pFrame->MapViewToModelPos(GetIdx()));
|
||||
const ::sw::mark::IMark* pFieldmark =
|
||||
const ::sw::mark::MarkBase* pFieldmark =
|
||||
m_pFrame->GetDoc().getIDocumentMarkAccess()->getInnerFieldmarkFor(aPosition);
|
||||
bool bIsStartMark = (TextFrameIndex(1) == GetLen()
|
||||
&& CH_TXT_ATR_FIELDSTART == GetText()[sal_Int32(GetIdx())]);
|
||||
|
||||
@@ -971,7 +971,7 @@ static Color getBookmarkColor(const SwTextNode& rNode, const sw::mark::Bookmark*
|
||||
{
|
||||
SwDoc& rDoc = const_cast<SwDoc&>(rNode.GetDoc());
|
||||
const rtl::Reference< SwXBookmark > xRef = SwXBookmark::CreateXBookmark(rDoc,
|
||||
const_cast<sw::mark::IMark*>(static_cast<const sw::mark::IMark*>(pBookmark)));
|
||||
const_cast<sw::mark::MarkBase*>(static_cast<const sw::mark::MarkBase*>(pBookmark)));
|
||||
const css::uno::Reference<css::rdf::XResource> xSubject(xRef);
|
||||
uno::Reference<frame::XModel> xModel = rDoc.GetDocShell()->GetBaseModel();
|
||||
|
||||
@@ -2898,7 +2898,7 @@ void SwScriptInfo::selectHiddenTextProperty(const SwTextNode& rNode,
|
||||
|
||||
for (const SwContentIndex* pIndex = rNode.GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
|
||||
{
|
||||
const sw::mark::IMark* pMark = pIndex->GetMark();
|
||||
const sw::mark::MarkBase* pMark = pIndex->GetMark();
|
||||
const sw::mark::Bookmark* pBookmark = dynamic_cast<const sw::mark::Bookmark*>(pMark);
|
||||
if (pBookmarks && pBookmark)
|
||||
{
|
||||
|
||||
@@ -471,7 +471,7 @@ bool SwTextFrame::FormatEmpty()
|
||||
for (SwContentIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
|
||||
pIndex; pIndex = pIndex->GetNext())
|
||||
{
|
||||
sw::mark::IMark const*const pMark = pIndex->GetMark();
|
||||
sw::mark::MarkBase const*const pMark = pIndex->GetMark();
|
||||
if (dynamic_cast<const sw::mark::Bookmark*>(pMark) != nullptr)
|
||||
{ // need bookmark portions!
|
||||
return false;
|
||||
|
||||
@@ -688,7 +688,7 @@ std::pair<OUString, bool> SwTOXPara::GetURL(SwRootFrame const*const) const
|
||||
SwDoc& rDoc = const_cast<SwDoc&>( pTextNd->GetDoc() );
|
||||
// tdf#123313: this *must not* create a bookmark, its Undo would
|
||||
// be screwed! create it as preparatory step, in ctor!
|
||||
::sw::mark::IMark const * const pMark = rDoc.getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
::sw::mark::MarkBase const * const pMark = rDoc.getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
*pTextNd,
|
||||
IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK);
|
||||
aText = "#" + pMark->GetName();
|
||||
|
||||
@@ -782,7 +782,7 @@ SwTextAnnotationField::~SwTextAnnotationField()
|
||||
{
|
||||
}
|
||||
|
||||
::sw::mark::IMark* SwTextAnnotationField::GetAnnotationMark() const
|
||||
::sw::mark::MarkBase* SwTextAnnotationField::GetAnnotationMark() const
|
||||
{
|
||||
auto pPostItField = dynamic_cast<const SwPostItField*>(GetFormatField().GetField());
|
||||
assert(pPostItField);
|
||||
|
||||
@@ -1501,12 +1501,12 @@ void SwTextNode::Update(
|
||||
bool bAtLeastOneBookmarkMoved = false;
|
||||
bool bAtLeastOneExpandedBookmarkAtInsertionPosition = false;
|
||||
// A text node already knows its marks via its SwContentIndexes.
|
||||
o3tl::sorted_vector<const sw::mark::IMark*> aSeenMarks;
|
||||
o3tl::sorted_vector<const sw::mark::MarkBase*> aSeenMarks;
|
||||
const SwContentIndex* next;
|
||||
for (const SwContentIndex* pIndex = GetFirstIndex(); pIndex; pIndex = next )
|
||||
{
|
||||
next = pIndex->GetNext();
|
||||
const sw::mark::IMark* pMark = pIndex->GetMark();
|
||||
const sw::mark::MarkBase* pMark = pIndex->GetMark();
|
||||
if (!pMark)
|
||||
continue;
|
||||
// filter out ones that cannot match to reduce the max size of aSeenMarks
|
||||
|
||||
@@ -603,7 +603,7 @@ void SwHistoryTextFlyCnt::dumpAsXml(xmlTextWriterPtr pWriter) const
|
||||
}
|
||||
|
||||
SwHistoryBookmark::SwHistoryBookmark(
|
||||
const ::sw::mark::IMark& rBkmk,
|
||||
const ::sw::mark::MarkBase& rBkmk,
|
||||
bool bSavePos,
|
||||
bool bSaveOtherPos)
|
||||
: SwHistoryHint(HSTRY_BOOKMARK)
|
||||
@@ -640,7 +640,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
|
||||
SwNodes& rNds = pDoc->GetNodes();
|
||||
IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
|
||||
std::optional<SwPaM> oPam;
|
||||
::sw::mark::IMark* pMark = nullptr;
|
||||
::sw::mark::MarkBase* pMark = nullptr;
|
||||
|
||||
// now the situation is that m_bSavePos and m_bSaveOtherPos don't determine
|
||||
// whether the mark was deleted
|
||||
@@ -695,7 +695,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
|
||||
pBookmark->RestoreMetadata(m_pMetadataUndo);
|
||||
}
|
||||
|
||||
bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::IMark& rBkmk)
|
||||
bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::MarkBase& rBkmk)
|
||||
{
|
||||
return m_nNode == rBkmk.GetMarkPos().GetNodeIndex()
|
||||
&& m_nContent == rBkmk.GetMarkPos().GetContentIndex()
|
||||
@@ -1122,7 +1122,7 @@ void SwHistory::AddColl(SwFormatColl *const pColl, SwNodeOffset const nNodeIdx,
|
||||
m_SwpHstry.push_back( std::move(pHt) );
|
||||
}
|
||||
|
||||
void SwHistory::AddIMark(const ::sw::mark::IMark& rBkmk,
|
||||
void SwHistory::AddIMark(const ::sw::mark::MarkBase& rBkmk,
|
||||
bool const bSavePos, bool const bSaveOtherPos)
|
||||
{
|
||||
OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <utility>
|
||||
|
||||
SwUndoBookmark::SwUndoBookmark( SwUndoId nUndoId,
|
||||
const ::sw::mark::IMark& rBkmk )
|
||||
const ::sw::mark::MarkBase& rBkmk )
|
||||
: SwUndo( nUndoId, &rBkmk.GetMarkPos().GetDoc() )
|
||||
, m_pHistoryBookmark(new SwHistoryBookmark(rBkmk, true, rBkmk.IsExpanded()))
|
||||
{
|
||||
@@ -75,7 +75,7 @@ SwRewriter SwUndoBookmark::GetRewriter() const
|
||||
return aResult;
|
||||
}
|
||||
|
||||
SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk )
|
||||
SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::MarkBase& rBkmk )
|
||||
: SwUndoBookmark( SwUndoId::INSBOOKMARK, rBkmk )
|
||||
{
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
|
||||
SetInDoc( &rContext.GetDoc() );
|
||||
}
|
||||
|
||||
SwUndoDeleteBookmark::SwUndoDeleteBookmark( const ::sw::mark::IMark& rBkmk )
|
||||
SwUndoDeleteBookmark::SwUndoDeleteBookmark( const ::sw::mark::MarkBase& rBkmk )
|
||||
: SwUndoBookmark( SwUndoId::DELBOOKMARK, rBkmk )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1124,7 +1124,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark,
|
||||
bool bSavePos = false;
|
||||
bool bSaveOtherPos = false;
|
||||
bool bDelete = false;
|
||||
const ::sw::mark::IMark *const pBkmk = pMarkAccess->getAllMarksBegin()[n];
|
||||
const ::sw::mark::MarkBase *const pBkmk = pMarkAccess->getAllMarksBegin()[n];
|
||||
auto const type(IDocumentMarkAccess::GetType(*pBkmk));
|
||||
|
||||
if( DelContentType::CheckNoCntnt & nDelContentType )
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
std::mutex m_Mutex; // just for OInterfaceContainerHelper3
|
||||
::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_EventListeners;
|
||||
SwDoc* m_pDoc;
|
||||
::sw::mark::IMark* m_pRegisteredBookmark;
|
||||
::sw::mark::MarkBase* m_pRegisteredBookmark;
|
||||
OUString m_sMarkName;
|
||||
bool m_bHidden;
|
||||
OUString m_HideCondition;
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
// DO NOT registerInMark here! (because SetXBookmark would delete rThis)
|
||||
}
|
||||
|
||||
void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk);
|
||||
void registerInMark(SwXBookmark & rThis, ::sw::mark::MarkBase *const pBkmk);
|
||||
protected:
|
||||
virtual void Notify(const SfxHint&) override;
|
||||
|
||||
@@ -85,19 +85,14 @@ void SwXBookmark::Impl::Notify(const SfxHint& rHint)
|
||||
}
|
||||
|
||||
void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis,
|
||||
::sw::mark::IMark* const pBkmk)
|
||||
::sw::mark::MarkBase* const pBkmk)
|
||||
{
|
||||
const rtl::Reference<SwXBookmark> xBookmark(&rThis);
|
||||
if (pBkmk)
|
||||
{
|
||||
EndListeningAll();
|
||||
StartListening(pBkmk->GetNotifier());
|
||||
::sw::mark::MarkBase *const pMarkBase(dynamic_cast< ::sw::mark::MarkBase * >(pBkmk));
|
||||
OSL_ENSURE(pMarkBase, "registerInMark: no MarkBase?");
|
||||
if (pMarkBase)
|
||||
{
|
||||
pMarkBase->SetXBookmark(xBookmark);
|
||||
}
|
||||
pBkmk->SetXBookmark(xBookmark);
|
||||
assert(m_pDoc == nullptr || m_pDoc == &pBkmk->GetMarkPos().GetDoc());
|
||||
m_pDoc = &pBkmk->GetMarkPos().GetDoc();
|
||||
}
|
||||
@@ -120,12 +115,12 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark& rThis,
|
||||
}
|
||||
|
||||
void SwXBookmark::registerInMark(SwXBookmark & rThis,
|
||||
::sw::mark::IMark *const pBkmk)
|
||||
::sw::mark::MarkBase *const pBkmk)
|
||||
{
|
||||
m_pImpl->registerInMark( rThis, pBkmk );
|
||||
}
|
||||
|
||||
::sw::mark::IMark* SwXBookmark::GetBookmark() const
|
||||
::sw::mark::MarkBase* SwXBookmark::GetBookmark() const
|
||||
{
|
||||
return m_pImpl->m_pRegisteredBookmark;
|
||||
}
|
||||
@@ -156,15 +151,14 @@ SwXBookmark::~SwXBookmark()
|
||||
|
||||
rtl::Reference<SwXBookmark> SwXBookmark::CreateXBookmark(
|
||||
SwDoc & rDoc,
|
||||
::sw::mark::IMark *const pBookmark)
|
||||
::sw::mark::MarkBase *const pBookmark)
|
||||
{
|
||||
// #i105557#: do not iterate over the registered clients: race condition
|
||||
::sw::mark::MarkBase *const pMarkBase(dynamic_cast< ::sw::mark::MarkBase * >(pBookmark));
|
||||
OSL_ENSURE(!pBookmark || pMarkBase, "CreateXBookmark: no MarkBase?");
|
||||
OSL_ENSURE(pBookmark, "CreateXBookmark: no MarkBase?");
|
||||
rtl::Reference<SwXBookmark> xBookmark;
|
||||
if (pMarkBase)
|
||||
if (pBookmark)
|
||||
{
|
||||
xBookmark = pMarkBase->GetXBookmark();
|
||||
xBookmark = pBookmark->GetXBookmark();
|
||||
}
|
||||
if (!xBookmark.is())
|
||||
{
|
||||
@@ -176,12 +170,12 @@ rtl::Reference<SwXBookmark> SwXBookmark::CreateXBookmark(
|
||||
SwXBookmark *const pXBookmark =
|
||||
pBookmark ? new SwXBookmark(&rDoc) : new SwXBookmark;
|
||||
xBookmark.set(pXBookmark);
|
||||
pXBookmark->m_pImpl->registerInMark(*pXBookmark, pMarkBase);
|
||||
pXBookmark->m_pImpl->registerInMark(*pXBookmark, pBookmark);
|
||||
}
|
||||
return xBookmark;
|
||||
}
|
||||
|
||||
::sw::mark::IMark const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const pDoc,
|
||||
::sw::mark::MarkBase const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const pDoc,
|
||||
const uno::Reference<uno::XInterface> & xUT)
|
||||
{
|
||||
SwXBookmark *const pXBkm = dynamic_cast<SwXBookmark*>(xUT.get());
|
||||
@@ -671,17 +665,14 @@ uno::Reference<container::XNameContainer> SwXFieldmark::getParameters()
|
||||
}
|
||||
|
||||
rtl::Reference<SwXBookmark>
|
||||
SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark *const pMark,
|
||||
SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::MarkBase *const pMark,
|
||||
bool const isReplacementObject)
|
||||
{
|
||||
// #i105557#: do not iterate over the registered clients: race condition
|
||||
::sw::mark::MarkBase *const pMarkBase(
|
||||
dynamic_cast< ::sw::mark::MarkBase * >(pMark));
|
||||
assert(!pMark || pMarkBase);
|
||||
rtl::Reference<SwXBookmark> xMark;
|
||||
if (pMarkBase)
|
||||
if (pMark)
|
||||
{
|
||||
xMark = pMarkBase->GetXBookmark();
|
||||
xMark = pMark->GetXBookmark();
|
||||
}
|
||||
if (!xMark.is())
|
||||
{
|
||||
@@ -699,7 +690,7 @@ SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark *const pMark,
|
||||
pXBkmk = new SwXFieldmark(isReplacementObject, &rDoc);
|
||||
|
||||
xMark = pXBkmk.get();
|
||||
pXBkmk->registerInMark(*pXBkmk, pMarkBase);
|
||||
pXBkmk->registerInMark(*pXBkmk, pMark);
|
||||
}
|
||||
return xMark;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc,
|
||||
SwDoc & rTargetDoc,
|
||||
std::optional<SwPaM>& o_rpPaM, std::pair<OUString, FlyCntType> & o_rFrame,
|
||||
OUString & o_rTableName, SwUnoTableCursor const*& o_rpTableCursor,
|
||||
::sw::mark::IMark const*& o_rpMark,
|
||||
::sw::mark::MarkBase const*& o_rpMark,
|
||||
std::vector<SdrObject *> & o_rSdrObjects)
|
||||
{
|
||||
uno::Reference<drawing::XShapes> const xShapes(xIfc, UNO_QUERY);
|
||||
@@ -249,7 +249,7 @@ void GetSelectableFromAny(uno::Reference<uno::XInterface> const& xIfc,
|
||||
return;
|
||||
}
|
||||
|
||||
::sw::mark::IMark const*const pMark =
|
||||
::sw::mark::MarkBase const*const pMark =
|
||||
SwXBookmark::GetBookmarkInDoc(& rTargetDoc, xIfc);
|
||||
if (pMark)
|
||||
{
|
||||
|
||||
@@ -681,7 +681,7 @@ void SwXTextRange::InvalidateImpl()
|
||||
moSvtListener->EndListeningAll();
|
||||
}
|
||||
|
||||
void SwXTextRange::SetMark(::sw::mark::IMark& rMark)
|
||||
void SwXTextRange::SetMark(::sw::mark::MarkBase& rMark)
|
||||
{
|
||||
moSvtListener->EndListeningAll();
|
||||
m_pTableOrSectionFormat = nullptr;
|
||||
@@ -937,7 +937,7 @@ SwXTextRange::getStart()
|
||||
SolarMutexGuard aGuard;
|
||||
|
||||
uno::Reference< text::XTextRange > xRet;
|
||||
::sw::mark::IMark const * const pBkmk = m_pMark;
|
||||
::sw::mark::MarkBase const * const pBkmk = m_pMark;
|
||||
if (!m_xParentText.is())
|
||||
{
|
||||
getText();
|
||||
@@ -974,7 +974,7 @@ SwXTextRange::getEnd()
|
||||
SolarMutexGuard aGuard;
|
||||
|
||||
uno::Reference< text::XTextRange > xRet;
|
||||
::sw::mark::IMark const * const pBkmk = m_pMark;
|
||||
::sw::mark::MarkBase const * const pBkmk = m_pMark;
|
||||
if (!m_xParentText.is())
|
||||
{
|
||||
getText();
|
||||
@@ -1065,7 +1065,7 @@ bool SwXTextRange::GetPositions(SwPaM& rToFill, ::sw::TextRangeMode const eMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
::sw::mark::IMark const * const pBkmk = m_pMark;
|
||||
::sw::mark::MarkBase const * const pBkmk = m_pMark;
|
||||
if(pBkmk)
|
||||
{
|
||||
*rToFill.GetPoint() = pBkmk->GetMarkPos();
|
||||
@@ -1112,7 +1112,7 @@ sal_Int16 SwXTextRange::compareRegionStarts(SwXTextRange& rhs)
|
||||
|
||||
void SwXTextRange::GetStartPaM(std::optional<SwPaM>& roPaM)
|
||||
{
|
||||
::sw::mark::IMark const * const pBkmk = m_pMark;
|
||||
::sw::mark::MarkBase const * const pBkmk = m_pMark;
|
||||
if (!m_xParentText.is())
|
||||
{
|
||||
getText();
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace
|
||||
typedef std::multiset < SwXBookmarkPortion_ImplSharedPtr, BookmarkCompareStruct > SwXBookmarkPortion_ImplList;
|
||||
|
||||
/// Inserts pBkmk to rBkmArr in case it starts or ends at rOwnNode
|
||||
void lcl_FillBookmark(sw::mark::IMark* const pBkmk, const SwNode& rOwnNode, SwDoc& rDoc, SwXBookmarkPortion_ImplList& rBkmArr)
|
||||
void lcl_FillBookmark(sw::mark::MarkBase* const pBkmk, const SwNode& rOwnNode, SwDoc& rDoc, SwXBookmarkPortion_ImplList& rBkmArr)
|
||||
{
|
||||
bool const isExpanded = pBkmk->IsExpanded();
|
||||
const SwPosition& rStartPos = pBkmk->GetMarkStart();
|
||||
@@ -201,11 +201,11 @@ namespace
|
||||
SwTextNode* pTextNode = rUnoCursor.GetPoint()->GetNode().GetTextNode();
|
||||
assert(pTextNode);
|
||||
// A text node already knows its marks via its SwContentIndexes.
|
||||
o3tl::sorted_vector<const sw::mark::IMark*> aSeenMarks;
|
||||
o3tl::sorted_vector<const sw::mark::MarkBase*> aSeenMarks;
|
||||
for (const SwContentIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
|
||||
{
|
||||
// Need a non-cost mark here, as we'll create a UNO wrapper around it.
|
||||
sw::mark::IMark* pBkmk = const_cast<sw::mark::IMark*>(pIndex->GetMark());
|
||||
sw::mark::MarkBase* pBkmk = const_cast<sw::mark::MarkBase*>(pIndex->GetMark());
|
||||
if (!pBkmk)
|
||||
continue;
|
||||
IDocumentMarkAccess::MarkType eType = IDocumentMarkAccess::GetType(*pBkmk);
|
||||
@@ -894,7 +894,7 @@ lcl_ExportHints(
|
||||
break;
|
||||
|
||||
const SwTextAnnotationField* pTextAnnotationField = dynamic_cast<const SwTextAnnotationField*>( pAttr );
|
||||
::sw::mark::IMark* pAnnotationMark = pTextAnnotationField ? pTextAnnotationField->GetAnnotationMark() : nullptr;
|
||||
::sw::mark::MarkBase* pAnnotationMark = pTextAnnotationField ? pTextAnnotationField->GetAnnotationMark() : nullptr;
|
||||
if ( pAnnotationMark != nullptr )
|
||||
{
|
||||
pPortion = new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION_END );
|
||||
|
||||
@@ -1434,7 +1434,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const
|
||||
ppMark != pMarkAccess->getAllMarksEnd();
|
||||
++ppMark)
|
||||
{
|
||||
const ::sw::mark::IMark* pBookmark = *ppMark;
|
||||
const ::sw::mark::MarkBase* pBookmark = *ppMark;
|
||||
|
||||
const SwNodeOffset nBookNdIdx = pBookmark->GetMarkPos().GetNodeIndex();
|
||||
if( nBookNdIdx==nNodeIdx )
|
||||
@@ -1498,7 +1498,7 @@ void SwHTMLParser::StripTrailingPara()
|
||||
ppMark != pMarkAccess->getAllMarksEnd();
|
||||
++ppMark)
|
||||
{
|
||||
::sw::mark::IMark* pMark = *ppMark;
|
||||
::sw::mark::MarkBase* pMark = *ppMark;
|
||||
|
||||
SwNodeOffset nBookNdIdx = pMark->GetMarkPos().GetNodeIndex();
|
||||
if(nBookNdIdx==nNodeIdx)
|
||||
|
||||
@@ -2915,7 +2915,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
|
||||
(*ppBkmk)->GetMarkStart() == *aAttrPam.GetPoint() )
|
||||
break; // do not generate duplicates on this position
|
||||
aAttrPam.DeleteMark();
|
||||
const ::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark(
|
||||
const ::sw::mark::MarkBase* const pNewMark = pMarkAccess->makeMark(
|
||||
aAttrPam,
|
||||
sName,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
|
||||
@@ -1270,7 +1270,7 @@ void SwHTMLWriter::OutAnchor( const OUString& rName )
|
||||
void SwHTMLWriter::OutBookmarks()
|
||||
{
|
||||
// fetch current bookmark
|
||||
const ::sw::mark::IMark* pBookmark = nullptr;
|
||||
const ::sw::mark::MarkBase* pBookmark = nullptr;
|
||||
IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
|
||||
if(m_nBkmkTabPos != -1)
|
||||
pBookmark = pMarkAccess->getAllMarksBegin()[m_nBkmkTabPos];
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
using namespace css;
|
||||
|
||||
typedef std::multimap<SwNodeOffset, const ::sw::mark::IMark*> SwBookmarkNodeTable;
|
||||
typedef std::multimap<SwNodeOffset, const ::sw::mark::MarkBase*> SwBookmarkNodeTable;
|
||||
|
||||
struct Writer_Impl
|
||||
{
|
||||
@@ -51,7 +51,7 @@ struct Writer_Impl
|
||||
Writer_Impl();
|
||||
|
||||
void RemoveFontList();
|
||||
void InsertBkmk( const ::sw::mark::IMark& rBkmk );
|
||||
void InsertBkmk( const ::sw::mark::MarkBase& rBkmk );
|
||||
};
|
||||
|
||||
Writer_Impl::Writer_Impl()
|
||||
@@ -64,7 +64,7 @@ void Writer_Impl::RemoveFontList()
|
||||
aFontRemoveLst.clear();
|
||||
}
|
||||
|
||||
void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk)
|
||||
void Writer_Impl::InsertBkmk(const ::sw::mark::MarkBase& rBkmk)
|
||||
{
|
||||
SwNodeOffset nNd = rBkmk.GetMarkPos().GetNodeIndex();
|
||||
|
||||
@@ -409,7 +409,7 @@ void Writer::CreateBookmarkTable()
|
||||
|
||||
// search all Bookmarks in the range and return it in the Array
|
||||
bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt,
|
||||
sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr)
|
||||
sal_Int32 nEnd, std::vector< const ::sw::mark::MarkBase* >& rArr)
|
||||
{
|
||||
OSL_ENSURE( rArr.empty(), "there are still entries available" );
|
||||
|
||||
@@ -427,7 +427,7 @@ bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt,
|
||||
{
|
||||
for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it )
|
||||
{
|
||||
const ::sw::mark::IMark& rBkmk = *(it->second);
|
||||
const ::sw::mark::MarkBase& rBkmk = *(it->second);
|
||||
sal_Int32 nContent;
|
||||
if( rBkmk.GetMarkPos().GetNode() == rNd &&
|
||||
(nContent = rBkmk.GetMarkPos().GetContentIndex() ) >= nStt &&
|
||||
|
||||
@@ -108,7 +108,7 @@ using namespace ::oox;
|
||||
|
||||
using oox::vml::VMLExport;
|
||||
|
||||
using sw::mark::IMark;
|
||||
using sw::mark::MarkBase;
|
||||
|
||||
AttributeOutputBase& DocxExport::AttrOutput() const
|
||||
{
|
||||
@@ -167,7 +167,7 @@ void DocxExport::AppendBookmarks( const SwTextNode& rNode, sal_Int32 nCurrentPos
|
||||
IMarkVector aMarks;
|
||||
if ( GetBookmarks( rNode, nCurrentPos, nCurrentPos + nLen, aMarks ) )
|
||||
{
|
||||
for ( IMark* pMark : aMarks )
|
||||
for ( MarkBase* pMark : aMarks )
|
||||
{
|
||||
const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
|
||||
const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
|
||||
@@ -205,7 +205,7 @@ void DocxExport::AppendAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int32 n
|
||||
IMarkVector aMarks;
|
||||
if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
|
||||
{
|
||||
for ( IMark* pMark : aMarks )
|
||||
for ( MarkBase* pMark : aMarks )
|
||||
{
|
||||
const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
|
||||
const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
|
||||
|
||||
@@ -2020,7 +2020,7 @@ bool MSWordExportBase::GetBookmarks( const SwTextNode& rNd, sal_Int32 nStt,
|
||||
const sal_Int32 nMarks = pMarkAccess->getAllMarksCount();
|
||||
for ( sal_Int32 i = 0; i < nMarks; i++ )
|
||||
{
|
||||
IMark* pMark = pMarkAccess->getAllMarksBegin()[i];
|
||||
MarkBase* pMark = pMarkAccess->getAllMarksBegin()[i];
|
||||
|
||||
switch (IDocumentMarkAccess::GetType( *pMark ))
|
||||
{
|
||||
@@ -2068,7 +2068,7 @@ bool MSWordExportBase::GetAnnotationMarks( const SwWW8AttrIter& rAttrs, sal_Int3
|
||||
const sal_Int32 nMarks = pMarkAccess->getAnnotationMarksCount();
|
||||
for ( sal_Int32 i = 0; i < nMarks; i++ )
|
||||
{
|
||||
IMark* pMark = pMarkAccess->getAnnotationMarksBegin()[i];
|
||||
MarkBase* pMark = pMarkAccess->getAnnotationMarksBegin()[i];
|
||||
|
||||
// Only keep the bookmarks starting or ending in this node
|
||||
if ( pMark->GetMarkStart().GetNode() == rNd ||
|
||||
@@ -2110,7 +2110,7 @@ namespace {
|
||||
class CompareMarksEnd
|
||||
{
|
||||
public:
|
||||
bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const
|
||||
bool operator() ( const MarkBase * pOneB, const MarkBase * pTwoB ) const
|
||||
{
|
||||
const sal_Int32 nOEnd = pOneB->GetMarkEnd().GetContentIndex();
|
||||
const sal_Int32 nTEnd = pTwoB->GetMarkEnd().GetContentIndex();
|
||||
@@ -2127,7 +2127,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nCu
|
||||
|
||||
if ( !m_rSortedBookmarksStart.empty() )
|
||||
{
|
||||
IMark* pMarkStart = m_rSortedBookmarksStart.front();
|
||||
MarkBase* pMarkStart = m_rSortedBookmarksStart.front();
|
||||
const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex();
|
||||
if( !bNextPositionOnly || (nNext > nCurrentPos ))
|
||||
{
|
||||
@@ -2138,7 +2138,7 @@ bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nCu
|
||||
|
||||
if ( !m_rSortedBookmarksEnd.empty() )
|
||||
{
|
||||
IMark* pMarkEnd = m_rSortedBookmarksEnd[0];
|
||||
MarkBase* pMarkEnd = m_rSortedBookmarksEnd[0];
|
||||
const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex();
|
||||
if( !bNextPositionOnly || nNext > nCurrentPos )
|
||||
{
|
||||
@@ -2159,7 +2159,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& rNearest, const sal_Int
|
||||
|
||||
if ( !m_rSortedAnnotationMarksStart.empty() )
|
||||
{
|
||||
IMark* pMarkStart = m_rSortedAnnotationMarksStart.front();
|
||||
MarkBase* pMarkStart = m_rSortedAnnotationMarksStart.front();
|
||||
const sal_Int32 nNext = pMarkStart->GetMarkStart().GetContentIndex();
|
||||
if( !bNextPositionOnly || (nNext > nCurrentPos ))
|
||||
{
|
||||
@@ -2170,7 +2170,7 @@ void MSWordExportBase::NearestAnnotationMark( sal_Int32& rNearest, const sal_Int
|
||||
|
||||
if ( !m_rSortedAnnotationMarksEnd.empty() )
|
||||
{
|
||||
IMark* pMarkEnd = m_rSortedAnnotationMarksEnd[0];
|
||||
MarkBase* pMarkEnd = m_rSortedAnnotationMarksEnd[0];
|
||||
const sal_Int32 nNext = pMarkEnd->GetMarkEnd().GetContentIndex();
|
||||
if( !bNextPositionOnly || nNext > nCurrentPos )
|
||||
{
|
||||
@@ -2189,7 +2189,7 @@ void MSWordExportBase::GetSortedAnnotationMarks( const SwWW8AttrIter& rAttrs, sa
|
||||
{
|
||||
IMarkVector aSortedEnd;
|
||||
IMarkVector aSortedStart;
|
||||
for ( IMark* pMark : aMarksStart )
|
||||
for ( MarkBase* pMark : aMarksStart )
|
||||
{
|
||||
// Remove the positions equal to the current pos
|
||||
const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
|
||||
@@ -2223,7 +2223,7 @@ void MSWordExportBase::GetSortedBookmarks( const SwTextNode& rNode, sal_Int32 nC
|
||||
{
|
||||
IMarkVector aSortedEnd;
|
||||
IMarkVector aSortedStart;
|
||||
for ( IMark* pMark : aMarksStart )
|
||||
for ( MarkBase* pMark : aMarksStart )
|
||||
{
|
||||
// Remove the positions equal to the current pos
|
||||
const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
|
||||
|
||||
@@ -1437,7 +1437,7 @@ WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const
|
||||
|
||||
void WW8Export::AppendBookmarks( const SwTextNode& rNd, sal_Int32 nCurrentPos, sal_Int32 nLen, const SwRedlineData* /*pRedlineData*/ )
|
||||
{
|
||||
std::vector< const ::sw::mark::IMark* > aArr;
|
||||
std::vector< const ::sw::mark::MarkBase* > aArr;
|
||||
sal_Int32 nContent;
|
||||
const sal_Int32 nCurrentEnd = nCurrentPos + nLen;
|
||||
if( !GetWriter().GetBookmarks( rNd, nCurrentPos, nCurrentEnd, aArr ))
|
||||
@@ -1445,9 +1445,9 @@ void WW8Export::AppendBookmarks( const SwTextNode& rNd, sal_Int32 nCurrentPos, s
|
||||
|
||||
SwNodeOffset nNd = rNd.GetIndex();
|
||||
sal_uLong nSttCP = Fc2Cp( Strm().Tell() );
|
||||
for(const ::sw::mark::IMark* p : aArr)
|
||||
for(const ::sw::mark::MarkBase* p : aArr)
|
||||
{
|
||||
const ::sw::mark::IMark& rBkmk = *p;
|
||||
const ::sw::mark::MarkBase& rBkmk = *p;
|
||||
if(dynamic_cast< const ::sw::mark::Fieldmark *>(&rBkmk))
|
||||
continue;
|
||||
|
||||
@@ -1484,7 +1484,7 @@ void WW8Export::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCu
|
||||
IMarkVector aMarks;
|
||||
if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
|
||||
{
|
||||
for (const sw::mark::IMark* pMark : aMarks)
|
||||
for (const sw::mark::MarkBase* pMark : aMarks)
|
||||
{
|
||||
const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
|
||||
if (nStart == nCurrentPos)
|
||||
|
||||
@@ -584,7 +584,7 @@ public:
|
||||
std::stack< MSWordSaveData > m_aSaveData;
|
||||
|
||||
/// Used to split the runs according to the bookmarks start and ends
|
||||
typedef std::vector< ::sw::mark::IMark* > IMarkVector;
|
||||
typedef std::vector< ::sw::mark::MarkBase* > IMarkVector;
|
||||
IMarkVector m_rSortedBookmarksStart;
|
||||
IMarkVector m_rSortedBookmarksEnd;
|
||||
IMarkVector m_rSortedAnnotationMarksStart;
|
||||
|
||||
@@ -1618,7 +1618,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
|
||||
sal_uInt16 nBkmNo;
|
||||
if( IsFootnoteEdnBkmField(rFormatField, nBkmNo) )
|
||||
{
|
||||
::sw::mark::IMark const * const pMark = m_rDoc.getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
|
||||
::sw::mark::MarkBase const * const pMark = m_rDoc.getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
|
||||
|
||||
const SwPosition& rBkMrkPos = pMark->GetMarkPos();
|
||||
|
||||
|
||||
@@ -1221,7 +1221,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
|
||||
|
||||
bool bSetCursor = true;
|
||||
const size_t nCols = aColArr.size();
|
||||
::sw::mark::IMark* pMark = nullptr;
|
||||
::sw::mark::MarkBase* pMark = nullptr;
|
||||
for( sal_Int32 i = 0 ; ; ++i )
|
||||
{
|
||||
bool bBreak = false;
|
||||
|
||||
@@ -151,7 +151,7 @@ static void lcl_FillSubRegionList( SwWrtShell& rSh, weld::ComboBox& rSubRegions,
|
||||
ppMark != pMarkAccess->getBookmarksEnd();
|
||||
++ppMark)
|
||||
{
|
||||
const ::sw::mark::IMark* pBkmk = *ppMark;
|
||||
const ::sw::mark::MarkBase* pBkmk = *ppMark;
|
||||
if( pBkmk->IsExpanded() )
|
||||
rSubRegions.append_text( pBkmk->GetName() );
|
||||
}
|
||||
|
||||
@@ -588,7 +588,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString)
|
||||
ppMark != pMarkAccess->getBookmarksEnd();
|
||||
++ppMark)
|
||||
{
|
||||
const ::sw::mark::IMark* pBkmk = *ppMark;
|
||||
const ::sw::mark::MarkBase* pBkmk = *ppMark;
|
||||
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk))
|
||||
{
|
||||
bool isSubstring = MatchSubstring(pBkmk->GetName(), filterString);
|
||||
@@ -1108,7 +1108,7 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
|
||||
pSh->getIDocumentOutlineNodesAccess()->getOutlineNodes( maOutlineNodes );
|
||||
if ( nOutlIdx < maOutlineNodes.size() )
|
||||
{
|
||||
::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
::sw::mark::MarkBase const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
*(maOutlineNodes[nOutlIdx]),
|
||||
IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK);
|
||||
aName = pMark->GetName();
|
||||
@@ -1128,7 +1128,7 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
|
||||
pSh->getIDocumentListItemsAccess()->getNumItems(maNumItems);
|
||||
if ( nNumItemIdx < maNumItems.size() )
|
||||
{
|
||||
::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
::sw::mark::MarkBase const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
*(maNumItems[nNumItemIdx]->GetTextNode()),
|
||||
IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK);
|
||||
aName = pMark->GetName();
|
||||
|
||||
@@ -33,9 +33,9 @@ class BookmarkTable
|
||||
|
||||
public:
|
||||
BookmarkTable(std::unique_ptr<weld::TreeView> xControl);
|
||||
void InsertBookmark(SwWrtShell& rSh, sw::mark::IMark* pMark);
|
||||
void InsertBookmark(SwWrtShell& rSh, sw::mark::MarkBase* pMark);
|
||||
bool SelectByName(const OUString& sName);
|
||||
sw::mark::IMark* GetBookmarkByName(const OUString& sName);
|
||||
sw::mark::MarkBase* GetBookmarkByName(const OUString& sName);
|
||||
OUString GetNameProposal() const;
|
||||
|
||||
void unselect_all() { m_xControl->unselect_all(); }
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
class SwInsertBookmarkDlg final : public SfxDialogController
|
||||
{
|
||||
SwWrtShell& m_rSh;
|
||||
std::vector<std::pair<sw::mark::IMark*, OUString>> m_aTableBookmarks;
|
||||
std::vector<std::pair<sw::mark::MarkBase*, OUString>> m_aTableBookmarks;
|
||||
sal_Int32 m_nLastBookmarksCount;
|
||||
bool m_bSorted;
|
||||
bool m_bAreProtected;
|
||||
|
||||
@@ -102,8 +102,8 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, DeleteHdl, weld::Button&, void)
|
||||
|
||||
m_xBookmarksBox->selected_foreach([this, &nSelectedRows](weld::TreeIter& rEntry) {
|
||||
// remove from model
|
||||
sw::mark::IMark* pBookmark
|
||||
= weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry));
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
|
||||
OUString sRemoved = pBookmark->GetName();
|
||||
IDocumentMarkAccess* const pMarkAccess = m_rSh.getIDocumentMarkAccess();
|
||||
pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved), false);
|
||||
@@ -158,8 +158,8 @@ void SwInsertBookmarkDlg::SelectionChanged()
|
||||
int nSelectedRows = 0;
|
||||
m_xBookmarksBox->selected_foreach(
|
||||
[this, &sEditBoxText, &nSelectedRows](weld::TreeIter& rEntry) {
|
||||
sw::mark::IMark* pBookmark
|
||||
= weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry));
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rEntry));
|
||||
const OUString& sEntryName = pBookmark->GetName();
|
||||
if (!sEditBoxText.isEmpty())
|
||||
sEditBoxText.append(";");
|
||||
@@ -205,8 +205,8 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, RenameHdl, weld::Button&, void)
|
||||
if (!xSelected)
|
||||
return;
|
||||
|
||||
sw::mark::IMark* pBookmark
|
||||
= weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected));
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(*xSelected));
|
||||
uno::Reference<frame::XModel> xModel = m_rSh.GetView().GetDocShell()->GetBaseModel();
|
||||
uno::Reference<text::XBookmarksSupplier> xBkms(xModel, uno::UNO_QUERY);
|
||||
uno::Reference<container::XNameAccess> xNameAccess = xBkms->getBookmarks();
|
||||
@@ -253,8 +253,8 @@ IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::Toggleable&, rBox, void)
|
||||
|
||||
IMPL_LINK(SwInsertBookmarkDlg, EditingHdl, weld::TreeIter const&, rIter, bool)
|
||||
{
|
||||
sw::mark::IMark const* const pBookmark(
|
||||
weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rIter)));
|
||||
sw::mark::MarkBase const* const pBookmark(
|
||||
weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rIter)));
|
||||
assert(pBookmark);
|
||||
return pBookmark->IsExpanded()
|
||||
&& pBookmark->GetMarkPos().GetNode() == pBookmark->GetOtherMarkPos().GetNode()
|
||||
@@ -263,8 +263,8 @@ IMPL_LINK(SwInsertBookmarkDlg, EditingHdl, weld::TreeIter const&, rIter, bool)
|
||||
|
||||
IMPL_LINK(SwInsertBookmarkDlg, EditedHdl, weld::TreeView::iter_string const&, rIterString, bool)
|
||||
{
|
||||
sw::mark::IMark const* const pBookmark(
|
||||
weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(rIterString.first)));
|
||||
sw::mark::MarkBase const* const pBookmark(
|
||||
weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(rIterString.first)));
|
||||
assert(pBookmark);
|
||||
bool bRet(false);
|
||||
if (pBookmark->GetMarkPos() != pBookmark->GetOtherMarkPos())
|
||||
@@ -300,8 +300,8 @@ void SwInsertBookmarkDlg::GotoSelectedBookmark()
|
||||
if (!xSelected)
|
||||
return;
|
||||
|
||||
sw::mark::IMark* pBookmark
|
||||
= weld::fromId<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected));
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xBookmarksBox->get_id(*xSelected));
|
||||
|
||||
m_rSh.EnterStdMode();
|
||||
m_rSh.GotoMark(pBookmark);
|
||||
@@ -324,7 +324,7 @@ bool SwInsertBookmarkDlg::HaveBookmarksChanged()
|
||||
if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
|
||||
return true;
|
||||
|
||||
std::vector<std::pair<sw::mark::IMark*, OUString>>::const_iterator aListIter
|
||||
std::vector<std::pair<sw::mark::MarkBase*, OUString>>::const_iterator aListIter
|
||||
= m_aTableBookmarks.begin();
|
||||
for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
|
||||
ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
|
||||
@@ -496,7 +496,7 @@ std::unique_ptr<weld::TreeIter> BookmarkTable::get_selected() const
|
||||
return xIter;
|
||||
}
|
||||
|
||||
void BookmarkTable::InsertBookmark(SwWrtShell& rSh, sw::mark::IMark* const pMark)
|
||||
void BookmarkTable::InsertBookmark(SwWrtShell& rSh, sw::mark::MarkBase* const pMark)
|
||||
{
|
||||
sw::mark::Bookmark* pBookmark = dynamic_cast<sw::mark::Bookmark*>(pMark);
|
||||
assert(pBookmark);
|
||||
@@ -544,7 +544,8 @@ std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const OUStri
|
||||
{
|
||||
std::unique_ptr<weld::TreeIter> xRet;
|
||||
m_xControl->all_foreach([this, &sName, &xRet](weld::TreeIter& rEntry) {
|
||||
sw::mark::IMark* pBookmark = weld::fromId<sw::mark::IMark*>(m_xControl->get_id(rEntry));
|
||||
sw::mark::MarkBase* pBookmark
|
||||
= weld::fromId<sw::mark::MarkBase*>(m_xControl->get_id(rEntry));
|
||||
if (pBookmark->GetName() == sName)
|
||||
{
|
||||
xRet = m_xControl->make_iterator(&rEntry);
|
||||
@@ -555,13 +556,13 @@ std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const OUStri
|
||||
return xRet;
|
||||
}
|
||||
|
||||
sw::mark::IMark* BookmarkTable::GetBookmarkByName(const OUString& sName)
|
||||
sw::mark::MarkBase* BookmarkTable::GetBookmarkByName(const OUString& sName)
|
||||
{
|
||||
auto xEntry = GetRowByBookmarkName(sName);
|
||||
if (!xEntry)
|
||||
return nullptr;
|
||||
|
||||
return weld::fromId<sw::mark::IMark*>(m_xControl->get_id(*xEntry));
|
||||
return weld::fromId<sw::mark::MarkBase*>(m_xControl->get_id(*xEntry));
|
||||
}
|
||||
|
||||
bool BookmarkTable::SelectByName(const OUString& sName)
|
||||
@@ -579,7 +580,7 @@ OUString BookmarkTable::GetNameProposal() const
|
||||
sal_Int32 nHighestBookmarkId = 0;
|
||||
for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
|
||||
{
|
||||
sw::mark::IMark* pBookmark = weld::fromId<sw::mark::IMark*>(m_xControl->get_id(i));
|
||||
sw::mark::MarkBase* pBookmark = weld::fromId<sw::mark::MarkBase*>(m_xControl->get_id(i));
|
||||
const OUString& sName = pBookmark->GetName();
|
||||
sal_Int32 nIndex = 0;
|
||||
if (o3tl::getToken(sName, 0, ' ', nIndex) == sDefaultBookmarkName)
|
||||
|
||||
@@ -883,7 +883,7 @@ void SwTransferable::DeleteSelection()
|
||||
static void DeleteDDEMarks(SwDoc & rDest)
|
||||
{
|
||||
IDocumentMarkAccess *const pMarkAccess = rDest.getIDocumentMarkAccess();
|
||||
std::vector< ::sw::mark::IMark* > vDdeMarks;
|
||||
std::vector< ::sw::mark::MarkBase* > vDdeMarks;
|
||||
// find all DDE-Bookmarks
|
||||
for (IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
|
||||
ppMark != pMarkAccess->getAllMarksEnd();
|
||||
@@ -1636,7 +1636,7 @@ bool SwTransferable::Paste(SwWrtShell& rSh, TransferableDataHelper& rData, RndSt
|
||||
pDispatch->Execute(FN_START_OF_DOCUMENT, SfxCallMode::SYNCHRON);
|
||||
|
||||
// store cursor position in row mode
|
||||
::sw::mark::IMark* pMark = (!bRowMode || nSelectedRowsOrCols == 0) ? nullptr : rSh.SetBookmark(
|
||||
::sw::mark::MarkBase* pMark = (!bRowMode || nSelectedRowsOrCols == 0) ? nullptr : rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
OUString(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK );
|
||||
@@ -3997,7 +3997,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
|
||||
{
|
||||
bool bTableCol(SelectionType::TableCol & nSelection);
|
||||
|
||||
::sw::mark::IMark* pMarkMoveFrom = bMove
|
||||
::sw::mark::MarkBase* pMarkMoveFrom = bMove
|
||||
? rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
OUString(),
|
||||
@@ -4070,7 +4070,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
|
||||
bool bPasteIntoTable = rSh.GetCursor()->GetPointNode().GetTableBox() != nullptr;
|
||||
|
||||
// store cursor
|
||||
::sw::mark::IMark* pMark = rSh.SetBookmark(
|
||||
::sw::mark::MarkBase* pMark = rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
OUString(),
|
||||
IDocumentMarkAccess::MarkType::UNO_BOOKMARK );
|
||||
@@ -4442,7 +4442,7 @@ SwTransferDdeLink::SwTransferDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
|
||||
rSh.DoUndo( false );
|
||||
bool bIsModified = rSh.IsModified();
|
||||
|
||||
::sw::mark::IMark* pMark = rSh.SetBookmark(
|
||||
::sw::mark::MarkBase* pMark = rSh.SetBookmark(
|
||||
vcl::KeyCode(),
|
||||
OUString(),
|
||||
IDocumentMarkAccess::MarkType::DDE_BOOKMARK);
|
||||
@@ -4509,7 +4509,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
|
||||
{
|
||||
// the mark is still a DdeBookmark
|
||||
// we replace it with a Bookmark, so it will get saved etc.
|
||||
::sw::mark::IMark* const pMark = *ppMark;
|
||||
::sw::mark::MarkBase* const pMark = *ppMark;
|
||||
::sfx2::SvLinkSource* p = m_xRefObj.get();
|
||||
SwServerObject& rServerObject = dynamic_cast<SwServerObject&>(*p);
|
||||
|
||||
@@ -4529,7 +4529,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
|
||||
pMarkAccess->deleteMark(ppMark, false);
|
||||
|
||||
// recreate as Bookmark
|
||||
::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark(
|
||||
::sw::mark::MarkBase* const pNewMark = pMarkAccess->makeMark(
|
||||
aPaM,
|
||||
sMarkName,
|
||||
IDocumentMarkAccess::MarkType::BOOKMARK,
|
||||
|
||||
@@ -574,7 +574,7 @@ bool SwPostItMgr::CalcRects()
|
||||
// update layout information
|
||||
const SwTextAnnotationField* pTextAnnotationField =
|
||||
dynamic_cast< const SwTextAnnotationField* >( pItem->GetFormatField().GetTextField() );
|
||||
const ::sw::mark::IMark* pAnnotationMark =
|
||||
const ::sw::mark::MarkBase* pAnnotationMark =
|
||||
pTextAnnotationField != nullptr ? pTextAnnotationField->GetAnnotationMark() : nullptr;
|
||||
if ( pAnnotationMark != nullptr )
|
||||
{
|
||||
|
||||
@@ -41,11 +41,11 @@ namespace com::sun::star{
|
||||
|
||||
class SwMailMergeConfigItem_Impl;
|
||||
class SwView;
|
||||
namespace sw::mark { class IMark; }
|
||||
namespace sw::mark { class MarkBase; }
|
||||
|
||||
struct SwDocMergeInfo
|
||||
{
|
||||
sw::mark::IMark* startPageInTarget;
|
||||
sw::mark::MarkBase* startPageInTarget;
|
||||
sal_Int32 nDBRow;
|
||||
};
|
||||
|
||||
|
||||
@@ -421,8 +421,8 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
|
||||
virtual void DrawSelChanged( ) override;
|
||||
|
||||
// jump to bookmark and set the "selections-flags" correctly again
|
||||
SW_DLLPUBLIC void GotoMark( const ::sw::mark::IMark* const pMark );
|
||||
bool GotoMark( const ::sw::mark::IMark* const pMark, bool bSelect );
|
||||
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 OUString& rName );
|
||||
bool GoNextBookmark(); // true when there still was one
|
||||
bool GoPrevBookmark();
|
||||
@@ -649,7 +649,7 @@ private:
|
||||
BOOKMARK_PREV
|
||||
};
|
||||
|
||||
bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
|
||||
bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::MarkBase* const pMark=nullptr);
|
||||
};
|
||||
|
||||
inline void SwWrtShell::ResetCursorStack()
|
||||
|
||||
@@ -1044,7 +1044,7 @@ FIELD_INSERT:
|
||||
rSh.StartAction();
|
||||
|
||||
IDocumentMarkAccess* pMarkAccess = rSh.GetDoc()->getIDocumentMarkAccess();
|
||||
std::vector<sw::mark::IMark*> aRemovals;
|
||||
std::vector<sw::mark::MarkBase*> aRemovals;
|
||||
for (auto it = pMarkAccess->getFieldmarksBegin(); it != pMarkAccess->getFieldmarksEnd(); ++it)
|
||||
{
|
||||
auto pFieldmark = dynamic_cast<sw::mark::Fieldmark*>(*it);
|
||||
|
||||
@@ -718,7 +718,7 @@ void DeleteBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
|
||||
});
|
||||
|
||||
IDocumentMarkAccess* pMarkAccess = rWrtSh.GetDoc()->getIDocumentMarkAccess();
|
||||
std::vector<sw::mark::IMark*> aRemovals;
|
||||
std::vector<sw::mark::MarkBase*> aRemovals;
|
||||
for (auto it = pMarkAccess->getBookmarksBegin(); it != pMarkAccess->getBookmarksEnd(); ++it)
|
||||
{
|
||||
auto pBookmark = dynamic_cast<sw::mark::Bookmark*>(*it);
|
||||
|
||||
@@ -224,7 +224,7 @@ void GetBookmarks(tools::JsonWriter& rJsonWriter, SwDocShell* pDocShell,
|
||||
auto aBookmarks = rJsonWriter.startArray("bookmarks");
|
||||
for (auto it = rIDMA.getBookmarksBegin(); it != rIDMA.getBookmarksEnd(); ++it)
|
||||
{
|
||||
sw::mark::IMark* pMark = *it;
|
||||
sw::mark::MarkBase* pMark = *it;
|
||||
if (!pMark->GetName().startsWith(aNamePrefix))
|
||||
{
|
||||
continue;
|
||||
@@ -255,7 +255,7 @@ void GetBookmark(tools::JsonWriter& rJsonWriter, SwDocShell* pDocShell,
|
||||
IDocumentMarkAccess& rIDMA = *pDocShell->GetDoc()->getIDocumentMarkAccess();
|
||||
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
|
||||
SwPosition& rCursor = *pWrtShell->GetCursor()->GetPoint();
|
||||
sw::mark::IMark* pBookmark = rIDMA.getOneInnermostBookmarkFor(rCursor);
|
||||
sw::mark::MarkBase* pBookmark = rIDMA.getOneInnermostBookmarkFor(rCursor);
|
||||
auto aBookmark = rJsonWriter.startNode("bookmark");
|
||||
if (!pBookmark)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface)
|
||||
std::pair<OUString, FlyCntType> frame;
|
||||
OUString tableName;
|
||||
SwUnoTableCursor const* pTableCursor(nullptr);
|
||||
::sw::mark::IMark const* pMark(nullptr);
|
||||
::sw::mark::MarkBase const* pMark(nullptr);
|
||||
SwUnoCursorHelper::GetSelectableFromAny(xInterface, *pDoc,
|
||||
pPaM, frame, tableName, pTableCursor, pMark, sdrObjects);
|
||||
if (pPaM)
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace
|
||||
return bFound;
|
||||
}
|
||||
|
||||
bool lcl_IsUiVisibleBookmark(const ::sw::mark::IMark* pMark)
|
||||
bool lcl_IsUiVisibleBookmark(const ::sw::mark::MarkBase* pMark)
|
||||
{
|
||||
return IDocumentMarkAccess::GetType(*pMark) == IDocumentMarkAccess::MarkType::BOOKMARK;
|
||||
}
|
||||
@@ -3244,7 +3244,7 @@ bool SwContentTree::FillTransferData(TransferDataContainer& rTransfer)
|
||||
static_cast<SwOutlineContent*>(pCnt)->GetOutlinePos();
|
||||
const SwTextNode* pTextNode =
|
||||
pWrtShell->GetNodes().GetOutLineNds()[nPos]->GetTextNode();
|
||||
sw::mark::IMark const * const pMark =
|
||||
sw::mark::MarkBase const * const pMark =
|
||||
pWrtShell->getIDocumentMarkAccess()->getMarkForTextNode(
|
||||
*pTextNode, IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK);
|
||||
// REFERENCESUBTYPE_OUTLINE is changed to REFERENCESUBTYPE::BOOKMARK in
|
||||
@@ -7259,7 +7259,7 @@ void SwContentTree::BringPostItFieldsToAttention(std::vector<const SwTextAttr*>&
|
||||
assert(dynamic_cast<const SwTextAnnotationField*>(pTextField));
|
||||
const SwTextAnnotationField* pTextAnnotationField =
|
||||
static_cast<const SwTextAnnotationField*>(pTextField);
|
||||
const ::sw::mark::IMark* pAnnotationMark = pTextAnnotationField->GetAnnotationMark();
|
||||
const ::sw::mark::MarkBase* pAnnotationMark = pTextAnnotationField->GetAnnotationMark();
|
||||
const SwPosition aMarkStart = pAnnotationMark ? pAnnotationMark->GetMarkStart()
|
||||
: SwPosition(rTextNode, p->GetStart());
|
||||
const SwPosition aMarkEnd = pAnnotationMark ? pAnnotationMark->GetMarkEnd()
|
||||
|
||||
@@ -631,7 +631,7 @@ bool SwWrtShell::GotoPage(sal_uInt16 nPage, bool bRecord)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark, bool bSelect )
|
||||
bool SwWrtShell::GotoMark( const ::sw::mark::MarkBase* const pMark, bool bSelect )
|
||||
{
|
||||
ShellMoveCursor aTmp( this, bSelect );
|
||||
SwPosition aPos = *GetCursor()->GetPoint();
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
bool SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark)
|
||||
bool SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::MarkBase* const pMark)
|
||||
{
|
||||
addCurrentPosition();
|
||||
(this->*m_fnKillSel)( nullptr, false );
|
||||
@@ -269,7 +269,7 @@ void SwWrtShell::GotoMark( const OUString& rName )
|
||||
MoveBookMark( BOOKMARK_INDEX, *ppMark );
|
||||
}
|
||||
|
||||
void SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark )
|
||||
void SwWrtShell::GotoMark( const ::sw::mark::MarkBase* const pMark )
|
||||
{
|
||||
MoveBookMark( BOOKMARK_INDEX, pMark );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user