Kaydet (Commit) dcfe0095 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Don't set too-large size for SdrPage

...(from which ScDrawPage is derived).  SdrPage::mnWidth/Height have been signed
32-bit ever since at least b97a3f93
"INTEGRATION: CWS hedaburemove01" (INT32 nWdt/nHgt back then).

With (new-in-Clang) -fsanitize=implicit-signed-integer-truncation, this cause
failure during CppunitTest_desktop_lib:

> svx/source/svdraw/svdpage.cxx:1215:19: runtime error: implicit conversion from type 'long' of value 9223372036854775807 (64-bit, signed) to type 'sal_Int32' (aka 'int') changed the value to -1 (32-bit, signed)
>  #0 in SdrPage::SetSize(Size const&) at svx/source/svdraw/svdpage.cxx:1215:19 (instdir/program/libsvxcorelo.so +0x4aede6f)
>  #1 in ScDrawPage::ScDrawPage(ScDrawLayer&, bool) at sc/source/core/data/drawpage.cxx:30:5 (instdir/program/libsclo.so +0x9addca3)
>  #2 in ScDrawLayer::AllocPage(bool) at sc/source/core/data/drwlayer.cxx:369:16 (instdir/program/libsclo.so +0x9aee60d)
>  #3 in ScDrawLayer::ScAddPage(short) at sc/source/core/data/drwlayer.cxx:397:50 (instdir/program/libsclo.so +0x9aeeea7)
>  #4 in ScDocument::InitDrawLayer(SfxObjectShell*) at sc/source/core/data/documen9.cxx:155:26 (instdir/program/libsclo.so +0x91fd6d0)
>  #5 in ScDocShell::MakeDrawLayer() at sc/source/ui/docshell/docsh2.cxx:175:21 (instdir/program/libsclo.so +0xcd0d25e)
>  #6 in ScTabView::MakeDrawLayer() at sc/source/ui/view/tabview2.cxx:1400:34 (instdir/program/libsclo.so +0xed70dda)
>  #7 in ScTabViewShell::ScTabViewShell(SfxViewFrame*, SfxViewShell*) at sc/source/ui/view/tabvwsh4.cxx:1702:5 (instdir/program/libsclo.so +0xee61296)
>  #8 in ScTabViewShell::CreateInstance(SfxViewFrame*, SfxViewShell*) at sc/source/ui/view/tabvwsh.cxx:106:1 (instdir/program/libsclo.so +0xee060a0)
>  #9 in SfxViewFactory::CreateInstance(SfxViewFrame*, SfxViewShell*) at sfx2/source/view/viewfac.cxx:28:12 (instdir/program/libsfxlo.so +0x419481e)
>  #10 in SfxBaseModel::createViewController(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/doc/sfxbasemodel.cxx:4089:46 (instdir/program/libsfxlo.so +0x3a9244c)
>  #11 in non-virtual thunk to SfxBaseModel::createViewController(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/doc/sfxbasemodel.cxx (instdir/program/libsfxlo.so +0x3a94895)
>  #12 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference<com::sun::star::frame::XModel2> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, comphelper::NamedValueCollection const&, rtl::OUString const&) at sfx2/source/view/frmload.cxx:584:60 (instdir/program/libsfxlo.so +0x40ca60a)
>  #13 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:711:13 (instdir/program/libsfxlo.so +0x40c3f25)
>  #14 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1149:37 (instdir/program/libfwklo.so +0x1520131)
>  #15 in framework::LoadEnv::startLoading() at framework/source/loadenv/loadenv.cxx:383:20 (instdir/program/libfwklo.so +0x1510b16)
>  #16 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:169:14 (instdir/program/libfwklo.so +0x150c7c8)
>  #17 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:619:12 (instdir/program/libfwklo.so +0x166f1ce)
>  #18 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx (instdir/program/libfwklo.so +0x166f3da)
>  #19 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:50:60 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x8f176)
>  #20 in DesktopLOKTest::loadDoc(char const*, LibreOfficeKitDocumentType) at desktop/qa/desktop_lib/test_desktop_lib.cxx:215:19 (workdir/LinkTarget/CppunitTest/libtest_desktop_lib.so +0xf2ca0)
>  #21 in DesktopLOKTest::testSearchCalc() at desktop/qa/desktop_lib/test_desktop_lib.cxx:423:37 (workdir/LinkTarget/CppunitTest/libtest_desktop_lib.so +0x100543)
[...]

Change-Id: I2af2f259a1415ba7977331d53d7ae9919692ff93
Reviewed-on: https://gerrit.libreoffice.org/63114
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 88c6b454
......@@ -24,7 +24,8 @@
ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage)
: FmFormPage(rNewModel, bMasterPage)
{
SetSize( Size( LONG_MAX, LONG_MAX ) );
SetSize( Size( SAL_MAX_INT32, SAL_MAX_INT32 ) );
// largest size supported by sal_Int32 SdrPage::mnWidth/Height
}
ScDrawPage::~ScDrawPage()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment