summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-06-03 16:21:24 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-06-04 09:22:07 +0200
commit22005041f829d85e675ea27bdee1770af58a1ea0 (patch)
treedc641733a3e5e1c472428ec6cc54cd20502aa6be /sfx2
parenta628c01e783b8970ec6d1a4499f01981c077e607 (diff)
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@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewfrm.cxx24
1 files changed, 14 insertions, 10 deletions
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();
+ }
}
}