From fda1a37673f9b69b5422ea90572631e20174918e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 13 Nov 2014 13:37:58 +0000 Subject: [PATCH] fix impress table layout cache wrt wrong table selection border --- ...layout-cache-returns-wrong-rectangle.patch | 79 +++++++++++++++++++ libreoffice.spec | 4 + 2 files changed, 83 insertions(+) create mode 100644 0001-table-layout-cache-returns-wrong-rectangle.patch diff --git a/0001-table-layout-cache-returns-wrong-rectangle.patch b/0001-table-layout-cache-returns-wrong-rectangle.patch new file mode 100644 index 0000000..628baec --- /dev/null +++ b/0001-table-layout-cache-returns-wrong-rectangle.patch @@ -0,0 +1,79 @@ +From f79f3d1322b396f5f45ccd7742015749e93ac57b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 13 Nov 2014 13:32:35 +0000 +Subject: [PATCH] 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 + +Change-Id: I4f09594d82c1597204afbd059e175af9bf8e2527 +(cherry picked from commit 98cd2671f0a215ced6203372ac673e2380031ac0) +--- + svx/source/table/svdotable.cxx | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +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; + } + } + } +-- +1.9.3 + diff --git a/libreoffice.spec b/libreoffice.spec index 65d371d..6ce2455 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -341,6 +341,7 @@ Patch43: 0001-strip-off-hard-coded-numbering-from-outliner-preview.patch Patch44: 0001-have-a-stab-at-improving-impossible-question.patch Patch45: 0001-just-use-ANSI-C-declarations.patch Patch46: 0001-valgrind-check-return-of-convertDateTime-before-usin.patch +Patch47: 0001-table-layout-cache-returns-wrong-rectangle.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2307,6 +2308,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Thu Nov 13 2014 Caolán McNamara - 1:4.3.4.1-2 +- fix impress table layout cache wrt wrong table selection border + * Tue Nov 11 2014 David Tardon - 1:4.3.4.1-1 - update to 4.3.4 rc1