summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-14 13:39:02 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-16 11:38:27 +0100
commitac9cf73997ea8e6ea8b5919dd677b4c8faf36acd (patch)
tree2e56922fcb9f8f0a10bdd147749bff34bfa2b4ca /sw
parentf06a9ec1fd6d0daad1177f496211ef9befd8849c (diff)
sw lok comments: fix cursor position of a newly created sidebar window
With this, pressing ctrl-alt-c to create a new comment has the correct cursor position. Change-Id: Icb8d708dab015d8ffa9bcfe28de66238a75b50bc (cherry picked from commit d78432e9a077725046419902c542ce4e5f515705)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index bcc128412cbc..01ce695d8bfe 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -665,7 +665,24 @@ void SwSidebarWin::SetPosAndSize()
{
bChange = true;
SetSizePixel(mPosSize.GetSize());
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Position is not yet set at VCL level, but the map mode should
+ // contain the right origin to emit the correct cursor position.
+ mpSidebarTextControl->Push(PushFlags::MAPMODE);
+ Point aOffset(mPosSize.Left(), mPosSize.Top());
+ aOffset = PixelToLogic(aOffset);
+ MapMode aMapMode(mpSidebarTextControl->GetMapMode());
+ aMapMode.SetOrigin(aOffset);
+ mpSidebarTextControl->SetMapMode(aMapMode);
+ mpSidebarTextControl->EnableMapMode(false);
+ }
+
DoResize();
+
+ if (comphelper::LibreOfficeKit::isActive())
+ mpSidebarTextControl->Pop();
}
if (GetPosPixel().X() != mPosSize.TopLeft().X() || (std::abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) )