summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-03-16 13:50:00 +0200
committerTor Lillqvist <tml@collabora.com>2020-03-20 15:10:48 +0100
commit5ccb7ecf7cda92934d63cc171674b6c4f7f51af7 (patch)
treed1ca3398df7d517f0f466b5cc226cf1730ca3ed3 /sc
parentb1e9ab0dd38c76413b46111d5bdbc837099b8f69 (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). Online will eventually be changed to use .uno:LOKSetMobilePhone or .uno:LOGSetTablet only (and never the UnSet variants). 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. This is a work in progress and will be improved. Currently there are undefined corner cases. 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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90778 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx5
-rw-r--r--sc/source/ui/view/viewfun5.cxx2
6 files changed, 8 insertions, 7 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 076acd2f06de..bea2cc244eb3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1309,7 +1309,7 @@ namespace {
void ScInputHandler::ShowFuncList( const ::std::vector< OUString > & rFuncStrVec )
{
if (comphelper::LibreOfficeKit::isActive() &&
- comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
SfxViewShell* pViewShell = SfxViewShell::Current();
if (pViewShell && rFuncStrVec.size())
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1fdb5ad5eddc..26035be992ca 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -821,7 +821,7 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
maButton->SetSymbol(SymbolType::SPIN_DOWN);
maButton->SetQuickHelpText(ScResId(SCSTR_QHELP_EXPAND_FORMULA));
// disable the multiline toggle on the mobile phones
- if (!comphelper::LibreOfficeKit::isActive() || !comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ if (!comphelper::LibreOfficeKit::isActive() || !comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
maButton->Show();
}
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 80753e59c3cd..e18dd815396f 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -608,7 +608,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
if( xChartModel.is() )
xChartModel->unlockControllers();
}
- else if (!comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ else if (!comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
//the controller will be unlocked by the dialog when the dialog is told to do so
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 78363b683ebe..f5c8f7e4955b 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -175,7 +175,7 @@ boost::property_tree::ptree AlignmentPropertyPanel::DumpAsPropertyTree()
{
boost::property_tree::ptree aTree = PanelLayout::DumpAsPropertyTree();
- if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ if (comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
{
eraseNode(aTree, "textorientbox");
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 44096e0c7f43..ffcdf1656b15 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2211,10 +2211,11 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScGlobal::OpenURL(aUrl, aTarget, isTiledRendering);
return;
}
- // in mobile view there is no ctrl+click and for hyperlink popup
+ // On a mobile device view there is no ctrl+click and for hyperlink popup
// the cell coordinates must be sent along with click position for elegance
if (isTiledRendering &&
- comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ (comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()) ||
+ comphelper::LibreOfficeKit::isTablet(SfxLokHelper::getView())))
{
ScTabViewShell* pViewShell = pViewData->GetViewShell();
Point aPos = rMEvt.GetPosPixel();
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index c0a108c1045d..758c0621478d 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -337,7 +337,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
{
// Do CSV dialog if more than one line. But not if invoked from Automation.
sal_Int32 nDelim = pStrBuffer->indexOf('\n');
- if (!comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) && !comphelper::Automation::AutomationInvokedZone::isActive()
+ if (!comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()) && !comphelper::Automation::AutomationInvokedZone::isActive()
&& nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1)
{
vcl::Window* pParent = GetActiveWin();