diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-08-26 11:00:16 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2020-08-27 17:54:39 +0200 |
commit | be4fcac736fccce8ee7d4550a860b0127e7601bb (patch) | |
tree | 84387a6c62a316cf8dd6c106b180726e646aed5d /sfx2 | |
parent | bd2d082a0c681ec7340ed01a27b7d2c7ab14549c (diff) |
tdf#136133: AppendInfoBar can return null
2 cases:
1) When set Donate property to false value in /org.openoffice.Office.UI.Infobar/Enabled
and LastTimeDonateShow with 1 in /org.openoffice.Setup/Product (Expert Configuration)
See https://bugs.documentfoundation.org/attachment.cgi?id=164702
2) GetInvolved = false and LastTimeGetInvolved = 1
See https://bugs.documentfoundation.org/attachment.cgi?id=164703
Change-Id: I2da22616fb6f3fb4e42bf6b5e5c29cc094dc2fd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101391
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index b0f1e40fbb82..9e4b4b280c59 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1382,11 +1382,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("getinvolved", "", SfxResId(STR_GET_INVOLVED_TEXT), InfobarType::INFO); - VclPtrInstance<PushButton> xGetInvolvedButton(&GetWindow()); - xGetInvolvedButton->SetText(SfxResId(STR_GET_INVOLVED_BUTTON)); - xGetInvolvedButton->SetSizePixel(xGetInvolvedButton->GetOptimalSize()); - xGetInvolvedButton->SetClickHdl(LINK(this, SfxViewFrame, GetInvolvedHandler)); - pInfoBar->addButton(xGetInvolvedButton); + if (pInfoBar) + { + VclPtrInstance<PushButton> xGetInvolvedButton(&GetWindow()); + xGetInvolvedButton->SetText(SfxResId(STR_GET_INVOLVED_BUTTON)); + xGetInvolvedButton->SetSizePixel(xGetInvolvedButton->GetOptimalSize()); + xGetInvolvedButton->SetClickHdl(LINK(this, SfxViewFrame, GetInvolvedHandler)); + pInfoBar->addButton(xGetInvolvedButton); + } } if (bUpdateLastTimeGetInvolvedShown @@ -1408,12 +1411,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) bUpdateLastTimeDonateShown = true; VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("donate", "", SfxResId(STR_DONATE_TEXT), InfobarType::INFO); - - VclPtrInstance<PushButton> xDonateButton(&GetWindow()); - xDonateButton->SetText(SfxResId(STR_DONATE_BUTTON)); - xDonateButton->SetSizePixel(xDonateButton->GetOptimalSize()); - xDonateButton->SetClickHdl(LINK(this, SfxViewFrame, DonationHandler)); - pInfoBar->addButton(xDonateButton); + if (pInfoBar) + { + VclPtrInstance<PushButton> xDonateButton(&GetWindow()); + xDonateButton->SetText(SfxResId(STR_DONATE_BUTTON)); + xDonateButton->SetSizePixel(xDonateButton->GetOptimalSize()); + xDonateButton->SetClickHdl(LINK(this, SfxViewFrame, DonationHandler)); + pInfoBar->addButton(xDonateButton); + } } if (bUpdateLastTimeDonateShown |