summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-03-18 08:22:51 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-03-31 05:12:52 +0200
commit185a7a1868f8bc46924e03b77bc36361c3af8919 (patch)
tree217b25c919588dfb1d132a350526a74607f17d52
parent940f90f3da170b62379e9d1d33d4e6d690997026 (diff)
use UnoGraphic directly in GetXGraphic, move hxx to inc/graphic
Change-Id: I6f170709255f396e82591572efef399fa438dc0e Reviewed-on: https://gerrit.libreoffice.org/52145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--solenv/clang-format/blacklist6
-rw-r--r--vcl/inc/graphic/UnoGraphic.hxx (renamed from vcl/source/graphic/UnoGraphic.hxx)4
-rw-r--r--vcl/inc/graphic/UnoGraphicDescriptor.hxx (renamed from vcl/source/graphic/UnoGraphicDescriptor.hxx)0
-rw-r--r--vcl/inc/graphic/UnoGraphicTransformer.hxx (renamed from vcl/source/graphic/UnoGraphicTransformer.hxx)0
-rw-r--r--vcl/source/gdi/graph.cxx22
-rw-r--r--vcl/source/graphic/UnoGraphic.cxx3
-rw-r--r--vcl/source/graphic/UnoGraphicDescriptor.cxx2
-rw-r--r--vcl/source/graphic/UnoGraphicProvider.cxx4
-rw-r--r--vcl/source/graphic/UnoGraphicTransformer.cxx4
9 files changed, 20 insertions, 25 deletions
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
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
index f163a5023c2a..f163a5023c2a 100644
--- a/vcl/source/graphic/UnoGraphicDescriptor.hxx
+++ b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
diff --git a/vcl/source/graphic/UnoGraphicTransformer.hxx b/vcl/inc/graphic/UnoGraphicTransformer.hxx
index 7814c3707597..7814c3707597 100644
--- a/vcl/source/graphic/UnoGraphicTransformer.hxx
+++ b/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 {