summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 531aa9052f9c..b21fdd31fd0c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -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();