diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-03-24 09:12:07 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-05-19 12:43:02 +0200 |
commit | 91b66b621ba6bb71dc36facbad5f8a3a616103d8 (patch) | |
tree | ea1da4a5c56fcd9757d8a0e1a58e8d1a0967b00c /comphelper | |
parent | ac2ace4c40bb97818d75ae74df0cb0b6f9451a3f (diff) |
Simplify the LibreOfficeKit mobile phone and tablet API
There is not need to ever change the kind of device a view is for, so
why bother with the bool parameter to setMobilePhone() and
setTablet(). Also, make sure just either of them is called, at most
once, for a view.
Change-Id: I9ac872f0ab4772e4a7c40c49f62b32fa7b1e47f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90969
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94485
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/lok.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index c4ff1c641240..dd4a280f52c5 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -59,9 +59,11 @@ bool isActive() return g_bActive; } -void setMobilePhone(int nViewId, bool bIsMobilePhone) +void setMobilePhone(int nViewId) { - g_vIsViewMobilePhone[nViewId] = bIsMobilePhone; + assert(!isMobilePhone(nViewId)); + assert(!isTablet(nViewId)); + g_vIsViewMobilePhone[nViewId] = true; } bool isMobilePhone(int nViewId) @@ -72,9 +74,11 @@ bool isMobilePhone(int nViewId) return false; } -void setTablet(int nViewId, bool bIsTablet) +void setTablet(int nViewId) { - g_vIsViewTablet[nViewId] = bIsTablet; + assert(!isMobilePhone(nViewId)); + assert(!isTablet(nViewId)); + g_vIsViewTablet[nViewId] = true; } bool isTablet(int nViewId) |