[Libreoffice-commits] core.git: sw/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 28 18:28:06 UTC 2020


 sw/source/uibase/uiview/view.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6e0bb3fc4e89ddb85ddf40889b11a0c0bd4ab607
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Aug 28 12:00:11 2020 +0300
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 28 20:27:17 2020 +0200

    Fix ooo38104-1.sxw crash after c123bfff501229f398a1b679fc7434b82d53685c
    
    Unlike the c123bf commit, this commit does not cause the crash that
    was caught by the crash-testing system.
    
    (The crash could be reproduced by:
        wget -O ooo38104-1.sxw https://bz.apache.org/ooo/attachment.cgi?id=19889
        ./instdir/program/soffice.bin --headless --convert-to docx ./ooo38104-1.sxw
    )
    
    In this commit, I reinstate the "early return" in
    SwView::ReadUserDataSequence() that I dropped in the c123bf commit,
    but instead move the SelectShell() call earlier, so that it will be
    executed before the potential early return.
    
    The problem that we try to fix here is the one that the fresh
    CppunitTest_sw_updateall_object_replacements checks, so to reproduce
    that problem, revert both this commit and c123bf, and then run that
    unit test.
    
    Change-Id: I6c728b75a2f172b75fbf2ad00c019c32aecc19f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101531
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 32c64fef35a4..a61a96af71d6 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1381,10 +1381,16 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
         // delegate further
         GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
     }
+
+    SelectShell();
+
     if (!bGotVisibleBottom)
         return;
 
     Point aCursorPos( nX, nY );
+    const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+    if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
+        return;
 
     m_pWrtShell->EnableSmooth( false );
     const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
@@ -1441,7 +1447,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
         // reset flag value
         m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
     }
-    SelectShell();
 
     // Set ViewLayoutSettings
     const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&


More information about the Libreoffice-commits mailing list