[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sfx2/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 28 15:15:38 UTC 2020


 sfx2/source/view/viewfrm.cxx |   27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 4db16b2dc835cce918623343b87eab6b067f3023
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Aug 26 11:00:16 2020 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 28 17:15:01 2020 +0200

    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 at yahoo.fr>
    (cherry picked from commit be4fcac736fccce8ee7d4550a860b0127e7601bb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101456
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3a0572058932..39b1c911778d 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1331,11 +1331,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
@@ -1357,12 +1360,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


More information about the Libreoffice-commits mailing list