summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/core/sdpage.cxx20
-rw-r--r--sd/source/ui/func/futext.cxx2
2 files changed, 11 insertions, 11 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 31bc4cec27d1..fc2fcdafe155 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2601,9 +2601,9 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
OUString aString;
#if defined(IOS) || defined(ANDROID)
- bool isMobile = true;
+ bool isMobileDevice = true;
#else
- bool isMobile = comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView());
+ bool isMobileDevice = comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()) || comphelper::LibreOfficeKit::isTablet(SfxLokHelper::getView());
#endif
if (eObjKind == PRESOBJ_TITLE)
@@ -2612,20 +2612,20 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
{
if (mePageKind != PageKind::Notes)
{
- if (isMobile)
+ if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_MPTITLE_MOBILE);
else
aString = SdResId(STR_PRESOBJ_MPTITLE);
}
else
{
- if (isMobile)
+ if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_MPNOTESTITLE_MOBILE);
else
aString = SdResId(STR_PRESOBJ_MPNOTESTITLE);
}
}
- else if (isMobile)
+ else if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_TITLE_MOBILE);
else
aString = SdResId(STR_PRESOBJ_TITLE);
@@ -2634,12 +2634,12 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
{
if (mbMaster)
{
- if (isMobile)
+ if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_MPOUTLINE_MOBILE);
else
aString = SdResId(STR_PRESOBJ_MPOUTLINE);
}
- else if (isMobile)
+ else if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_OUTLINE_MOBILE);
else
aString = SdResId(STR_PRESOBJ_OUTLINE);
@@ -2648,19 +2648,19 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
{
if (mbMaster)
{
- if (isMobile)
+ if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_MPNOTESTEXT_MOBILE);
else
aString = SdResId(STR_PRESOBJ_MPNOTESTEXT);
}
- else if (isMobile)
+ else if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_NOTESTEXT_MOBILE);
else
aString = SdResId(STR_PRESOBJ_NOTESTEXT);
}
else if (eObjKind == PRESOBJ_TEXT)
{
- if (isMobile)
+ if (isMobileDevice)
aString = SdResId(STR_PRESOBJ_TEXT_MOBILE);
else
aString = SdResId(STR_PRESOBJ_TEXT);
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index a6b7677debae..fc216d5d1389 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -524,7 +524,7 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
pTxtObj->AdjustTextFrameWidthAndHeight();
aSet.Put(makeSdrTextMaxFrameHeightItem(pTxtObj->GetLogicRect().GetSize().Height()));
pTxtObj->SetMergedItemSet(aSet);
- if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ if (comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()) || comphelper::LibreOfficeKit::isTablet(SfxLokHelper::getView()))
pTxtObj->SetText(SdResId(STR_PRESOBJ_TEXT_EDIT_MOBILE));
}
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )