Kaydet (Commit) 99d8ce56 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Meeks

fdo#66762 - Other: com.sun.star.awt.DisplayAccess removed

API_CHANGE:

I removed the undocumented internal API
  "com.sun.star.awt.DisplayAccess"
in commit dde234b6
  "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, to wit,
the size and position of the primary display.

Change-Id: I76300bac604e9e4b7be95b0872a7f95cb6781903
Reviewed-on: https://gerrit.libreoffice.org/4919Reviewed-by: 's avatarMichael Meeks <michael.meeks@suse.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@suse.com>
üst 37a3f963
dictionaries @ 92a907ab
Subproject commit 43d24786db9947f0aababb1228379b0b3ece2652
Subproject commit 92a907ab17814a8e08ab787745fefb85ed00d3f3
helpcontent2 @ a14b0def
Subproject commit d87de0c383537470900fcd7dc78d534e1f9c3f7c
Subproject commit a14b0defe8aec0eb8e80827e5c9cc76ebe742fd3
......@@ -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 size and position of the primary display
*/
com::sun::star::awt::Rectangle getWorkArea();
......
......@@ -560,9 +560,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::GetScreenPosSizePixel( 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment