Kaydet (Commit) edf6819a authored tarafından Tamás Zolnai's avatar Tamás Zolnai

lok: Insert shape at the positon of the selected cell

Calculation of the visible area is not working correctly in
online case which leads to positioning of the shape outisde
of the view.
Instead of that calculation use the selected cell's position
to insert the shape at, similar how image insertion works.

Change-Id: I5c887261556c491962ed19f416ce480a63c24a9a
Reviewed-on: https://gerrit.libreoffice.org/65177
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst b052974a
......@@ -324,11 +324,21 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
sal_uInt32 nDefaultObjectSizeHeight = rAppOpt.GetDefaultObjectSizeHeight();
// calc position and size
tools::Rectangle aVisArea = pWin->PixelToLogic(tools::Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
Point aPagePos = aVisArea.Center();
aPagePos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) );
aPagePos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) );
tools::Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
bool bLOKIsActive = comphelper::LibreOfficeKit::isActive();
Point aInsertPos;
if(!bLOKIsActive)
{
tools::Rectangle aVisArea = pWin->PixelToLogic(tools::Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
aInsertPos = aVisArea.Center();
aInsertPos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) );
aInsertPos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) );
}
else
{
aInsertPos = GetInsertPos();
}
tools::Rectangle aNewObjectRectangle(aInsertPos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
ScDrawView* pDrView = GetScDrawView();
......
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