summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-12-08 15:15:47 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-12-08 15:17:22 +0100
commita9b042dd4554764eb5cef336c35d615d009806d6 (patch)
tree89ffe501cdac9f9aa7b0034d5afed58405a2cf98
parent24deea41f820399593210c8806edd68940f77c20 (diff)
emfio: allow disabling EMF+ via a bootstrap variable
Bootstrap variables have multiple sources, so the environment variable way continues to work. This also allows disabling EMF+ using the -env:EMF_PLUS_DISABLE=1 cmdline parameter, which is useful when soffice is not started in a shell. Conflicts: emfio/source/reader/emfreader.cxx Change-Id: I76e82b77d70910ba4843db6ab998b0b1ea4a31f5
-rw-r--r--emfio/source/reader/emfreader.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 5d2749d16356..c9dd15bc1879 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -24,6 +24,7 @@
#include <o3tl/safeint.hxx>
#include <tools/stream.hxx>
#include <memory>
+#include <rtl/bootstrap.hxx>
#ifdef DBG_UTIL
#include <vcl/pngwrite.hxx>
@@ -724,7 +725,9 @@ namespace emfio
bool bStatus = ReadHeader();
bool bHaveDC = false;
- static bool bEnableEMFPlus = ( getenv( "EMF_PLUS_DISABLE" ) == nullptr );
+ OUString aEMFPlusDisable;
+ rtl::Bootstrap::get("EMF_PLUS_DISABLE", aEMFPlusDisable);
+ bool bEnableEMFPlus = aEMFPlusDisable.isEmpty();
SAL_INFO("emfio", "EMF_PLUS_DISABLE is " << (bEnableEMFPlus ? "enabled" : "disabled"));