summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2020-04-20 21:26:26 +0200
committerMichael Meeks <michael.meeks@collabora.com>2020-05-28 09:19:31 +0100
commit38f31adea6596e1303821df06ba481b850508490 (patch)
treef512e350ea809e03b19e7b2874722ef35daf6790 /comphelper
parent8e53cb9471f9b793c462bb0675548d262917d3b5 (diff)
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 <andras.timar@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/lok.cxx36
1 files changed, 0 insertions, 36 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index c58a1aa6f547..0f665f1be202 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -91,12 +91,6 @@ static LanguageAndLocale g_aLanguageAndLocale;
/// Scaling of the cairo canvas painting for hi-dpi
static double g_fDPIScale(1.0);
-/// Which views are on mobile phones?
-static std::map<int, bool> g_vIsViewMobilePhone;
-
-/// Which views are on tablets?
-static std::map<int, bool> g_vIsViewTablet;
-
void setActive(bool bActive)
{
g_bActive = bActive;
@@ -107,36 +101,6 @@ bool isActive()
return g_bActive;
}
-void setMobilePhone(int nViewId)
-{
- assert(!isMobilePhone(nViewId));
- assert(!isTablet(nViewId));
- g_vIsViewMobilePhone[nViewId] = true;
-}
-
-bool isMobilePhone(int nViewId)
-{
- if (g_vIsViewMobilePhone.find(nViewId) != g_vIsViewMobilePhone.end())
- return g_vIsViewMobilePhone[nViewId];
- else
- return false;
-}
-
-void setTablet(int nViewId)
-{
- assert(!isMobilePhone(nViewId));
- assert(!isTablet(nViewId));
- g_vIsViewTablet[nViewId] = true;
-}
-
-bool isTablet(int nViewId)
-{
- if (g_vIsViewTablet.find(nViewId) != g_vIsViewTablet.end())
- return g_vIsViewTablet[nViewId];
- else
- return false;
-}
-
void setPartInInvalidation(bool bPartInInvalidation)
{
g_bPartInInvalidation = bPartInInvalidation;