diff options
-rw-r--r-- | sc/source/ui/view/tabvwsh2.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 117edd72493d..da77a4278655 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -19,6 +19,7 @@ #include <comphelper/lok.hxx> #include <sfx2/bindings.hxx> +#include <sfx2/lokhelper.hxx> #include <sfx2/viewfrm.hxx> #include <svl/whiter.hxx> #include <unotools/moduleoptions.hxx> @@ -320,6 +321,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) // calc position and size bool bLOKIsActive = comphelper::LibreOfficeKit::isActive(); + bool bIsMobile = comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()); Point aInsertPos; if(!bLOKIsActive) { @@ -328,6 +330,16 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) aInsertPos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) ); aInsertPos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) ); } + else if (bIsMobile) + { + aInsertPos = GetViewData().getLOKVisibleArea().Center(); + + aInsertPos.setX(sc::TwipsToHMM(aInsertPos.X())); + aInsertPos.setY(sc::TwipsToHMM(aInsertPos.Y())); + + aInsertPos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) ); + aInsertPos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) ); + } else { aInsertPos = GetInsertPos(); |