summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-03-27 12:25:40 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-03-28 08:56:10 +0200
commit1c1160967acf49cffae8921f3ab8361821bbaaaf (patch)
tree0bcc1f841d81625f86649c907ca344d729a45c87 /xmloff
parent1a43481a1d8913a2c5fcb0c2e4363deaf439caff (diff)
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. Change-Id: I50eebba51072d3c93bfe6bed59e9f007568810c0 Reviewed-on: https://gerrit.libreoffice.org/51939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx4
-rw-r--r--xmloff/source/text/txtparae.cxx3
2 files changed, 6 insertions, 1 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index a670d6dad8ec..b0422e8fde8b 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 <o3tl/any.hxx>
#include <o3tl/make_unique.hxx>
@@ -2438,7 +2439,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)
{
uno::Reference<graphic::XGraphic> xReplacementGraphic;
xPropSet->getPropertyValue("ReplacementGraphic") >>= xReplacementGraphic;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index c23ddb2bfa98..a9c5c35d56f2 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -117,6 +117,7 @@
#include <algorithm>
#include <iterator>
#include <comphelper/graphicmimetype.hxx>
+#include <officecfg/Office/Common.hxx>
using namespace ::std;
using namespace ::com::sun::star;
@@ -3153,6 +3154,8 @@ void XMLTextParagraphExport::_exportTextGraphic(
}
}
+ const bool bAddReplacementImages = officecfg::Office::Common::Save::Graphic::AddReplacementImages::get();
+ if (bAddReplacementImages)
{
// replacement graphic for backwards compatibility, but
// only for SVG and metafiles currently