[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - svx/source
Caolán McNamara
caolanm at redhat.com
Thu Nov 13 08:33:09 PST 2014
svx/source/table/svdotable.cxx | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
New commits:
commit 5839f0c4b98b37327a80b3fbe66d3b28459737b0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 13 13:32:35 2014 +0000
impress table layout cache returns wrong rectangle
the layouter can modify its input rectangle to grow
it to the necessary size to contain the layout
but we're returning the input rectangle when the inputs are the same as the
last call, not returning the output rectangle.
cache the output rect for a given input and return that
so now insert->table in impress and tab so extra cells are added and
then select the table and the blue border contains the whole
table, not just the first two rows
(cherry picked from commit 98cd2671f0a215ced6203372ac673e2380031ac0)
Change-Id: I4f09594d82c1597204afbd059e175af9bf8e2527
Reviewed-on: https://gerrit.libreoffice.org/12406
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index d49cfb3..fbd532a 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -244,7 +244,8 @@ public:
virtual bool isInUse() SAL_OVERRIDE;
private:
static SdrTableObjImpl* lastLayoutTable;
- static Rectangle lastLayoutRectangle;
+ static Rectangle lastLayoutInputRectangle;
+ static Rectangle lastLayoutResultRectangle;
static bool lastLayoutFitWidth;
static bool lastLayoutFitHeight;
static WritingMode lastLayoutMode;
@@ -253,7 +254,8 @@ private:
};
SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = NULL;
-Rectangle SdrTableObjImpl::lastLayoutRectangle;
+Rectangle SdrTableObjImpl::lastLayoutInputRectangle;
+Rectangle SdrTableObjImpl::lastLayoutResultRectangle;
bool SdrTableObjImpl::lastLayoutFitWidth;
bool SdrTableObjImpl::lastLayoutFitHeight;
WritingMode SdrTableObjImpl::lastLayoutMode;
@@ -696,14 +698,14 @@ void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHe
// Optimization: SdrTableObj::SetChanged() can call this very often, repeatedly
// with the same settings, noticeably increasing load time. Skip if already done.
WritingMode writingMode = mpTableObj->GetWritingMode();
- if( lastLayoutTable != this || lastLayoutRectangle != rArea
+ if( lastLayoutTable != this || lastLayoutInputRectangle != rArea
|| lastLayoutFitWidth != bFitWidth || lastLayoutFitHeight != bFitHeight
|| lastLayoutMode != writingMode
|| lastRowCount != getRowCount()
|| lastColCount != getColumnCount() )
{
lastLayoutTable = this;
- lastLayoutRectangle = rArea;
+ lastLayoutInputRectangle = rArea;
lastLayoutFitWidth = bFitWidth;
lastLayoutFitHeight = bFitHeight;
lastLayoutMode = writingMode;
@@ -711,6 +713,11 @@ void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHe
lastColCount = getColumnCount();
TableModelNotifyGuard aGuard( mxTable.get() );
mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
+ lastLayoutResultRectangle = rArea;
+ }
+ else
+ {
+ rArea = lastLayoutResultRectangle;
}
}
}
More information about the Libreoffice-commits
mailing list