diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-02-23 21:26:34 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-02-24 10:25:22 +0000 |
commit | 288d694ff695ef83cbe4224db87dd65281c75a8f (patch) | |
tree | 00037a09f1c9673a013e2a27331d14e892f2a98d /editeng | |
parent | 91242645788f4a5806dfc2a8cf4918acda9ca9a6 (diff) |
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@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 291a0676891c..98712ddf7a74 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 9a6b009bbdd4..1453427b29cb 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -732,7 +732,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 ); |