summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-04-11 19:24:25 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-04-26 11:17:54 +0900
commitcec4add12404f23ad69b73be39ad27156fbaec97 (patch)
tree000c754cb1f993faa90ac39cc54e06ad4fcc621a /oox
parentd8aec51a52d5dc4db17514875b3c823ebcb28b66 (diff)
oox: write graphic (blip) in ThemeExport - BlipFill
Share the graphic writing from DrawingML class, which needed a bit of refactoring and use it when writing the BlipFill when exporting a theme with ThemeExport. Change-Id: I89bf3be98f607b7641d231982af2f7a5e2c3d3a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150261 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit b09c377888e2e75859fff37fdf9408065eb522d6)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/ThemeExport.cxx13
-rw-r--r--oox/source/export/drawingml.cxx20
2 files changed, 29 insertions, 4 deletions
diff --git a/oox/source/export/ThemeExport.cxx b/oox/source/export/ThemeExport.cxx
index 8f00058e0bb1..16da603fa14c 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -34,8 +34,10 @@ void writeRelativeRectangle(sax_fastparser::FSHelperPtr pFS, sal_Int32 nToken,
}
} // end anonymous namespace
-ThemeExport::ThemeExport(oox::core::XmlFilterBase* pFilterBase)
+ThemeExport::ThemeExport(oox::core::XmlFilterBase* pFilterBase,
+ oox::drawingml::DocumentType eDocumentType)
: mpFilterBase(pFilterBase)
+ , meDocumentType(eDocumentType)
{
}
@@ -579,7 +581,14 @@ OString convertRectangleAlignment(model::RectangleAlignment eFlipMode)
}
} // end anonymous ns
-void ThemeExport::writeBlip(model::BlipFill const& /*rBlipFil*/) {}
+void ThemeExport::writeBlip(model::BlipFill const& rBlipFil)
+{
+ if (!rBlipFil.mxGraphic.is())
+ return;
+ oox::drawingml::GraphicExport aExporter(mpFS, mpFilterBase, meDocumentType);
+ Graphic aGraphic(rBlipFil.mxGraphic);
+ aExporter.writeBlip(aGraphic, false);
+}
void ThemeExport::writeBlipFill(model::BlipFill const& rBlipFill)
{
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index cff8c3c738f4..c3efed87579d 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1224,7 +1224,23 @@ const char* DrawingML::GetRelationCompPrefix() const
return getRelationCompPrefix(meDocumentType);
}
-OUString GraphicExport::write(const Graphic& rGraphic , bool bRelPathToMedia)
+OUString GraphicExport::writeBlip(Graphic const& rGraphic , bool bRelPathToMedia)
+{
+ OUString sRelId;
+
+ sRelId = writeToStorage(rGraphic, bRelPathToMedia);
+
+ mpFS->startElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelId);
+
+ //WriteImageBrightnessContrastTransparence(rXPropSet);
+ //WriteArtisticEffect(rXPropSet);
+
+ mpFS->endElementNS(XML_a, XML_blip);
+
+ return sRelId;
+}
+
+OUString GraphicExport::writeToStorage(const Graphic& rGraphic , bool bRelPathToMedia)
{
GfxLink aLink = rGraphic.GetGfxLink ();
BitmapChecksum aChecksum = rGraphic.GetChecksum();
@@ -1357,7 +1373,7 @@ OUString GraphicExport::write(const Graphic& rGraphic , bool bRelPathToMedia)
OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia )
{
GraphicExport exporter(mpFS, mpFB, meDocumentType);
- return exporter.write(rGraphic, bRelPathToMedia);
+ return exporter.writeToStorage(rGraphic, bRelPathToMedia);
}
void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::drawing::XShape>& xShape)