summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-23 09:02:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-23 09:31:33 +0100
commit5263052d3261c4fff45120d568c947e30987d6df (patch)
tree142160595ec504287bb19ad8aaf250e3ddf93e4e
parent5eaff8456878a03f5c45187493c6b6d9bb867952 (diff)
Resolves: fdo#33509 Context menu in spellcheck in RTL UI closes too early
(cherry picked from commit 485b6dc95fe783ef3bb9bbe1ae2f65fe04edc926)
-rw-r--r--vcl/source/window/floatwin.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 46944f12ee..3c92b116b2 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -696,13 +696,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
// so they can be compared across different frames
// !!! rRect is expected to be in screen coordinates of the parent frame window !!!
maFloatRect = rRect;
- if( GetParent()->ImplHasMirroredGraphics() )
+
+ Window *pReference = GetParent();
+
+ // compare coordinates in absolute screen coordinates
+ // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509
+ if( pReference->ImplHasMirroredGraphics() )
{
- maFloatRect.SetPos( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) );
- maFloatRect = GetParent()->ImplOutputToUnmirroredAbsoluteScreenPixel( maFloatRect );
+ if(!pReference->IsRTLEnabled() )
+ // --- RTL --- re-mirror back to get device coordiantes
+ pReference->ImplReMirror(maFloatRect);
+
+ maFloatRect.SetPos(pReference->ScreenToOutputPixel(maFloatRect.TopLeft()));
+ maFloatRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel(maFloatRect);
}
else
- maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) );
+ maFloatRect.SetPos(pReference->OutputToAbsoluteScreenPixel(pReference->ScreenToOutputPixel(rRect.TopLeft())));
maFloatRect.Left() -= 2;
maFloatRect.Top() -= 2;