solenv/clang-format/blacklist                |    6 +++---
 vcl/inc/graphic/UnoGraphic.hxx               |    4 ++--
 vcl/source/gdi/graph.cxx                     |   22 ++++++++--------------
 vcl/source/graphic/UnoGraphic.cxx            |    3 ++-
 vcl/source/graphic/UnoGraphicDescriptor.cxx  |    2 +-
 vcl/source/graphic/UnoGraphicProvider.cxx    |    4 ++--
 vcl/source/graphic/UnoGraphicTransformer.cxx |    4 ++--
 7 files changed, 20 insertions(+), 25 deletions(-)

New commits:
commit 185a7a1868f8bc46924e03b77bc36361c3af8919
Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
Date:   Sun Mar 18 08:22:51 2018 +0900

    use UnoGraphic directly in GetXGraphic, move hxx to inc/graphic
    
    Change-Id: I6f170709255f396e82591572efef399fa438dc0e
    Reviewed-on: https://gerrit.libreoffice.org/52145
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 5e1551bdcc14..407db28b157d 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -17575,6 +17575,9 @@ vcl/inc/fontattributes.hxx
 vcl/inc/fontinstance.hxx
 vcl/inc/fontselect.hxx
 vcl/inc/fontsubset.hxx
+vcl/inc/graphic/UnoGraphic.hxx
+vcl/inc/graphic/UnoGraphicDescriptor.hxx
+vcl/inc/graphic/UnoGraphicTransformer.hxx
 vcl/inc/headless/svpbmp.hxx
 vcl/inc/headless/svpcairotextrender.hxx
 vcl/inc/headless/svpdummies.hxx
@@ -18207,13 +18210,10 @@ vcl/source/gdi/wall.cxx
 vcl/source/graphic/GraphicObject.cxx
 vcl/source/graphic/GraphicObject2.cxx
 vcl/source/graphic/UnoGraphic.cxx
-vcl/source/graphic/UnoGraphic.hxx
 vcl/source/graphic/UnoGraphicDescriptor.cxx
-vcl/source/graphic/UnoGraphicDescriptor.hxx
 vcl/source/graphic/UnoGraphicObject.cxx
 vcl/source/graphic/UnoGraphicProvider.cxx
 vcl/source/graphic/UnoGraphicTransformer.cxx
-vcl/source/graphic/UnoGraphicTransformer.hxx
 vcl/source/graphic/grfattr.cxx
 vcl/source/graphic/grfcache.cxx
 vcl/source/graphic/grfcache.hxx
diff --git a/vcl/source/graphic/UnoGraphic.hxx b/vcl/inc/graphic/UnoGraphic.hxx
similarity index 97%
rename from vcl/source/graphic/UnoGraphic.hxx
rename to vcl/inc/graphic/UnoGraphic.hxx
index f987d902eace..e0ec65d83a31 100644
--- a/vcl/source/graphic/UnoGraphic.hxx
+++ b/vcl/inc/graphic/UnoGraphic.hxx
@@ -25,8 +25,8 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/awt/XBitmap.hpp>
 
-#include "UnoGraphicDescriptor.hxx"
-#include "UnoGraphicTransformer.hxx"
+#include <graphic/UnoGraphicDescriptor.hxx>
+#include <graphic/UnoGraphicTransformer.hxx>
 
 #include <vcl/graph.hxx>
 
diff --git a/vcl/source/graphic/UnoGraphicDescriptor.hxx 
b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
similarity index 100%
rename from vcl/source/graphic/UnoGraphicDescriptor.hxx
rename to vcl/inc/graphic/UnoGraphicDescriptor.hxx
diff --git a/vcl/source/graphic/UnoGraphicTransformer.hxx 
b/vcl/inc/graphic/UnoGraphicTransformer.hxx
similarity index 100%
rename from vcl/source/graphic/UnoGraphicTransformer.hxx
rename to vcl/inc/graphic/UnoGraphicTransformer.hxx
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 1b753414b60e..6d9d972efc55 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <cppuhelper/typeprovider.hxx>
+#include <graphic/UnoGraphic.hxx>
 
 using namespace ::com::sun::star;
 
@@ -360,25 +361,18 @@ const BitmapEx& Graphic::GetBitmapExRef() const
     return mxImpGraphic->ImplGetBitmapExRef();
 }
 
-uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
+uno::Reference<graphic::XGraphic> Graphic::GetXGraphic() const
 {
-    uno::Reference< graphic::XGraphic > xRet;
+    uno::Reference<graphic::XGraphic> xGraphic;
 
-    if( GetType() != GraphicType::NONE )
+    if (GetType() != GraphicType::NONE)
     {
-        uno::Reference < uno::XComponentContext > xContext( 
::comphelper::getProcessComponentContext() );
-        uno::Reference< graphic::XGraphicProvider > xProv( 
graphic::GraphicProvider::create( xContext ) );
-
-        uno::Sequence< beans::PropertyValue > aLoadProps( 1 );
-        OUString aURL = "private:memorygraphic/" + OUString::number( 
reinterpret_cast< sal_Int64 >( this ) );
-
-        aLoadProps[ 0 ].Name = "URL";
-        aLoadProps[ 0 ].Value <<= aURL;
-
-        xRet = xProv->queryGraphic( aLoadProps );
+        unographic::Graphic* pUnoGraphic = new unographic::Graphic;
+        pUnoGraphic->init(*this);
+        xGraphic = pUnoGraphic;
     }
 
-    return xRet;
+    return xGraphic;
 }
 
 Size Graphic::GetPrefSize() const
diff --git a/vcl/source/graphic/UnoGraphic.cxx 
b/vcl/source/graphic/UnoGraphic.cxx
index 5821a254da92..bc09e40d045d 100644
--- a/vcl/source/graphic/UnoGraphic.cxx
+++ b/vcl/source/graphic/UnoGraphic.cxx
@@ -17,11 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <graphic/UnoGraphic.hxx>
+
 #include <vcl/svapp.hxx>
 #include <com/sun/star/graphic/GraphicType.hpp>
 #include <com/sun/star/graphic/XGraphicTransformer.hpp>
 #include <vcl/dibtools.hxx>
-#include "UnoGraphic.hxx"
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/queryinterface.hxx>
diff --git a/vcl/source/graphic/UnoGraphicDescriptor.cxx 
b/vcl/source/graphic/UnoGraphicDescriptor.cxx
index cdc54568d387..d8281f13732d 100644
--- a/vcl/source/graphic/UnoGraphicDescriptor.cxx
+++ b/vcl/source/graphic/UnoGraphicDescriptor.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "UnoGraphicDescriptor.hxx"
+#include <graphic/UnoGraphicDescriptor.hxx>
 
 #include <unotools/ucbstreamhelper.hxx>
 #include <vcl/graphicfilter.hxx>
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx 
b/vcl/source/graphic/UnoGraphicProvider.cxx
index abb85ac6aac0..dd51f7533728 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -41,8 +41,8 @@
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
 
-#include "UnoGraphicDescriptor.hxx"
-#include "UnoGraphic.hxx"
+#include <graphic/UnoGraphicDescriptor.hxx>
+#include <graphic/UnoGraphic.hxx>
 #include <rtl/ref.hxx>
 #include <vcl/GraphicObject.hxx>
 #include <vcl/dibtools.hxx>
diff --git a/vcl/source/graphic/UnoGraphicTransformer.cxx 
b/vcl/source/graphic/UnoGraphicTransformer.cxx
index c69e17258fe0..05a1f436247b 100644
--- a/vcl/source/graphic/UnoGraphicTransformer.cxx
+++ b/vcl/source/graphic/UnoGraphicTransformer.cxx
@@ -18,6 +18,8 @@
  */
 
 
+#include <graphic/UnoGraphicTransformer.hxx>
+
 #include <vcl/svapp.hxx>
 #include <vcl/image.hxx>
 #include <vcl/metaact.hxx>
@@ -27,8 +29,6 @@
 #include <vcl/bitmapaccess.hxx>
 #include <com/sun/star/text/GraphicCrop.hpp>
 
-#include "UnoGraphicTransformer.hxx"
-
 using namespace com::sun::star;
 
 namespace unographic {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to