Bug 54938 - Adapt supportsService implementations to cppu::supportsService
Summary: Adapt supportsService implementations to cppu::supportsService
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.2.0 target:4.3.0 target:6.5....
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2012-09-14 17:37 UTC by Stephan Bergmann
Modified: 2020-02-07 12:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2012-09-14 17:37:52 UTC
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=2171077c0c3c43a61546ab2c0ae68ba63c5112f7> "Introduce cppu::supportsService helper, adapt some call-sites" introduces a new function cppu::supportsService (cppuhelper/supportsservice.hxx) intended to be called from (C++) implementations of com.sun.star.lang.XServiceInfo's supportsService method.

See the above commit for examples of how to adapt existing implementations of supportsService.  Find and adapt more implementations.
Comment 1 Björn Michaelsen 2013-10-04 18:46:53 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 2 Commit Notification 2013-10-07 17:10:33 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7235d23267e4591e5cf47762abd3f63421b06904

fdo#54938: Adapt supportsService implementations to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2013-10-09 15:13:29 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2b91dc3ae674648da6909b0ab96129a7d7d3ed39

fdo#54938: Adapt connectivity module to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2013-10-17 13:14:35 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3d3293144b0e0d2d28136b1b2c7154d6352463b8

fdo#54938: Adapt svtools and comphelper module ...



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Marcos Souza 2013-10-21 17:01:58 UTC
In reportdesign, I saw a lot of uses of comhelper::existsValue:

::sal_Bool SAL_CALL OToolboxController::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
    return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
}

We want to remove this too and use cppuhelper::supportsService?
Comment 6 Marcos Souza 2013-10-21 17:06:28 UTC
Inside chart2, I saw some uses of:

sal_Bool SAL_CALL AccessibleBase::supportsService( const OUString& ServiceName )
    throw (RuntimeException)
{
    return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
}

And inside comphelper I found this declaration:

/** the base implementation iterates over the service names from <code>getSupportedServiceNames</code> */
sal_Bool SAL_CALL ServiceInfoHelper::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException)
{
    return supportsService( ServiceName, getSupportedServiceNames() );
}

sal_Bool SAL_CALL ServiceInfoHelper::supportsService( const OUString& ServiceName, const ::com::sun::star::uno::Sequence< OUString >& SupportedServices ) throw() 
{
    const OUString * pArray = SupportedServices.getConstArray();
    for( sal_Int32 i = 0; i < SupportedServices.getLength(); i++ )
        if( pArray[i] == ServiceName )
            return sal_True;
    return sal_False;
}

