<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.
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
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.
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.
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.
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?
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?
(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.
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.
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.
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.
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.
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 :)
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.
(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.
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.
(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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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" ); }
(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?
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.
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.
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.
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.
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.
(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.
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.
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.
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.
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.
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.
(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.
(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?
(In reply to comment #48) > But, I can add support to XServiceInfo right? No, I see no reason to do so.
(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. :)
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
(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.
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.
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.
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.
(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.
(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.
(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.
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.
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!
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.
Thanks a lot Alexandre and other guys who helped to solve this! And thanks to Stephan who helped us!
Migrating Whiteboard tags to Keywords: (EasyHack) [NinjaEdit]
Remove LibreOffice Dev List from CC on EasyHacks (curtailing excessive email to list) [NinjaEdit]
There are still some places where this needs to be done, e.g. xmlsecurity/source/xmlsec .
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.
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.
(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!
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.
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.
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.
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.