From c1307e3f9e21fb97f53161192bbe820a68382ffb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Nov 19 2014 13:42:06 +0000 Subject: unbreak tables in impress --- diff --git a/0001-impress-tables-are-not-interactively-growing.patch b/0001-impress-tables-are-not-interactively-growing.patch new file mode 100644 index 0000000..26cb866 --- /dev/null +++ b/0001-impress-tables-are-not-interactively-growing.patch @@ -0,0 +1,55 @@ +From 5a958aa9d95f0c14e4980f6909550e657d87a3a9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 13 Nov 2014 14:31:09 +0000 +Subject: [PATCH] impress tables are not interactively growing + +the optimization here stops tables growing as their text +contents change in editing mode + +So, just recalculate if the table could grow and its +being interactively edited, which leaves the original +(dubious ?) load-time optimization in place + +Change-Id: I894acf47d34ec8b68aaf9076b5a0cb7e29c38a17 +(cherry picked from commit 22ef69b25fa60f4543dc72cb7a8d2f88b789ce43) +--- + svx/source/table/svdotable.cxx | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx +index fbd532a..856a9e5 100644 +--- a/svx/source/table/svdotable.cxx ++++ b/svx/source/table/svdotable.cxx +@@ -689,16 +689,17 @@ sal_Int32 SdrTableObjImpl::getRowCount() const + return mxTable.is() ? mxTable->getRowCount() : 0; + } + +- +- + void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHeight ) + { + if( mpLayouter && mpTableObj->GetModel() ) + { + // Optimization: SdrTableObj::SetChanged() can call this very often, repeatedly + // with the same settings, noticeably increasing load time. Skip if already done. ++ bool bInteractiveMightGrowBecauseTextChanged = ++ mpTableObj->IsRealyEdited() && (mpTableObj->IsAutoGrowHeight() || mpTableObj->IsAutoGrowWidth()); + WritingMode writingMode = mpTableObj->GetWritingMode(); +- if( lastLayoutTable != this || lastLayoutInputRectangle != rArea ++ if( bInteractiveMightGrowBecauseTextChanged ++ || lastLayoutTable != this || lastLayoutInputRectangle != rArea + || lastLayoutFitWidth != bFitWidth || lastLayoutFitHeight != bFitHeight + || lastLayoutMode != writingMode + || lastRowCount != getRowCount() +@@ -722,8 +723,6 @@ void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHe + } + } + +- +- + void SdrTableObjImpl::UpdateCells( Rectangle& rArea ) + { + if( mpLayouter && mxTable.is() ) +-- +1.9.3 + 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 9812325..98b02e9 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -36,7 +36,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 7%{?libo_prerelease}%{?dist} +Release: 8%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 Group: Applications/Productivity URL: http://www.libreoffice.org/ @@ -321,6 +321,8 @@ Patch65: 0001-resolved-fdo-82936-do-not-clear-the-3D-flag-on-refup.patch Patch66: 0001-fdo-85282-Correct-adjustment-of-range-reference-on-d.patch Patch67: 0001-Resolves-fdo-65634-improve-wheel-scrolling-sidebar-p.patch Patch68: 0001-Related-fdo-65634-make-sidebar-react-to-resizes-when.patch +Patch69: 0001-table-layout-cache-returns-wrong-rectangle.patch +Patch70: 0001-impress-tables-are-not-interactively-growing.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2262,6 +2264,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Wed Nov 19 2014 Caolán McNamara - 1:4.2.7.2-8 +- table resizing etc in impress is mangled + * Thu Nov 13 2014 Caolán McNamara - 1:4.2.7.2-7 - Resolves: rhbz#1163477 improve wheel scrolling in sidebar