[libreoffice/f17] Resolves: rhbz#928786 crash on deleting certain table rows

Caolán McNamara caolanm at fedoraproject.org
Thu Apr 4 10:54:18 UTC 2013


commit 122306c8914f7de1689e2314ebd97241c26b153c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 4 11:52:56 2013 +0100

    Resolves: rhbz#928786 crash on deleting certain table rows

 ...bz-907933-crash-on-removing-second-last-p.patch |   66 ++++++++++++++++++++
 libreoffice.spec                                   |    7 ++-
 2 files changed, 72 insertions(+), 1 deletions(-)
---
diff --git a/0001-Resolves-rhbz-907933-crash-on-removing-second-last-p.patch b/0001-Resolves-rhbz-907933-crash-on-removing-second-last-p.patch
new file mode 100644
index 0000000..c1699d9
--- /dev/null
+++ b/0001-Resolves-rhbz-907933-crash-on-removing-second-last-p.patch
@@ -0,0 +1,66 @@
+From 15d8b51bf82610c663f80fe552a1c0315e137ad3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Tue, 5 Feb 2013 17:33:49 +0000
+Subject: [PATCH] Resolves: rhbz#907933 crash on removing second last para in
+ cell...
+
+if (basically) the last para is on next page
+
+Change-Id: Iaff610ea94a829e73bfb8c694a27e0e9b4f6e295
+Reviewed-on: https://gerrit.libreoffice.org/2012
+Tested-by: Michael Stahl <mstahl at redhat.com>
+Reviewed-by: Michael Stahl <mstahl at redhat.com>
+---
+ sw/source/core/inc/tabfrm.hxx    |  2 ++
+ sw/source/core/layout/tabfrm.cxx | 20 ++++++++++++++++++++
+ 2 files changed, 22 insertions(+)
+
+diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
+index 464fc9c..1041385 100644
+--- a/sw/source/core/inc/tabfrm.hxx
++++ b/sw/source/core/inc/tabfrm.hxx
+@@ -151,6 +151,8 @@ public:
+     //
+     sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
+     void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
++    //return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
++    SwTabFrm* GetFollowFlowLineFor();
+ 
+     sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
+     void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
+diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
+index 27ad754..fb23128 100644
+--- a/sw/source/core/layout/tabfrm.cxx
++++ b/sw/source/core/layout/tabfrm.cxx
+@@ -132,8 +132,28 @@ extern const SwTable   *pRowCacheLastTable;
+ extern const SwTabFrm  *pRowCacheLastTabFrm;
+ extern const SwFrm     *pRowCacheLastCellFrm;
+ 
++//return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
++SwTabFrm* SwTabFrm::GetFollowFlowLineFor()
++{
++    SwFlowFrm *pPrec = GetPrecede();
++    if (pPrec && pPrec->GetFrm()->IsTabFrm())
++    {
++        SwTabFrm *pPrevTabFrm = (SwTabFrm*)pPrec;
++        assert(this == pPrevTabFrm->GetFollow());
++        if (pPrevTabFrm->HasFollowFlowLine() && pPrevTabFrm->GetFollow() == this)
++            return pPrevTabFrm;
++    }
++    return NULL;
++}
++
+ SwTabFrm::~SwTabFrm()
+ {
++    //rhbz#907933, we are a follow flow line for something and have been
++    //deleted, remove ourself as a follow flowline
++    SwTabFrm* pFlowFrameFor = GetFollowFlowLineFor();
++    if (pFlowFrameFor)
++        pFlowFrameFor->RemoveFollowFlowLine();
++
+     // There is some terrible code in fetab.cxx, that
+     // makes use of these global pointers. Obviously
+     // this code did not consider that a TabFrm can be
+-- 
+1.8.1.2
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 4aabe29..dd9724c 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -35,7 +35,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        %{libo_version}.2
-Release:        10%{?dist}
+Release:        11%{?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
 Group:          Applications/Productivity
 URL:            http://www.documentfoundation.org/develop
@@ -182,6 +182,7 @@ Patch64: 0001-rhbz-760765-copy-custom-styles-on-copy-paste.patch
 Patch65: 0001-fdo-53175-Fixed-the-end-of-hyperlinks.patch
 Patch66: 0001-Fix-fdo-47669-also-check-if-we-started-the-tag-befor.patch
 Patch67: 0001-fixed-a-possible-crasher-in-basic-runtime.patch
+Patch68: 0001-Resolves-rhbz-907933-crash-on-removing-second-last-p.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1079,6 +1080,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch65 -p1 -b .fdo-53175-Fixed-the-end-of-hyperlinks.patch
 %patch66 -p1 -b .Fix-fdo-47669-also-check-if-we-started-the-tag-befor.patch
 %patch67 -p1 -b .fixed-a-possible-crasher-in-basic-runtime.patch
+%patch68 -p1 -b .rhbz-907933-crash-on-removing-second-last-p.patch
 
 # TODO: check this
 # these are horribly incomplete--empty translations and copied english
@@ -2365,6 +2367,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
+* Thu Apr 04 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.5.7.2-11
+- Resolves: rhbz#928786 crash on deleting certain table rows
+
 * Fri Mar 22 2013 David Tardon <dtardon at redhat.com> - 1:3.5.7.2-10
 - Resolves: rhbz#904897 writer fails to save any text following a
   hyperlink on export to docx


More information about the scm-commits mailing list