sc/source/ui/view/tabvwsh2.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit 7a27ac1060fcf8a6bbf9e03ad1457633dcd1ad06 Author: Muhammet Kara <muhammet.k...@collabora.com> AuthorDate: Wed Feb 12 05:42:11 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Feb 13 06:56:01 2020 +0100 mobile: Center inserted shapes on visible area Change-Id: I366ef5d01ee3afb072b1f67d24015c889a41f4b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88488 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits