19 #ifndef INCLUDED_SW_INC_DOCARY_HXX
20 #define INCLUDED_SW_INC_DOCARY_HXX
23 #include <type_traits>
60 template<
typename Value>
64 typedef typename std::vector<Value>::iterator
iterator;
66 typedef typename std::vector<Value>::size_type
size_type;
67 typedef typename std::vector<Value>::value_type
value_type;
85 bool empty()
const {
return mvVals.empty(); }
87 size_t size()
const {
return mvVals.size(); }
88 iterator
begin() {
return mvVals.begin(); }
89 const_iterator
begin()
const {
return mvVals.begin(); }
90 iterator
end() {
return mvVals.end(); }
91 const_iterator
end()
const {
return mvVals.end(); }
92 void clear() { mvVals.clear(); }
93 iterator
erase(iterator aIt) {
return mvVals.erase(aIt); }
94 iterator
erase(iterator aFirst, iterator aLast) {
return mvVals.erase(aFirst, aLast); }
95 iterator
insert(iterator aIt, Value
const& rVal) {
return mvVals.insert(aIt, rVal); }
96 template<
typename TInputIterator>
97 void insert(iterator aIt, TInputIterator aFirst, TInputIterator aLast)
99 mvVals.insert(aIt, aFirst, aLast);
101 void push_back(Value
const& rVal) { mvVals.push_back(rVal); }
102 void reserve(size_type nSize) { mvVals.reserve(nSize); }
103 Value const&
at(size_type nPos)
const {
return mvVals.at(nPos); }
111 for(const_iterator it =
begin(); it !=
end(); ++it)
125 if (aEndIdx < aStartIdx)
127 for (const_iterator it =
begin() + aStartIdx;
128 it !=
begin() + aEndIdx; ++it)
135 const_iterator
const it = std::find(
begin(),
end(), p);
136 return it ==
end() ? SIZE_MAX : it -
begin();
140 bool IsAlive(
typename std::remove_pointer<Value>::type
const*
const p)
const
146 template<
typename Value>
197 class SwFieldTypes :
public std::vector<std::unique_ptr<SwFieldType>> {
202 class SwTOXTypes :
public std::vector<std::unique_ptr<SwTOXType>> {};
231 bool Contains(
const SwRangeRedline* p)
const {
return maVector.
find(const_cast<SwRangeRedline*>(p)) != maVector.
end(); }
232 size_type
GetPos(
const SwRangeRedline* p)
const;
234 bool Insert(SwRangeRedline*& p);
235 bool Insert(SwRangeRedline*& p, size_type& rInsPos);
239 void Remove( size_type nPos );
240 void Remove(
const SwRangeRedline* p );
251 size_type
FindNextSeqNo( sal_uInt16 nSeqNo, size_type nSttPos )
const;
252 size_type
FindPrevSeqNo( sal_uInt16 nSeqNo, size_type nSttPos )
const;
261 const SwRangeRedline*
FindAtPosition(
const SwPosition& startPosition, size_type& tableIndex,
bool next =
true )
const;
264 bool isMoved(size_type tableIndex)
const;
268 SwRangeRedline*
operator[]( size_type idx )
const {
return maVector[idx]; }
296 sal_uInt16
GetSize()
const {
return m_aExtraRedlines.size(); }
306 #endif // INCLUDED_SW_INC_DOCARY_HXX
void DeleteAndDestroy(int aStartIdx, int aEndIdx)
void insert(iterator aIt, TInputIterator aFirst, TInputIterator aLast)
bool InsertWithValidRanges(SwRangeRedline *&p, size_type *pInsPos=nullptr)
static void dumpAsXml(xmlTextWriterPtr)
Marks a position in the document model.
void reserve(size_type nSize)
vector_type::const_iterator end() const
bool Contains(const SwRangeRedline *p) const
size_type FindPrevOfSeqNo(size_type nSttPos) const
iterator erase(iterator aFirst, iterator aLast)
void Remove(size_type nPos)
size_t GetPos(Value const &p) const
const_iterator find(const Value &x) const
SwTableLine is one table row in the document model.
std::vector< Value >::const_iterator const_iterator
Value const & at(size_type nPos) const
std::vector< Value > mvVals
void dumpAsXml(xmlTextWriterPtr pWriter) const
const_iterator end() const
vector_type::const_iterator begin() const
static void LOKRedlineNotification(RedlineNotification eType, SwRangeRedline *pRedline)
Emits LOK notification about one addition / removal of a redline item.
bool HasOverlappingElements() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
size_type GetPos(const SwRangeRedline *p) const
Value const & front() const
std::vector< SwOLENode * > SwOLENodes
std::vector< Value >::value_type value_type
void DeleteAndDestroy(size_type nPos)
std::vector< Value >::size_type size_type
void DeleteAndDestroyAll()
vector_type::size_type size_type
void dumpAsXml(xmlTextWriterPtr pWriter) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
std::vector< Value >::iterator iterator
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
iterator erase(iterator aIt)
Value const & operator[](size_type nPos) const
const_iterator end() const
SwVectorModifyBase & operator=(SwVectorModifyBase const &)=default
SwTable is one table in the document model, containing rows (which contain cells).
SwVectorModifyBase(DestructorPolicy policy=DestructorPolicy::FreeElements)
iterator insert(iterator aIt, Value const &rVal)
void push_back(Value const &rVal)
const_iterator begin() const
size_type FindNextOfSeqNo(size_type nSttPos) const
const DestructorPolicy mPolicy
bool isMoved(size_type tableIndex) const
SwRangeRedline * operator[](size_type idx) const
const_iterator begin() const
SwTableBox is one table cell in the document model.
Value & operator[](size_type nPos)
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
struct _xmlTextWriter * xmlTextWriterPtr
o3tl::sorted_vector< SwRangeRedline *, CompareSwRedlineTable, o3tl::find_partialorder_ptrequals > vector_type
bool Insert(SwRangeRedline *&p)
std::vector< Value >::size_type size_type
bool m_bHasOverlappingElements
Sometimes we load bad data, and we need to know if we can use fast binary search, or if we have to fa...
void CheckOverlapping(vector_type::const_iterator it)
static constexpr size_type npos
bool operator()(SwRangeRedline *const &lhs, SwRangeRedline *const &rhs) const
std::vector< SwRangeRedline * >::const_iterator const_iterator
virtual ~SwVectorModifyBase()