[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 2 commits - sw/source vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jul 3 01:54:35 PDT 2015


 sw/source/core/layout/frmtool.cxx |    2 +-
 vcl/source/control/button.cxx     |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 64b4ed9de3852494416cdcb8c25d2e24fc4d0253
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 2 12:09:59 2015 +0200

    tdf#92443 PushButton::ImplDrawPushButtonFrame: fix Invalidate() loop
    
    Regression from commit 32a776c83b86db3efaa7177c479e9327f28fbf46
    (Refactor Buttons to use RenderContext when painting, 2015-05-05), the
    problem was that we started to call vcl::Window::SetSettings(), which
    invokes Invalidate(), which should not happen, since we're in Paint().
    
    Fix this by restoring the old behavior of calling
    OutputDevice::SetSettings() directly again.
    
    Change-Id: I57c8e7947764e8cdc2d144be2dd140d3c408255d
    (cherry picked from commit b45040d1ec1a0b765f1b2284fffaed2b17b6227b)

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e8ab9c9..2b3759e 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -729,9 +729,13 @@ void PushButton::ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext,
         StyleSettings aStyleSettings = aSettings.GetStyleSettings();
         aStyleSettings.Set3DColors(GetControlBackground());
         aSettings.SetStyleSettings(aStyleSettings);
-        rRenderContext.SetSettings(aSettings);
+
+        // Call OutputDevice::SetSettings() explicitly, as rRenderContext may
+        // be a vcl::Window in fact, and vcl::Window::SetSettings() will call
+        // Invalidate(), which is a problem, since we're in Paint().
+        rRenderContext.OutputDevice::SetSettings(aSettings);
         rRect = aDecoView.DrawButton(rRect, nStyle);
-        rRenderContext.SetSettings(aOldSettings);
+        rRenderContext.OutputDevice::SetSettings(aOldSettings);
     }
     else
         rRect = aDecoView.DrawButton(rRect, nStyle);
commit 7fe52c31531ab3ba0d8ca92d16096861b77db081
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 2 09:56:33 2015 +0200

    coverity#1309050 pLayout might be 0 here
    
    Change-Id: I5756c033e173faaba373c145b15a07e275453643
    (cherry picked from commit ef46186bbab756442db1b7c12cd1902c138c737e)

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 6cbc38c..72bfaef 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3317,7 +3317,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
                         {
                             SwObjectFormatter::FormatObj( *pFlyFrm );
                         }
-                        pTmpFrm->Calc(pLayout->GetCurrShell()->GetOut());
+                        pTmpFrm->Calc(pLayout ? pLayout->GetCurrShell()->GetOut() : 0);
                     }
 
                     // #127369#


More information about the Libreoffice-commits mailing list