comphelper/source/misc/lok.cxx               |    6 ++++--
 include/comphelper/lok.hxx                   |    2 ++
 sc/qa/unit/tiledrendering/tiledrendering.cxx |    3 +--
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit a4aeb2b0c474e0cd7a4c870865aa15462b6b6a3c
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Mar 13 12:14:14 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Mar 13 12:21:33 2023 +0000

    lok: introduce resetCompatFlag
    
    and reset logic of setCompatFlag/isCompatFlagSet changed in
    afb7b373c34bd6a1608a30eb8267fa6f8231e853
    "CppunitTest_sc_tiledrendering: reset CompatFlag in tearDown
    Otherwise, there are some tests setting it to scPrintTwipsMsgs,
    so depending on the order of execution, it might affect other
    tests"
    
    Change-Id: I306ac0b77b65f99879f4018cfbc57354a158f38a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148783
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 019865a63696..405411db7ba8 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -178,9 +178,11 @@ bool isLocalRendering()
     return g_bLocalRendering;
 }
 
-void setCompatFlag(Compat flag) { g_eCompatFlags = flag; }
+void setCompatFlag(Compat flag) { g_eCompatFlags = 
static_cast<Compat>(g_eCompatFlags | flag); }
 
-bool isCompatFlagSet(Compat flag) { return g_eCompatFlags == flag; }
+bool isCompatFlagSet(Compat flag) { return (g_eCompatFlags & flag) == flag; }
+
+void resetCompatFlag() { g_eCompatFlags = Compat::none; }
 
 void setLocale(const LanguageTag& rLanguageTag)
 {
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 4cfdb70a09d3..545136f762ea 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -84,6 +84,8 @@ enum Compat : sal_uInt32
 COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag);
 /// Get compatibility flags
 COMPHELPER_DLLPUBLIC bool isCompatFlagSet(Compat flag);
+/// Reset compatibility flags
+COMPHELPER_DLLPUBLIC void resetCompatFlag();
 
 /// Check whether clients want viewId in visible cursor invalidation payload.
 COMPHELPER_DLLPUBLIC bool isViewIdForVisCursorInvalidation();
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 8f914b294f24..9d5d129e4987 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -104,8 +104,7 @@ void ScTiledRenderingTest::tearDown()
 
     m_callbackWrapper.clear();
 
-    comphelper::LibreOfficeKit::setCompatFlag(
-        comphelper::LibreOfficeKit::Compat::none);
+    comphelper::LibreOfficeKit::resetCompatFlag();
 
     comphelper::LibreOfficeKit::setActive(false);
 

Reply via email to