summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-02-21 20:15:21 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-02-25 08:09:56 +0100
commit4256ffa959f994f0964f7391fad70df8a9c884f0 (patch)
treebf4bf55fa48f0e6af3093edf43d82c13a7f56615 /xmloff/source/style
parent99223fc736c55cc1eb319ae1576b3998771e6b6f (diff)
fix import of graphic bullets
When changing to use "GraphicBitmap" property instead of "ImageURL", the import wasn't adapted and there was no test which would warn of such an situation. This also changes the difference between writer and impress where impress used "Graphic" and not "GraphicBitmap" property. Also adds missing tests for both writer and impress Change-Id: Ieed629d2d37f7806d63e729b6ef23cd848593071 Reviewed-on: https://gerrit.libreoffice.org/50140 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/xmlnumi.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 2003144946b9..7c0a4665b611 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/awt/XBitmap.hpp>
#include <o3tl/any.hxx>
#include <o3tl/make_unique.hxx>
@@ -528,23 +529,27 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties()
if( bImage )
{
- OUString sStr( sImageURL );
- if( !sImageURL.isEmpty() )
+ uno::Reference<graphic::XGraphic> xGraphic;
+ if (!sImageURL.isEmpty())
{
- sStr = GetImport().ResolveGraphicObjectURL( sImageURL, false );
+ xGraphic = GetImport().loadGraphicByURL(sImageURL);
}
else if( xBase64Stream.is() )
{
- sStr = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
+ xGraphic = GetImport().loadGraphicFromBase64(xBase64Stream);
}
- if( !sStr.isEmpty() )
+ uno::Reference<awt::XBitmap> xBitmap;
+ if (xGraphic.is())
+ xBitmap.set(xGraphic, uno::UNO_QUERY);
+
+ if (xBitmap.is())
{
- pProps[nPos].Name = "GraphicURL";
- pProps[nPos++].Value <<= sStr;
+ pProps[nPos].Name = "GraphicBitmap";
+ pProps[nPos++].Value <<= xBitmap;
}
- awt::Size aSize( nImageWidth, nImageHeight );
+ awt::Size aSize(nImageWidth, nImageHeight);
pProps[nPos].Name = "GraphicSize";
pProps[nPos++].Value <<= aSize;