summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/graph.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/graph.cxx')
-rw-r--r--vcl/source/gdi/graph.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 0b2c043572db..9a9cfea8502f 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -21,6 +21,7 @@
#include <vcl/outdev.hxx>
#include <vcl/svapp.hxx>
#include <vcl/graph.hxx>
+#include <vcl/image.hxx>
#include <vcl/metaact.hxx>
#include <impgraph.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -33,6 +34,7 @@
#include <graphic/UnoGraphic.hxx>
#include <vcl/GraphicExternalLink.hxx>
+#include <image.h>
using namespace ::com::sun::star;
@@ -216,6 +218,17 @@ Graphic::Graphic(const BitmapEx& rBmpEx)
{
}
+// We use XGraphic for passing toolbar images across app UNO aps
+// and we need to be able to see and preserve 'stock' images too.
+Graphic::Graphic(const Image& rImage)
+ // FIXME: should really defer the BitmapEx load.
+ : mxImpGraphic(new ImpGraphic(rImage.GetBitmapEx()))
+{
+ OUString aStock = rImage.GetStock();
+ if (aStock.getLength())
+ mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock);
+}
+
Graphic::Graphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr)
: mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
{