[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jan 31 07:30:16 UTC 2019
sw/source/uibase/uiview/view2.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit a89f535d85bb7d32ccb5196813ba6233f45c0c83
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 30 20:48:15 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jan 31 08:29:44 2019 +0100
Don't add snap point < MINZOOM
...as happens e.g. during JunitTest_forms_unoapi_1 when nFac is 0 (MINZOOM is
20), which then causes with Clang -fsanitize=implicit-signed-integer-truncation:
> svx/source/stbctrls/zoomsliderctrl.cxx:137:24: runtime error: implicit conversion from type 'int' of value -20 (32-bit, signed) to type 'sal_uInt16' (aka 'unsigned short') changed the value to 65516 (16-bit, unsigned)
> #0 in SvxZoomSliderControl::Zoom2Offset(unsigned short) const at svx/source/stbctrls/zoomsliderctrl.cxx:137:24
> #1 in SvxZoomSliderControl::StateChanged(unsigned short, SfxItemState, SfxPoolItem const*) at svx/source/stbctrls/zoomsliderctrl.cxx:211:41
> #2 in SfxStatusBarControl::statusChanged(com::sun::star::frame::FeatureStateEvent const&) at sfx2/source/statbar/stbitem.cxx:283:13
> #3 in SfxDispatchController_Impl::addStatusListener(com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> const&, com::sun::star::util::URL const&) at sfx2/source/control/unoctitm.cxx:859:16
> #4 in SfxOfficeDispatch::addStatusListener(com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> const&, com::sun::star::util::URL const&) at sfx2/source/control/unoctitm.cxx:247:16
> #5 in svt::StatusbarController::bindListener() at svtools/source/uno/statusbarcontroller.cxx:467:38
> #6 in svt::StatusbarController::update() at svtools/source/uno/statusbarcontroller.cxx:178:5
> #7 in framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > >::operator()(std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> >&) const at framework/source/uielement/statusbarmanager.cxx:72:34
> #8 in framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > > std::for_each<__gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > >, std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > >, std::bidirectional_iterator_tag>, framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsig
ned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > > >(__gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > >, std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > >, std::bidirectional_iterator_tag>, __gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > >, std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::s
un::star::frame::XStatusbarController> > > >, std::bidirectional_iterator_tag>, framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > >) at gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/bits/stl_algo.h:3866:2
> #9 in framework::StatusBarManager::UpdateControllers() at framework/source/uielement/statusbarmanager.cxx:272:9
> #10 in framework::StatusBarManager::FillStatusBar(com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> const&) at framework/source/uielement/statusbarmanager.cxx:513:5
> #11 in framework::StatusBarWrapper::initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) at framework/source/uielement/statusbarwrapper.cxx:123:40
> #12 in framework::MenuBarFactory::CreateUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ui::XUIElement> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) at framework/source/uifactory/menubarfactory.cxx:160:12
> #13 in (anonymous namespace)::StatusBarFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/statusbarfactory.cxx:73:5
> #14 in non-virtual thunk to (anonymous namespace)::StatusBarFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/statusbarfactory.cxx
> #15 in (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx:441:39
> #16 in non-virtual thunk to (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx
> #17 in framework::LayoutManager::implts_createElement(rtl::OUString const&) at framework/source/layoutmanager/layoutmanager.cxx:705:50
> #18 in framework::LayoutManager::implts_createStatusBar(rtl::OUString const&) at framework/source/layoutmanager/layoutmanager.cxx:822:44
> #19 in framework::LayoutManager::createElement(rtl::OUString const&) at framework/source/layoutmanager/layoutmanager.cxx:1472:13
> #20 in framework::LayoutManager::requestElement(rtl::OUString const&) at framework/source/layoutmanager/layoutmanager.cxx:1597:13
> #21 in SfxWorkWindow::UpdateStatusBar_Impl() at sfx2/source/appl/workwin.cxx:1456:29
> #22 in SfxWorkWindow::UpdateObjectBars_Impl2() at sfx2/source/appl/workwin.cxx:1225:5
> #23 in SfxWorkWindow::UpdateObjectBars_Impl() at sfx2/source/appl/workwin.cxx:1083:5
> #24 in SfxDispatcher::Update_Impl(bool) at sfx2/source/control/dispatch.cxx:1216:19
> #25 in SfxBaseController::ConnectSfxFrame_Impl(SfxBaseController::ConnectSfxFrame) at sfx2/source/view/sfxbasecontroller.cxx:1250:50
> #26 in SfxBaseController::attachFrame(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/sfxbasecontroller.cxx:528:13
> #27 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:595:18
> #28 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:712:13
> #29 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1149:37
> #30 in framework::LoadEnv::startLoading() at framework/source/loadenv/loadenv.cxx:383:20
> #31 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
> #32 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:620:12
> #33 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
> #34 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
> #35 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
> #36 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
> #37 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const at binaryurp/source/incomingrequest.cxx:236:13
Change-Id: I6875aa9cee8bd24231872c857be83b0d152a8dff
Reviewed-on: https://gerrit.libreoffice.org/67178
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 8d5b3bd42e52..63cd87a68867 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1448,7 +1448,10 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
nFac = std::min( nFac, nVisPercent );
- aZoomSliderItem.AddSnappingPoint( nFac );
+ if (nFac >= MINZOOM)
+ {
+ aZoomSliderItem.AddSnappingPoint( nFac );
+ }
if ( bAutomaticViewLayout )
{
More information about the Libreoffice-commits
mailing list