[Libreoffice-commits] core.git: 4 commits - offapi/com offapi/UnoApi_offapi.mk package/inc vcl/source

Noel Grandin noel at peralex.com
Tue May 7 23:07:16 PDT 2013


 offapi/UnoApi_offapi.mk                              |    9 +-
 offapi/com/sun/star/graphic/SvgTools.idl             |   11 ---
 offapi/com/sun/star/packages/zip/XZipFileAccess.idl  |    4 -
 offapi/com/sun/star/packages/zip/XZipFileAccess2.idl |   45 ++++++++++++
 offapi/com/sun/star/packages/zip/ZipFileAccess.idl   |   14 +--
 offapi/com/sun/star/rendering/MtfRenderer.idl        |    7 +
 package/inc/zipfileaccess.hxx                        |    9 +-
 vcl/source/control/field2.cxx                        |    2 
 vcl/source/filter/FilterConfigItem.cxx               |    1 
 vcl/source/filter/graphicfilter.cxx                  |   69 +++++++++----------
 vcl/source/gdi/gdimtf.cxx                            |   67 ++++++++----------
 vcl/source/gdi/impimagetree.cxx                      |    9 +-
 vcl/source/gdi/svgdata.cxx                           |   12 +--
 13 files changed, 141 insertions(+), 118 deletions(-)

New commits:
commit ae0cb395d8e2b887054e5cfd4fc5525a94fab240
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 7 08:07:01 2013 +0200

    fdo#46808, Convert ZipFileAccess service to new style
    
    Dropped XComponent from merged interface because noone is using it.
    
    Change-Id: Id22c49e63679f42d86f617a919fdfd7cea4d5381

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index de96093..8022e5e 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -243,6 +243,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/m
 	ManifestReader \
 	ManifestWriter \
 ))
+$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/zip,\
+	ZipFileAccess \
+))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/plugin,\
 	PluginManager \
 ))
@@ -969,9 +972,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/package
 	PackageFolderEnumeration \
 	PackageStream \
 ))
-$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/packages/zip,\
-	ZipFileAccess \
-))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/presentation,\
 	ChartShape \
 	CustomPresentation \
@@ -2879,6 +2879,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/packages/manifes
 ))
 $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/packages/zip,\
 	XZipFileAccess \
+	XZipFileAccess2 \
 	ZipConstants \
 	ZipEntry \
 	ZipException \
diff --git a/offapi/com/sun/star/packages/zip/XZipFileAccess.idl b/offapi/com/sun/star/packages/zip/XZipFileAccess.idl
index b80417c..24cc313 100644
--- a/offapi/com/sun/star/packages/zip/XZipFileAccess.idl
+++ b/offapi/com/sun/star/packages/zip/XZipFileAccess.idl
@@ -19,10 +19,10 @@
 #ifndef __com_sun_star_packages_zip_XZipFileAccess_idl__
 #define __com_sun_star_packages_zip_XZipFileAccess_idl__
 
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/packages/zip/ZipEntry.idl>
 #include <com/sun/star/container/NoSuchElementException.idl>
+#include <com/sun/star/io/XInputStream.idl>
 #include <com/sun/star/io/IOException.idl>
+#include <com/sun/star/uno/XInterface.idl>
 
 
 
diff --git a/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl b/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl
new file mode 100644
index 0000000..796ecf4
--- /dev/null
+++ b/offapi/com/sun/star/packages/zip/XZipFileAccess2.idl
@@ -0,0 +1,45 @@
+/* -*- 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_packages_zip_XZipFileAccess2_idl__
+#define __com_sun_star_packages_zip_XZipFileAccess2_idl__
+
+#include <com/sun/star/packages/zip/XZipFileAccess.idl>
+#include <com/sun/star/container/XNameAccess.idl>
+
+
+module com {  module sun {  module star {   module packages {  module zip {
+
+
+/**
+    Merged interface for ZipFileAccess service.
+    @since LibreOffice 4.1
+ */
+interface XZipFileAccess2
+{
+    interface XZipFileAccess;
+    interface com::sun::star::container::XNameAccess;
+
+};
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
index e0ac0ed..a53362b 100644
--- a/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
+++ b/offapi/com/sun/star/packages/zip/ZipFileAccess.idl
@@ -19,11 +19,8 @@
 #ifndef __com_sun_star_packages_zip_ZipFileAccess_idl__
 #define __com_sun_star_packages_zip_ZipFileAccess_idl__
 
