2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_DOCARY_HXX
|
|
|
|
#define INCLUDED_SW_INC_DOCARY_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-05-16 11:48:48 +02:00
|
|
|
#include <vector>
|
2017-05-03 13:04:08 +02:00
|
|
|
#include <type_traits>
|
2012-07-20 17:16:03 +02:00
|
|
|
#include <o3tl/sorted_vector.hxx>
|
2001-01-23 09:42:57 +00:00
|
|
|
|
2015-04-10 21:32:36 +02:00
|
|
|
#include <boost/multi_index_container.hpp>
|
|
|
|
#include <boost/multi_index/composite_key.hpp>
|
|
|
|
#include <boost/multi_index/identity.hpp>
|
|
|
|
#include <boost/multi_index/mem_fun.hpp>
|
|
|
|
#include <boost/multi_index/ordered_index.hpp>
|
|
|
|
#include <boost/multi_index/random_access_index.hpp>
|
|
|
|
|
2017-10-23 22:30:30 +02:00
|
|
|
#include "charfmt.hxx"
|
|
|
|
#include "fmtcol.hxx"
|
|
|
|
#include "frmfmt.hxx"
|
|
|
|
#include "section.hxx"
|
|
|
|
#include "tox.hxx"
|
|
|
|
#include "numrule.hxx"
|
2018-02-07 09:25:55 +01:00
|
|
|
#include "fldbas.hxx"
|
2016-11-18 10:10:48 +02:00
|
|
|
|
2014-01-13 17:58:25 +02:00
|
|
|
class SwRangeRedline;
|
2014-01-16 16:51:09 +02:00
|
|
|
class SwExtraRedline;
|
2015-11-25 06:03:10 -05:00
|
|
|
class SwUnoCursor;
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwOLENode;
|
2014-03-23 13:19:15 +02:00
|
|
|
class SwTable;
|
|
|
|
class SwTableLine;
|
|
|
|
class SwTableBox;
|
2018-02-07 09:25:55 +01:00
|
|
|
struct SwPosition;
|
|
|
|
class SwContentNode;
|
|
|
|
class SwTextNode;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2001-01-19 15:45:37 +00:00
|
|
|
namespace com { namespace sun { namespace star { namespace i18n {
|
2012-09-02 09:05:03 +03:00
|
|
|
struct ForbiddenCharacters; ///< comes from the I18N UNO interface
|
2007-09-27 06:59:22 +00:00
|
|
|
}}}}
|
2001-01-19 15:45:37 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-11-18 10:10:48 +02:00
|
|
|
/** provides some methods for generic operations on lists that contain SwFormat* subclasses. */
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwFormatsBase
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
virtual size_t GetFormatCount() const = 0;
|
|
|
|
virtual SwFormat* GetFormat(size_t idx) const = 0;
|
|
|
|
virtual ~SwFormatsBase() {};
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-11-11 16:52:48 +01:00
|
|
|
template<typename Value>
|
2016-10-21 18:42:26 +09:00
|
|
|
class SwVectorModifyBase
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
2014-11-11 16:52:48 +01:00
|
|
|
public:
|
2016-10-21 18:42:26 +09:00
|
|
|
typedef typename std::vector<Value>::iterator iterator;
|
2014-11-11 16:52:48 +01:00
|
|
|
typedef typename std::vector<Value>::const_iterator const_iterator;
|
2016-10-21 18:42:26 +09:00
|
|
|
typedef typename std::vector<Value>::size_type size_type;
|
|
|
|
typedef typename std::vector<Value>::value_type value_type;
|
2014-11-11 16:52:48 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
enum class DestructorPolicy {
|
|
|
|
KeepElements,
|
|
|
|
FreeElements,
|
|
|
|
};
|
|
|
|
|
2014-10-01 14:54:59 +09:00
|
|
|
private:
|
2016-10-21 18:42:26 +09:00
|
|
|
typename std::vector<Value> mvVals;
|
2014-11-11 16:52:48 +01:00
|
|
|
const DestructorPolicy mPolicy;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// default destructor deletes all contained elements
|
|
|
|
SwVectorModifyBase(DestructorPolicy policy = DestructorPolicy::FreeElements)
|
|
|
|
: mPolicy(policy) {}
|
2014-10-01 14:54:59 +09:00
|
|
|
|
2012-06-20 16:36:51 +02:00
|
|
|
public:
|
2016-10-21 18:42:26 +09:00
|
|
|
bool empty() const { return mvVals.empty(); }
|
|
|
|
Value const& front() const { return mvVals.front(); }
|
|
|
|
size_t size() const { return mvVals.size(); }
|
|
|
|
iterator begin() { return mvVals.begin(); }
|
|
|
|
const_iterator begin() const { return mvVals.begin(); }
|
|
|
|
iterator end() { return mvVals.end(); }
|
|
|
|
const_iterator end() const { return mvVals.end(); }
|
|
|
|
void clear() { mvVals.clear(); }
|
|
|
|
iterator erase(iterator aIt) { return mvVals.erase(aIt); }
|
|
|
|
iterator erase(iterator aFirst, iterator aLast) { return mvVals.erase(aFirst, aLast); }
|
|
|
|
iterator insert(iterator aIt, Value const& rVal) { return mvVals.insert(aIt, rVal); }
|
|
|
|
template<typename TInputIterator>
|
|
|
|
void insert(iterator aIt, TInputIterator aFirst, TInputIterator aLast)
|
|
|
|
{
|
|
|
|
mvVals.insert(aIt, aFirst, aLast);
|
|
|
|
}
|
|
|
|
void push_back(Value const& rVal) { mvVals.push_back(rVal); }
|
|
|
|
void reserve(size_type nSize) { mvVals.reserve(nSize); }
|
|
|
|
Value const& at(size_type nPos) const { return mvVals.at(nPos); }
|
|
|
|
Value const& operator[](size_type nPos) const { return mvVals[nPos]; }
|
|
|
|
Value& operator[](size_type nPos) { return mvVals[nPos]; }
|
2014-11-11 16:52:48 +01:00
|
|
|
|
|
|
|
// free any remaining child objects based on mPolicy
|
|
|
|
virtual ~SwVectorModifyBase()
|
|
|
|
{
|
|
|
|
if (mPolicy == DestructorPolicy::FreeElements)
|
|
|
|
for(const_iterator it = begin(); it != end(); ++it)
|
|
|
|
delete *it;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DeleteAndDestroy(int aStartIdx, int aEndIdx)
|
|
|
|
{
|
|
|
|
if (aEndIdx < aStartIdx)
|
|
|
|
return;
|
|
|
|
for (const_iterator it = begin() + aStartIdx;
|
|
|
|
it != begin() + aEndIdx; ++it)
|
|
|
|
delete *it;
|
2017-08-02 12:57:55 +02:00
|
|
|
erase( begin() + aStartIdx, begin() + aEndIdx);
|
2014-11-11 16:52:48 +01:00
|
|
|
}
|
|
|
|
|
2015-04-06 12:23:09 +03:00
|
|
|
size_t GetPos(Value const& p) const
|
2014-11-11 16:52:48 +01:00
|
|
|
{
|
|
|
|
const_iterator const it = std::find(begin(), end(), p);
|
2015-05-04 13:25:38 +03:00
|
|
|
return it == end() ? SIZE_MAX : it - begin();
|
2014-11-11 16:52:48 +01:00
|
|
|
}
|
|
|
|
|
2017-05-03 13:04:08 +02:00
|
|
|
/// check that given format is still alive (i.e. contained here)
|
|
|
|
bool IsAlive(typename std::remove_pointer<Value>::type const*const p) const
|
2014-11-11 16:52:48 +01:00
|
|
|
{ return std::find(begin(), end(), p) != end(); }
|
|
|
|
|
2015-05-04 10:29:18 +02:00
|
|
|
static void dumpAsXml(struct _xmlTextWriter* /*pWriter*/) {};
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-11-11 16:52:48 +01:00
|
|
|
template<typename Value>
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwFormatsModifyBase : public SwVectorModifyBase<Value>, public SwFormatsBase
|
2014-11-11 16:52:48 +01:00
|
|
|
{
|
|
|
|
protected:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatsModifyBase(typename SwVectorModifyBase<Value>::DestructorPolicy
|
2014-11-11 16:52:48 +01:00
|
|
|
policy = SwVectorModifyBase<Value>::DestructorPolicy::FreeElements)
|
|
|
|
: SwVectorModifyBase<Value>(policy) {}
|
|
|
|
|
|
|
|
public:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual size_t GetFormatCount() const override
|
2016-10-21 18:42:26 +09:00
|
|
|
{ return SwVectorModifyBase<Value>::size(); }
|
2014-11-11 16:52:48 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual Value GetFormat(size_t idx) const override
|
2016-10-21 18:42:26 +09:00
|
|
|
{ return SwVectorModifyBase<Value>::operator[](idx); }
|
2014-11-11 16:52:48 +01:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
size_t GetPos(const SwFormat *p) const
|
2015-05-20 13:05:49 +02:00
|
|
|
{ return SwVectorModifyBase<Value>::GetPos( static_cast<Value>( const_cast<SwFormat*>( p ) ) ); }
|
2017-05-03 13:04:08 +02:00
|
|
|
|
|
|
|
/// check if given format is contained here
|
|
|
|
/// @precond pFormat must not have been deleted
|
|
|
|
bool ContainsFormat(SwFormat const*const pFormat) const {
|
|
|
|
Value p = dynamic_cast<Value>(const_cast<SwFormat*>(pFormat));
|
|
|
|
return p != nullptr && SwVectorModifyBase<Value>::IsAlive(p);
|
Avoid bad downcast of SwFrmFmt to SwSectionFmt
as observed by -fsanitize=vptr e.g. during CppunitTest_writerperfect_writer:
SwFmtsModifyBase<SwSectionFmt*>::Contains(SwFmt const*) const
SwUndoFmtAttr::Init()
SwUndoFmtAttr::SwUndoFmtAttr(SfxItemSet const&, SwFmt&, bool)
SwDoc::ChgFmt(SwFmt&, SfxItemSet const&)
SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool)
SwXStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)
SwXStyle::setPropertyValues(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)
SvXMLImportPropertyMapper::_FillMultiPropertySet(std::__debug::vector<XMLPropertyState, std::allocator<XMLPropertyState> > const&, com::sun::star::uno::Reference<com::sun::star::beans::XMultiPropertySet> const&, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> const&, rtl::Reference<XMLPropertySetMapper> const&, _ContextID_Index_Pair*)
SvXMLImportPropertyMapper::FillPropertySet(std::__debug::vector<XMLPropertyState, std::allocator<XMLPropertyState> > const&, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>, _ContextID_Index_Pair*) const
XMLShapeStyleContext::FillPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&)
XMLPropStyleContext::CreateAndInsert(bool)
XMLTextShapeStyleContext::CreateAndInsert(bool)
SvXMLStylesContext::CopyStylesToDoc(bool, bool)
SwXMLImport::InsertStyles(bool)
SwXMLStylesContext_Impl::EndElement()
SvXMLImport::endElement(rtl::OUString const&)
...
Change-Id: Ibbf6d4def751c5a8ad1416e22b8b5255eda3dd44
2015-03-04 13:52:03 +01:00
|
|
|
}
|
2014-11-11 16:52:48 +01:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwGrfFormatColls : public SwFormatsModifyBase<SwGrfFormatColl*>
|
2014-11-11 16:52:48 +01:00
|
|
|
{
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwGrfFormatColls() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
|
2014-11-11 16:52:48 +01:00
|
|
|
};
|
2013-03-14 19:36:04 +01:00
|
|
|
|
2015-04-10 21:32:36 +02:00
|
|
|
// Like o3tl::find_partialorder_ptrequals
|
|
|
|
// We don't allow duplicated object entries!
|
2015-06-20 20:23:44 +00:00
|
|
|
struct type_name_key:boost::multi_index::composite_key<
|
2015-04-10 21:32:36 +02:00
|
|
|
SwFrameFormat*,
|
2015-06-20 20:23:44 +00:00
|
|
|
boost::multi_index::const_mem_fun<SwFormat,sal_uInt16,&SwFormat::Which>,
|
|
|
|
boost::multi_index::const_mem_fun<SwFormat,const OUString&,&SwFormat::GetName>,
|
|
|
|
boost::multi_index::identity<SwFrameFormat*> // the actual object pointer
|
2015-04-10 21:32:36 +02:00
|
|
|
>{};
|
|
|
|
|
|
|
|
typedef boost::multi_index_container<
|
|
|
|
SwFrameFormat*,
|
2015-06-20 20:23:44 +00:00
|
|
|
boost::multi_index::indexed_by<
|
|
|
|
boost::multi_index::random_access<>,
|
|
|
|
boost::multi_index::ordered_unique< type_name_key >
|
2015-04-10 21:32:36 +02:00
|
|
|
>
|
|
|
|
>
|
|
|
|
SwFrameFormatsBase;
|
|
|
|
|
2012-09-02 09:05:03 +03:00
|
|
|
/// Specific frame formats (frames, DrawObjects).
|
2015-06-20 20:23:44 +00:00
|
|
|
class SW_DLLPUBLIC SwFrameFormats : public SwFormatsBase
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
2015-04-10 21:32:36 +02:00
|
|
|
// function updating ByName index via modify
|
|
|
|
friend void SwFrameFormat::SetName( const OUString&, bool );
|
|
|
|
|
2015-06-20 20:23:44 +00:00
|
|
|
typedef SwFrameFormatsBase::nth_index<0>::type ByPos;
|
|
|
|
typedef SwFrameFormatsBase::nth_index<1>::type ByTypeAndName;
|
2015-04-10 21:32:36 +02:00
|
|
|
typedef ByPos::iterator iterator;
|
|
|
|
|
2015-06-20 20:23:44 +00:00
|
|
|
SwFrameFormatsBase m_Array;
|
|
|
|
ByPos &m_PosIndex;
|
|
|
|
ByTypeAndName &m_TypeAndNameIndex;
|
2015-04-10 21:32:36 +02:00
|
|
|
|
2012-06-20 16:36:51 +02:00
|
|
|
public:
|
2015-04-10 21:32:36 +02:00
|
|
|
typedef ByPos::const_iterator const_iterator;
|
|
|
|
typedef ByTypeAndName::const_iterator const_range_iterator;
|
|
|
|
typedef SwFrameFormatsBase::size_type size_type;
|
|
|
|
typedef SwFrameFormatsBase::value_type value_type;
|
|
|
|
|
2015-06-20 20:23:44 +00:00
|
|
|
SwFrameFormats();
|
2015-04-10 21:32:36 +02:00
|
|
|
// frees all SwFrameFormat!
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SwFrameFormats() override;
|
2015-04-10 21:32:36 +02:00
|
|
|
|
2015-06-20 20:23:44 +00:00
|
|
|
bool empty() const { return m_Array.empty(); }
|
|
|
|
size_t size() const { return m_Array.size(); }
|
2015-04-10 21:32:36 +02:00
|
|
|
|
|
|
|
// Only fails, if you try to insert the same object twice
|
|
|
|
std::pair<const_iterator,bool> push_back( const value_type& x );
|
|
|
|
|
|
|
|
// This will try to remove the exact object!
|
|
|
|
bool erase( const value_type& x );
|
|
|
|
void erase( size_type index );
|
|
|
|
void erase( const_iterator const& position );
|
|
|
|
|
|
|
|
// Get the iterator of the exact object (includes pointer!),
|
|
|
|
// e.g for position with std::distance.
|
2017-05-02 22:45:48 +02:00
|
|
|
// There is also ContainsFormat, if you don't need the position.
|
2015-04-10 21:32:36 +02:00
|
|
|
const_iterator find( const value_type& x ) const;
|
|
|
|
|
|
|
|
// As this array is non-unique related to type and name,
|
|
|
|
// we always get ranges for the "key" values.
|
|
|
|
std::pair<const_range_iterator,const_range_iterator>
|
|
|
|
rangeFind( sal_uInt16 type, const OUString& name ) const;
|
|
|
|
// Convenience function, which just uses type and name!
|
|
|
|
// To look for the exact object use find.
|
|
|
|
std::pair<const_range_iterator,const_range_iterator>
|
|
|
|
rangeFind( const value_type& x ) const;
|
|
|
|
// So we can actually check for end()
|
2015-06-20 20:23:44 +00:00
|
|
|
const_range_iterator rangeEnd() const { return m_TypeAndNameIndex.end(); }
|
2017-03-03 20:57:02 +01:00
|
|
|
const_iterator rangeProject( const_range_iterator const& position )
|
2015-06-20 20:23:44 +00:00
|
|
|
{ return m_Array.project<0>( position ); }
|
2015-04-10 21:32:36 +02:00
|
|
|
|
|
|
|
const value_type& operator[]( size_t index_ ) const
|
2015-06-20 20:23:44 +00:00
|
|
|
{ return m_PosIndex.operator[]( index_ ); }
|
|
|
|
const value_type& front() const { return m_PosIndex.front(); }
|
|
|
|
const value_type& back() const { return m_PosIndex.back(); }
|
|
|
|
const_iterator begin() const { return m_PosIndex.begin(); }
|
|
|
|
const_iterator end() const { return m_PosIndex.end(); }
|
2015-04-10 21:32:36 +02:00
|
|
|
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter, const char* pName) const;
|
2015-04-10 21:32:36 +02:00
|
|
|
|
2016-08-29 16:42:40 +02:00
|
|
|
virtual size_t GetFormatCount() const override { return m_Array.size(); }
|
|
|
|
virtual SwFormat* GetFormat(size_t idx) const override { return operator[]( idx ); }
|
2015-04-10 21:32:36 +02:00
|
|
|
|
2017-05-02 22:45:48 +02:00
|
|
|
/// fast check if given format is contained here
|
|
|
|
/// @precond pFormat must not have been deleted
|
2017-05-06 14:46:52 +01:00
|
|
|
bool ContainsFormat(SwFrameFormat const& rFormat) const;
|
2017-05-02 22:45:48 +02:00
|
|
|
/// not so fast check that given format is still alive (i.e. contained here)
|
|
|
|
bool IsAlive(SwFrameFormat const*) const;
|
2015-04-10 21:32:36 +02:00
|
|
|
|
|
|
|
void DeleteAndDestroyAll( bool keepDefault = false );
|
|
|
|
|
|
|
|
bool newDefault( const value_type& x );
|
|
|
|
void newDefault( const_iterator const& position );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// Unsorted, undeleting SwFrameFormat vector
|
|
|
|
class SwFrameFormatsV : public SwFormatsModifyBase<SwFrameFormat*>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SwFrameFormatsV() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwCharFormats : public SwFormatsModifyBase<SwCharFormat*>
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwTextFormatColls : public SwFormatsModifyBase<SwTextFormatColl*>
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwTextFormatColls() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
|
|
|
|
2012-09-02 09:05:03 +03:00
|
|
|
/// Array of Undo-history.
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwSectionFormats : public SwFormatsModifyBase<SwSectionFormat*>
|
2012-06-20 16:36:51 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2012-06-20 16:36:51 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-05-02 15:28:11 +01:00
|
|
|
class SwFieldTypes : public SwVectorModifyBase<SwFieldType*> {
|
|
|
|
public:
|
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-05-02 19:03:46 +02:00
|
|
|
class SwTOXTypes : public SwVectorModifyBase<SwTOXType*> {};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwNumRuleTable : public SwVectorModifyBase<SwNumRule*> {
|
2012-05-16 15:23:09 +02:00
|
|
|
public:
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2012-05-16 15:23:09 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
struct CompareSwRedlineTable
|
2012-07-20 17:16:03 +02:00
|
|
|
{
|
2014-01-13 17:58:25 +02:00
|
|
|
bool operator()(SwRangeRedline* const &lhs, SwRangeRedline* const &rhs) const;
|
2012-07-20 17:16:03 +02:00
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-03-14 15:27:42 +05:30
|
|
|
// Notification type for notifying about redlines to LOK clients
|
|
|
|
enum class RedlineNotification { Add, Remove, Modify };
|
|
|
|
|
2017-05-18 13:52:04 +01:00
|
|
|
typedef SwRangeRedline* SwRangeRedlinePtr;
|
|
|
|
|
2015-10-09 11:14:47 +02:00
|
|
|
class SwRedlineTable
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-10-09 11:14:47 +02:00
|
|
|
typedef o3tl::sorted_vector<SwRangeRedline*, CompareSwRedlineTable,
|
|
|
|
o3tl::find_partialorder_ptrequals> vector_type;
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
typedef vector_type::size_type size_type;
|
2017-03-02 18:24:40 +01:00
|
|
|
static constexpr size_type npos = USHRT_MAX;
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
//TODO: std::numeric_limits<size_type>::max()
|
2015-10-09 11:14:47 +02:00
|
|
|
private:
|
|
|
|
vector_type maVector;
|
|
|
|
public:
|
|
|
|
~SwRedlineTable();
|
2017-06-28 11:47:44 +02:00
|
|
|
bool Contains(const SwRangeRedline* p) const { return maVector.find(const_cast<SwRangeRedline*>(p)) != maVector.end(); }
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
size_type GetPos(const SwRangeRedline* p) const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-05-18 13:52:04 +01:00
|
|
|
bool Insert(SwRangeRedlinePtr& p);
|
|
|
|
bool Insert(SwRangeRedlinePtr& p, size_type& rInsPos);
|
|
|
|
bool InsertWithValidRanges(SwRangeRedlinePtr& p, size_type* pInsPos = nullptr);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
void Remove( size_type nPos );
|
2018-01-19 14:40:12 +02:00
|
|
|
void Remove( const SwRangeRedline* p );
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
void DeleteAndDestroy( size_type nPos, size_type nLen = 1 );
|
2012-07-20 17:16:03 +02:00
|
|
|
void DeleteAndDestroyAll();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-02-27 09:01:06 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2013-11-26 14:10:36 +02:00
|
|
|
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
size_type FindNextOfSeqNo( size_type nSttPos ) const;
|
|
|
|
size_type FindPrevOfSeqNo( size_type nSttPos ) const;
|
2012-09-02 09:05:03 +03:00
|
|
|
/** Search next or previous Redline with the same Seq. No.
|
2015-03-02 22:13:35 +01:00
|
|
|
Search can be restricted via Lookahead.
|
2015-03-01 08:47:53 +01:00
|
|
|
Using 0 makes search the whole array. */
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
size_type FindNextSeqNo( sal_uInt16 nSeqNo, size_type nSttPos ) const;
|
|
|
|
size_type FindPrevSeqNo( sal_uInt16 nSeqNo, size_type nSttPos ) const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-28 18:03:49 +02:00
|
|
|
/**
|
|
|
|
Find the redline at the given position.
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
@param tableIndex position in SwRedlineTable to start searching at, will be updated with the index of the returned
|
2014-04-28 18:03:49 +02:00
|
|
|
redline (or the next redline after the given position if not found)
|
|
|
|
@param next true: redline starts at position and ends after, false: redline starts before position and ends at or after
|
|
|
|
*/
|
Complete the transition of SwRedlineTable::size_type
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types
in the SwRedlineTable interface". This all started as an attempt to reduce the
number of places a to-be-committed improved loplugin:loopvartoosmall complains
about. Lets see where it ends...
SwRedlineTable::size_type is now the size_type of the underlying std::vector, no
longer sal_uInt16 from ancient times. I tried hard to find all places that are
affected by this change, changing types of affected variables and non-static
data members as needed. Some notes:
* The original code used USHRT_MAX as a "not found" value. I replaced that with
a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for
now of value USHRT_MAX. This should eventually be changed to something more
sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is
best done after we have constexpr support in all toolchains, so that npos can
be constexpr). It is important that the value of npos is towards positive
infinity, as many places in the code use
for (i = f(); // may return npos
i < table.size(); ++i)
table[i] ...
* There are some borders where values of SwRedlineTable::size_type are converted
into different types, for various reasons. But all of those other types
should be large enough for practical purposes (at least 32 bits wide):
MakrEntry::m_nIdx: long int
SvxRedlinTable::InsertEntry: sal_uIntPtr nPos
SwRangeRedline: size_t
SwRedlineItr: sal_Int32
SwVbaRevision::GetPosition: sal_Int32
SwXRedlines: sal_Int32
* .uno:TrackedChangeIndex= transports textual representations of such values.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as
strings, while SwTiledRenderingTest converts them to int.
* TODO: The one place I'm unsure about is SfxUInt16Items with IDs
FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE
in sw/source/uibase/uiview/view2.cxx. For now, I kept those as
SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from
those items. But I have no idea where instances of those items would actually
be created, and what it would mean to change those items' types?
Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8
Reviewed-on: https://gerrit.libreoffice.org/34775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02 08:35:18 +01:00
|
|
|
const SwRangeRedline* FindAtPosition( const SwPosition& startPosition, size_type& tableIndex, bool next = true ) const;
|
2014-04-28 18:03:49 +02:00
|
|
|
|
2015-10-09 11:14:47 +02:00
|
|
|
bool empty() const { return maVector.empty(); }
|
|
|
|
size_type size() const { return maVector.size(); }
|
|
|
|
SwRangeRedline* operator[]( size_type idx ) const { return maVector[idx]; }
|
|
|
|
vector_type::const_iterator begin() const { return maVector.begin(); }
|
|
|
|
vector_type::const_iterator end() const { return maVector.end(); }
|
|
|
|
void Resort() { maVector.Resort(); }
|
2017-03-14 15:27:42 +05:30
|
|
|
|
2017-11-13 00:20:20 +01:00
|
|
|
// Notifies all LOK clients when redlines are added/modified/removed
|
2017-03-16 19:33:48 +05:30
|
|
|
static void LOKRedlineNotification(RedlineNotification eType, SwRangeRedline* pRedline);
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2017-11-13 00:20:20 +01:00
|
|
|
/// Table that holds 'extra' redlines, such as 'table row insert/delete', 'paragraph moves' etc...
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwExtraRedlineTable
|
2014-01-16 16:51:09 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::vector<SwExtraRedline*> m_aExtraRedlines;
|
|
|
|
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
~SwExtraRedlineTable();
|
2014-01-16 16:51:09 +02:00
|
|
|
|
2018-01-19 14:40:12 +02:00
|
|
|
void Insert( SwExtraRedline* p );
|
2014-01-16 16:51:09 +02:00
|
|
|
|
|
|
|
void DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen = 1 );
|
|
|
|
void DeleteAndDestroyAll();
|
|
|
|
|
2015-03-02 07:51:53 +01:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
|
2014-01-16 16:51:09 +02:00
|
|
|
|
|
|
|
sal_uInt16 GetSize() const { return m_aExtraRedlines.size(); }
|
|
|
|
SwExtraRedline* GetRedline( sal_uInt16 uIndex ) const { return m_aExtraRedlines.operator[]( uIndex ); }
|
2014-03-23 13:19:15 +02:00
|
|
|
|
2015-06-18 01:22:54 +05:30
|
|
|
SW_DLLPUBLIC bool DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTable, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete );
|
2014-03-23 13:19:15 +02:00
|
|
|
bool DeleteTableRowRedline ( SwDoc* pDoc, const SwTableLine& rTableLine, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete );
|
|
|
|
bool DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& rTableBox, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete );
|
2014-01-16 16:51:09 +02:00
|
|
|
};
|
|
|
|
|
2014-10-18 19:26:00 +09:00
|
|
|
typedef std::vector<SwOLENode*> SwOLENodes;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#endif // INCLUDED_SW_INC_DOCARY_HXX
|
2001-01-23 09:42:57 +00:00
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|