[Libreoffice-commits] core.git: editeng/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Mon Dec 5 19:25:43 UTC 2016


 editeng/source/editeng/editdoc.cxx |   82 +++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 44 deletions(-)

New commits:
commit dce3d70d269263f35ac6921d61ee6569e75cadbf
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sun Dec 4 16:10:05 2016 +0100

    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 at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index fe4ae42..126a5da 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 )


More information about the Libreoffice-commits mailing list