summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/view.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-08-28 12:00:11 +0300
committerCaolán McNamara <caolanm@redhat.com>2020-08-28 20:27:17 +0200
commit6e0bb3fc4e89ddb85ddf40889b11a0c0bd4ab607 (patch)
treefe4909df7e6a71ff4b317e4d9c984d5d94c66ad8 /sw/source/uibase/uiview/view.cxx
parent3f291bb285335efbc2f21a08bdcb23d92911940c (diff)
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@redhat.com>
Diffstat (limited to 'sw/source/uibase/uiview/view.cxx')
-rw-r--r--sw/source/uibase/uiview/view.cxx7
1 files changed, 6 insertions, 1 deletions
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 &&