diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-05-14 20:12:11 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2016-05-15 20:13:04 +0000 |
commit | 0b223bac012fae1af2d2bf1fe9c038cbe88846ed (patch) | |
tree | 1742fa75091b3a0643839e9bed6f768b7d239325 | |
parent | 4523f78312bd07449fa205301d99a81ef0f69420 (diff) |
LOK: ensure KeyInput is handled with the correct MapMode
The MapMode is set explicitly to make sure the coordinates
of the comment widget is in absolute terms. However
PostItMgr::MakeVisible invalidates it. This is to
ensure that the MapMode is restored after MakeVisible
is called when LOK is active.
Change-Id: I2adf749488e6eb46d29a0b29c4dfd644606c92ab
Reviewed-on: https://gerrit.libreoffice.org/25015
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 8da86c3957b4..67a2252d4a00 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -50,6 +50,7 @@ #include <editeng/editview.hxx> #include <editeng/flditem.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include <uitool.hxx> #include <view.hxx> @@ -251,8 +252,12 @@ void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt ) } else { + // MakeVisible can lose our MapMode, save it. + auto oldMapMode = GetMapMode(); //let's make sure we see our note mrPostItMgr.MakeVisible(&mrSidebarWin); + if (comphelper::LibreOfficeKit::isActive()) + SetMapMode(oldMapMode); long aOldHeight = mrSidebarWin.GetPostItTextHeight(); bool bDone = false; |