summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-07-15 14:49:01 +0200
committerNoel Grandin <noel@peralex.com>2013-07-18 13:06:09 +0200
commit48d7af8ad317b1919e83e7925c5809e8a96d5303 (patch)
tree32f6b35ab081258f459405a5adc6cd8e1e8bd01f
parent3d67253be08fba7b717332a23ffbe6f2cb6c2a53 (diff)
fdo#66762 - Other: com.sun.star.awt.DisplayAccess removed
I removed the undocumented internal API "com.sun.star.awt.DisplayAccess" in commit dde234b6955a421d51d2b37e4fc3972c660146f0 "fdo#46808, remove awt::DisplayAccess service." However, it appears someone was actually using this. Now, at the same time, we have a method in XToolkit, getWorkArea(), which looks like it was designed to return this exact information, but which has been returning zero for as far back as our commit history goes. So, to kill two birds with one stone, this commit changes getWorkArea() to return the information the customer needs. Change-Id: I76300bac604e9e4b7be95b0872a7f95cb6781903 (cherry picked from commit 2aaaa5806021c52de1153ca2de0ca721e7eb73c0)
-rw-r--r--offapi/com/sun/star/awt/XToolkit.idl6
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx11
2 files changed, 13 insertions, 4 deletions
diff --git a/offapi/com/sun/star/awt/XToolkit.idl b/offapi/com/sun/star/awt/XToolkit.idl
index a329c8b26384..2595ddf2e50f 100644
--- a/offapi/com/sun/star/awt/XToolkit.idl
+++ b/offapi/com/sun/star/awt/XToolkit.idl
@@ -50,7 +50,11 @@ published interface XToolkit: com::sun::star::uno::XInterface
com::sun::star::awt::XWindowPeer getDesktopWindow();
- /** returns the complete work area for this toolkit.
+ /**
+ * For LibreOffice versions < 4.1, this method just returned an empty rectangle.
+ * After that, it started returning a valid value.
+ *
+ * @returns the complete work area for this toolkit.
*/
com::sun::star::awt::Rectangle getWorkArea();
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 4f38a2927b65..49f3d3fde429 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -522,9 +522,14 @@ void SAL_CALL VCLXToolkit::disposing()
::com::sun::star::awt::Rectangle VCLXToolkit::getWorkArea( ) throw(::com::sun::star::uno::RuntimeException)
{
- ::com::sun::star::awt::Rectangle aRect;
- // 07/00: AppWindow doesn't exist anymore...
- return aRect;
+ sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
+ Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay );
+ com::sun::star::awt::Rectangle aNotherRect;
+ aNotherRect.X = aWorkRect.getX();
+ aNotherRect.Y = aWorkRect.getY();
+ aNotherRect.Width = aWorkRect.getWidth();
+ aNotherRect.Height = aWorkRect.getHeight();
+ return aNotherRect;
}
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > VCLXToolkit::createWindow( const ::com::sun::star::awt::WindowDescriptor& rDescriptor ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)