Kaydet (Commit) 873f09df authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Jan Holesovsky

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/54465Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 32ebfd0d
...@@ -445,13 +445,22 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, ...@@ -445,13 +445,22 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow,
if (bLOKActive && pLOKTwipsPos) if (bLOKActive && pLOKTwipsPos)
{ {
// if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel)
// 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 // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)),
// computed output device dpi or at least the most commonly used 96 dpi // for pixel conversions when map mode is not enabled, we gets
// value; and anyway the following is what we already do in // a 20 twips per pixel conversion since LogicToLogic uses
// ScGridWindow::LogicInvalidate when map mode is not enabled. // a fixed 72 dpi value, instead of a correctly computed output
*pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); // 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 // caller expects coordinates relative to top-level win
......
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