editeng/source/editeng/editdoc.hxx | 10 +++++----- editeng/source/editeng/impedit3.cxx | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-)
New commits: commit 04f75cd35e5e2657fcb8033fc88dc8abce9cd90e Author: Marco Cecchetti <marco.cecche...@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 <c...@libreoffice.org> Reviewed-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 288d694ff695ef83cbe4224db87dd65281c75a8f) Reviewed-on: https://gerrit.libreoffice.org/34605 Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> (cherry picked from commit 4b0faa318888f94a8a9034faa2f54f641be1a17c) Reviewed-on: https://gerrit.libreoffice.org/34675 diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 601e4bf..5ae040b 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -478,7 +478,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; @@ -532,7 +532,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 ); @@ -592,7 +592,7 @@ private: sal_Int32 nInvalidPosStart; sal_Int32 nFirstLineOffset; // For Writer-LineSpacing-Interpretation - sal_uInt16 nBulletX; + sal_Int32 nBulletX; sal_Int32 nInvalidDiff; bool bInvalid : 1; @@ -618,8 +618,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 15afde8..ca7f220 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -738,7 +738,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 } @@ -1608,23 +1608,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(); } @@ -1657,11 +1657,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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits