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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 16 09:28:08 UTC 2020


 basic/source/runtime/stdobj1.cxx |   10 +++++-----
 include/vcl/svapp.hxx            |   20 ++------------------
 vcl/source/app/svapp.cxx         |    5 -----
 vcl/source/window/debugevent.cxx |    2 --
 4 files changed, 7 insertions(+), 30 deletions(-)

New commits:
commit 3fcee07aa7edb927eec77ea865ad1c33f6bdabfa
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jan 15 21:26:54 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jan 16 10:27:30 2020 +0100

    drop Application::GetAppWindow
    
    Change-Id: I8f1640b0ed816101305a893646de8ed9750d1247
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86889
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index 1943bdb6fcf9..79105d3e4ed3 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -19,7 +19,7 @@
 
 #include <basic/sberrors.hxx>
 #include <basic/sbstar.hxx>
-#include <vcl/wrkwin.hxx>
+#include <vcl/outdev.hxx>
 #include <vcl/svapp.hxx>
 #include <sbstdobj.hxx>
 
@@ -85,8 +85,8 @@ void SbStdPicture::PropWidth( SbxVariable* pVar, bool bWrite )
     }
 
     Size aSize = aGraphic.GetPrefSize();
-    aSize = Application::GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
-    aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
+    aSize = Application::GetDefaultDevice()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
+    aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
 
     pVar->PutInteger( static_cast<sal_Int16>(aSize.Width()) );
 }
@@ -100,8 +100,8 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, bool bWrite )
     }
 
     Size aSize = aGraphic.GetPrefSize();
-    aSize = Application::GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
-    aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
+    aSize = Application::GetDefaultDevice()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
+    aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
 
     pVar->PutInteger( static_cast<sal_Int16>(aSize.Height()) );
 }
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 8b79031342e7..61a7443c5cec 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -59,7 +59,6 @@ class Help;
 class OutputDevice;
 namespace vcl { class Window; }
 namespace vcl { class KeyCode; }
-class WorkWindow;
 class NotifyEvent;
 class KeyEvent;
 class MouseEvent;
@@ -808,26 +807,11 @@ public:
     */
     ///@{
 
-    /** Get the main application window.
-
-     @remark the main application window (or App window) has a style of WB_APP,
-        there can only be on WorkWindow with this style, if a dialog or floating
-        window cannot find a parent, then the parent becomes the app window.
-
-        It also becomes the "default window", is used for help, is a fallback if
-        the application has no name, and a number of other things.
-
-     returns Pointer to main application window.
-
-     @see GetFocusWindow, GetDefaultDevice
-    */
-    static WorkWindow*          GetAppWindow();
-
     /** Get the currently focused window.
 
      @returns Pointer to focused window.
 
-     @see GetAppWindow, GetDefaultDevice
+     @see GetDefaultDevice
     */
     static vcl::Window*              GetFocusWindow();
 
@@ -836,7 +820,7 @@ public:
      @returns Pointer to an OutputDevice. However, it is a Window object -
              Window class subclasses OutputDevice.
 
-     @see GetAppWindow, GetFocusWindow
+     @see GetFocusWindow
     */
     static OutputDevice*        GetDefaultDevice();
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index f295c634543c..dcb35069e0cd 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1042,11 +1042,6 @@ void Application::LockFontUpdates(bool bLock)
     OutputDevice::LockFontUpdates(bLock);
 }
 
-WorkWindow* Application::GetAppWindow()
-{
-    return ImplGetSVData()->maFrameData.mpAppWin;
-}
-
 vcl::Window* Application::GetFocusWindow()
 {
     return ImplGetSVData()->mpWinData->mpFocusWin;
diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx
index 5a5c164abc30..bb0d54b1150e 100644
--- a/vcl/source/window/debugevent.cxx
+++ b/vcl/source/window/debugevent.cxx
@@ -45,8 +45,6 @@ vcl::Window *DebugEventInjector::ChooseWindow()
         // select a top window at random
         long nIdx = Application::GetTopWindowCount() * getRandom();
         pParent = Application::GetTopWindow( nIdx );
-        if (!pParent)
-            pParent = Application::GetAppWindow();
     }
     assert (pParent != nullptr);
 


More information about the Libreoffice-commits mailing list