-#include <com/sun/star/packages/zip/XZipFileAccess.idl>
-#include <com/sun/star/lang/XInitialization.idl>
-#include <com/sun/star/lang/XComponent.idl>
-#include <com/sun/star/container/XNameAccess.idl>
-#include <com/sun/star/io/IOException.idl>
+#include <com/sun/star/packages/zip/XZipFileAccess2.idl>
+#include <com/sun/star/ucb/InteractiveIOException.idl>
 
 
 
@@ -32,12 +29,9 @@ module com {  module sun {  module star {   module packages {  module zip {
 
 /** allows to get reading access to non-encrypted entries inside zip file.
  */
-service ZipFileAccess
+service ZipFileAccess : XZipFileAccess2
 {
-    interface XZipFileAccess;
-    interface ::com::sun::star::container::XNameAccess;
-    interface ::com::sun::star::lang::XInitialization;
-    interface ::com::sun::star::lang::XComponent;
+    createWithURL([in] string URL) raises ( com::sun::star::io::IOException, com::sun::star::ucb::InteractiveIOException );
 };
 
 
diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx
index 8b1fc0d..e84d7ac 100644
--- a/package/inc/zipfileaccess.hxx
+++ b/package/inc/zipfileaccess.hxx
@@ -20,7 +20,7 @@
 #ifndef _ZIPFILEACCESS_HXX_
 #define _ZIPFILEACCESS_HXX_
 
-#include <com/sun/star/packages/zip/XZipFileAccess.hpp>
+#include <com/sun/star/packages/zip/XZipFileAccess2.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -28,16 +28,15 @@
 #include <com/sun/star/container/XNameAccess.hpp>
 
 #include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/implbase4.hxx>
 
 #include <mutexholder.hxx>
 
 #include <ZipFile.hxx>
 #include <HashMaps.hxx>
 
-class OZipFileAccess : public ::cppu::WeakImplHelper5<
-                        ::com::sun::star::packages::zip::XZipFileAccess,
-                        ::com::sun::star::container::XNameAccess,
+class OZipFileAccess : public ::cppu::WeakImplHelper4<
+                        ::com::sun::star::packages::zip::XZipFileAccess2,
                         ::com::sun::star::lang::XInitialization,
                         ::com::sun::star::lang::XComponent,
                         ::com::sun::star::lang::XServiceInfo >
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 7a2fbdd..a2cab8b 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -31,6 +31,7 @@
 #include "com/sun/star/io/XInputStream.hpp"
 #include "com/sun/star/lang/Locale.hpp"
 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/packages/zip/ZipFileAccess.hpp"
 #include "com/sun/star/uno/Any.hxx"
 #include "com/sun/star/uno/Exception.hpp"
 #include "com/sun/star/uno/Reference.hxx"
@@ -344,13 +345,11 @@ bool ImplImageTree::find(
 
     for (Paths::iterator i(m_paths.begin()); i != m_paths.end();) {
         if (!i->second.is()) {
-            css::uno::Sequence< css::uno::Any > args(1);
-            args[0] <<= i->first + ".zip";
             try {
                 i->second.set(
-                    comphelper::getProcessServiceFactory()->createInstanceWithArguments(
-                        OUString( "com.sun.star.packages.zip.ZipFileAccess"),
-                        args),
+                    css::packages::zip::ZipFileAccess::createWithURL(
+                       comphelper::getProcessComponentContext(),
+                       i->first + ".zip"),
                     css::uno::UNO_QUERY_THROW);
             } catch (css::uno::RuntimeException &) {
                 throw;
commit 782bbfc65666272497f9c36a9c59d8b32231aa06
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 7 14:55:32 2013 +0200

    fdo#46808, Convert graphic::SvgTools to new style
    
    Change-Id: Id195be7968ab256e44271cad00fa8b5cac8698b4

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index def1b3a..de96093 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/graphic,\
 	GraphicObject \
 	GraphicProvider \
 	Primitive2DTools \
+	SvgTools \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection,\
 	DefaultHelpProvider \
@@ -2651,7 +2652,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/graphic,\
 	GraphicColorMode \
 	GraphicType \
 	PrimitiveFactory2D \
-	SvgTools \
 	XGraphic \
 	XGraphicObject \
 	XGraphicProvider \
diff --git a/offapi/com/sun/star/graphic/SvgTools.idl b/offapi/com/sun/star/graphic/SvgTools.idl
index 049a4a9..2a469bdd 100644
--- a/offapi/com/sun/star/graphic/SvgTools.idl
+++ b/offapi/com/sun/star/graphic/SvgTools.idl
@@ -25,16 +25,11 @@ module com { module sun { module star { module graphic
 {
 
 /** Service that describes the necessary interfaces and properties
-    to handle svg files
+    to handle svg files.
+    Parses a svg file to a sequence of  B2DPrimitives for internal usage
  */
 
-service SvgTools
-{
-    /** Interface to parse a svg file to a sequence of
-        B2DPrimitives for internal usage
-    */
-    interface ::com::sun::star::graphic::XSvgParser;
-};
+service SvgTools : XSvgParser;
 
 } ; } ; } ; } ;
 
diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index d5f527c..3125e6a 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -21,7 +21,7 @@
 #include <vcl/svgdata.hxx>
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/graphic/XSvgParser.hpp>
+#include <com/sun/star/graphic/SvgTools.hpp>
 #include <com/sun/star/graphic/Primitive2DTools.hpp>
 #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
 #include <vcl/canvastools.hxx>
@@ -119,17 +119,13 @@ void SvgData::ensureSequenceAndRange()
         if(myInputStream.is())
         {
             // create SVG interpreter
-            uno::Reference< lang::XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory());
-            const OUString aServiceName("com.sun.star.graphic.SvgTools");
+            uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
 
             try
             {
-                const uno::Reference< graphic::XSvgParser > xSvgParser(xFactory->createInstance(aServiceName), uno::UNO_QUERY_THROW);
+                const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext);
 
-                if(xSvgParser.is())
-                {
-                    maSequence = xSvgParser->getDecomposition(myInputStream, maPath);
-                }
+                maSequence = xSvgParser->getDecomposition(myInputStream, maPath);
             }
             catch(const uno::Exception&)
             {
commit 2c625e036ddaadb71db36f3e44c737b069e6fcb4
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 6 13:47:14 2013 +0200

    fdo#46808, Use service constructor for rendering::MtfRenderer
    
    Change-Id: If15cd2ac23bf76aa79ee8134ee0fb97c64d747c3

diff --git a/offapi/com/sun/star/rendering/MtfRenderer.idl b/offapi/com/sun/star/rendering/MtfRenderer.idl
index 0dafbfb..6e4ef4b 100644
--- a/offapi/com/sun/star/rendering/MtfRenderer.idl
+++ b/offapi/com/sun/star/rendering/MtfRenderer.idl
@@ -21,10 +21,15 @@
 #define __com_sun_star_rendering_MtfRenderer_idl__
 
 #include <com/sun/star/rendering/XMtfRenderer.idl>
+#include <com/sun/star/rendering/XBitmapCanvas.idl>
 
 module com { module sun { module star { module rendering {
 
-    service MtfRenderer : XMtfRenderer;
+service MtfRenderer : XMtfRenderer
+{
+    createWithBitmapCanvas([in] XBitmapCanvas Canvas);
+};
+
 
 }; }; }; };
 
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 14051a6..223fd65 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -408,55 +408,48 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
 
         Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
         uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
-        uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
         if( xBitmap.is () )
         {
-            uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
-            uno::Sequence< uno::Any > args (1);
             uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
             if( xBitmapCanvas.is() )
             {
-                args[0] = uno::Any( xBitmapCanvas );
-                xMtfRenderer.set( xFactory->createInstanceWithArguments( OUString("com.sun.star.rendering.MtfRenderer"),
-                                                                         args ), uno::UNO_QUERY );
+                uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+                uno::Reference< rendering::XMtfRenderer > xMtfRenderer = rendering::MtfRenderer::createWithBitmapCanvas( xContext, xBitmapCanvas );
 
-                if( xMtfRenderer.is() )
-                {
-                    xBitmapCanvas->clear();
-                    uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
-                    if( xMtfFastPropertySet.is() )
-                        // set this metafile to the renderer to
-                        // speedup things (instead of copying data to
-                        // sequence of bytes passed to renderer)
-                        xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast<sal_Int64>( this ) ) );
-
-                    xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );
-
-                    uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
-                    if( xFastPropertySet.get() )
-                    {
-                        // 0 means get BitmapEx
-                        uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
-                        BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue());
-                        if( pBitmapEx ) {
-                            pOut->DrawBitmapEx( rPos, *pBitmapEx );
-                            delete pBitmapEx;
-                            return true;
-                        }
-                    }
+                xBitmapCanvas->clear();
+                uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
+                if( xMtfFastPropertySet.is() )
+                    // set this metafile to the renderer to
+                    // speedup things (instead of copying data to
+                    // sequence of bytes passed to renderer)
+                    xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast<sal_Int64>( this ) ) );
 
-                    SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
-                    pSalBmp->SetHasAlpha( true );
+                xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );
 
-                    if( pSalBmp->Create( xBitmapCanvas, aSize ) )
-                    {
-                        Bitmap aBitmap( pSalBmp );
-                        pOut->DrawBitmap( rPos, aBitmap );
+                uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
+                if( xFastPropertySet.get() )
+                {
+                    // 0 means get BitmapEx
+                    uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
+                    BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue());
+                    if( pBitmapEx ) {
+                        pOut->DrawBitmapEx( rPos, *pBitmapEx );
+                        delete pBitmapEx;
                         return true;
                     }
+                }
+
+                SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
+                pSalBmp->SetHasAlpha( true );
 
-                    delete pSalBmp;
+                if( pSalBmp->Create( xBitmapCanvas, aSize ) )
+                {
+                    Bitmap aBitmap( pSalBmp );
+                    pOut->DrawBitmap( rPos, aBitmap );
+                    return true;
                 }
+
+                delete pSalBmp;
             }
         }
     }
commit 48ad2f61fe71edc1a8967b322d3e0f368f4be06f
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 6 12:48:23 2013 +0200

    fdo#46808, Convert some code to getProcessComponentContext
    
    Change-Id: Ic59060818bf02a402610613a6bc97c5969a5c461

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index d09d97c..575a43a 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1568,7 +1568,7 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const
 {
     if ( !mpCalendarWrapper )
     {
-        ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( comphelper::getProcessServiceFactory() ) );
+        ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getProcessComponentContext() );
         mpCalendarWrapper->loadDefaultCalendar( GetLocale() );
     }
 
diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx
index ceafbde..4f7b26d3 100644
--- a/vcl/source/filter/FilterConfigItem.cxx
+++ b/vcl/source/filter/FilterConfigItem.cxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
 
-using namespace ::utl                       ;   // getProcessServiceFactory
 using namespace ::com::sun::star::lang      ;   // XMultiServiceFactory
 using namespace ::com::sun::star::beans     ;   // PropertyValue
 using namespace ::com::sun::star::uno       ;   // Reference
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 047cee4..f6d1a9f 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -84,17 +84,17 @@ static ::osl::Mutex& getListMutex()
     return s_aListProtection;
 }
 
