summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-07-17 19:18:32 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-07-17 19:15:31 +0200
commit68a96f747345dd55bcb6abdd8eee0e2d9768c9ec (patch)
tree82dc96ea1ee20a8506c942b5b7b679fc849186c6 /sc
parent2a20a894b0752e5b7f28547ed9a90570739e8bea (diff)
Use IsRunningUnitTest / IsRunningUITest consistently
The functions are moved to o3tl as inline functions. Change-Id: Ief7d7e292ef15e055ad04ab5707e5e6a2a05b916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170636 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen2.cxx3
-rw-r--r--sc/source/core/data/queryiter.cxx2
2 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 1c64bb8f334f..028975850f96 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -20,6 +20,7 @@
#include <scextopt.hxx>
#include <autonamecache.hxx>
+#include <o3tl/test_info.hxx>
#include <osl/thread.h>
#include <svx/xtable.hxx>
#include <sfx2/bindings.hxx>
@@ -102,7 +103,7 @@ ScSheetLimits ScSheetLimits::CreateDefault()
if( SC_MOD())
jumboSheets = SC_MOD()->GetDefaultsOptions().GetInitJumboSheets();
else
- assert( getenv("LO_RUNNING_UNIT_TEST") != nullptr ); // in unittests
+ assert(o3tl::IsRunningUnitTest());
if (jumboSheets)
return ScSheetLimits(MAXCOL_JUMBO, MAXROW_JUMBO);
else
diff --git a/sc/source/core/data/queryiter.cxx b/sc/source/core/data/queryiter.cxx
index 11b4bb725ce6..ae8b5b2a38e8 100644
--- a/sc/source/core/data/queryiter.cxx
+++ b/sc/source/core/data/queryiter.cxx
@@ -1625,7 +1625,7 @@ static bool CanBeUsedForSorterCache(ScDocument& /*rDoc*/, const ScQueryParam& /*
&& rParam.GetEntry(0).eOp != SC_EQUAL)
return false;
// For unittests allow inefficient caching, in order for the code to be checked.
- static const bool bRunningUnitTest = getenv("LO_RUNNING_UNIT_TEST");
+ static const bool bRunningUnitTest = o3tl::IsRunningUnitTest();
if(refData == nullptr || refData->Ref1.IsRowRel() || refData->Ref2.IsRowRel())
{
// If this is not a range, then a cache is not worth it. If rows are relative, then each