summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2018-05-16 21:43:59 +0200
committerJan Holesovsky <kendy@collabora.com>2018-05-23 16:25:56 +0200
commit873f09df02a14c8e16ff13ce189c0af3317a754a (patch)
tree8b7eeba24b1d0530d486b1c7c302198e0af651db /vcl
parent32ebfd0da5da80a2fc7b92469024585f1d49bb16 (diff)
lok: sc: tunneled spell-check context menu appear in bottom right corner
In the end it seems that in this context LogicToLogic is used for converting non-pixel units, too. Change-Id: I268e5522e929dd55af1284c38780064315d8cd41 Reviewed-on: https://gerrit.libreoffice.org/54465 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/floatwin.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 302703bf4e8a..8a5d5dcc62fd 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -445,13 +445,22 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow,
if (bLOKActive && pLOKTwipsPos)
{
- // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)),
- // when map mode is not enabled, we gets a 20 twips per pixel conversion
- // since LogicToLogic uses a fixed 72 dpi value, instead of a correctly
- // computed output device dpi or at least the most commonly used 96 dpi
- // value; and anyway the following is what we already do in
- // ScGridWindow::LogicInvalidate when map mode is not enabled.
- *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip));
+ if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel)
+ {
+ // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)),
+ // for pixel conversions when map mode is not enabled, we gets
+ // a 20 twips per pixel conversion since LogicToLogic uses
+ // a fixed 72 dpi value, instead of a correctly computed output
+ // device dpi or at least the most commonly used 96 dpi value;
+ // and anyway the following is what we already do in
+ // ScGridWindow::LogicInvalidate when map mode is not enabled.
+
+ *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip));
+ }
+ else
+ {
+ *pLOKTwipsPos = pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip));
+ }
}
// caller expects coordinates relative to top-level win