From 4b2476b5ac464d876cb1be4d3e02e30c329607cc Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Tue, 30 Jan 2018 21:34:52 +0100 Subject: Avoid empty avoid name for SfxPrintingHint Create a brand new doc on Writer, click Print then Cancel button => warn:legacy.tools:2382:2382:sfx2/source/doc/sfxbasemodel.cxx:3071: Empty event name! Here's the bt 0 0x00007ffff1da379c in SfxBaseModel::postEvent_Impl(rtl::OUString const&, com::sun::star::uno::Reference const&) (this=0x5555578f0630, aName="", xController=empty uno::Reference) at /home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3073 1 0x00007ffff1da134b in SfxBaseModel::Notify(SfxBroadcaster&, SfxHint const&) (this=0x5555578f0630, rBC=..., rHint=...) at /home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:2731 2 0x00007ffff12768d1 in SfxBroadcaster::Broadcast(SfxHint const&) (this=0x5555578e9420, rHint=...) at /home/julien/lo/libreoffice/svl/source/notify/SfxBroadcaster.cxx:49 3 0x00007ffff1eec7b6 in SfxPrinterController::jobFinished(com::sun::star::view::PrintableState) (this=0x55555c092d20, nState=com::sun::star::view::PrintableState::PrintableState_JOB_ABORTED) at /home/julien/lo/libreoffice/sfx2/source/view/viewprn.cxx:329 4 0x00007fffec314318 in Printer::FinishPrintJob(std::shared_ptr const&) (xController=std::shared_ptr (count 2, weak 0) 0x55555c092d20) at /home/julien/lo/libreoffice/vcl/source/gdi/print3.cxx:519 5 0x00007fffec3143b1 in Printer::ImplPrintJob(std::shared_ptr const&, JobSetup const&) (xController=std::shared_ptr (count 2, weak 0) 0x55555c092d20, i_rInitSetup=...) at /home/julien/lo/libreoffice/vcl/source/gdi/print3.cxx:529 6 0x00007fffec3128ef in PrintJobAsync::ExecJob(void*) (this=0x55555c09b940) at /home/julien/lo/libreoffice/vcl/source/gdi/print3.cxx:275 7 0x00007fffec3128c5 in PrintJobAsync::LinkStubExecJob(void*, void*) (instance=0x55555c09b940, data=0x0) at /home/julien/lo/libreoffice/vcl/source/gdi/print3.cxx:273 This behavior has been like this since: https://cgit.freedesktop.org/libreoffice/core/commit/?id=87dfa6dd336d596112c0beb6b42f082178461678 This patch will allow SfxBaseModel::postEvent_Impl to not return early See https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/sfxbasemodel.cxx#3059 Change-Id: I77ff916c15944693f9f0848bf8f18659f9b519df Reviewed-on: https://gerrit.libreoffice.org/48936 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/sfx2/event.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx index 3e86bcd9989b..ac0c2689e1f7 100644 --- a/include/sfx2/event.hxx +++ b/include/sfx2/event.hxx @@ -172,7 +172,11 @@ public: {} SfxPrintingHint( css::view::PrintableState nState ) - : SfxViewEventHint( SfxEventHintId::PrintDoc, rtl::OUString(), nullptr, css::uno::Reference< css::frame::XController >() ) + : SfxViewEventHint( + SfxEventHintId::PrintDoc, + GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), + nullptr, + css::uno::Reference< css::frame::XController >() ) , mnPrintableState( nState ) {} -- cgit v1.2.3