summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-03-16 13:50:00 +0200
committerTor Lillqvist <tml@collabora.com>2020-03-16 15:14:01 +0100
commitfc5400b167f1f6a9a788acfd5894622f440ee5f5 (patch)
tree2c6c50351d32861356d393940a1cca7e2dabc61e /sfx2
parente3daab4a0899ab89b42bdc1086217deba51bb993 (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 'sfx2')
-rw-r--r--sfx2/source/sidebar/Deck.cxx2
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx4
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx6
3 files changed, 6 insertions, 6 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index ba8f4928ac0b..fd87430a9b70 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -300,7 +300,7 @@ void Deck::RequestLayout()
bChangeNeeded = true;
}
if (mnMinimalWidth > 0 && (mnMinimalWidth != aParentSize.Width() || GetSizePixel().Width() != mnMinimalWidth)
- && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ && comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
aParentSize.setWidth(mnMinimalWidth);
bChangeNeeded = true;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index c885066ef5c9..10cd448771fa 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1222,9 +1222,9 @@ void SidebarController::RequestCloseDeck()
{
const vcl::ILibreOfficeKitNotifier* pNotifier = mpCurrentDeck->GetLOKNotifier();
auto pMobileNotifier = SfxViewShell::Current();
- if (pMobileNotifier && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ if (pMobileNotifier && comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
- // Mobile.
+ // Mobile phone.
std::stringstream aStream;
boost::property_tree::ptree aTree;
aTree.put("id", mpCurrentDeck->GetLOKWindowId());
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 2bf4ea7258bb..13aa2b13dba4 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -62,9 +62,9 @@ public:
try
{
- if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ if (comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
- // Mobile.
+ // Mobile phone.
std::stringstream aStream;
boost::property_tree::ptree aTree = m_rSidebarDockingWin.DumpAsPropertyTree();
aTree.put("id", m_rSidebarDockingWin.GetLOKWindowId());
@@ -78,7 +78,7 @@ public:
}
// Notify the sidebar is created, and its LOKWindowId, which
- // is needed on both Mobile and Desktop.
+ // is needed on mobile phones, tablets, and desktop.
const Point pos = Point(m_rSidebarDockingWin.GetOutOffXPixel(),
m_rSidebarDockingWin.GetOutOffYPixel());
const OString posMessage = pos.toString();