-class ImpFilterOutputStream : public ::cppu::WeakImplHelper1< ::com::sun::star::io::XOutputStream >
+class ImpFilterOutputStream : public ::cppu::WeakImplHelper1< css::io::XOutputStream >
 {
 protected:
 
     SvStream&               mrStm;
 
-    virtual void SAL_CALL   writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& rData )
-        throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
+    virtual void SAL_CALL   writeBytes( const css::uno::Sequence< sal_Int8 >& rData )
+        throw (css::io::NotConnectedException, css::io::BufferSizeExceededException, css::io::IOException, css::uno::RuntimeException)
         { mrStm.Write( rData.getConstArray(), rData.getLength() ); }
     virtual void SAL_CALL   flush()
-        throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
+        throw (css::io::NotConnectedException, css::io::BufferSizeExceededException, css::io::IOException, css::uno::RuntimeException)
         { mrStm.Flush(); }
     virtual void SAL_CALL   closeOutput() throw() {}
 
@@ -113,16 +113,16 @@ static sal_Bool DirEntryExists( const INetURLObject& rObj )
     try
     {
         ::ucbhelper::Content aCnt( rObj.GetMainURL( INetURLObject::NO_DECODE ),
-                             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+                             css::uno::Reference< css::ucb::XCommandEnvironment >(),
                              comphelper::getProcessComponentContext() );
 
         bExists = aCnt.isDocument();
     }
-    catch(const ::com::sun::star::ucb::CommandAbortedException&)
+    catch(const css::ucb::CommandAbortedException&)
     {
         SAL_WARN( "svtools.filter", "CommandAbortedException" );
     }
-    catch(const ::com::sun::star::ucb::ContentCreationException&)
+    catch(const css::ucb::ContentCreationException&)
     {
         SAL_WARN( "svtools.filter", "ContentCreationException" );
     }
@@ -138,13 +138,13 @@ static void KillDirEntry( const String& rMainUrl )
     try
     {
         ::ucbhelper::Content aCnt( rMainUrl,
-                             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+                             css::uno::Reference< css::ucb::XCommandEnvironment >(),
                              comphelper::getProcessComponentContext() );
 
         aCnt.executeCommand( "delete",
-                             ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
+                             css::uno::makeAny( sal_Bool( sal_True ) ) );
     }
-    catch(const ::com::sun::star::ucb::CommandAbortedException&)
+    catch(const css::ucb::CommandAbortedException&)
     {
         SAL_WARN( "svtools.filter", "CommandAbortedException" );
     }
@@ -892,7 +892,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
             if( ( nMode == 1 ) || ( nMode == 2 ) )
             {
                 GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
-                ::com::sun::star::awt::Size aDefaultSize( 10000, 10000 );
+                css::awt::Size aDefaultSize( 10000, 10000 );
                 Size aNewSize( OutputDevice::LogicToLogic( Size( nLogicalWidth, nLogicalHeight ), MAP_100TH_MM, aMtf.GetPrefMapMode() ) );
 
                 if( aNewSize.Width() && aNewSize.Height() )
@@ -2007,41 +2007,38 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String&
                     // do the normal GDIMetaFile export instead
                     try
                     {
-                        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
-                        ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+                        css::uno::Reference< css::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
 
-                        if( xMgr.is() )
-                        {
-                            ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > xSaxWriter(
-                                xml::sax::Writer::create( xContext ), uno::UNO_QUERY_THROW);
+                        css::uno::Reference< css::xml::sax::XDocumentHandler > xSaxWriter(
+                            xml::sax::Writer::create( xContext ), uno::UNO_QUERY_THROW);
 
-                            ::com::sun::star::uno::Reference< ::com::sun::star::svg::XSVGWriter > xSVGWriter( xMgr->createInstance(
-                                OUString( "com.sun.star.svg.SVGWriter" ) ), ::com::sun::star::uno::UNO_QUERY );
+                        css::uno::Reference< css::svg::XSVGWriter > xSVGWriter(
+                            xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.svg.SVGWriter", xContext ),
+                            css::uno::UNO_QUERY );
 
-                            if( xSaxWriter.is() && xSVGWriter.is() )
-                            {
-                                ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xActiveDataSource(
-                                    xSaxWriter, ::com::sun::star::uno::UNO_QUERY );
+                        if( xSaxWriter.is() && xSVGWriter.is() )
+                        {
+                            css::uno::Reference< css::io::XActiveDataSource > xActiveDataSource(
+                                xSaxWriter, css::uno::UNO_QUERY );
 
-                                if( xActiveDataSource.is() )
-                                {
-                                    const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xStmIf(
-                                        static_cast< ::cppu::OWeakObject* >( new ImpFilterOutputStream( rOStm ) ) );
+                            if( xActiveDataSource.is() )
+                            {
+                                const css::uno::Reference< css::uno::XInterface > xStmIf(
+                                    static_cast< ::cppu::OWeakObject* >( new ImpFilterOutputStream( rOStm ) ) );
 
-                                    SvMemoryStream aMemStm( 65535, 65535 );
+                                SvMemoryStream aMemStm( 65535, 65535 );
 
-                                    // #i119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
-                                    ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
+                                // #i119735# just use GetGDIMetaFile, it will create a buffered version of contained bitmap now automatically
+                                ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
 
-                                    xActiveDataSource->setOutputStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
-                                        xStmIf, ::com::sun::star::uno::UNO_QUERY ) );
-                                    ::com::sun::star::uno::Sequence< sal_Int8 > aMtfSeq( (sal_Int8*) aMemStm.GetData(), aMemStm.Tell() );
-                                    xSVGWriter->write( xSaxWriter, aMtfSeq );
-                                }
+                                xActiveDataSource->setOutputStream( css::uno::Reference< css::io::XOutputStream >(
+                                    xStmIf, css::uno::UNO_QUERY ) );
+                                css::uno::Sequence< sal_Int8 > aMtfSeq( (sal_Int8*) aMemStm.GetData(), aMemStm.Tell() );
+                                xSVGWriter->write( xSaxWriter, aMtfSeq );
                             }
                         }
                     }
-                    catch(const ::com::sun::star::uno::Exception&)
+                    catch(const css::uno::Exception&)
                     {
                         nStatus = GRFILTER_IOERROR;
                     }


More information about the Libreoffice-commits mailing list