[Libreoffice-commits] core.git: 5 commits - offapi/com offapi/UnoApi_offapi.mk sfx2/source sw/CppunitTest_sw_ooxmlexport.mk sw/CppunitTest_sw_rtfimport.mk udkapi/com vcl/source vcl/unx
Noel Grandin
noel at peralex.com
Mon May 6 02:28:21 PDT 2013
offapi/UnoApi_offapi.mk | 3
offapi/com/sun/star/datatransfer/clipboard/SystemClipboardExt.idl | 39 ++++++
offapi/com/sun/star/graphic/Primitive2DTools.idl | 8 -
sfx2/source/appl/appmisc.cxx | 63 ++++------
sw/CppunitTest_sw_ooxmlexport.mk | 1
sw/CppunitTest_sw_rtfimport.mk | 1
udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl | 4
vcl/source/gdi/outdev.cxx | 20 +--
vcl/source/gdi/svgdata.cxx | 60 ++++-----
vcl/source/window/window.cxx | 57 ++++-----
vcl/unx/gtk/fpicker/SalGtkPicker.cxx | 6
11 files changed, 144 insertions(+), 118 deletions(-)
New commits:
commit 46662428b2b17043e1d09c4107e7a5c0cf490b86
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 3 17:23:20 2013 +0200
fdo#46808, Convert graphic::Primitive2DTools to new style
Change-Id: I9719b43dbf98cfca29638f54cc907e48c7ad28b7
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 1e5b2112..c426138 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -189,6 +189,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/graphic,\
GraphicObject \
GraphicProvider \
+ Primitive2DTools \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection,\
DefaultHelpProvider \
@@ -938,7 +939,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/graphic
GraphicRasterizer \
GraphicRendererVCL \
MediaProperties \
- Primitive2DTools \
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\
ChapterCollator \
diff --git a/offapi/com/sun/star/graphic/Primitive2DTools.idl b/offapi/com/sun/star/graphic/Primitive2DTools.idl
index 75209fd..a99b460 100644
--- a/offapi/com/sun/star/graphic/Primitive2DTools.idl
+++ b/offapi/com/sun/star/graphic/Primitive2DTools.idl
@@ -27,13 +27,7 @@ module com { module sun { module star { module graphic
/** Service that describes the necessary interfaces and properties
for tooling involved with XPrimitive2D interfaces
*/
-
-service Primitive2DTools
-{
- /** Interface to render B2DPrimitives to a XBitmap
- */
- interface ::com::sun::star::graphic::XPrimitive2DRenderer;
-};
+service Primitive2DTools : XPrimitive2DRenderer;
} ; } ; } ; } ;
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index f6d1597..06f18fb 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/graphic/XPrimitive2DRenderer.hpp>
+#include <com/sun/star/graphic/Primitive2DTools.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -218,44 +218,39 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid
// UNO dance to render from drawinglayer
// ---------------------------------------------------------------------
- uno::Reference< lang::XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory());
- const OUString aServiceName("com.sun.star.graphic.Primitive2DTools");
+ uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
try
{
- const uno::Reference< graphic::XPrimitive2DRenderer > xPrimitive2DRenderer(
- xFactory->createInstance(aServiceName),
- uno::UNO_QUERY_THROW);
-
- if(xPrimitive2DRenderer.is())
+ const uno::Reference< graphic::XPrimitive2DRenderer > xPrimitive2DRenderer =
+ graphic::Primitive2DTools::create( xContext );
+
+ // cancel out rasterize's mm2pixel conversion
+ // see fFactor100th_mmToInch in
+ // drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+ const double fFakeDPI=2.54 * 1000.0;
+
+ geometry::RealRectangle2D aRealRect(
+ 0, 0,
+ nWidth, nWidth / fAspectRatio);
+
+ const uno::Reference< rendering::XBitmap > xBitmap(
+ xPrimitive2DRenderer->rasterize(
+ drawinglayer::primitive2d::Primitive2DSequence(&xTransformRef, 1),
+ uno::Sequence< beans::PropertyValue >(),
+ fFakeDPI,
+ fFakeDPI,
+ aRealRect,
+ 500000));
+
+ if(xBitmap.is())
{
- // cancel out rasterize's mm2pixel conversion
- // see fFactor100th_mmToInch in
- // drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
- const double fFakeDPI=2.54 * 1000.0;
-
- geometry::RealRectangle2D aRealRect(
- 0, 0,
- nWidth, nWidth / fAspectRatio);
-
- const uno::Reference< rendering::XBitmap > xBitmap(
- xPrimitive2DRenderer->rasterize(
- drawinglayer::primitive2d::Primitive2DSequence(&xTransformRef, 1),
- uno::Sequence< beans::PropertyValue >(),
- fFakeDPI,
- fFakeDPI,
- aRealRect,
- 500000));
-
- if(xBitmap.is())
- {
- const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW);
+ const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW);
- if(xIntBmp.is())
- {
- rBitmap = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
- return true;
- }
+ if(xIntBmp.is())
+ {
+ rBitmap = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
+ return true;
}
}
}
diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index e175eda..d5f527c 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -22,7 +22,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/graphic/XSvgParser.hpp>
-#include <com/sun/star/graphic/XPrimitive2DRenderer.hpp>
+#include <com/sun/star/graphic/Primitive2DTools.hpp>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
#include <vcl/canvastools.hxx>
#include <comphelper/seqstream.hxx>
@@ -46,43 +46,39 @@ BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx(
{
// create replacement graphic from maSequence
// create XPrimitive2DRenderer
- uno::Reference< lang::XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory());
- const OUString aServiceName("com.sun.star.graphic.Primitive2DTools");
+ uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
try
{
- const uno::Reference< graphic::XPrimitive2DRenderer > xPrimitive2DRenderer(xFactory->createInstance(aServiceName), uno::UNO_QUERY_THROW);
+ const uno::Reference< graphic::XPrimitive2DRenderer > xPrimitive2DRenderer = graphic::Primitive2DTools::create(xContext);
- if(xPrimitive2DRenderer.is())
+ uno::Sequence< beans::PropertyValue > aViewParameters;
+ geometry::RealRectangle2D aRealRect;
+
+ aRealRect.X1 = rTargetRange.getMinX();
+ aRealRect.Y1 = rTargetRange.getMinY();
+ aRealRect.X2 = rTargetRange.getMaxX();
+ aRealRect.Y2 = rTargetRange.getMaxY();
+
+ // get system DPI
+ const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MAP_INCH));
+
+ const uno::Reference< rendering::XBitmap > xBitmap(
+ xPrimitive2DRenderer->rasterize(
+ rSequence,
+ aViewParameters,
+ aDPI.getWidth(),
+ aDPI.getHeight(),
+ aRealRect,
+ nMaximumQuadraticPixels));
+
+ if(xBitmap.is())
{
- uno::Sequence< beans::PropertyValue > aViewParameters;
- geometry::RealRectangle2D aRealRect;
-
- aRealRect.X1 = rTargetRange.getMinX();
- aRealRect.Y1 = rTargetRange.getMinY();
- aRealRect.X2 = rTargetRange.getMaxX();
- aRealRect.Y2 = rTargetRange.getMaxY();
-
- // get system DPI
- const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MAP_INCH));
-
- const uno::Reference< rendering::XBitmap > xBitmap(
- xPrimitive2DRenderer->rasterize(
- rSequence,
- aViewParameters,
- aDPI.getWidth(),
- aDPI.getHeight(),
- aRealRect,
- nMaximumQuadraticPixels));
-
- if(xBitmap.is())
- {
- const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW);
+ const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW);
- if(xIntBmp.is())
- {
- aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
- }
+ if(xIntBmp.is())
+ {
+ aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
}
}
}
commit 6e0d0934d0cbb74bb5a4fbf05b4448832f6d4722
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 3 17:15:43 2013 +0200
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: I65a4399de203e02b8fc90c7d2e4c783d5c156de5
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b32078a..6822698 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -8332,7 +8332,7 @@ uno::Reference< XDragSource > Window::GetDragSource()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const SystemEnvData * pEnvData = GetSystemData();
if( pEnvData )
@@ -8364,10 +8364,14 @@ uno::Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( !aDragSourceSN.isEmpty() )
- mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDragSource.set(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aDragSourceSN, aDragSourceAL, xContext ),
+ UNO_QUERY );
if( !aDropTargetSN.isEmpty() )
- mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDropTarget.set(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aDropTargetSN, aDropTargetAL, xContext ),
+ UNO_QUERY );
}
}
@@ -8417,7 +8421,7 @@ uno::Reference< XClipboard > Window::GetClipboard()
#else
xSystemClipboard = SystemClipboard::createDefault(xContext);
#endif
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xSystemClipboard, UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY );
}
}
// createInstance can throw any exception
@@ -8446,7 +8450,6 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
#if defined(UNX) && !defined(MACOSX)
@@ -8456,10 +8459,10 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
static uno::Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY );
+ s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboardExt", xContext ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY );
+ s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
commit 647f348c62d0a08fc26625aa58708fe9495d6904
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 3 17:09:59 2013 +0200
fdo#46808, Use service constructor for rendering::CanvasFactory
Change-Id: If6bebe0d2dfb30c3fffd0fb284cd766e3f315b49
diff --git a/sw/CppunitTest_sw_ooxmlexport.mk b/sw/CppunitTest_sw_ooxmlexport.mk
index 524e70a..e96961f 100644
--- a/sw/CppunitTest_sw_ooxmlexport.mk
+++ b/sw/CppunitTest_sw_ooxmlexport.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_ooxmlexport))
$(eval $(call gb_CppunitTest_use_components,sw_ooxmlexport,\
basic/util/sb \
+ canvas/source/factory/canvasfactory \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk
index e5b4f30..8cedeeb 100644
--- a/sw/CppunitTest_sw_rtfimport.mk
+++ b/sw/CppunitTest_sw_rtfimport.mk
@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_ure,sw_rtfimport))
$(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\
basic/util/sb \
+ canvas/source/factory/canvasfactory \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index f134388..7c03af0 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/awt/XGraphics.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/CanvasFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
@@ -2565,22 +2566,17 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
aArg[ 3 ] = uno::makeAny( sal_False );
aArg[ 5 ] = GetSystemGfxDataAny();
- uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
-
- uno::Reference<rendering::XCanvas> xCanvas;
+ uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
// Create canvas instance with window handle
// =========================================
- static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(
- xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ),
+ static uno::Reference<lang::XMultiComponentFactory> xCanvasFactory( rendering::CanvasFactory::create( xContext ) );
+
+ uno::Reference<rendering::XCanvas> xCanvas;
+ xCanvas.set(
+ xCanvasFactory->createInstanceWithArgumentsAndContext(
+ "com.sun.star.rendering.Canvas", aArg, xContext ),
uno::UNO_QUERY );
- if(xCanvasFactory.is())
- {
- xCanvas.set(
- xCanvasFactory->createInstanceWithArguments(
- "com.sun.star.rendering.Canvas", aArg ),
- uno::UNO_QUERY );
- }
return xCanvas;
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 4201c39..b32078a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -75,23 +75,24 @@
#include "dndlcon.hxx"
#include "dndevdis.hxx"
+#include "com/sun/star/accessibility/XAccessible.hpp"
+#include "com/sun/star/accessibility/AccessibleRole.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
-#include "com/sun/star/rendering/XCanvas.hpp"
-#include "com/sun/star/rendering/XSpriteCanvas.hpp"
+#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/awt/XWindow.hpp"
-#include "comphelper/processfactory.hxx"
+#include "com/sun/star/awt/XDisplayConnection.hpp"
#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
#include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp"
#include "com/sun/star/datatransfer/clipboard/SystemClipboardExt.hpp"
-#include "com/sun/star/awt/XTopWindow.hpp"
-#include "com/sun/star/awt/XDisplayConnection.hpp"
#include "com/sun/star/lang/XInitialization.hpp"
#include "com/sun/star/lang/XComponent.hpp"
#include "com/sun/star/lang/XServiceName.hpp"
-#include "com/sun/star/accessibility/XAccessible.hpp"
-#include "com/sun/star/accessibility/AccessibleRole.hpp"
+#include "com/sun/star/rendering/CanvasFactory.hpp"
+#include "com/sun/star/rendering/XCanvas.hpp"
+#include "com/sun/star/rendering/XSpriteCanvas.hpp"
+#include "comphelper/processfactory.hxx"
#include <sal/macros.h>
#include <rtl/strbuf.hxx>
@@ -9467,16 +9468,13 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
// Create canvas instance with window handle
// =========================================
- static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
- uno::Reference<lang::XMultiServiceFactory>(
- xFactory->createInstance(
- OUString( "com.sun.star.rendering.CanvasFactory" ) ),
- UNO_QUERY ));
- uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+ static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiComponentFactory> xStaticCanvasFactory(
+ rendering::CanvasFactory::create( xContext ) );
+ uno::Reference<lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get());
if(xCanvasFactory.is())
{
@@ -9489,22 +9487,24 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
if( (nDisplay >= Application::GetScreenCount()) )
{
- xCanvas.set( xCanvasFactory->createInstanceWithArguments(
+ xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
bSpriteCanvas ?
OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
OUString( "com.sun.star.rendering.Canvas.MultiScreen" ),
- aArg ),
+ aArg,
+ xContext ),
UNO_QUERY );
}
else
{
#endif
- xCanvas.set( xCanvasFactory->createInstanceWithArguments(
+ xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
bSpriteCanvas ?
OUString( "com.sun.star.rendering.SpriteCanvas" ) :
OUString( "com.sun.star.rendering.Canvas" ),
- aArg ),
+ aArg,
+ xContext ),
UNO_QUERY );
#ifdef WNT
commit 135d20caa4178c3a6d7682b547c5da6d58310f01
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 3 16:54:29 2013 +0200
fdo#46808, Convert SystemClipboardExt service to new style
Service already existed, just needed an IDL file
Change-Id: Icde7c41e48b8c511976c2a65a87dca064546fa95
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0bc0676..1e5b2112 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransf
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransfer/clipboard,\
SystemClipboard \
+ SystemClipboardExt \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment,\
ExtensionManager \
diff --git a/offapi/com/sun/star/datatransfer/clipboard/SystemClipboardExt.idl b/offapi/com/sun/star/datatransfer/clipboard/SystemClipboardExt.idl
new file mode 100644
index 0000000..aa1cfb4
--- /dev/null
+++ b/offapi/com/sun/star/datatransfer/clipboard/SystemClipboardExt.idl
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_datatransfer_clipboard_SystemClipboardExt_idl__
+#define __com_sun_star_datatransfer_clipboard_SystemClipboardExt_idl__
+
+#include <com/sun/star/datatransfer/clipboard/XClipboard.idl>
+
+
+module com { module sun { module star { module datatransfer { module clipboard {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+published service SystemClipboardExt : XClipboard;
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index bc59719..4201c39 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -84,6 +84,7 @@
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
#include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp"
+#include "com/sun/star/datatransfer/clipboard/SystemClipboardExt.hpp"
#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/awt/XDisplayConnection.hpp"
#include "com/sun/star/lang/XInitialization.hpp"
@@ -8403,10 +8404,9 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = SystemClipboardExt::create( xContext );;
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
{
commit e4f37435a0fdd66b2d58633c991c6df720790f39
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 3 16:45:38 2013 +0200
fdo#46808, Use service constructor for uri::ExternalUriReferenceTranslator
Change-Id: I723b1baf50b75f6aaea86a4784ee10a3d2196e83
diff --git a/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl b/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
index 30b4d81..baf7cdb 100644
--- a/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
+++ b/udkapi/com/sun/star/uri/ExternalUriReferenceTranslator.idl
@@ -20,9 +20,9 @@
#ifndef __com_sun_star_uri_ExternalUriReferenceTranslator_idl__
#define __com_sun_star_uri_ExternalUriReferenceTranslator_idl__
-module com { module sun { module star { module uri {
+#include <com/sun/star/uri/XExternalUriReferenceTranslator.idl>
-published interface XExternalUriReferenceTranslator;
+module com { module sun { module star { module uri {
/**
translates between external and internal URI references.
diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
index f69adf4..d14c00b 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -24,7 +24,7 @@
#endif
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
#include <comphelper/processfactory.hxx>
#include <rtl/process.h>
#include <osl/diagnose.h>
@@ -66,7 +66,7 @@ OUString SalGtkPicker::uritounicode(const gchar* pIn)
}
else
{
- OUString aNewURL = uno::Reference<uri::XExternalUriReferenceTranslator>(uno::Reference<XMultiComponentFactory>(comphelper::getProcessServiceFactory(), UNO_QUERY_THROW)->createInstanceWithContext(OUString("com.sun.star.uri.ExternalUriReferenceTranslator"), m_xContext), UNO_QUERY_THROW)->translateToInternal(sURL);
+ OUString aNewURL = uri::ExternalUriReferenceTranslator::create( m_xContext )->translateToInternal(sURL);
if( !aNewURL.isEmpty() )
sURL = aNewURL;
}
@@ -82,7 +82,7 @@ OString SalGtkPicker::unicodetouri(const OUString &rURL)
INetURLObject aURL(rURL);
if (INET_PROT_FILE == aURL.GetProtocol())
{
- OUString aNewURL = uno::Reference<uri::XExternalUriReferenceTranslator>(uno::Reference<XMultiComponentFactory>(comphelper::getProcessServiceFactory(), UNO_QUERY_THROW)->createInstanceWithContext(OUString("com.sun.star.uri.ExternalUriReferenceTranslator"), m_xContext ), UNO_QUERY_THROW)->translateToExternal( rURL );
+ OUString aNewURL = uri::ExternalUriReferenceTranslator::create( m_xContext )->translateToInternal(rURL);
if( !aNewURL.isEmpty() )
{
More information about the Libreoffice-commits
mailing list