drop isLOKDesktop and LOKDeviceFormFactor

follow-up of
commit 7579bac8e9
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Fri May 29 10:46:04 2026 +0200

    drop isLOKTablet

and

commit f436c1cd89
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Fri May 29 10:07:20 2026 +0200

    drop isLOKMobilePhone

Change-Id: I59604e56af75933acaa3ba6146e9b406d7a7845e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205828
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2026-05-29 15:13:09 +02:00
parent 50391b654f
commit 0a231f1237
7 changed files with 1 additions and 50 deletions
-6
View File
@@ -2945,9 +2945,6 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
}
}
const OUString aDeviceFormFactor = extractParameter(aOptions, u"DeviceFormFactor");
SfxLokHelper::setDeviceFormFactor(aDeviceFormFactor);
const OUString aBatch = extractParameter(aOptions, u"Batch");
if (!aBatch.isEmpty())
{
@@ -7168,9 +7165,6 @@ static int doc_createViewWithOptions(LibreOfficeKitDocument* pThis,
comphelper::LibreOfficeKit::setLocale(LanguageTag(aLanguage));
}
const OUString aDeviceFormFactor = extractParameter(aOptions, u"DeviceFormFactor");
SfxLokHelper::setDeviceFormFactor(aDeviceFormFactor);
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
const int nId = SfxLokHelper::createView(pDocument->mnDocumentId);
-4
View File
@@ -139,10 +139,6 @@ public:
static void setLoadLanguage(const OUString& rBcp47LanguageTag);
/// Set the locale for the given view.
static void setViewLocale(int nId, const OUString& rBcp47LanguageTag);
/// Get the device form factor that should be used for a new view.
static LOKDeviceFormFactor getDeviceFormFactor();
/// Set the device form factor that should be used for a new view.
static void setDeviceFormFactor(std::u16string_view rDeviceFormFactor);
/// Set color preview state for the given view.
static void setColorPreviewState(int nId, bool nEnabled);
-16
View File
@@ -108,19 +108,6 @@ namespace o3tl
template<> struct typed_flags<SfxViewShellFlags> : is_typed_flags<SfxViewShellFlags, 0x0110> {};
}
/* [Description]
The SfxViewShell flags control the behavior of SfxViewShell for the
duration of its lifetime. They are defined in the constructor of
<SfxViewShell>.
*/
enum class LOKDeviceFormFactor
{
UNKNOWN = 0,
DESKTOP = 1
};
class SfxViewFactory;
#define SFX_DECL_VIEWFACTORY(Class) \
private: \
@@ -170,7 +157,6 @@ friend class SfxPrinterController;
LanguageTag maLOKLanguageTag;
LanguageTag maLOKLocale;
std::unique_ptr<CalendarWrapper> mpCalendar;
LOKDeviceFormFactor maLOKDeviceFormFactor;
bool mbLOKAccessibilityEnabled;
rtl::Reference<LOKDocumentFocusListener> mpLOKDocumentFocusListener;
std::unordered_set<OUString> mvLOKBlockedCommandList;
@@ -473,8 +459,6 @@ public:
void SetLOKLanguageAndLocale(const OUString& rBcp47LanguageTag);
/// Get the LibreOfficeKit calendar of this view.
CalendarWrapper& GetLOKCalendar();
/// Check if the lok client is running on a desktop machine.
bool isLOKDesktop() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::DESKTOP; }
virtual tools::Rectangle getLOKVisibleArea() const { return tools::Rectangle(); }
+1 -1
View File
@@ -1278,7 +1278,7 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
}
const SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive() && pViewShell && pViewShell->isLOKDesktop())
if (comphelper::LibreOfficeKit::isActive())
{
tools::JsonWriter writer;
writer.put("type", "formulausage");
-6
View File
@@ -426,12 +426,6 @@ void ScInputWindow::StartFormula()
if (comphelper::LibreOfficeKit::isActive())
{
TextGrabFocus();
if (pViewSh && !pViewSh->isLOKDesktop())
{
nStartPara = nEndPara = pView->getEditEngine().GetParagraphCount() ?
(pView->getEditEngine().GetParagraphCount() - 1) : 0;
nStartPos = nEndPos = pView->getEditEngine().GetTextLen(nStartPara);
}
}
pView->SetSelection(ESelection(nStartPara, nStartPos, nEndPara, nEndPos));
pScMod->InputChanged(pView);
-14
View File
@@ -95,7 +95,6 @@ namespace
{
LanguageTag g_defaultLanguageTag(u"en-US"_ustr, true);
LanguageTag g_loadLanguageTag(u"en-US"_ustr, true); //< The language used to load.
LOKDeviceFormFactor g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
bool g_isDefaultTimezoneSet = false;
OUString g_DefaultTimezone;
const std::size_t g_logNotifierCacheMaxSize = 50;
@@ -449,19 +448,6 @@ void SfxLokHelper::setViewLocale(int nId, const OUString& rBcp47LanguageTag)
}
}
LOKDeviceFormFactor SfxLokHelper::getDeviceFormFactor()
{
return g_deviceFormFactor;
}
void SfxLokHelper::setDeviceFormFactor(std::u16string_view rDeviceFormFactor)
{
if (rDeviceFormFactor == u"desktop")
g_deviceFormFactor = LOKDeviceFormFactor::DESKTOP;
else
g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
}
void SfxLokHelper::setColorPreviewState(int nId, bool nEnabled)
{
std::vector<SfxViewShell*>& rViewArr = SfxGetpApp()->GetViewShells_Impl();
-3
View File
@@ -2754,7 +2754,6 @@ SfxViewShell::SfxViewShell
, mbPrinterSettingsModified(false)
, maLOKLanguageTag(LANGUAGE_NONE)
, maLOKLocale(LANGUAGE_NONE)
, maLOKDeviceFormFactor(LOKDeviceFormFactor::UNKNOWN)
, mbLOKAccessibilityEnabled(false)
, mbLOKColorPreviewEnabled(false)
{
@@ -2776,8 +2775,6 @@ SfxViewShell::SfxViewShell
maLOKIsTimezoneSet = isTimezoneSet;
maLOKTimezone = aTimezone;
maLOKDeviceFormFactor = SfxLokHelper::getDeviceFormFactor();
vcl::Window* pFrameWin = rViewFrame.GetWindow().GetFrameWindow();
if (pFrameWin && !pFrameWin->GetLOKNotifier())
pFrameWin->SetLOKNotifier(this, true);