Kaydet (Commit) 22005041 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a628c01e
...@@ -1239,16 +1239,20 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) ...@@ -1239,16 +1239,20 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
if ((iCurrent > iLast) && !Application::IsHeadlessModeEnabled() && !bIsUITest) if ((iCurrent > iLast) && !Application::IsHeadlessModeEnabled() && !bIsUITest)
{ {
VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", SfxResId(STR_WHATSNEW_TEXT), InfoBarType::Info); VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", SfxResId(STR_WHATSNEW_TEXT), InfoBarType::Info);
VclPtrInstance<PushButton> xWhatsNewButton(&GetWindow()); if (pInfoBar)
xWhatsNewButton->SetText(SfxResId(STR_WHATSNEW_BUTTON)); {
xWhatsNewButton->SetSizePixel(xWhatsNewButton->GetOptimalSize()); VclPtrInstance<PushButton> xWhatsNewButton(&GetWindow());
xWhatsNewButton->SetClickHdl(LINK(this, SfxViewFrame, WhatsNewHandler)); xWhatsNewButton->SetText(SfxResId(STR_WHATSNEW_BUTTON));
pInfoBar->addButton(xWhatsNewButton); xWhatsNewButton->SetSizePixel(xWhatsNewButton->GetOptimalSize());
xWhatsNewButton->SetClickHdl(LINK(this, SfxViewFrame, WhatsNewHandler));
//update lastversion pInfoBar->addButton(xWhatsNewButton);
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch); //update lastversion
batch->commit(); std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Setup::Product::ooSetupLastVersion::set(
sSetupVersion, batch);
batch->commit();
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment