class SwRangeRedline; class SwExtraRedline; class SwOLENode; class SwTable; class SwTableLine; class SwTableBox; enumclass RedlineType : sal_uInt16;
/** provides some methods for generic operations on lists that contain SwFormat* subclasses. */ class SW_DLLPUBLIC SwFormatsBase
{ public: virtual size_t GetFormatCount() const = 0; virtual SwFormat* GetFormat(size_t idx) const = 0; virtual ~SwFormatsBase();
// default linear search implementation, some subclasses will override with a more efficient search virtual SwFormat* FindFormatByName(const UIName& rName) const; virtualvoid Rename(const SwFrameFormat&, const UIName&) {};
// free any remaining child objects based on mPolicy virtual ~SwVectorModifyBase()
{ if (mPolicy == DestructorPolicy::FreeElements) for(const_iterator it = begin(); it != end(); ++it) delete *it;
}
//TODO: These functions are apparently brittle (but the copy functions are actually used by the // code; the move functions will be implicitly-defined as deleted anyway) and should probably // only be used with DestructorPolicy::KeepELements:
SwVectorModifyBase(SwVectorModifyBase const &) = default;
SwVectorModifyBase(SwVectorModifyBase &&) = default;
SwVectorModifyBase & operator =(SwVectorModifyBase const &) = default;
SwVectorModifyBase & operator =(SwVectorModifyBase &&) = default;
void DeleteAndDestroy(int aStartIdx, int aEndIdx)
{ if (aEndIdx < aStartIdx) return; for (const_iterator it = begin() + aStartIdx;
it != begin() + aEndIdx; ++it) delete *it;
erase( begin() + aStartIdx, begin() + aEndIdx);
}
size_t GetPos(typename std::remove_pointer_t<Value> const* const p) const
{
const_iterator const it = std::find(begin(), end(), p); return it == end() ? SIZE_MAX : it - begin();
}
/// check that given format is still alive (i.e. contained here) bool IsAlive(typename std::remove_pointer<Value>::type const*const p) const
{ return std::find(begin(), end(), p) != end(); }
virtual Value GetFormat(size_t idx) const override
{ return SwVectorModifyBase<Value>::operator[](idx); }
// Override return type to reduce casting virtual Value FindFormatByName(const UIName& rName) const override
{ returnstatic_cast<Value>(SwFormatsBase::FindFormatByName(rName)); }
};
class SwGrfFormatColls final : public SwFormatsModifyBase<SwGrfFormatColl*>
{ public:
SwGrfFormatColls() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
};
/// Unsorted, undeleting SwFrameFormat vector class SwFrameFormatsV final : public SwFormatsModifyBase<SwFrameFormat*>
{ public:
SwFrameFormatsV() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
};
/// Container of paragraph styles. class SwTextFormatColls final : public SwFormatsModifyBase<SwTextFormatColl*>
{ public:
SwTextFormatColls() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {} void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
/// Array of Undo-history. class SwSectionFormats final : public SwFormatsModifyBase<SwSectionFormat*>
{ public: void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
class SwFieldTypes : public std::vector<std::unique_ptr<SwFieldType>> { public: void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
class SwTOXTypes : public std::vector<std::unique_ptr<SwTOXType>> {};
class SwNumRuleTable final : public SwVectorModifyBase<SwNumRule*> { public: void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
// Notification type for notifying about redlines to LOK clients enumclass RedlineNotification { Add, Remove, Modify };
class SW_DLLPUBLIC SwRedlineTable
{ public: typedef o3tl::sorted_vector<SwRangeRedline*, CompareSwRedlineTable,
o3tl::find_partialorder_ptrequals> vector_type; typedef vector_type::size_type size_type; static constexpr size_type npos = SAL_MAX_INT32; private:
vector_type maVector; /// Sometimes we load bad data, and we need to know if we can use /// fast binary search, or if we have to fall back to a linear search bool m_bHasOverlappingElements = false; mutable sal_uInt32 m_nMaxMovedID = 1; //every move-redline pair get a unique ID, so they can find each other. mutableconst SwRangeRedline* mpMaxEndPos = nullptr; // the redline with the maximum end pos public:
~SwRedlineTable(); bool Contains(const SwRangeRedline* p) const { return maVector.find(p) != maVector.end(); }
size_type GetPos(const SwRangeRedline* p) const;
size_type FindNextOfSeqNo( size_type nSttPos ) const;
size_type FindPrevOfSeqNo( size_type nSttPos ) const; /** Search next or previous Redline with the same Seq. No. SearchcanberestrictedviaLookahead.
Using 0 makes search the whole array. */
size_type FindNextSeqNo( sal_uInt16 nSeqNo, size_type nSttPos ) const;
size_type FindPrevSeqNo( sal_uInt16 nSeqNo, size_type nSttPos ) const;
/** Findtheredlineatthegivenposition.
@paramtableIndexpositioninSwRedlineTabletostartsearchingat,willbeupdatedwiththeindexofthereturned redline(orthenextredlineafterthegivenpositionifnotfound) @paramnexttrue:redlinestartsatpositionandendsafter,false:redlinestartsbeforepositionandendsatorafter
*/ const SwRangeRedline* FindAtPosition( const SwPosition& startPosition, size_type& tableIndex, bool next = true ) const; // is there a redline with the same text content from the same author (near the redline), // but with the opposite type (Insert or Delete). It's used to recognize tracked text moving. bool isMoved(size_type tableIndex) const; bool isMovedImpl(size_type tableIndex, bool bTryCombined) const;
sal_uInt32 getNewMovedID() const { return ++m_nMaxMovedID; } void setMovedIDIfNeeded(sal_uInt32 nMax); void getConnectedArea(size_type nPosOrigin, size_type& rPosStart, size_type& rPosEnd, bool bCheckChilds) const;
OUString getTextOfArea(size_type rPosStart, size_type rPosEnd) const;
// Notifies all LOK clients when redlines are added/modified/removed staticvoid LOKRedlineNotification(RedlineNotification eType, SwRangeRedline* pRedline);
/// Table that holds 'extra' redlines, such as 'table row insert/delete', 'paragraph moves' etc... class SwExtraRedlineTable
{ private:
std::vector<SwExtraRedline*> m_aExtraRedlines;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.