summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-12-04 16:10:05 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-05 19:25:10 +0000
commitdce3d70d269263f35ac6921d61ee6569e75cadbf (patch)
tree7ae903a1171c45d99e3008c313bb9017f45a246b /editeng
parent7006568138b5b2d2c11dd558049cd4085c449c9e (diff)
use initialization list
guess comments in EditSelection ctors were about calling copy-ctor directly instead of default-ctor + copy assign Change-Id: I0f849d7e9af3d3b8c6d8688f549b3539a0c67873 Reviewed-on: https://gerrit.libreoffice.org/31632 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx82
1 files changed, 38 insertions, 44 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index fe4ae42b3071..126a5dae8f2a 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -552,19 +552,18 @@ void ExtraPortionInfo::SaveOrgDXArray( const long* pDXArray, sal_Int32 nLen )
pOrgDXArray = nullptr;
}
-ParaPortion::ParaPortion( ContentNode* pN )
+ParaPortion::ParaPortion( ContentNode* pN ) :
+ pNode(pN),
+ nHeight(0),
+ nInvalidPosStart(0),
+ nFirstLineOffset(0),
+ nBulletX(0),
+ nInvalidDiff(0),
+ bInvalid(true),
+ bSimple(false),
+ bVisible(true),
+ bForceRepaint(false)
{
-
- pNode = pN;
- bInvalid = true;
- bVisible = true;
- bSimple = false;
- bForceRepaint = false;
- nInvalidPosStart = 0;
- nInvalidDiff = 0;
- nHeight = 0;
- nFirstLineOffset = 0;
- nBulletX = 0;
}
ParaPortion::~ParaPortion()
@@ -964,38 +963,36 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map
}
EditLine::EditLine() :
+ nTxtWidth(0),
+ nStartPosX(0),
+ nStart(0),
+ nEnd(0),
+ nStartPortion(0), // to be able to tell the difference between a line
+ // without Portions from one with the Portion number 0
+ nEndPortion(0),
+ nHeight(0),
+ nTxtHeight(0),
+ nCrsrHeight(0),
+ nMaxAscent(0),
bHangingPunctuation(false),
bInvalid(true)
{
-
- nStart = nEnd = 0;
- nStartPortion = 0; // to be able to tell the difference between a line
- // without Portions from one with the Portion number 0
- nEndPortion = 0;
- nHeight = 0;
- nStartPosX = 0;
- nTxtHeight = 0;
- nTxtWidth = 0;
- nCrsrHeight = 0;
- nMaxAscent = 0;
}
EditLine::EditLine( const EditLine& r ) :
+ nTxtWidth(0),
+ nStartPosX(0),
+ nStart(r.nStart),
+ nEnd(r.nEnd),
+ nStartPortion(r.nStartPortion),
+ nEndPortion(r.nEndPortion),
+ nHeight(0),
+ nTxtHeight(0),
+ nCrsrHeight(0),
+ nMaxAscent(0),
bHangingPunctuation(r.bHangingPunctuation),
bInvalid(true)
{
-
- nEnd = r.nEnd;
- nStart = r.nStart;
- nStartPortion = r.nStartPortion;
- nEndPortion = r.nEndPortion;
-
- nHeight = 0;
- nStartPosX = 0;
- nTxtHeight = 0;
- nTxtWidth = 0;
- nCrsrHeight = 0;
- nMaxAscent = 0;
}
EditLine::~EditLine()
@@ -1188,19 +1185,16 @@ EditSelection::EditSelection()
{
}
-EditSelection::EditSelection( const EditPaM& rStartAndAnd )
+EditSelection::EditSelection( const EditPaM& rStartAndAnd ) :
+ aStartPaM(rStartAndAnd),
+ aEndPaM(rStartAndAnd)
{
- // could still be optimized!
- // do no first call the Def-constructor from PaM!
- aStartPaM = rStartAndAnd;
- aEndPaM = rStartAndAnd;
}
-EditSelection::EditSelection( const EditPaM& rStart, const EditPaM& rEnd )
+EditSelection::EditSelection( const EditPaM& rStart, const EditPaM& rEnd ) :
+ aStartPaM(rStart),
+ aEndPaM(rEnd)
{
- // could still be optimized!
- aStartPaM = rStart;
- aEndPaM = rEnd;
}
EditSelection& EditSelection::operator = ( const EditPaM& rPaM )