diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-03-16 13:50:00 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-03-16 15:14:01 +0100 |
commit | fc5400b167f1f6a9a788acfd5894622f440ee5f5 (patch) | |
tree | 2c6c50351d32861356d393940a1cca7e2dabc61e /desktop | |
parent | e3daab4a0899ab89b42bdc1086217deba51bb993 (diff) |
Rename isMobile to isMobilePhone and introduce a separate isTablet
The intended semantics of isMobile() has been to say whether the
device is a mobile phone ot not. Not whether it is a mobile device in
general. So make that explicit.
Adjust call sites as necessary. Also, in a couple of places where it
is likely that what is relevant is whether it is a mobile device in
general, not just whether it is a mobile phone, check both isMobile()
and isTablet().
For stable interoperability with current Online, keep accepting also
the .uno:LOKSetMobile "command" (and .uno:LOKUnSetMobile, except that
Online never sends that), but Online will be changed to use
.uno:LOKSetMobilePhone.
Also drop the default value for the bool parameter to
setMobilePhone(). Default bool parameters can be quite confusing, and
it was especially silly in this case as there is one (1) call site.
Change-Id: I2a71c37323ee151cbc671bd8e714e1dee10f8b1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90560
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d64e827e006a..95762d537e1c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3623,15 +3623,25 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma if (nView < 0) return; - // Set/unset mobile view for LOK - if (gImpl && aCommand == ".uno:LOKSetMobile") + // Set/unset mobile phone view for LOK + if (gImpl && (aCommand == ".uno:LOKSetMobile" || aCommand == ".uno:LOKSetMobilePhone")) { - comphelper::LibreOfficeKit::setMobile(nView); + comphelper::LibreOfficeKit::setMobilePhone(nView, true); return; } - else if (gImpl && aCommand == ".uno:LOKUnSetMobile") + else if (gImpl && (aCommand == ".uno:LOKUnSetMobile" || aCommand == ".uno:LOKUnSetMobilePhone")) { - comphelper::LibreOfficeKit::setMobile(nView, false); + comphelper::LibreOfficeKit::setMobilePhone(nView, false); + return; + } + else if (gImpl && aCommand == ".uno:LOKSetTablet") + { + comphelper::LibreOfficeKit::setTablet(nView, true); + return; + } + else if (gImpl && aCommand == ".uno:LOKUnSetTablet") + { + comphelper::LibreOfficeKit::setTablet(nView, false); return; } else if (gImpl && aCommand == ".uno:ToggleOrientation") |