Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2012

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/12/2012/1

Resolves: rhbz#907933 crash on removing second last para in cell...

if (basically) the last para is on next page

Change-Id: Iaff610ea94a829e73bfb8c694a27e0e9b4f6e295
---
M sw/source/core/inc/tabfrm.hxx
M sw/source/core/layout/tabfrm.cxx
2 files changed, 22 insertions(+), 0 deletions(-)



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 @@
     //
     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 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

-- 
To view, visit https://gerrit.libreoffice.org/2012
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaff610ea94a829e73bfb8c694a27e0e9b4f6e295
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Caolán McNamara <caolanm@redhat.com>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.