fdo#46808 - [Easy Hack] Adapt UNO services to new-style

Noel Grandin noelgrandin at gmail.com
Thu Mar 22 05:11:50 PDT 2012


Hi

Diff attached.

OK, I've switched to using the new simplest example, 
CachedDynamicResultSetStubFactory, and I've got "make offapi" working.

However, converting the only usage I can find, in resultsethelper.cxx, 
results in the compiler not finding the correct header file.

I think I need to modify some part of the build to copy header files 
around, because CachedDynamicResultSetStubFactory.hpp is only found in:
     ./workdir/unxlngx6.pro/UnoApiHeaders
while UnoUrlResolver.hpp (the example in the bugreport) is found in:
   
./workdir/unxlngx6.pro/CustomTarget/cppuhelper/unotypes/com/sun/star/bridge/UnoUrlResolver.hpp
   
./workdir/unxlngx6.pro/CustomTarget/cppu/qa/com/sun/star/bridge/UnoUrlResolver.hpp
   
./workdir/unxlngx6.pro/UnoApiHeaders/udkapi/com/sun/star/bridge/UnoUrlResolver.hpp
   ./solver/unxlngx6.pro/inc/udkapi/com/sun/star/bridge/UnoUrlResolver.hpp

But I have no idea where to start. Any ideas?

Thanks, Noel Grandin

On 2012-03-21 17:31, Stephan Bergmann wrote:
> On 03/21/2012 04:19 PM, Noel Grandin wrote:
>> On Wed, Mar 21, 2012 at 14:44, Stephan Bergmann<sbergman at redhat.com>  
>> wrote:
>>> offapi/type_reference/types.rdb.  (Btw, you did replace the
>>> com.sun.star.script.Converter from the example with your actual
>>> com.sun.star.script.Engine, did you?)
>>
>> Aaah, that would be the problem. I assumed that because of it's name
>> "Converter" it had something to do with "converting" the types.rdb
>> file
>>
>> Doh!
>
> Sorry, 
> <http://cgit.freedesktop.org/libreoffice/core/commit/?id=ba8a429a2e062879d1d6641e22838928da1d8573> 
> "Clarify example" hopefully prevents that problem in the future.
>
> Stephan
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
-------------- next part --------------
diff --git a/offapi/com/sun/star/ucb/CachedDynamicResultSetStubFactory.idl b/offapi/com/sun/star/ucb/CachedDynamicResultSetStubFactory.idl
index 199e2c6..a215ead 100644
--- a/offapi/com/sun/star/ucb/CachedDynamicResultSetStubFactory.idl
+++ b/offapi/com/sun/star/ucb/CachedDynamicResultSetStubFactory.idl
@@ -39,13 +39,7 @@ module com { module sun { module star { module ucb {
 /** is a factory for <type>CachedDynamicResultSetStub</type> implementations.
 */
 published service CachedDynamicResultSetStubFactory
-{
-    //-------------------------------------------------------------------------
-    /** a factory for implementations of service
-        <type>CachedDynamicResultSetStub</type>.
-     */
-    interface com::sun::star::ucb::XCachedDynamicResultSetStubFactory;
-};
+   : com::sun::star::ucb::XCachedDynamicResultSetStubFactory;
 
 //=============================================================================
 
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 19ad36b..6782d6c 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/ucbhelper/source/provider/resultsethelper.cxx b/ucbhelper/source/provider/resultsethelper.cxx
index 8fd870d..ee07588 100644
--- a/ucbhelper/source/provider/resultsethelper.cxx
+++ b/ucbhelper/source/provider/resultsethelper.cxx
@@ -38,6 +38,7 @@
 #include <com/sun/star/ucb/ListActionType.hpp>
 #include <com/sun/star/ucb/WelcomeDynamicResultSetStruct.hpp>
 #include <com/sun/star/ucb/XCachedDynamicResultSetStubFactory.hpp>
+#include <com/sun/star/ucb/CachedDynamicResultSetStubFactory.hpp>
 #include <com/sun/star/ucb/XSourceInitialization.hpp>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <ucbhelper/resultsethelper.hxx>
@@ -258,12 +259,7 @@ void SAL_CALL ResultSetImplHelper::connectToCache(
         try
         {
             xStubFactory
-                = uno::Reference<
-                    com::sun::star::ucb::XCachedDynamicResultSetStubFactory >(
-                        m_xSMgr->createInstance(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                                "com.sun.star.ucb.CachedDynamicResultSetStubFactory" )) ),
-                uno::UNO_QUERY );
+                = com::sun::star::ucb::CachedDynamicResultSetStubFactory.create();
         }
         catch ( uno::Exception const & )
         {


More information about the LibreOffice mailing list