[Libreoffice-commits] core.git: sfx2/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 4 07:22:45 UTC 2019
sfx2/source/view/viewfrm.cxx | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
New commits:
commit 22005041f829d85e675ea27bdee1770af58a1ea0
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jun 3 16:21:24 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Jun 4 09:22:07 2019 +0200
AppendInfoBar can return null
e.g., when opening the old help window ("Help - LibreOffice Help" in a build
configured with --with-help to "build the old local help" (configure.ac))
Change-Id: Icecd224774b98811ddf9545c5fa83a85fab259fc
Reviewed-on: https://gerrit.libreoffice.org/73390
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 5620f4396e8f..ed8ffa200ef6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1239,16 +1239,20 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
if ((iCurrent > iLast) && !Application::IsHeadlessModeEnabled() && !bIsUITest)
{
VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", SfxResId(STR_WHATSNEW_TEXT), InfoBarType::Info);
- VclPtrInstance<PushButton> xWhatsNewButton(&GetWindow());
- xWhatsNewButton->SetText(SfxResId(STR_WHATSNEW_BUTTON));
- xWhatsNewButton->SetSizePixel(xWhatsNewButton->GetOptimalSize());
- xWhatsNewButton->SetClickHdl(LINK(this, SfxViewFrame, WhatsNewHandler));
- pInfoBar->addButton(xWhatsNewButton);
-
- //update lastversion
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
- officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch);
- batch->commit();
+ if (pInfoBar)
+ {
+ VclPtrInstance<PushButton> xWhatsNewButton(&GetWindow());
+ xWhatsNewButton->SetText(SfxResId(STR_WHATSNEW_BUTTON));
+ xWhatsNewButton->SetSizePixel(xWhatsNewButton->GetOptimalSize());
+ xWhatsNewButton->SetClickHdl(LINK(this, SfxViewFrame, WhatsNewHandler));
+ pInfoBar->addButton(xWhatsNewButton);
+
+ //update lastversion
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Setup::Product::ooSetupLastVersion::set(
+ sSetupVersion, batch);
+ batch->commit();
+ }
}
}
More information about the Libreoffice-commits
mailing list