Maybe we want to remove this too?
Comment 7 Stephan Bergmann 2013-10-22 06:27:27 UTC
(In reply to comment #5)
> In reportdesign, I saw a lot of uses of comhelper::existsValue:
> 
> ::sal_Bool SAL_CALL OToolboxController::supportsService( const OUString&
> ServiceName ) throw (uno::RuntimeException)
> {
>     return
> ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
> }
> 
> We want to remove this too and use cppuhelper::supportsService?

Yes, I would suggest to rewrite those supportsService member functions to use cppuhelper::supportsService, for the sake of consistency.

(In reply to comment #6)
> sal_Bool SAL_CALL ServiceInfoHelper::supportsService( const OUString&
> ServiceName, const ::com::sun::star::uno::Sequence< OUString >&
> SupportedServices ) throw() 
> {
>     const OUString * pArray = SupportedServices.getConstArray();
>     for( sal_Int32 i = 0; i < SupportedServices.getLength(); i++ )
>         if( pArray[i] == ServiceName )
>             return sal_True;
>     return sal_False;
> }
> 
> Maybe we want to remove this too?

Yes, the static comphelper::ServiceInfoHelper::supportsService can go.
Comment 8 Commit Notification 2013-10-22 10:40:44 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee5661ecd3bbeae38b04cd3f582a320a231d11bd

fdo#54938: Adapt supportsService implementations..



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2013-10-23 09:19:41 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8f6d2eef50e1fabac30233c23a800da2c1c8ebc9

fdo#54938: Kill ServiceInfoHelper::supportsService and use cppu's instead.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2013-10-23 15:08:19 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=196f980012739d94654e6863b85b2e49f7e1a1e5

fdo#54938: Replace existsValue for cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2013-10-24 16:04:45 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=be0adb9f0fc738fe8735d2e0802fd19091799d11

fdo#54938: Remove SupportsServiceImpl from sw and use cppu instead



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Marcos Souza 2013-10-24 17:09:43 UTC
I saw a lot of places like this:

sal_Bool SAL_CALL ScTabViewObj::supportsService( const OUString& rServiceName )
                                                    throw(uno::RuntimeException)
{
    return rServiceName.equalsAscii( SCTABVIEWOBJ_SERVICE ) || 
           rServiceName.equalsAscii( SCVIEWSETTINGS_SERVICE );
}

So, can we just exchange this to cppu::supportsService? Or we need to some another pieces of code?

OBS: I believe all places that test the supportsService like this have this same function:
uno::Sequence<OUString> SAL_CALL ScTabViewObj::getSupportedServiceNames()
                                                    throw(uno::RuntimeException)
{
    uno::Sequence<OUString> aRet(2);
    OUString* pArray = aRet.getArray();
    pArray[0] = OUString( SCTABVIEWOBJ_SERVICE );
    pArray[1] = OUString( SCVIEWSETTINGS_SERVICE );
    return aRet;
}

with the same service name added into uno::Sequence.

With this change we can have a more standard code, at least talking about the way we get uno service names :)
Comment 13 Commit Notification 2013-10-25 08:19:00 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=da5449da0c056a3a0da239eff2e2b8b66cfd6224

fdo#54938: More uses of cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Stephan Bergmann 2013-10-25 08:27:30 UTC
(In reply to comment #12)
> sal_Bool SAL_CALL ScTabViewObj::supportsService( const OUString&
> rServiceName )
>                                                    
> throw(uno::RuntimeException)
> {
>     return rServiceName.equalsAscii( SCTABVIEWOBJ_SERVICE ) || 
>            rServiceName.equalsAscii( SCVIEWSETTINGS_SERVICE );
> }
> 
> So, can we just exchange this to cppu::supportsService? Or we need to some
> another pieces of code?

Every UNO object O implementing css.lang.XServiceInfo must meet the condition that O.supportsService(S) returns true iff S is in the sequence returned by O.getSupportedServiceNames().  Therefore, any case where the implementation of supportsService could not be replaced by a call to cppu::supportsService would be a bug that needs fixing anyway.
Comment 15 Commit Notification 2013-10-25 08:31:00 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=704f95e5255ff72bfb548d50d66d4da61dc483ef

fdo#54938: More uses of cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Marcos Souza 2013-10-25 10:41:17 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > sal_Bool SAL_CALL ScTabViewObj::supportsService( const OUString&
> > rServiceName )
> >                                                    
> > throw(uno::RuntimeException)
> > {
> >     return rServiceName.equalsAscii( SCTABVIEWOBJ_SERVICE ) || 
> >            rServiceName.equalsAscii( SCVIEWSETTINGS_SERVICE );
> > }
> > 
> > So, can we just exchange this to cppu::supportsService? Or we need to some
> > another pieces of code?
> 
> Every UNO object O implementing css.lang.XServiceInfo must meet the
> condition that O.supportsService(S) returns true iff S is in the sequence
> returned by O.getSupportedServiceNames().  Therefore, any case where the
> implementation of supportsService could not be replaced by a call to
> cppu::supportsService would be a bug that needs fixing anyway.

Nice! I'll use cppu::supportsService for all places that implements css.lang.XServiceInfo and remove that string comparisons.
Comment 17 Commit Notification 2013-10-30 15:36:24 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0865c446c2ac3facd75f03020e934e71403429e1

fdo#54938: Convert package, writerfilter and writerperfect



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2013-10-30 17:40:13 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2b01553fa5982ed50fd37f346a150d1aac8dcd6f

fdo#54938: Convert svx to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2013-11-04 11:32:31 UTC
Jose Guilherme Vanz committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2bb5f4773cc73a13bcd1460c02bc33bb4e60225c

fdo#54938: Convert to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2013-12-09 15:39:46 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=326aa3ff4d86c5709ae85ab71fd2c6828bbe7559

fdo#54938: Convert sc to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2013-12-09 16:09:55 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cccc6c4ebcc508576d9cf609a649d4d3d76d61eb

fdo#54938: Convert sd to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2013-12-09 16:26:44 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2f50ce6cfab2871cd879c1429e1938d3642616ef

fdo#54938: Convert sw to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2013-12-09 16:45:33 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=66b602e2315f91faf4c28ea9b72bfe188e0eec9c

fdo#54938: Convert io to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2013-12-09 17:03:31 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4b623c10ca4dbb94cdd7fd8189b40e50fbf9b6e

fdo#54938: Convert starmath to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2013-12-10 07:34:31 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=afd32065b619a6016658eaac650a29d0d03d4c61

fdo#54938: Convert dbaccess to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 26 Commit Notification 2013-12-18 09:17:51 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6cd3118b6370a0314e58692e08b68c4dcb0f922a

fdo#54938: Convert i18npool to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2014-01-16 09:27:11 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cf51afb0269e9c1fd5d51ca8b67b86a38d1da75f

fdo#54938: Convert svtools to cppu::supportsService...



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2014-01-16 09:27:26 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a2218b0d8b39e5018342b9085a3ec98941631952

fdo#54938: Convert svx and svl to cppu::supportsService...



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 29 Commit Notification 2014-01-16 09:27:40 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ccf47bd943bf8d09e60fd3310ba31d550e744765

fdo#54938: Convert canvas to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 30 Commit Notification 2014-01-16 09:27:55 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eeeefd6fd87b3cff18ba9078869bdfcd0e351d6f

fdo#54938: Convert filter to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 31 Commit Notification 2014-01-25 14:44:18 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=74c876e615fe575657d0a083f5a3781d4020f0c4

fdo#54938 Convert chart2 to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 32 Commit Notification 2014-01-25 16:14:34 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=03cc76aad32b0aa40e229b14d3b2dca3ebc92dd8

fdo#54938 Convert toolkit to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 33 Commit Notification 2014-01-26 11:34:05 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8ef77fc61e207598d5ad6ca428ccac4249aed170

fdo#54938 Convert extensions to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 34 Alexandre Vicenzi 2014-01-31 07:39:48 UTC
What's the correct way to convert this?

sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName ) throw( RuntimeException )
{
   return
   (rServiceName == "com.sun.star.document.ImportFilter" ) ||
   (rServiceName == "com.sun.star.document.ExportFilter" );
}
Comment 35 Stephan Bergmann 2014-01-31 10:10:56 UTC
(In reply to comment #34)
> sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName
> ) throw( RuntimeException )
> {
>    return
>    (rServiceName == "com.sun.star.document.ImportFilter" ) ||
>    (rServiceName == "com.sun.star.document.ExportFilter" );
> }

Please always give a pointer to the relevant file, apparently oox/source/core/filterbase.cxx in this case.

As currrent FilterBase::supportsService behavior is in line with FilterBase::getSupportedServiceNames behavior (defined just afterwards), the usual approach of forwarding to cppu::supportsService just works here.  Or what am I missing?
Comment 36 Commit Notification 2014-01-31 10:57:26 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f63a5fa269678cdc021f5c280f697e53771545a

fdo#54938 Convert odk to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 37 Commit Notification 2014-02-02 15:00:30 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a91de8efc9b99cedb917203e3255d55a514fb8a3

fdo#54938 Convert framework to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 38 Commit Notification 2014-02-02 17:38:25 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=93ef9a43a53218bdfbdea2ec20fba73fef08db75

fdo#54938 Convert bridges, editeng and others to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 39 Commit Notification 2014-02-02 18:53:32 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=32b8c5c4a9fd03b4e05dff2a77ec186973c126b3

fdo#54938 Convert basctl, mysqlc, sdext, svgio, writerp. to cppu::supportsSer.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 40 Commit Notification 2014-02-03 14:36:36 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f9369d33a455b328f96fa554e3e942e64a40a4da

fdo#54938 Convert to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 41 Alexandre Vicenzi 2014-02-04 00:04:40 UTC
(In reply to comment #35)
> (In reply to comment #34)
> > sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName
> > ) throw( RuntimeException )
> > {
> >    return
> >    (rServiceName == "com.sun.star.document.ImportFilter" ) ||
> >    (rServiceName == "com.sun.star.document.ExportFilter" );
> > }
> 
> Please always give a pointer to the relevant file, apparently
> oox/source/core/filterbase.cxx in this case.
> 
> As currrent FilterBase::supportsService behavior is in line with
> FilterBase::getSupportedServiceNames behavior (defined just afterwards), the
> usual approach of forwarding to cppu::supportsService just works here.  Or
> what am I missing?

It's OK. I forgot to check getSupportedServiceNames.
Comment 42 Commit Notification 2014-02-04 02:38:00 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=56b404001ef83cc151727cc5a489dc493c6b65ec

fdo#54938 Convert oox and scaddins to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 43 Commit Notification 2014-02-04 10:17:26 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6ad41af76fc5a101e553472dd070b065a3e8b28c

fdo#54938 Convert dtrans, remoteb., reportd., ucbhelper to cppu::supportsSer..



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 44 Commit Notification 2014-02-05 14:02:21 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=625971b104bd39c0168816f822d1a0c491e25f45

fdo#54938 Convert sfx2, xmloff and connec.. to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 45 Commit Notification 2014-02-05 14:31:05 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e17cf910320848edbc3d11ec62acbf1c8f531ae5

fdo#54938 Convert comphelper and vcl to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 46 Alexandre Vicenzi 2014-02-06 00:33:42 UTC
Stephan,

Does OObjectBase (reportdesign/source/core/sdr/RptObject.cxx, reportdesign/inc/RptObject.hxx) support any service? I can't find Implementation Name and
Supported Service Names.

If OObjectBase doesn't support, I think my implementation would be OK. Else if supports any service I need those services name to fix what I have done.

I can't find what services OObjectBase support.

The old implementation not even had getSupportedServiceNames() and getImplementationName() methods.
Comment 47 Stephan Bergmann 2014-02-06 09:49:22 UTC
(In reply to comment #46)
> Does OObjectBase (reportdesign/source/core/sdr/RptObject.cxx,
> reportdesign/inc/RptObject.hxx) support any service? I can't find
> Implementation Name and
> Supported Service Names.

OObjectBase::supportsService appears to not be an implementation of css.lang.XServiceInfo.supportsService.  Just leave it alone when converting implementations of XServiceInfo.supportsService to use cppu::supportsService.

> If OObjectBase doesn't support, I think my implementation would be OK. Else
> if supports any service I need those services name to fix what I have done.
> 
> The old implementation not even had getSupportedServiceNames() and
> getImplementationName() methods.

Not sure what "old" and "new" implementations you are referring to.
Comment 48 Alexandre Vicenzi 2014-02-06 10:05:45 UTC
(In reply to comment #47)
> (In reply to comment #46)
> > Does OObjectBase (reportdesign/source/core/sdr/RptObject.cxx,
> > reportdesign/inc/RptObject.hxx) support any service? I can't find
> > Implementation Name and
> > Supported Service Names.
> 
> OObjectBase::supportsService appears to not be an implementation of
> css.lang.XServiceInfo.supportsService.  Just leave it alone when converting
> implementations of XServiceInfo.supportsService to use cppu::supportsService.
> 
> > If OObjectBase doesn't support, I think my implementation would be OK. Else
> > if supports any service I need those services name to fix what I have done.
> > 
> > The old implementation not even had getSupportedServiceNames() and
> > getImplementationName() methods.
> 
> Not sure what "old" and "new" implementations you are referring to.

But, I can add support to XServiceInfo right? Is this what I trying to do.

The old and new, are what I'm trying to do. I made OObjectBase inherit from XServiceInfo and I added the missing methods. I didn't commit this one yet.

What do you think?
Comment 49 Stephan Bergmann 2014-02-06 10:25:41 UTC
(In reply to comment #48)
> But, I can add support to XServiceInfo right?

No, I see no reason to do so.
Comment 50 Alexandre Vicenzi 2014-02-06 11:06:30 UTC
(In reply to comment #49)
> (In reply to comment #48)
> > But, I can add support to XServiceInfo right?
> 
> No, I see no reason to do so.

OK. :)
Comment 51 Alexandre Vicenzi 2014-02-06 12:46:19 UTC
Stephan,

And about this case? 

WizardsToolbarController doesn't inherit from XServiceInfo too, and I get some problems when I tried to add XServiceInfo.

css::uno::Sequence<OUString> WizardsToolbarController::getSupportedServiceNames()
throw (css::uno::RuntimeException)
{
    css::uno::Sequence< OUString > aRet(1);
    OUString* pArray = aRet.getArray();
    pArray[0] = "com.sun.star.frame.ToolbarController";
    return aRet;
}

in framework/source/uielement/popuptoolbarcontroller.cxx
Comment 52 Stephan Bergmann 2014-02-06 13:32:26 UTC
(In reply to comment #51)
> WizardsToolbarController doesn't inherit from XServiceInfo too, and I get
> some problems when I tried to add XServiceInfo.
> 
> css::uno::Sequence<OUString>
> WizardsToolbarController::getSupportedServiceNames()
> throw (css::uno::RuntimeException)
> {
>     css::uno::Sequence< OUString > aRet(1);
>     OUString* pArray = aRet.getArray();
>     pArray[0] = "com.sun.star.frame.ToolbarController";
>     return aRet;
> }
> 
> in framework/source/uielement/popuptoolbarcontroller.cxx

Yes, looks like all those derivatives of PopupMenuToolbarController erroneously fail to inherit from XServiceInfo.
Comment 53 Commit Notification 2014-02-06 15:48:44 UTC
Alexandre Vicenzi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f139c10fd357c1c07f857a1d277f39d9cbc39d1f

fdo#54938 Convert oox, sc, vcl, svtools... to cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 54 Commit Notification 2014-02-06 15:49:01 UTC Comment hidden (obsolete)
Comment 55 Alexandre Vicenzi 2014-02-11 22:12:29 UTC
Stephan,

I'm trying to adjust PopupMenuToolbarController (framework/source/uielement/popuptoolbarcontroller.cxx), but I'm getting some errors.

I tried this approach:

class PopupMenuToolbarController : public ::cppu::WeakImplHelper2< svt::ToolboxController, css::lang::XServiceInfo >

And I get these errors:

In file included from ./framework/source/uielement/popuptoolbarcontroller.cxx:21:0:
./include/cppuhelper/implbase2.hxx: In instantiation of ‘class cppu::WeakImplHelper2<svt::ToolboxController, com::sun::star::lang::XServiceInfo>’:
./framework/source/uielement/popuptoolbarcontroller.cxx:50:51:   required from here
./include/cppuhelper/implbase2.hxx:94:69: warning: direct base ‘cppu::OWeakObject’ inaccessible in ‘cppu::WeakImplHelper2<svt::ToolboxController, com::sun::star::lang::XServiceInfo>’ due to ambiguity [enabled by default]
     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE SAL_DLLPUBLIC_EXPORT WeakImplHelper2
                                                                     ^
./framework/source/uielement/popuptoolbarcontroller.cxx: In constructor ‘{anonymous}::PopupMenuToolbarController::PopupMenuToolbarController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&, const rtl::OUString&)’:
./framework/source/uielement/popuptoolbarcontroller.cxx:84:12: error: type ‘svt::ToolboxController’ is not a direct base of ‘{anonymous}::PopupMenuToolbarController’
     : svt::ToolboxController()

What I'm missing? Or what is the correct way to do this. I tried multiple inheritance and didn't work too.
Comment 56 Alexandre Vicenzi 2014-02-11 23:45:59 UTC
I tried to convert dbaccess/source/inc/apitools.hxx, but I get this:

In member function ‘virtual sal_Bool dbaccess::OQuery::supportsService(const rtl::OUString&)’:
./dbaccess/source/inc/apitools.hxx:81:57: error: ‘com::sun::star::lang::XServiceInfo’ is an ambiguous base of ‘dbaccess::OQuery’
         return cppu::supportsService(this, _rServiceName);

Do you have any idea? In this case supportsService is a macro.
Comment 57 Stephan Bergmann 2014-02-12 11:18:46 UTC
(In reply to comment #55)
> I'm trying to adjust PopupMenuToolbarController
> (framework/source/uielement/popuptoolbarcontroller.cxx), but I'm getting
> some errors.

There's two potential approaches.

First, check whether all derivatives of svt::ToolboxController are implementations of UNO services, so should all implement css::uno::XServiceInfo, so include that directly in svt::ToolboxController_Base (cf. <http://cgit.freedesktop.org/libreoffice/core/commit/?id=307684b2c735947e81aa061b8e16fa197fc15857> "Clean-up svt::ToolboxController inheritance").

Or, if that's not feasible, use cppu::ImplInheritanceHelper1 (cppuhelper/implbase1.hxx) to derive framework::PopupMenuToolbarController from both svt::ToolboxController and css::uno::XServiceInfo.
Comment 58 Stephan Bergmann 2014-02-12 11:33:10 UTC
(In reply to comment #56)
> I tried to convert dbaccess/source/inc/apitools.hxx, but I get this:
> 
> In member function ‘virtual sal_Bool dbaccess::OQuery::supportsService(const
> rtl::OUString&)’:
> ./dbaccess/source/inc/apitools.hxx:81:57: error:
> ‘com::sun::star::lang::XServiceInfo’ is an ambiguous base of
> ‘dbaccess::OQuery’
>          return cppu::supportsService(this, _rServiceName);
> 
> Do you have any idea? In this case supportsService is a macro.

Multiple inheritance of the same UNO interface does happen, and you then need to help the compiler by static_casting this to one of the branches through which it is inherited.  (Though multiple inheritance of XServiceInfo rather smells like a design bug that should be cleaned up.)

Unwind the use of IMPLEMENT_SERVICE_INFO3 in dbaccess/source/core/api/query.cxx, find out through which branches XServiceInfo is inherited, and use a static_cast around the this pointer in the implementation of OQuery::supportsService.
Comment 59 Alexandre Vicenzi 2014-02-12 17:19:37 UTC
(In reply to comment #58)
> (In reply to comment #56)
> > I tried to convert dbaccess/source/inc/apitools.hxx, but I get this:
> > 
> > In member function ‘virtual sal_Bool dbaccess::OQuery::supportsService(const
> > rtl::OUString&)’:
> > ./dbaccess/source/inc/apitools.hxx:81:57: error:
> > ‘com::sun::star::lang::XServiceInfo’ is an ambiguous base of
> > ‘dbaccess::OQuery’
> >          return cppu::supportsService(this, _rServiceName);
> > 
> > Do you have any idea? In this case supportsService is a macro.
> 
> Multiple inheritance of the same UNO interface does happen, and you then
> need to help the compiler by static_casting this to one of the branches
> through which it is inherited.  (Though multiple inheritance of XServiceInfo
> rather smells like a design bug that should be cleaned up.)
> 
> Unwind the use of IMPLEMENT_SERVICE_INFO3 in
> dbaccess/source/core/api/query.cxx, find out through which branches
> XServiceInfo is inherited, and use a static_cast around the this pointer in
> the implementation of OQuery::supportsService.

OK, I will take a look. Thanks.
Comment 60 Commit Notification 2014-03-03 21:54:40 UTC
Donizete Waterkemper committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c4cff5a6452c05c797742327f57bb682fa5379ce

fdo#54938: Convert some places to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 61 Marcos Souza 2014-03-04 11:48:03 UTC
Stephan, these are the last cases that needs conversion to supportsService(and maybe to inherit the XServiceInfo):

./dbaccess/source/inc/apitools.hxx: Needs to be converted to cppu::supportsService at line 80.
./reportdesign/source/core/sdr/RptObject.cxx: Needs to be converted to cppu::supportsService at line 421.
./comphelper/source/misc/servicedecl.cxx: Needs to be converted to cppu::supportsService at line 80.
./comphelper/source/misc/servicedecl.cxx: Needs to be converted to cppu::supportsService at line 136.
./basctl/source/dlged/dlgedobj.cxx: Needs to be converted to cppu::supportsService at line 638.
./chart2/source/inc/ServiceMacros.hxx: Needs to be converted to cppu::supportsService at line 70

These headers are used in a lot of places, so this can be a little difficult to do now.

What you suggests, to leave thia as it is?

Thanks!
Comment 62 Commit Notification 2014-03-04 13:31:23 UTC
Marcos Paulo de Souza committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4d6560f5066d143552cba861aaadc2f49b4357d4

fdo#54938: Convert some places to use cppu::supportsService



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 63 Marcos Souza 2014-03-04 13:37:26 UTC
Thanks a lot Alexandre and other guys who helped to solve this!

And thanks to Stephan who helped us!
Comment 64 Robinson Tryon (qubit) 2015-12-18 10:03:15 UTC Comment hidden (obsolete)
Comment 65 Robinson Tryon (qubit) 2016-02-18 16:37:17 UTC Comment hidden (obsolete)
Comment 66 Samuel Mehrbrodt (allotropia) 2017-02-17 15:18:37 UTC
There are still some places where this needs to be done, e.g. xmlsecurity/source/xmlsec .
Comment 67 Commit Notification 2020-01-06 10:09:03 UTC
Yusuf Keten committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c9253b9007059496521f24ef8348e80bb120e1e6

tdf#54938 Adapt supportsService implementations to cppu::supportsService

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 68 Mehmet Emin Başoğlu 2020-01-27 09:18:33 UTC
Hello, I tried to find all the related files with OpenGrok and searched 
	+"supportsService( const OUString" && -"cppu\:\:supportsService"
with the file path cxx.

I think these files arn't related with the bug:
	/core/stoc/test/testproxyfac.cxx
	/core/sc/source/filter/orcus/filterdetect.cxx
	/core/vcl/source/treelist/transfer.cxx

Other files in the search are waiting to merge. It seems like the bug is ready to be closed.
Comment 69 Stephan Bergmann 2020-01-27 09:46:29 UTC
(In reply to Mehmet Emin Başoğlu from comment #68)
> Other files in the search are waiting to merge. It seems like the bug is
> ready to be closed.

In which case: Thanks to all who have contributed fixes here!
Comment 70 Commit Notification 2020-01-27 15:10:23 UTC
Batuhan Taskaya committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ae9b25af849a63e8f9f41b8030c4947d6a59d358

tdf#54938: Adapt supportsService implementations to cppu::supportsService

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 71 Commit Notification 2020-02-01 09:21:34 UTC
Canberk TURAN committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a2c9b446243c153653537227da4731ebc945fb73

tdf#54938: Adapt supportsService implementations to cppu::supportsService

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 72 Commit Notification 2020-02-03 14:35:42 UTC
Hakan Bakacak committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7edce6c3a5df7787a4bd25e55301d57f300834b8

tdf#54938: Adapt supportsService implementations to cppu::supportsService

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 73 Commit Notification 2020-02-07 12:35:34 UTC
Mehmet Emin Başoğlu committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/91a3411bb74ad81663a4204f4547c523a1237f7b

tdf#54938: Adapt supportsService implementations to cppu::supportsService

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.