summaryrefslogtreecommitdiff
path: root/editeng/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-04 10:56:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-04 13:19:01 +0200
commit35f03f26799747894d1534796b6cb227bd4f233b (patch)
tree7fe8a9581accad08e5015655f52c5ffd838e927b /editeng/inc
parente2bdd31c0231444f1ba1463bffb5656c230c3073 (diff)
speed up loading large ODS a little
by flattening the ParaPortionList, which reduces allocations Change-Id: I7b350335e336f92bb048905c2b2f06378c8a3423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115061 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/inc')
-rw-r--r--editeng/inc/editdoc.hxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index 9b35cfeaa028..7017516445f6 100644
--- a/editeng/inc/editdoc.hxx
+++ b/editeng/inc/editdoc.hxx
@@ -433,8 +433,10 @@ class TextPortionList
PortionsType maPortions;
public:
- TextPortionList();
- ~TextPortionList();
+ TextPortionList();
+ ~TextPortionList();
+ TextPortionList(TextPortionList&&) = default;
+ TextPortionList& operator=(TextPortionList&&) = default;
void Reset();
sal_Int32 FindPortion(
@@ -475,9 +477,7 @@ private:
bool bInvalid:1; // for skillful formatting
public:
- EditLine();
- EditLine( const EditLine& );
- ~EditLine();
+ EditLine();
bool IsIn( sal_Int32 nIndex ) const
{ return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); }
@@ -532,7 +532,6 @@ public:
EditLine* Clone() const;
- EditLine& operator = ( const EditLine& rLine );
friend bool operator == ( const EditLine& r1, const EditLine& r2 );
};
@@ -544,8 +543,10 @@ class EditLineList
LinesType maLines;
public:
- EditLineList();
- ~EditLineList();
+ EditLineList();
+ ~EditLineList();
+ EditLineList(EditLineList&&) = default;
+ EditLineList& operator=(EditLineList&&) = default;
void Reset();
void DeleteFromLine(sal_Int32 nDelFrom);
@@ -582,11 +583,11 @@ private:
bool bVisible : 1; // Belongs to the node!
bool bForceRepaint : 1;
- ParaPortion( const ParaPortion& ) = delete;
-
public:
- ParaPortion( ContentNode* pNode );
- ~ParaPortion();
+ ParaPortion( ContentNode* pNode );
+ ~ParaPortion();
+ ParaPortion( ParaPortion&& ) = default;
+ ParaPortion& operator=( ParaPortion&& ) = default;
sal_Int32 GetLineNumber( sal_Int32 nIndex ) const;
@@ -633,7 +634,7 @@ public:
class ParaPortionList
{
mutable sal_Int32 nLastCache;
- std::vector<std::unique_ptr<ParaPortion>> maPortions;
+ std::vector<ParaPortion> maPortions;
public:
ParaPortionList();
~ParaPortionList();
@@ -646,13 +647,12 @@ public:
ParaPortion* SafeGetObject(sal_Int32 nPos);
sal_Int32 GetPos(const ParaPortion* p) const;
- ParaPortion* operator[](sal_Int32 nPos);
- const ParaPortion* operator[](sal_Int32 nPos) const;
+ ParaPortion& operator[](sal_Int32 nPos);
+ const ParaPortion& operator[](sal_Int32 nPos) const;
- std::unique_ptr<ParaPortion> Release(sal_Int32 nPos);
- void Remove(sal_Int32 nPos);
- void Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p);
- void Append(std::unique_ptr<ParaPortion> p);
+ ParaPortion Remove(sal_Int32 nPos);
+ ParaPortion& Insert(sal_Int32 nPos, ParaPortion&& p);
+ void Append(ParaPortion&& p);
sal_Int32 Count() const;
#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG