summaryrefslogtreecommitdiff
path: root/svx/source/table/cell.cxx
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-06-23 19:20:07 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-24 09:14:39 +0000
commita64eda5c5f754b7534d2d62ac9a1f13165621533 (patch)
tree665980197f59da1895d86e13e3c8210c653bec24 /svx/source/table/cell.cxx
parent69987ea99a722cb4b3e2df3132b89bacd0a5b862 (diff)
Related bnc#822625: Minimum height was not invalidated when rectangle changes.
5792e76cb5beb630c135f57b74f57d74dd2dc2b0 was too optimistic and did not invalidate mnCachedMinHeight often enough. This was resulting in a grey area below table frame when resizing it. So, revert 5792e76cb5beb630c135f57b74f57d74dd2dc2b0 "Related bnc#822625: Cache minimum height for table cells." and istead just use getMinimumWidth() in TableLayouter if that's all we need. getMinimumHeight() is expensive. Change-Id: I34c49dda75d6ccccaa5b4d3746114352621a40dd (cherry picked from commit b8f7ea5da41d61d405adec54dcd10b54ee0e5591) Reviewed-on: https://gerrit.libreoffice.org/9871 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/table/cell.cxx')
-rw-r--r--svx/source/table/cell.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 7e04db74f313..d4f199bf07e6 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -358,7 +358,6 @@ Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) th
, mbMerged( sal_False )
, mnRowSpan( 1 )
, mnColSpan( 1 )
-, mnCachedMinHeight( -1 )
, mxTable( rTableObj.getTable() )
{
if( rTableObj.GetModel() )
@@ -525,7 +524,6 @@ void Cell::setMerged()
void Cell::notifyModified()
{
- mnCachedMinHeight = -1;
if( mxTable.is() )
mxTable->setModified( sal_True );
}
@@ -682,10 +680,8 @@ sal_Int32 Cell::getMinimumHeight()
if( !mpProperties )
return 0;
- if( mnCachedMinHeight != -1 )
- return mnCachedMinHeight;
-
SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ sal_Int32 nMinimumHeight = 0;
Rectangle aTextRect;
TakeTextAnchorRect( aTextRect );
@@ -696,7 +692,7 @@ sal_Int32 Cell::getMinimumHeight()
if(pEditOutliner)
{
pEditOutliner->SetMaxAutoPaperSize(aSize);
- mnCachedMinHeight = pEditOutliner->GetTextHeight()+1;
+ nMinimumHeight = pEditOutliner->GetTextHeight()+1;
}
else /*if ( hasText() )*/
{
@@ -709,12 +705,12 @@ sal_Int32 Cell::getMinimumHeight()
{
rOutliner.SetText(*GetOutlinerParaObject());
}
- mnCachedMinHeight=rOutliner.GetTextHeight()+1;
+ nMinimumHeight=rOutliner.GetTextHeight()+1;
rOutliner.Clear();
}
- mnCachedMinHeight += GetTextUpperDistance() + GetTextLowerDistance();
- return mnCachedMinHeight;
+ nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
+ return nMinimumHeight;
}
// -----------------------------------------------------------------------------