[Libreoffice-commits] core.git: include/toolkit offapi/com offapi/UnoApi_offapi.mk toolkit/source

Caolán McNamara caolanm at redhat.com
Sat May 18 05:57:09 PDT 2013


 include/toolkit/awt/vclxprinter.hxx       |   24 ++++++++----------------
 offapi/UnoApi_offapi.mk                   |    1 +
 offapi/com/sun/star/awt/PrinterServer.idl |   28 ++++++++++++++++++++++++++++
 toolkit/source/awt/vclxprinter.cxx        |   13 -------------
 4 files changed, 37 insertions(+), 29 deletions(-)

New commits:
commit 5ade04867f280b18dfbfb7e60568ed58b32d6bbc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat May 18 12:38:01 2013 +0100

    Resolves: #i87883# add a PrinterServer.idl and fix impl
    
    Change-Id: Id351109616737f916d7f4c2715347daa23367281

diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx
index ca14b2d..a3aca63 100644
--- a/include/toolkit/awt/vclxprinter.hxx
+++ b/include/toolkit/awt/vclxprinter.hxx
@@ -25,11 +25,15 @@
 #include <com/sun/star/awt/XPrinter.hpp>
 #include <com/sun/star/awt/XPrinterServer.hpp>
 #include <com/sun/star/awt/XInfoPrinter.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/weak.hxx>
 #include <osl/mutex.hxx>
 
+#include <toolkit/helper/macros.hxx>
 #include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <toolkit/helper/servicenames.hxx>
 #include <cppuhelper/propshlp.hxx>
 
 #include "vcl/oldprintadaptor.hxx"
@@ -190,29 +194,17 @@ public:
 //  class VCLXPrinterServer
 //  ----------------------------------------------------
 
-class VCLXPrinterServer :   public ::com::sun::star::awt::XPrinterServer,
-                            public ::com::sun::star::lang::XTypeProvider,
-                            public ::cppu::OWeakObject
+class VCLXPrinterServer : public ::cppu::WeakImplHelper2<com::sun::star::awt::XPrinterServer,
+    com::sun::star::lang::XServiceInfo>
 {
 public:
-
-    // ::com::sun::star::uno::XInterface
-    ::com::sun::star::uno::Any                  SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-    void                                        SAL_CALL acquire() throw()  { OWeakObject::acquire(); }
-    void                                        SAL_CALL release() throw()  { OWeakObject::release(); }
-
-    // ::com::sun::star::lang::XTypeProvider
-    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >  SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
-    ::com::sun::star::uno::Sequence< sal_Int8 >                     SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
     // ::com::sun::star::awt::XPrinterServer
     ::com::sun::star::uno::Sequence< OUString > SAL_CALL getPrinterNames(  ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
-};
-
-
 
+    DECLIMPL_SERVICEINFO(VCLXPrinterServer, szServiceName2_PrinterServer);
+};
 
 #endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index b73b86a..a3772e0 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1744,6 +1744,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
 	PopupMenuDirection \
 	PosSize \
 	PrinterException \
+	PrinterServer \
 	PushButtonType \
 	RasterOperation \
 	Rectangle \
diff --git a/offapi/com/sun/star/awt/PrinterServer.idl b/offapi/com/sun/star/awt/PrinterServer.idl
new file mode 100644
index 0000000..e323939
--- /dev/null
+++ b/offapi/com/sun/star/awt/PrinterServer.idl
@@ -0,0 +1,28 @@
+/* -*- 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/.
+ */
+
+#ifndef __com_sun_star_awt_PrinterServer_idl__
+#define __com_sun_star_awt_PrinterServer_idl__
+
+#include <com/sun/star/awt/XPrinterServer.idl>
+
+module com {  module sun {  module star {  module awt {
+
+/** mechanism to discover and manage printers
+ */
+service PrinterServer
+{
+    interface com::sun::star::awt::XPrinterServer;
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index a682157..60ef231 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -406,19 +406,6 @@ IMPL_XTYPEPROVIDER_END
 //  class VCLXPrinterServer
 //  ----------------------------------------------------
 
-// ::com::sun::star::uno::XInterface
-::com::sun::star::uno::Any VCLXPrinterServer::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
-{
-    ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
-                                        (static_cast< ::com::sun::star::awt::XPrinterServer* >(this)) );
-    return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
-}
-
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( VCLXPrinterServer )
-    getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinterServer>* ) NULL )
-IMPL_XTYPEPROVIDER_END
-
 // ::com::sun::star::awt::XPrinterServer
 ::com::sun::star::uno::Sequence< OUString > VCLXPrinterServer::getPrinterNames(  ) throw(::com::sun::star::uno::RuntimeException)
 {


More information about the Libreoffice-commits mailing list