[Libreoffice-commits] core.git: include/vcl sd/source vcl/source

Armin Le Grand Armin.Le.Grand at cib.de
Thu Oct 6 09:04:11 UTC 2016


 include/vcl/dialog.hxx       |    5 +++++
 sd/source/ui/dlg/brkdlg.cxx  |    9 +++++++--
 vcl/source/window/dialog.cxx |   18 +++++++++++-------
 3 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit b07163d73a28e7792011edddf246726919364a26
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Fri Sep 30 12:40:47 2016 +0200

    tdf#102852 Fixed BreakDlg
    
    Needed to ensure correct return value in dialog
    and that it repaints
    
    Change-Id: I029d10b6699629b2f2f8651f6d96ceceba7a3d8c
    Reviewed-on: https://gerrit.libreoffice.org/29401
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index da3aa7e..0d763bd 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -100,6 +100,11 @@ public:
     virtual void PrePaint(vcl::RenderContext& rRenderContext) override;
     virtual void PostPaint(vcl::RenderContext& rRenderContext) override;
 
+    // ensureRepaint - triggers Application::Yield until the dialog is
+    // completely repainted. Sometimes needed for dialogs showing progress
+    // during actions
+    void ensureRepaint();
+
     // Screenshot interface
     virtual std::vector<OString> getAllPageUIXMLDescriptions() const;
     virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index be0c2d5..516a3bc 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -145,8 +145,13 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit, bool )
         m_pFiInsInfo->SetText(info);
     }
 
-    Application::Reschedule();
-    return bCancel;
+    // make sure dialog gets painted, it is intended to
+    // show the progress to the user. Also necessary to
+    // provide a clickable cancel button
+    ensureRepaint();
+
+    // return okay-value (-> !cancel)
+    return !bCancel;
 }
 
 /**
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 5884a73..eef4c5a 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -863,14 +863,8 @@ bool Dialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDescription*/)
     return true;
 }
 
-Bitmap Dialog::createScreenshot()
+void Dialog::ensureRepaint()
 {
-    // same prerequisites as in Execute()
-    setDeferredProperties();
-    ImplAdjustNWFSizes();
-    Show();
-    ToTop();
-
     // ensure repaint
     Invalidate();
     mbPaintComplete = false;
@@ -879,6 +873,16 @@ Bitmap Dialog::createScreenshot()
     {
         Application::Yield();
     }
+}
+
+Bitmap Dialog::createScreenshot()
+{
+    // same prerequisites as in Execute()
+    setDeferredProperties();
+    ImplAdjustNWFSizes();
+    Show();
+    ToTop();
+    ensureRepaint();
 
     return GetBitmap(Point(), GetOutputSizePixel());
 }


More information about the Libreoffice-commits mailing list