summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-12-29 21:05:01 +0900
committerTomaž Vajngerl <quikee@gmail.com>2024-01-01 09:20:57 +0100
commitee2164d484541e0b45a40aad619d0db31afde634 (patch)
tree7d92b3ee47869c63c0dd4d1d13ef9e01220e7460 /editeng
parent7e378516bc596d0308bcb1c974760c224f516ea6 (diff)
editeng: simplify constr. and destr. of ParaPortion{List}
Change-Id: I8f7e242b66463baa9adcc0dee8eb8f4206630c7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161477 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/ParagraphPortion.hxx26
-rw-r--r--editeng/inc/ParagraphPortionList.hxx5
-rw-r--r--editeng/source/editeng/editdoc.cxx26
3 files changed, 16 insertions, 41 deletions
diff --git a/editeng/inc/ParagraphPortion.hxx b/editeng/inc/ParagraphPortion.hxx
index 93eb8356f611..e788bb7c9112 100644
--- a/editeng/inc/ParagraphPortion.hxx
+++ b/editeng/inc/ParagraphPortion.hxx
@@ -60,27 +60,29 @@ class ParaPortion
private:
EditLineList aLineList;
TextPortionList aTextPortionList;
- ContentNode* pNode;
- tools::Long nHeight;
+ ContentNode* pNode = nullptr;
+ tools::Long nHeight = 0;
ScriptTypePosInfos aScriptInfos;
WritingDirectionInfos aWritingDirectionInfos;
- sal_Int32 nInvalidPosStart;
- sal_Int32 nFirstLineOffset; // For Writer-LineSpacing-Interpretation
- sal_Int32 nBulletX;
- sal_Int32 nInvalidDiff;
+ sal_Int32 nInvalidPosStart = 0;
+ sal_Int32 nFirstLineOffset = 0; // For Writer-LineSpacing-Interpretation
+ sal_Int32 nBulletX = 0;
+ sal_Int32 nInvalidDiff = 0;
- bool bInvalid : 1;
- bool bSimple : 1; // only linear Tap
- bool bVisible : 1; // Belongs to the node!
- bool bForceRepaint : 1;
+ bool bInvalid : 1 = true;
+ bool bSimple : 1 = false; // only linear Tap
+ bool bVisible : 1 = true; // Belongs to the node!
+ bool bForceRepaint : 1 = false;
ParaPortion(const ParaPortion&) = delete;
public:
- ParaPortion(ContentNode* pNode);
- ~ParaPortion();
+ ParaPortion(ContentNode* pN)
+ : pNode(pN)
+ {
+ }
sal_Int32 GetLineNumber(sal_Int32 nIndex) const;
diff --git a/editeng/inc/ParagraphPortionList.hxx b/editeng/inc/ParagraphPortionList.hxx
index 8964c9767ba7..23654adc5e43 100644
--- a/editeng/inc/ParagraphPortionList.hxx
+++ b/editeng/inc/ParagraphPortionList.hxx
@@ -27,12 +27,11 @@ class EditDoc;
class ParaPortionList
{
- mutable sal_Int32 nLastCache;
+ mutable sal_Int32 nLastCache = 0;
std::vector<std::unique_ptr<ParaPortion>> maPortions;
public:
- ParaPortionList();
- ~ParaPortionList();
+ ParaPortionList() = default;
void Reset();
tools::Long GetYOffset(const ParaPortion* pPPortion) const;
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 6091c78ede4c..fdfd74edb09a 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -367,24 +367,6 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sa
return nullptr;
}
-ParaPortion::ParaPortion( ContentNode* pN ) :
- pNode(pN),
- nHeight(0),
- nInvalidPosStart(0),
- nFirstLineOffset(0),
- nBulletX(0),
- nInvalidDiff(0),
- bInvalid(true),
- bSimple(false),
- bVisible(true),
- bForceRepaint(false)
-{
-}
-
-ParaPortion::~ParaPortion()
-{
-}
-
void ParaPortion::MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff )
{
if ( !bInvalid )
@@ -539,14 +521,6 @@ sal_Int32 FastGetPos(const Array& rArray, const Val* p, sal_Int32& rLastPos)
}
-ParaPortionList::ParaPortionList() : nLastCache( 0 )
-{
-}
-
-ParaPortionList::~ParaPortionList()
-{
-}
-
sal_Int32 ParaPortionList::GetPos(const ParaPortion* p) const
{
return FastGetPos(maPortions, p, nLastCache);