[Libreoffice-commits] core.git: 3 commits - basic/source eventattacher/source include/linguistic lingucomponent/source linguistic/source linguistic/workben offapi/com pyuno/source udkapi/com udkapi/type_reference udkapi/UnoApi_udkapi.mk

Noel Grandin noel at peralex.com
Tue May 14 04:40:09 PDT 2013


 basic/source/classes/eventatt.cxx                                  |   23 +--
 basic/source/classes/sbunoobj.cxx                                  |   64 ++++------
 eventattacher/source/eventattacher.cxx                             |   43 +++---
 include/linguistic/lngprophelp.hxx                                 |   14 +-
 lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx |    4 
 lingucomponent/source/spellcheck/macosxspell/macspellimp.mm        |    2 
 lingucomponent/source/spellcheck/spell/sspellimp.cxx               |    4 
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx                |    4 
 linguistic/source/lngprophelp.cxx                                  |   14 +-
 linguistic/source/spelldsp.hxx                                     |    6 
 linguistic/source/thesdsp.hxx                                      |    6 
 linguistic/workben/sspellimp.cxx                                   |    2 
 offapi/com/sun/star/awt/DialogProvider.idl                         |    8 +
 pyuno/source/module/pyuno_runtime.cxx                              |   11 -
 udkapi/UnoApi_udkapi.mk                                            |    2 
 udkapi/com/sun/star/script/InvocationAdapterFactory.idl            |   18 --
 udkapi/type_reference/udkapi.rdb                                   |binary
 17 files changed, 97 insertions(+), 128 deletions(-)

New commits:
commit 708cab47c4457637f87815750a026168b3f10c84
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 13:10:53 2013 +0200

    fdo#46808, propogate XLinguProperties through some more code
    
    Change-Id: I89258875094e9731921fcafdc903278ca8f95aa8

diff --git a/include/linguistic/lngprophelp.hxx b/include/linguistic/lngprophelp.hxx
index 3995d87..4befc92 100644
--- a/include/linguistic/lngprophelp.hxx
+++ b/include/linguistic/lngprophelp.hxx
@@ -101,7 +101,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet,
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet,
             int nAllowedEvents );
     virtual ~PropertyChgHelper();
 
@@ -161,7 +161,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet );
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet );
     virtual ~PropertyHelper_Thes();
 
     // XPropertyChangeListener
@@ -184,7 +184,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet );
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet );
     ~PropertyHelper_Thesaurus();
     void    AddAsPropListener();
     void    RemoveAsPropListener();
@@ -223,7 +223,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet );
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet );
     virtual ~PropertyHelper_Spell();
 
     virtual void    SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
@@ -256,7 +256,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet );
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet );
     ~PropertyHelper_Spelling();
 
     void    AddAsPropListener();
@@ -305,7 +305,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet);
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet);
     virtual ~PropertyHelper_Hyphen();
 
     virtual void    SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
@@ -334,7 +334,7 @@ public:
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet);
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet);
     ~PropertyHelper_Hyphenation();
 
     void    AddAsPropListener();
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
index f4caedd..e567d64 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
@@ -96,7 +96,7 @@ PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl()
 {
     if (!pPropHelper)
     {
-        Reference< XPropertySet >   xPropSet( GetLinguProperties(), UNO_QUERY );
+        Reference< XLinguProperties >   xPropSet( GetLinguProperties(), UNO_QUERY );
 
         pPropHelper = new PropertyHelper_Hyphenation ((XHyphenator *) this, xPropSet );
         pPropHelper->AddAsPropListener();   //! after a reference is established
@@ -790,7 +790,7 @@ void SAL_CALL Hyphenator::initialize( const Sequence< Any >& rArguments )
         sal_Int32 nLen = rArguments.getLength();
         if (2 == nLen)
         {
-            Reference< XPropertySet >   xPropSet;
+            Reference< XLinguProperties >   xPropSet;
             rArguments.getConstArray()[0] >>= xPropSet;
             //rArguments.getConstArray()[1] >>= xDicList;
 
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index 64cc1c1..0936661 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -83,7 +83,7 @@ PropertyHelper_Spell & MacSpellChecker::GetPropHelper_Impl()
 {
     if (!pPropHelper)
     {
-        Reference< XPropertySet >   xPropSet( GetLinguProperties(), UNO_QUERY );
+        Reference< XLinguProperties >   xPropSet( GetLinguProperties(), UNO_QUERY );
 
         pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet );
         xPropHelper = pPropHelper;
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 8f85482..b1a799f 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -97,7 +97,7 @@ PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl()
 {
     if (!pPropHelper)
     {
-        Reference< XPropertySet >   xPropSet( GetLinguProperties(), UNO_QUERY );
+        Reference< XLinguProperties >   xPropSet( GetLinguProperties(), UNO_QUERY );
 
         pPropHelper = new PropertyHelper_Spelling( (XSpellChecker *) this, xPropSet );
         pPropHelper->AddAsPropListener();   //! after a reference is established
@@ -571,7 +571,7 @@ void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments )
         sal_Int32 nLen = rArguments.getLength();
         if (2 == nLen)
         {
-            Reference< XPropertySet >   xPropSet;
+            Reference< XLinguProperties >   xPropSet;
             rArguments.getConstArray()[0] >>= xPropSet;
             //rArguments.getConstArray()[1] >>= xDicList;
 
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 12b4b89..b09b950 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -120,7 +120,7 @@ PropertyHelper_Thesaurus& Thesaurus::GetPropHelper_Impl()
 {
     if (!pPropHelper)
     {
-        Reference< XPropertySet >   xPropSet( GetLinguProperties(), UNO_QUERY );
+        Reference< XLinguProperties >   xPropSet( GetLinguProperties(), UNO_QUERY );
 
         pPropHelper = new PropertyHelper_Thesaurus( (XThesaurus *) this, xPropSet );
         pPropHelper->AddAsPropListener();   //! after a reference is established
@@ -554,7 +554,7 @@ void SAL_CALL Thesaurus::initialize( const Sequence< Any >& rArguments )
         sal_Int32 nLen = rArguments.getLength();
         if (1 == nLen)
         {
-            Reference< XPropertySet >   xPropSet;
+            Reference< XLinguProperties >   xPropSet;
             rArguments.getConstArray()[0] >>= xPropSet;
 
             //! Pointer allows for access of the non-UNO functions.
diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx
index c36f55a..79db0f0 100644
--- a/linguistic/source/lngprophelp.cxx
+++ b/linguistic/source/lngprophelp.cxx
@@ -56,7 +56,7 @@ static int nCHCount = sizeof(aCH) / sizeof(aCH[0]);
 
 PropertyChgHelper::PropertyChgHelper(
         const Reference< XInterface > &rxSource,
-        Reference< XPropertySet > &rxPropSet,
+        Reference< XLinguProperties > &rxPropSet,
         int nAllowedEvents ) :
     PropertyChgHelperBase(),
     aPropNames          (nCHCount),
@@ -335,7 +335,7 @@ sal_Bool SAL_CALL
 
 PropertyHelper_Thes::PropertyHelper_Thes(
         const Reference< XInterface > &rxSource,
-        Reference< XPropertySet > &rxPropSet ) :
+        Reference< XLinguProperties > &rxPropSet ) :
     PropertyChgHelper   ( rxSource, rxPropSet, 0 )
 {
     SetDefaultValues();
@@ -370,7 +370,7 @@ static const char *aSP[] =
 
 PropertyHelper_Spell::PropertyHelper_Spell(
         const Reference< XInterface > & rxSource,
-        Reference< XPropertySet > &rxPropSet ) :
+        Reference< XLinguProperties > &rxPropSet ) :
     PropertyChgHelper   ( rxSource, rxPropSet, AE_SPELLCHECKER )
 {
     AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) );
@@ -558,7 +558,7 @@ static const char *aHP[] =
 
 PropertyHelper_Hyphen::PropertyHelper_Hyphen(
         const Reference< XInterface > & rxSource,
-        Reference< XPropertySet > &rxPropSet ) :
+        Reference< XLinguProperties > &rxPropSet ) :
     PropertyChgHelper   ( rxSource, rxPropSet, AE_HYPHENATOR )
 {
     AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) );
@@ -703,7 +703,7 @@ PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet )
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet )
 {
     pInst = new PropertyHelper_Thes( rxSource, rxPropSet );
     xPropHelper = pInst;
@@ -732,7 +732,7 @@ PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet)
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet)
 {
     pInst = new PropertyHelper_Hyphen( rxSource, rxPropSet );
     xPropHelper = pInst;
@@ -792,7 +792,7 @@ PropertyHelper_Spelling::PropertyHelper_Spelling(
             const ::com::sun::star::uno::Reference<
                 ::com::sun::star::uno::XInterface > &rxSource,
             ::com::sun::star::uno::Reference<
-                ::com::sun::star::beans::XPropertySet > &rxPropSet )
+                ::com::sun::star::linguistic2::XLinguProperties > &rxPropSet )
 {
     pInst = new PropertyHelper_Spell( rxSource, rxPropSet );
     xPropHelper = pInst;
diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx
index 401c671..c2e591af 100644
--- a/linguistic/source/spelldsp.hxx
+++ b/linguistic/source/spelldsp.hxx
@@ -60,7 +60,7 @@ class SpellCheckerDispatcher :
     LinguOptions            aOpt;
 
     ::com::sun::star::uno::Reference<
-        ::com::sun::star::beans::XPropertySet >                     xPropSet;
+        ::com::sun::star::linguistic2::XLinguProperties >           xPropSet;
     ::com::sun::star::uno::Reference<
         ::com::sun::star::linguistic2::XSearchableDictionaryList >  xDicList;
 
@@ -75,7 +75,7 @@ class SpellCheckerDispatcher :
     inline linguistic::SpellCache &  GetCache() const;
 
     inline ::com::sun::star::uno::Reference<
-        ::com::sun::star::beans::XPropertySet >
+        ::com::sun::star::linguistic2::XLinguProperties >
             GetPropSet();
     inline ::com::sun::star::uno::Reference<
         ::com::sun::star::linguistic2::XSearchableDictionaryList >
@@ -137,7 +137,7 @@ inline linguistic::SpellCache & SpellCheckerDispatcher::GetCache() const
 
 
 inline ::com::sun::star::uno::Reference<
-    ::com::sun::star::beans::XPropertySet >
+    ::com::sun::star::linguistic2::XLinguProperties >
         SpellCheckerDispatcher::GetPropSet()
 {
     return xPropSet.is() ?
diff --git a/linguistic/source/thesdsp.hxx b/linguistic/source/thesdsp.hxx
index bdf0888..83832b4 100644
--- a/linguistic/source/thesdsp.hxx
+++ b/linguistic/source/thesdsp.hxx
@@ -58,14 +58,14 @@ class ThesaurusDispatcher :
     ThesSvcByLangMap_t      aSvcMap;
 
     ::com::sun::star::uno::Reference<
-        ::com::sun::star::beans::XPropertySet >     xPropSet;
+        ::com::sun::star::linguistic2::XLinguProperties >     xPropSet;
 
     // disallow copy-constructor and assignment-operator for now
     ThesaurusDispatcher(const ThesaurusDispatcher &);
     ThesaurusDispatcher & operator = (const ThesaurusDispatcher &);
 
     inline ::com::sun::star::uno::Reference<
-        ::com::sun::star::beans::XPropertySet >
+        ::com::sun::star::linguistic2::XLinguProperties >
             GetPropSet();
 
     void    ClearSvcList();
@@ -106,7 +106,7 @@ public:
 
 
 inline ::com::sun::star::uno::Reference<
-    ::com::sun::star::beans::XPropertySet >
+    ::com::sun::star::linguistic2::XLinguProperties >
         ThesaurusDispatcher::GetPropSet()
 {
     return xPropSet.is() ?
diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index 4bbf3f3..91a18a3 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -70,7 +70,7 @@ PropertyHelper_Spell & SpellChecker::GetPropHelper_Impl()
 {
     if (!pPropHelper)
     {
-        Reference< XPropertySet >   xPropSet( GetLinguProperties(), UNO_QUERY );
+        Reference< XLinguProperties >   xPropSet = GetLinguProperties();
 
         pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet );
         xPropHelper = pPropHelper;
commit c75a46fbd0ba4daf857fcd7d70badeed5aae8e28
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 11:58:43 2013 +0200

    fdo#46808, use DialogProvider service constructor
    
    Change-Id: I1652be5cefd00892426cf8559cadc9605ad8d439

diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 7dfa94b..f74bb95 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -27,7 +27,7 @@
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XDialog.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/XDialogProvider.hpp>
+#include <com/sun/star/awt/DialogProvider.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
@@ -533,24 +533,17 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
     }
     Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( GetSbData()->pInst->GetBasic(), xModel );
 
-    Sequence< Any > aArgs( 4 );
-    if( bDocDialog )
-    {
-       aArgs[ 0 ] <<= xModel;
-    }
-    else
-    {
-       aArgs[ 0 ] <<= uno::Reference< uno::XInterface >();
-    }
-    aArgs[ 1 ] <<= xInput;
-    aArgs[ 2 ] = aDlgLibAny;
-    aArgs[ 3 ] <<= xScriptListener;
     // Create a "living" Dialog
     Reference< XControl > xCntrl;
     try
     {
-        Reference< XDialogProvider >  xDlgProv( xMSF->createInstanceWithArguments(OUString("com.sun.star.comp.scripting.DialogProvider" ), aArgs ), UNO_QUERY );
-        xCntrl.set( xDlgProv->createDialog(OUString() ), UNO_QUERY_THROW );
+       Reference< XDialogProvider >  xDlgProv;;
+       if( bDocDialog )
+           xDlgProv = css::awt::DialogProvider::createWithModelAndListener( xContext, xModel, xInput, aDlgLibAny, xScriptListener );
+       else
+           xDlgProv = css::awt::DialogProvider::createWithModelAndListener( xContext, uno::Reference< frame::XModel >(), xInput, aDlgLibAny, xScriptListener );
+
+       xCntrl.set( xDlgProv->createDialog(OUString() ), UNO_QUERY_THROW );
        // Add dialog model to dispose vector
        Reference< XComponent > xDlgComponent( xCntrl->getModel(), UNO_QUERY );
        GetSbData()->pInst->getComponentVector().push_back( xDlgComponent );
diff --git a/offapi/com/sun/star/awt/DialogProvider.idl b/offapi/com/sun/star/awt/DialogProvider.idl
index 9a578e1..e259ad7 100644
--- a/offapi/com/sun/star/awt/DialogProvider.idl
+++ b/offapi/com/sun/star/awt/DialogProvider.idl
@@ -22,6 +22,8 @@
 
 #include <com/sun/star/awt/XDialogProvider.idl>
 #include <com/sun/star/frame/XModel.idl>
+#include <com/sun/star/io/XInputStream.idl>
+#include <com/sun/star/script/XScriptListener.idl>
 
 
 
@@ -33,7 +35,13 @@ module com { module sun { module star { module awt {
  */
 service DialogProvider : com::sun::star::awt::XDialogProvider
 {
+
     createWithModel([in] com::sun::star::frame::XModel Model);
+
+    createWithModelAndListener([in] com::sun::star::frame::XModel Model,
+                     [in] com::sun::star::io::XInputStream InStream,
+                     [in] any DialogLib,
+                     [in] com::sun::star::script::XScriptListener ScriptListener);
 };
 
 
commit 8bf8a2f3493273cb408ef86c5d971e18fa8fc40b
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 09:52:58 2013 +0200

    fdo#46808, Convert script::InvocationAdapterFactory to new style
    
    Change-Id: I2fe24c863f4c43471f46032ed15fcd5b98863fc1

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index f16fc44..001df2a 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -49,6 +49,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/script/BasicErrorException.hpp>
+#include <com/sun/star/script/InvocationAdapterFactory.hpp>
 #include <com/sun/star/script/XAllListener.hpp>
 #include <com/sun/star/script/XInvocationAdapterFactory.hpp>
 #include <com/sun/star/script/Converter.hpp>
@@ -3028,16 +3029,13 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWri
     // search for the service and instatiate it
     Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
     Reference< XInterface > xInterface;
-    if ( xFactory.is() )
+    try
     {
-        try
-        {
-            xInterface = xFactory->createInstance( aServiceName );
-        }
-        catch( const Exception& )
-        {
-            implHandleAnyException( ::cppu::getCaughtException() );
-        }
+        xInterface = xFactory->createInstance( aServiceName );
+    }
+    catch( const Exception& )
+    {
+        implHandleAnyException( ::cppu::getCaughtException() );
     }
 
     SbxVariableRef refVar = rPar.Get(0);
@@ -3086,16 +3084,13 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar,
     // search for the service and instatiate it
     Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
     Reference< XInterface > xInterface;
-    if ( xFactory.is() )
+    try
     {
-        try
-        {
-            xInterface = xFactory->createInstanceWithArguments( aServiceName, aArgs );
-        }
-        catch( const Exception& )
-        {
-            implHandleAnyException( ::cppu::getCaughtException() );
-        }
+        xInterface = xFactory->createInstanceWithArguments( aServiceName, aArgs );
+    }
+    catch( const Exception& )
+    {
+        implHandleAnyException( ::cppu::getCaughtException() );
     }
 
     SbxVariableRef refVar = rPar.Get(0);
@@ -3131,19 +3126,12 @@ void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, sal_B
 
     // get the global service manager
     Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
-    if( xFactory.is() )
-    {
-        Any aAny;
-        aAny <<= xFactory;
+    Any aAny;
+    aAny <<= xFactory;
 
-        // Create a SbUnoObject out of it and return it
-        SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "ProcessServiceManager" ), aAny );
-        refVar->PutObject( (SbUnoObject*)xUnoObj );
-    }
-    else
-    {
-        refVar->PutObject( NULL );
-    }
+    // Create a SbUnoObject out of it and return it
+    SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "ProcessServiceManager" ), aAny );
+    refVar->PutObject( (SbUnoObject*)xUnoObj );
 }
 
 void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
@@ -4060,7 +4048,7 @@ private:
 // Function to replace AllListenerAdapterService::createAllListerAdapter
 Reference< XInterface > createAllListenerAdapter
 (
-    const Reference< XInvocationAdapterFactory >& xInvocationAdapterFactory,
+    const Reference< XInvocationAdapterFactory2 >& xInvocationAdapterFactory,
     const Reference< XIdlClass >& xListenerType,
     const Reference< XAllListener >& xListener,
     const Any& Helper
@@ -4069,10 +4057,12 @@ Reference< XInterface > createAllListenerAdapter
     Reference< XInterface > xAdapter;
     if( xInvocationAdapterFactory.is() && xListenerType.is() && xListener.is() )
     {
-       Reference< XInvocation > xInvocationToAllListenerMapper =
+        Reference< XInvocation > xInvocationToAllListenerMapper =
             (XInvocation*)new InvocationToAllListenerMapper( xListenerType, xListener, Helper );
         Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName() );
-        xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, aListenerType );
+        Sequence<Type> arg2(1);
+        arg2[0] = aListenerType;
+        xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, arg2 );
     }
     return xAdapter;
 }
@@ -4209,9 +4199,7 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
         return;
 
     // get the AllListenerAdapterService
-    Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
-    if( !xFactory.is() )
-        return;
+    Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
 
     // search the class
     Reference< XIdlClass > xClass = xCoreReflection->forName( aListenerClassName );
@@ -4219,8 +4207,8 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
         return;
 
     // From 1999-11-30: get the InvocationAdapterFactory
-    Reference< XInvocationAdapterFactory > xInvocationAdapterFactory = Reference< XInvocationAdapterFactory >(
-        xFactory->createInstance( OUString("com.sun.star.script.InvocationAdapterFactory") ), UNO_QUERY );
+    Reference< XInvocationAdapterFactory2 > xInvocationAdapterFactory =
+         InvocationAdapterFactory::create( xContext );
 
     BasicAllListener_Impl * p;
     Reference< XAllListener > xAllLst = p = new BasicAllListener_Impl( aPrefixName );
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 2469788..09275b0 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -27,7 +27,7 @@
 #include <com/sun/star/script/XEventAttacher2.hpp>
 #include <com/sun/star/script/Converter.hpp>
 #include <com/sun/star/script/XAllListener.hpp>
-#include <com/sun/star/script/XInvocationAdapterFactory.hpp>
+#include <com/sun/star/script/InvocationAdapterFactory.hpp>
 #include <com/sun/star/reflection/theCoreReflection.hpp>
 #include <com/sun/star/reflection/XIdlReflection.hpp>
 
@@ -86,7 +86,7 @@ private:
 // Function to replace AllListenerAdapterService::createAllListerAdapter
 Reference< XInterface > createAllListenerAdapter
 (
-    const Reference< XInvocationAdapterFactory >& xInvocationAdapterFactory,
+    const Reference< XInvocationAdapterFactory2 >& xInvocationAdapterFactory,
     const Reference< XIdlClass >& xListenerType,
     const Reference< XAllListener >& xListener,
     const Any& Helper
@@ -98,7 +98,9 @@ Reference< XInterface > createAllListenerAdapter
        Reference< XInvocation > xInvocationToAllListenerMapper =
             (XInvocation*)new InvocationToAllListenerMapper( xListenerType, xListener, Helper );
         Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName());
-        xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, aListenerType );
+        Sequence<Type> arg2(1);
+        arg2[0] = aListenerType;
+        xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, arg2 );
     }
     return xAdapter;
 }
