From 38f31adea6596e1303821df06ba481b850508490 Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Mon, 20 Apr 2020 21:26:26 +0200 Subject: lok: set device form factor of the client on view creation This patch allows the lok core to know about the device form facor of the client requesting the creation of new view, immediately instead of a later time. When a new view is needed a "DeviceFormFactor" parameter is forwarded to lo_documentLoadWithOptions and doc_createViewWithOptions from the client. This parameter can have one of the following values: 'desktop', 'tablet','mobile' and it is used to set a global variable accessible by SfxLokHelper::setDeviceFormFactor and SfxLokHelper::getDeviceFormFactor. This global variable is retrived in the SfxViewShell constructor for setting SfxViewShell::maLOKDeviceFormFactor attribute. In SfxViewShell we have the following 3 methods: - bool isLOKDesktop() - bool isLOKTablet() - bool isLOKMobilePhone() which replace the following boolean functions: - comphelper::LibreOfficeKit::isTablet - comphelper::LibreOfficeKit::::isMobilePhone Change-Id: I9b36f354278df8c216fcb90f6a9da8256ec9c1e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93340 Tested-by: Jenkins Reviewed-by: Andras Timar --- svx/source/sidebar/text/TextPropertyPanel.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'svx') diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index f2b3d9ae492d..9accfcdd0c6a 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -50,8 +50,9 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref get(mpSetDefault, "defaultattr"); bool isMobilePhone = false; + const SfxViewShell* pViewShell = SfxViewShell::Current(); if (comphelper::LibreOfficeKit::isActive() && - comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView())) + pViewShell && pViewShell->isLOKMobilePhone()) isMobilePhone = true; VclPtr xSpacingBar; get(xSpacingBar, "spacingbar"); -- cgit