[Libreoffice-commits] .: 2 commits - solenv/gdb writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 9 16:01:40 PST 2013


 solenv/gdb/libreoffice/sw.py                      |    2 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit e521930ea1c855c236efb67793e540d07c201d35
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 10 00:43:12 2013 +0100

    fdo#58327: writerfilter: RemoveLastParagraph is tricky:
    
    What happens here is that the xCursor->goLeft( 1, true ) selects the
    entire inserted table, which is then deleted.  That causes annoyances,
    such as an assertion from ~SwIndexReg because as collateral damage the
    SwTxtNode that SwReader::Read's pUndoPam points to is also deleted, as
    well as missing tables in the document.
    
    DomainMapper_Impl::RemoveLastParagraph() can avoid this by not using
    setString() but instead disposing the paragraph, like it already does in
    other cases.  But don't do it for new (loaded) documents, because it may
    kill flys in that case, which i strangely couldn't reproduce when
    pasting as RTF.
    
    Change-Id: I87302b8916e39ca42bc4fedfee40ac38fadd0939

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8716c0d..3ec9f5c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -282,7 +282,13 @@ void DomainMapper_Impl::RemoveLastParagraph( )
         // Keep the character properties of the last but one paragraph, even if
         // it's empty. This works for headers/footers, and maybe in other cases
         // as well, but surely not in textboxes.
-        if (m_bInHeaderFooterImport && xEnumerationAccess.is())
+        // fdo#58327: also do this at the end of the document: when pasting,
+        // a table before the cursor position would be deleted
+        // (but only for paste/insert, not load; otherwise it can happen that
+        // flys anchored at the disposed paragraph are deleted (fdo47036.rtf))
+        bool const bEndOfDocument(m_aTextAppendStack.size() == 1);
+        if ((m_bInHeaderFooterImport || (bEndOfDocument && !m_bIsNewDoc))
+            && xEnumerationAccess.is())
         {
             uno::Reference<container::XEnumeration> xEnumeration = xEnumerationAccess->createEnumeration();
             uno::Reference<lang::XComponent> xParagraph(xEnumeration->nextElement(), uno::UNO_QUERY);
commit b05250de08f5dad8c6ac1d86d0c63981d800744f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 10 00:15:05 2013 +0100

    gdb: print something also for non-recognized node types
    
    These do not occur as such but while a node is being destroyed it is
    still in the nodes array and may have some base class types; without
    giving these a value gdb will just stop printing the nodes array then.
    
    Change-Id: If78c4f633312cf8bad0048b704fe20bd09c7c28f

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index a9d2e8c..532f1c5 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -163,6 +163,8 @@ class BigPtrArrayPrinter(object):
                 cur_indent = self.indent
             elif str(node.dynamic_type.target()) == "SwDummySectionNode":
                 value = "DummySctNode "
+            else: # must be currently being deleted, so has some abstract type
+                value = "~DeletedNode "
 #            return "\n[%s%4d%s] %s %s" % (cur_indent, self.pos, \
 #                                self.max_indent[len(cur_indent):], node, value)
             return "\n[%4d] %s%s%s %s" % (self.pos, cur_indent, \


More information about the Libreoffice-commits mailing list