@@ -209,7 +211,7 @@ sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const OUString& Nam
 class EventAttacherImpl : public WeakImplHelper3 < XEventAttacher2, XInitialization, XServiceInfo >
 {
 public:
-    EventAttacherImpl( const Reference< XMultiServiceFactory >& );
+    EventAttacherImpl( const Reference< XComponentContext >& );
     ~EventAttacherImpl();
 
     // XServiceInfo
@@ -251,7 +253,7 @@ public:
 private:
     Reference<XEventListener> attachListenerForTarget(
         const Reference<XIntrospectionAccess>& xAccess,
-        const Reference<XInvocationAdapterFactory>& xInvocationAdapterFactory,
+        const Reference<XInvocationAdapterFactory2>& xInvocationAdapterFactory,
         const Reference<XAllListener>& xAllListener,
         const Any& aObject,
         const Any& aHelper,
@@ -265,24 +267,24 @@ private:
 
 private:
     Mutex                               m_aMutex;
-    Reference< XMultiServiceFactory >   m_xSMgr;
+    Reference< XComponentContext >      m_xContext;
 
     // Save Services
     Reference< XIntrospection >             m_xIntrospection;
     Reference< XIdlReflection >             m_xReflection;
     Reference< XTypeConverter >             m_xConverter;
-    Reference< XInvocationAdapterFactory >  m_xInvocationAdapterFactory;
+    Reference< XInvocationAdapterFactory2 >  m_xInvocationAdapterFactory;
 
     // needed services
     Reference< XIntrospection >             getIntrospection() throw( Exception );
     Reference< XIdlReflection >             getReflection() throw( Exception );
-    Reference< XInvocationAdapterFactory >  getInvocationAdapterService() throw( Exception );
+    Reference< XInvocationAdapterFactory2 >  getInvocationAdapterService() throw( Exception );
 };
 
 
 //*************************************************************************
-EventAttacherImpl::EventAttacherImpl( const Reference< XMultiServiceFactory >& rSMgr )
-    : m_xSMgr( rSMgr )
+EventAttacherImpl::EventAttacherImpl( const Reference< XComponentContext >& rxContext )
+    : m_xContext( rxContext )
 {
 }
 
@@ -295,7 +297,7 @@ EventAttacherImpl::~EventAttacherImpl()
 Reference< XInterface > SAL_CALL EventAttacherImpl_CreateInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( Exception )
 {
     Reference< XInterface > xRet;
-    XEventAttacher *pEventAttacher = (XEventAttacher*) new EventAttacherImpl(rSMgr);
+    XEventAttacher *pEventAttacher = (XEventAttacher*) new EventAttacherImpl( comphelper::getComponentContext(rSMgr) );
 
     if (pEventAttacher)
     {
@@ -349,7 +351,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments) th
             throw IllegalArgumentException();
 
         // InvocationAdapter service ?
-        Reference< XInvocationAdapterFactory > xALAS;
+        Reference< XInvocationAdapterFactory2 > xALAS;
         pArray[i] >>= xALAS;
         if( xALAS.is() )
         {
@@ -394,7 +396,7 @@ Reference< XIntrospection > EventAttacherImpl::getIntrospection() throw( Excepti
     Guard< Mutex > aGuard( m_aMutex );
     if( !m_xIntrospection.is() )
     {
-        m_xIntrospection = Introspection::create( comphelper::getComponentContext(m_xSMgr) );
+        m_xIntrospection = Introspection::create( m_xContext );
     }
     return m_xIntrospection;
 }
@@ -406,20 +408,19 @@ Reference< XIdlReflection > EventAttacherImpl::getReflection() throw( Exception
     Guard< Mutex > aGuard( m_aMutex );
     if( !m_xReflection.is() )
     {
-        m_xReflection = theCoreReflection::get(comphelper::getComponentContext(m_xSMgr));
+        m_xReflection = theCoreReflection::get(m_xContext);
     }
     return m_xReflection;
 }
 
 //*************************************************************************
 //*** Private helper methods ***
-Reference< XInvocationAdapterFactory > EventAttacherImpl::getInvocationAdapterService() throw( Exception )
+Reference< XInvocationAdapterFactory2 > EventAttacherImpl::getInvocationAdapterService() throw( Exception )
 {
     Guard< Mutex > aGuard( m_aMutex );
     if( !m_xInvocationAdapterFactory.is() )
     {
-        Reference< XInterface > xIFace( m_xSMgr->createInstance( OUString("com.sun.star.script.InvocationAdapterFactory") ) );
-        m_xInvocationAdapterFactory = Reference< XInvocationAdapterFactory >( xIFace, UNO_QUERY );
+        m_xInvocationAdapterFactory = InvocationAdapterFactory::create(m_xContext);
     }
     return m_xInvocationAdapterFactory;
 }
@@ -432,7 +433,7 @@ Reference< XTypeConverter > EventAttacherImpl::getConverter() throw( Exception )
     Guard< Mutex > aGuard( m_aMutex );
     if( !m_xConverter.is() )
     {
-        m_xConverter = Converter::create(comphelper::getComponentContext(m_xSMgr));
+        m_xConverter = Converter::create(m_xContext);
     }
     return m_xConverter;
 }
@@ -582,7 +583,7 @@ Reference< XEventListener > EventAttacherImpl::attachListener
     if( !xObject.is() || !AllListener.is() )
         throw IllegalArgumentException();
 
-    Reference< XInvocationAdapterFactory > xInvocationAdapterFactory = getInvocationAdapterService();
+    Reference< XInvocationAdapterFactory2 > xInvocationAdapterFactory = getInvocationAdapterService();
     if( !xInvocationAdapterFactory.is() )
         throw ServiceNotRegisteredException();
 
@@ -612,7 +613,7 @@ Reference< XEventListener > EventAttacherImpl::attachListener
 
 Reference<XEventListener> EventAttacherImpl::attachListenerForTarget(
     const Reference<XIntrospectionAccess>& xAccess,
-    const Reference<XInvocationAdapterFactory>& xInvocationAdapterFactory,
+    const Reference<XInvocationAdapterFactory2>& xInvocationAdapterFactory,
     const Reference<XAllListener>& xAllListener,
     const Any& aObject,
     const Any& aHelper,
@@ -725,7 +726,7 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachListeners(
     if (!xObject.is())
         throw IllegalArgumentException();
 
-    Reference< XInvocationAdapterFactory > xInvocationAdapterFactory = getInvocationAdapterService();
+    Reference< XInvocationAdapterFactory2 > xInvocationAdapterFactory = getInvocationAdapterService();
     if( !xInvocationAdapterFactory.is() )
         throw ServiceNotRegisteredException();
 
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 15615ba..96d8c15 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -33,6 +33,7 @@
 #include <com/sun/star/beans/XMaterialHolder.hpp>
 #include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/script/Converter.hpp>
+#include <com/sun/star/script/InvocationAdapterFactory.hpp>
 #include <com/sun/star/reflection/theCoreReflection.hpp>
 
 
@@ -267,15 +268,7 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
 
     c->xCoreReflection = theCoreReflection::get(ctx);
 
-    c->xAdapterFactory = Reference< XInvocationAdapterFactory2 > (
-        ctx->getServiceManager()->createInstanceWithContext(
-            OUString(  "com.sun.star.script.InvocationAdapterFactory"  ),
-            ctx ),
-        UNO_QUERY );
-    if( ! c->xAdapterFactory.is() )
-        throw RuntimeException(
-            OUString(  "pyuno: couldn't instantiate invocation adapter factory service" ),
-            Reference< XInterface > () );
+    c->xAdapterFactory = css::script::InvocationAdapterFactory::create(ctx);
 
     c->xIntrospection = Introspection::create(ctx);
 
diff --git a/udkapi/UnoApi_udkapi.mk b/udkapi/UnoApi_udkapi.mk
index 011e487..5e723a1 100644
--- a/udkapi/UnoApi_udkapi.mk
+++ b/udkapi/UnoApi_udkapi.mk
@@ -88,7 +88,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/registr
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/script,\
 	Engine \
-	InvocationAdapterFactory \
 	JavaScript \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/util,\
@@ -137,6 +136,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/script,\
 	AllListenerAdapter \
 	Converter \
 	Invocation \
+	InvocationAdapterFactory \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/uno,\
 	NamingService \
diff --git a/udkapi/com/sun/star/script/InvocationAdapterFactory.idl b/udkapi/com/sun/star/script/InvocationAdapterFactory.idl
index 2008728..766a2d0 100644
--- a/udkapi/com/sun/star/script/InvocationAdapterFactory.idl
+++ b/udkapi/com/sun/star/script/InvocationAdapterFactory.idl
@@ -19,12 +19,9 @@
 #ifndef __com_sun_star_script_InvocationAdapterFactory_idl__
 #define __com_sun_star_script_InvocationAdapterFactory_idl__
 
-#include <com/sun/star/script/XInvocationAdapterFactory.idl>
 #include <com/sun/star/script/XInvocationAdapterFactory2.idl>
 
-
-
- module com {  module sun {  module star {  module script {
+module com {  module sun {  module star {  module script {
 
 /** Provides functionality to create an adapter that supports (a)
     special interface type(s) and maps calls to the interface's
@@ -43,18 +40,7 @@
         <type scope="com::sun::star::script">XInvocationAdapterFactory2</type>.
     </p>
  */
-published service InvocationAdapterFactory
-{
-    /** Interface for creating adapter objects.
-        This interface is deprecated.  Use <type>XInvocationAdapterFactory2</type>.
-        @deprecated
-    */
-    interface com::sun::star::script::XInvocationAdapterFactory;
-
-    /** Interface for creating adapter objects.
-    */
-    interface com::sun::star::script::XInvocationAdapterFactory2;
-};
+published service InvocationAdapterFactory : XInvocationAdapterFactory2;
 
 
 }; }; }; };
diff --git a/udkapi/type_reference/udkapi.rdb b/udkapi/type_reference/udkapi.rdb
index 469512a..f1f890b 100644
Binary files a/udkapi/type_reference/udkapi.rdb and b/udkapi/type_reference/udkapi.rdb differ


More information about the Libreoffice-commits mailing list