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-09 11:15:31 +0100
commitf38c84f1dd1f78763bc72496ff251216bc1209a0 (patch)
treeb3d8ae2fed33425351e9dfeea3cf2497af575977
parent61809810c13778607f4cd3eaff6e490c3c6dd50d (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. (cherry picked from commit 71a1ea29b8793a8db012dd3452ef0dd87f1be36a) Conflicts: emfio/source/reader/emfreader.cxx Change-Id: I76e82b77d70910ba4843db6ab998b0b1ea4a31f5
-rw-r--r--vcl/source/filter/wmf/enhwmf.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 0a22ab3762fd..b10c61a14766 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -21,6 +21,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <vcl/dibtools.hxx>
#include <o3tl/make_unique.hxx>
+#include <rtl/bootstrap.hxx>
#include "winmtf.hxx"
@@ -648,7 +649,9 @@ bool EnhWMFReader::ReadEnhWMF()
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();
while( bStatus && nRecordCount-- && pWMF->good())
{