summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-05-14 08:16:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-05-14 11:34:30 +0200
commit13a834c26d28f3cc08f106bf5ec1b71d4bc1f418 (patch)
treef8ab2b912008c0bf02d37ba883d137f51816d421
parent29c017327585ea12c4fc7493a95ab378761aeafe (diff)
UBSan dynamic-type-mismatch (SfxInt32Item vs. SfxUInt32Item)
...presumably introduced by what looks like typos in e9164b9bc8bd39e02f99cf7c08e38ea0b1e1134a "lok: shape scaling rework" > } > // size > if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) { > - nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); > + nSizX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); > bChgSiz=true; > bChgWdh=true; > } > if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) { > - nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); > + nSizY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); > bChgSiz=true; > bChgHgt=true; > } but only showing up now (presumably due to newly added test code in 2f4ea95149702a46852b320f828d8462eb3666ba "lok: unit test for metric field or formatted field control") during CppunitTest_desktop_lib: > svx/source/svdraw/svdedtv1.cxx:1602:15: runtime error: downcast of address 0x603001642720 which does not point to an object of type 'const SfxInt32Item' > 0x603001642720: note: object is of type 'SfxUInt32Item' > 7a 04 80 2b 50 bb 0f 7f cb 7f 00 00 01 00 00 00 6a 27 00 be bc e8 02 00 be be be be be be be be > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'SfxUInt32Item' > #0 in SdrEditView::SetGeoAttrToMarked(SfxItemSet const&) at svx/source/svdraw/svdedtv1.cxx:1602:15 > #1 in ScDrawShell::ExecDrawAttr(SfxRequest&) at sc/source/ui/drawfunc/drawsh.cxx:385:32 > #2 in SfxStubScDrawShellExecDrawAttr(SfxShell*, SfxRequest&) at workdir/SdiTarget/sc/sdi/scslots.hxx:2779:1 > #3 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) at include/sfx2/shell.hxx:197:35 > #4 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) at sfx2/source/control/dispatch.cxx:252:16 > #5 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) at sfx2/source/control/dispatch.cxx:752:9 > #6 in SfxDispatcher::ExecuteList(unsigned short, SfxCallMode, std::initializer_list<SfxPoolItem const*>, std::initializer_list<SfxPoolItem const*>) at sfx2/source/control/dispatch.cxx:960:8 > #7 in svx::sidebar::PosSizePropertyPanel::executeSize() at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:848:45 > #8 in svx::sidebar::PosSizePropertyPanel::ChangeWidthHdl(weld::MetricSpinButton&) at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:378:5 > #9 in svx::sidebar::PosSizePropertyPanel::LinkStubChangeWidthHdl(void*, weld::MetricSpinButton&) at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:360:1 > #10 in Link<weld::MetricSpinButton&, void>::Call(weld::MetricSpinButton&) const at include/tools/link.hxx:111:45 > #11 in weld::MetricSpinButton::signal_value_changed() at include/vcl/weld.hxx:1721:54 > #12 in weld::MetricSpinButton::spin_button_value_changed(weld::SpinButton&) at vcl/source/window/builder.cxx:192:9 > #13 in weld::MetricSpinButton::LinkStubspin_button_value_changed(void*, weld::SpinButton&) at vcl/source/window/builder.cxx:190:5 > #14 in Link<weld::SpinButton&, void>::Call(weld::SpinButton&) const at include/tools/link.hxx:111:45 > #15 in weld::SpinButton::signal_value_changed() at include/vcl/weld.hxx:1490:54 > #16 in SalInstanceSpinButton::UpDownHdl(SpinField&) at vcl/source/app/salvtables.cxx:5169:71 > #17 in SalInstanceSpinButton::LinkStubUpDownHdl(void*, SpinField&) at vcl/source/app/salvtables.cxx:5169:1 > #18 in Link<SpinField&, void>::Call(SpinField&) const at include/tools/link.hxx:111:45 > #19 in SpinField::Up()::$_0::operator()() const at vcl/source/control/spinfld.cxx:361:88 > #20 in void std::__invoke_impl<void, SpinField::Up()::$_0&>(std::__invoke_other, SpinField::Up()::$_0&) at include/c++/11.0.0/bits/invoke.h:60:14 > #21 in std::enable_if<is_invocable_r_v<void, SpinField::Up()::$_0&>, void>::type std::__invoke_r<void, SpinField::Up()::$_0&>(SpinField::Up()::$_0&) at include/c++/11.0.0/bits/invoke.h:110:2 > #22 in std::_Function_handler<void (), SpinField::Up()::$_0>::_M_invoke(std::_Any_data const&) at include/c++/11.0.0/bits/std_function.h:291:9 > #23 in std::function<void ()>::operator()() const at include/c++/11.0.0/bits/std_function.h:622:14 > #24 in Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at vcl/source/control/ctrl.cxx:315:13 > #25 in SpinField::Up() at vcl/source/control/spinfld.cxx:361:5 > #26 in FormattedField::SetValueFromString(rtl::OUString const&) at vcl/source/control/fmtfield.cxx:854:20 > #27 in FormattedFieldUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString const, rtl::OUString, std::less<rtl::OUString const>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at vcl/source/uitest/uiobject.cxx:1361:31 > #28 in DesktopLOKTest::testMetricField() at desktop/qa/desktop_lib/test_desktop_lib.cxx:2858:13 Change-Id: I57988723e23f5a419639e37fe130bad92682a1a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94178 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--svx/source/svdraw/svdedtv1.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index c30109596d7a..3423ba65027b 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1599,12 +1599,12 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
}
// size
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) {
- nSizX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
bChgSiz=true;
bChgWdh=true;
}
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) {
- nSizY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
bChgSiz=true;
bChgHgt=true;
}