diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-04-18 16:30:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-18 18:20:56 +0200 |
commit | 383b55a38da0d92b4499f38b4d7f5ff036e0072f (patch) | |
tree | e787369e9f1b1916eab21abcff8ab66516631962 /editeng/inc | |
parent | 4845e68e6575030464c260406b667f0a51bf4a9e (diff) |
tdf#148620 Crash in Draw using Format > Lists > Move Down
This reverts
commit 35f03f26799747894d1534796b6cb227bd4f233b
speed up loading large ODS a little
since ImpEditEngine::ImpMoveParagraphs wants to manipulate
ParaPortion's and also identify them by pointer
Also convert the OSL_ASSERT in this method to an assert
to catch such problems earlier
Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/inc')
-rw-r--r-- | editeng/inc/editdoc.hxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 4d4de9497b67..b37fefd40bd0 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -433,10 +433,8 @@ class TextPortionList PortionsType maPortions; public: - TextPortionList(); - ~TextPortionList(); - TextPortionList(TextPortionList&&) = default; - TextPortionList& operator=(TextPortionList&&) = default; + TextPortionList(); + ~TextPortionList(); void Reset(); sal_Int32 FindPortion( @@ -477,7 +475,9 @@ private: bool bInvalid:1; // for skillful formatting public: - EditLine(); + EditLine(); + EditLine( const EditLine& ); + ~EditLine(); bool IsIn( sal_Int32 nIndex ) const { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); } @@ -532,6 +532,7 @@ public: EditLine* Clone() const; + EditLine& operator = ( const EditLine& rLine ); friend bool operator == ( const EditLine& r1, const EditLine& r2 ); }; @@ -543,10 +544,8 @@ class EditLineList LinesType maLines; public: - EditLineList(); - ~EditLineList(); - EditLineList(EditLineList&&) = default; - EditLineList& operator=(EditLineList&&) = default; + EditLineList(); + ~EditLineList(); void Reset(); void DeleteFromLine(sal_Int32 nDelFrom); @@ -583,11 +582,11 @@ private: bool bVisible : 1; // Belongs to the node! bool bForceRepaint : 1; + ParaPortion( const ParaPortion& ) = delete; + public: - ParaPortion( ContentNode* pNode ); - ~ParaPortion(); - ParaPortion( ParaPortion&& ) = default; - ParaPortion& operator=( ParaPortion&& ) = default; + ParaPortion( ContentNode* pNode ); + ~ParaPortion(); sal_Int32 GetLineNumber( sal_Int32 nIndex ) const; @@ -634,7 +633,7 @@ public: class ParaPortionList { mutable sal_Int32 nLastCache; - std::vector<ParaPortion> maPortions; + std::vector<std::unique_ptr<ParaPortion>> maPortions; public: ParaPortionList(); ~ParaPortionList(); @@ -647,12 +646,13 @@ 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; - ParaPortion Remove(sal_Int32 nPos); - ParaPortion& Insert(sal_Int32 nPos, ParaPortion&& p); - void Append(ParaPortion&& p); + 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); sal_Int32 Count() const; #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG |