[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - officecfg/registry xmloff/source
Serge Krot
Serge.Krot at cib.de
Tue Apr 3 13:33:44 UTC 2018
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 7 +++++++
xmloff/source/draw/shapeexport.cxx | 4 +++-
xmloff/source/text/txtparae.cxx | 4 +++-
3 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit da7a6f12bd92b174d36e10f88da4d2c5848390bd
Author: Serge Krot <Serge.Krot at cib.de>
Date: Tue Mar 27 12:25:40 2018 +0200
tdf#115005: New option to prevent adding fallback images
A new option AddReplacementImages was added to prevent
addition of fallback images that could increase the file
size of the package in several times.
Added unit test.
Reviewed-on: https://gerrit.libreoffice.org/51939
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Conflicts:
sd/qa/unit/export-tests-ooxml2.cxx
xmloff/source/draw/shapeexport.cxx
xmloff/source/text/txtparae.cxx
Change-Id: I50eebba51072d3c93bfe6bed59e9f007568810c0
Reviewed-on: https://gerrit.libreoffice.org/52324
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index fb96a51ec82f..74cbc1525e1a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2331,6 +2331,13 @@
</constraints>
<value>1</value>
</prop>
+ <prop oor:name="AddReplacementImages" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Export replacement objects as fallback images for vector graphics (True).</desc>
+ <label>Export replacement objects as fallback images for vector graphics</label>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="URL">
<info>
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 1fe976433eae..3d9ed583cd8f 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -85,6 +85,7 @@
#include <comphelper/graphicmimetype.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
+#include <officecfg/Office/Common.hxx>
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
@@ -2369,7 +2370,8 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
//Resolves: fdo#62461 put preferred image first above, followed by
//fallback here
- if( !bIsEmptyPresObj )
+ const bool bAddReplacementImages = officecfg::Office::Common::Save::Graphic::AddReplacementImages::get();
+ if( !bIsEmptyPresObj && bAddReplacementImages )
{
OUString aReplacementUrl;
xPropSet->getPropertyValue("ReplacementGraphicURL") >>= aReplacementUrl;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index de374d21265f..a79887846852 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -114,6 +114,7 @@
#include <algorithm>
#include <iterator>
#include <comphelper/graphicmimetype.hxx>
+#include <officecfg/Office/Common.hxx>
using namespace ::std;
using namespace ::com::sun::star;
@@ -3159,7 +3160,8 @@ void XMLTextParagraphExport::_exportTextGraphic(
//Resolves: fdo#62461 put preferred image first above, followed by
//fallback here
- if (!sReplacementOrigURL.isEmpty())
+ const bool bAddReplacementImages = officecfg::Office::Common::Save::Graphic::AddReplacementImages::get();
+ if (!sReplacementOrigURL.isEmpty() && bAddReplacementImages)
{
const OUString sReplacementURL(GetExport().AddEmbeddedGraphicObject( sReplacementOrigURL ));
More information about the Libreoffice-commits
mailing list