[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - editeng/source

Marco Cecchetti marco.cecchetti at collabora.com
Fri Feb 24 10:30:27 UTC 2017


 editeng/source/editeng/editdoc.hxx  |   10 +++++-----
 editeng/source/editeng/impedit3.cxx |   16 ++++++++--------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 4b0faa318888f94a8a9034faa2f54f641be1a17c
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Thu Feb 23 21:26:34 2017 +0100

    LOK - Calc: Text is not visible in cell when entering numerical input
    
    Problem
    The issue occurs when you double click and enter a numerical input in
    a cell which belongs to one of the front colums.
    
    Findings
    After a bit of investigation I detected that the problem shows up when
    the spreedsheet width is increased by invoking
    ScViewData::SetMaxTiledCol.
    Indeed the problem occurs whenever the spreadsheet width is larger
    than 2^16 twips.
    
    Solution
    By changing the type of some variables from sal_uInt16 to long in all
    involved contexts, the problem disappeared.
    
    Change-Id: Ia6c6c258b0644f03c897e7b4bcaded967f21537c
    Reviewed-on: https://gerrit.libreoffice.org/34597
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 288d694ff695ef83cbe4224db87dd65281c75a8f)
    Reviewed-on: https://gerrit.libreoffice.org/34605
    Reviewed-by: Marco Cecchetti <mrcekets at gmail.com>
    Tested-by: Marco Cecchetti <mrcekets at gmail.com>

diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 51b9ac2..fbc99a7 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -471,7 +471,7 @@ public:
 private:
     CharPosArrayType aPositions;
     long            nTxtWidth;
-    sal_uInt16          nStartPosX;
+    long            nStartPosX;
     sal_Int32          nStart;     // could be replaced by nStartPortion
     sal_Int32          nEnd;       // could be replaced by nEndPortion
     sal_Int32          nStartPortion;
@@ -525,7 +525,7 @@ public:
 
     sal_Int32       GetLen() const                  { return nEnd - nStart; }
 
-    sal_uInt16      GetStartPosX() const            { return nStartPosX; }
+    long            GetStartPosX() const            { return nStartPosX; }
     void            SetStartPosX( long start );
     Size            CalcTextSize( ParaPortion& rParaPortion );
 
@@ -585,7 +585,7 @@ private:
 
     sal_Int32              nInvalidPosStart;
     sal_Int32              nFirstLineOffset;   // For Writer-LineSpacing-Interpretation
-    sal_uInt16             nBulletX;
+    sal_Int32             nBulletX;
     sal_Int32              nInvalidDiff;
 
     bool                bInvalid            : 1;
@@ -611,8 +611,8 @@ public:
     bool                MustRepaint() const         { return bForceRepaint; }
     void                SetMustRepaint( bool bRP )  { bForceRepaint = bRP; }
 
-    sal_uInt16          GetBulletX() const          { return nBulletX; }
-    void                SetBulletX( sal_uInt16 n )      { nBulletX = n; }
+    sal_Int32           GetBulletX() const          { return nBulletX; }
+    void                SetBulletX( sal_Int32 n )   { nBulletX = n; }
 
     void                MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff);
     void                MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 nEnd );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 9334293..cf66a4d 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -733,7 +733,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
     {
         aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
         if ( aBulletArea.Right() > 0 )
-            pParaPortion->SetBulletX( (sal_uInt16) GetXValue( aBulletArea.Right() ) );
+            pParaPortion->SetBulletX( (sal_Int32) GetXValue( aBulletArea.Right() ) );
         else
             pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly
     }
@@ -1643,23 +1643,23 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn
     sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pParaPortion->GetNode(), &nSpaceBefore );
     const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pParaPortion->GetNode() );
     const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pParaPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ));
-    short nStartX = GetXValue( (short)(rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBefore));
+    long nStartX = GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBefore );
 
     Rectangle aBulletArea = Rectangle( Point(), Point() );
     if ( bLineBreak )
     {
-        nStartX = (short)GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBeforeAndMinLabelWidth );
+        nStartX = GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBeforeAndMinLabelWidth );
     }
     else
     {
         aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
         if ( aBulletArea.Right() > 0 )
-            pParaPortion->SetBulletX( (sal_uInt16) GetXValue( aBulletArea.Right() ) );
+            pParaPortion->SetBulletX( (sal_Int32) GetXValue( aBulletArea.Right() ) );
         else
             pParaPortion->SetBulletX( 0 ); // If Bullet set incorrectly.
         if ( pParaPortion->GetBulletX() > nStartX )
         {
-            nStartX = (short)GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBeforeAndMinLabelWidth );
+            nStartX = GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOfst() + nSpaceBeforeAndMinLabelWidth );
             if ( pParaPortion->GetBulletX() > nStartX )
                 nStartX = pParaPortion->GetBulletX();
         }
@@ -1692,11 +1692,11 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn
         if ( nMaxLineWidth < 0 )
             nMaxLineWidth = 1;
         if ( eJustification ==  SVX_ADJUST_CENTER )
-            nStartX = sal::static_int_cast< short >(nMaxLineWidth / 2);
+            nStartX = nMaxLineWidth / 2;
         else if ( eJustification ==  SVX_ADJUST_RIGHT )
-            nStartX = sal::static_int_cast< short >(nMaxLineWidth);
+            nStartX = nMaxLineWidth;
 
-        nStartX = sal::static_int_cast< short >(nStartX + nTextXOffset);
+        nStartX = nStartX + nTextXOffset;
     }
 
     pTmpLine->SetStartPosX( nStartX );


More information about the Libreoffice-commits mailing list