Kaydet (Commit) ac9cf739 authored tarafından Miklos Vajna's avatar Miklos Vajna

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 d78432e9)
üst f06a9ec1
...@@ -665,7 +665,24 @@ void SwSidebarWin::SetPosAndSize() ...@@ -665,7 +665,24 @@ void SwSidebarWin::SetPosAndSize()
{ {
bChange = true; bChange = true;
SetSizePixel(mPosSize.GetSize()); 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(); DoResize();
if (comphelper::LibreOfficeKit::isActive())
mpSidebarTextControl->Pop();
} }
if (GetPosPixel().X() != mPosSize.TopLeft().X() || (std::abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) ) if (GetPosPixel().X() != mPosSize.TopLeft().X() || (std::abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) )
......
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