summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-02-23 21:26:34 +0100
committerMarco Cecchetti <mrcekets@gmail.com>2017-02-28 17:06:43 +0000
commit04f75cd35e5e2657fcb8033fc88dc8abce9cd90e (patch)
treead187da63f48c94d07ccbd0f4fbc4ae6dc80e74e
parent496438dbe45c4ef94c57a6bbc1d4fa286182efee (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> (cherry picked from commit 288d694ff695ef83cbe4224db87dd65281c75a8f) Reviewed-on: https://gerrit.libreoffice.org/34605 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com> (cherry picked from commit 4b0faa318888f94a8a9034faa2f54f641be1a17c) Reviewed-on: https://gerrit.libreoffice.org/34675
-rw-r--r--editeng/source/editeng/editdoc.hxx10
-rw-r--r--editeng/source/editeng/impedit3.cxx16
2 files changed, 13 insertions, 13 deletions
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 601e4bf37ab6..5ae040b1386b 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 15afde88d8e8..ca7f220c71f3 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 );