summaryrefslogtreecommitdiff
path: root/comphelper/source/misc/lok.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/source/misc/lok.cxx')
-rw-r--r--comphelper/source/misc/lok.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 0969b5399bd4..253d94500f13 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -12,6 +12,7 @@
#include <sal/log.hxx>
#include <iostream>
+#include <map>
namespace comphelper
{
@@ -21,8 +22,6 @@ namespace LibreOfficeKit
static bool g_bActive(false);
-static bool g_bMobile(false);
-
static bool g_bPartInInvalidation(false);
static bool g_bTiledPainting(false);
@@ -44,6 +43,9 @@ static LanguageTag g_aLanguageTag("en-US", true);
/// Scaling of the cairo or CoreGraphics canvas painting for HiDPI or zooming in Calc.
static double g_fDPIScale(1.0);
+/// List of <viewid, bMobile> pairs
+static std::map<int, bool> g_vIsViewMobile;
+
void setActive(bool bActive)
{
g_bActive = bActive;
@@ -54,14 +56,24 @@ bool isActive()
return g_bActive;
}
-void setMobile(bool bIsMobile)
+void setMobile(int nViewId, bool bMobile)
{
- g_bMobile = bIsMobile;
+ if (g_vIsViewMobile.find(nViewId) != g_vIsViewMobile.end())
+ g_vIsViewMobile[nViewId] = bMobile;
+ else
+ g_vIsViewMobile.insert(std::make_pair(nViewId, bMobile));
}
-bool isMobile()
+bool isMobile(int nViewId)
{
- return g_bMobile;
+ // No view given, so act as a global var
+ if (nViewId == -1)
+ return g_vIsViewMobile.size() > 0;
+
+ if (g_vIsViewMobile.find(nViewId) != g_vIsViewMobile.end())
+ return g_vIsViewMobile[nViewId];
+ else
+ return false;
}
void setPartInInvalidation(bool bPartInInvalidation)