diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-25 08:43:20 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-06-29 14:48:11 -0700 |
commit | 22a09c25c8f56e3aab3ac1de6009461b4f063862 (patch) | |
tree | 613c8119bf9d4ec54fd3098142961f6ae1722cf5 /framework | |
parent | f206f0d5b0409573f003f141c1c5d519ba7d74c8 (diff) |
fixes for up-casting to Reference<XInterface>
Fix regressions introduced with
6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new type-checking
Reference constructor to reduce code noise"
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 533c6cb6bad6ef0432e8eebbfd4daf90ef71f3b4)
Conflicts:
framework/source/uifactory/menubarfactory.cxx
Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687
Reviewed-on: https://gerrit.libreoffice.org/9921
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
4 files changed, 27 insertions, 17 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index f67b5c459453..6c14f2b91cfc 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -490,6 +490,7 @@ void ModuleUIConfigurationManager::impl_resetElementTypeData( UIElementDataHashMap::iterator pIter = rHashMap.begin(); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY ); sal_Int16 nType = rUserElementType.nElementType; @@ -509,7 +510,7 @@ void ModuleUIConfigurationManager::impl_resetElementTypeData( ConfigurationEvent aReplaceEvent; aReplaceEvent.ResourceURL = rElement.aResourceURL; aReplaceEvent.Accessor <<= xThis; - aReplaceEvent.Source = xThis; + aReplaceEvent.Source = xIfac; aReplaceEvent.ReplacedElement <<= xOldSettings; aReplaceEvent.Element <<= rElement.xSettings; @@ -526,7 +527,7 @@ void ModuleUIConfigurationManager::impl_resetElementTypeData( ConfigurationEvent aEvent; aEvent.ResourceURL = rElement.aResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= rElement.xSettings; rRemoveNotifyContainer.push_back( aEvent ); @@ -559,6 +560,7 @@ void ModuleUIConfigurationManager::impl_reloadElementTypeData( Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY ); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); sal_Int16 nType = rUserElementType.nElementType; while ( pIter != rHashMap.end() ) @@ -577,7 +579,7 @@ void ModuleUIConfigurationManager::impl_reloadElementTypeData( aReplaceEvent.ResourceURL = rElement.aResourceURL; aReplaceEvent.Accessor <<= xThis; - aReplaceEvent.Source = xThis; + aReplaceEvent.Source = xIfac; aReplaceEvent.ReplacedElement <<= xOldSettings; aReplaceEvent.Element <<= rElement.xSettings; rReplaceNotifyContainer.push_back( aReplaceEvent ); @@ -595,7 +597,7 @@ void ModuleUIConfigurationManager::impl_reloadElementTypeData( aReplaceEvent.ResourceURL = rElement.aResourceURL; aReplaceEvent.Accessor <<= xThis; - aReplaceEvent.Source = xThis; + aReplaceEvent.Source = xIfac; aReplaceEvent.ReplacedElement <<= xOldSettings; aReplaceEvent.Element <<= rElement.xSettings; rReplaceNotifyContainer.push_back( aReplaceEvent ); @@ -612,7 +614,7 @@ void ModuleUIConfigurationManager::impl_reloadElementTypeData( aRemoveEvent.ResourceURL = rElement.aResourceURL; aRemoveEvent.Accessor <<= xThis; - aRemoveEvent.Source = xThis; + aRemoveEvent.Source = xIfac; aRemoveEvent.Element <<= rElement.xSettings; rRemoveNotifyContainer.push_back( aRemoveEvent ); @@ -1094,12 +1096,13 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la rElementType.bModified = true; Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Create event to notify listener about replaced element settings ConfigurationEvent aEvent; aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.ReplacedElement <<= xOldSettings; aEvent.Element <<= pDataSettings->xSettings; @@ -1141,13 +1144,14 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la rElements.insert( UIElementDataHashMap::value_type( ResourceURL, aUIElementData )); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Create event to notify listener about replaced element settings ConfigurationEvent aEvent; aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.ReplacedElement <<= pDataSettings->xSettings; aEvent.Element <<= aUIElementData.xSettings; @@ -1200,6 +1204,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException rElementType.bModified = true; Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Check if we have settings in the default layer which replaces the user-defined one! UIElementData* pDefaultDataSettings = impl_findUIElementData( ResourceURL, nElementType ); @@ -1210,7 +1215,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= xRemovedSettings; aEvent.ReplacedElement <<= pDefaultDataSettings->xSettings; @@ -1225,7 +1230,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= xRemovedSettings; aGuard.unlock(); diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 82dfc41fc3bf..feeb95fb1129 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -419,6 +419,7 @@ void UIConfigurationManager::impl_resetElementTypeData( UIElementDataHashMap::iterator pIter = rHashMap.begin(); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Make copies of the event structures to be thread-safe. We have to unlock our mutex before calling // our listeners! @@ -431,7 +432,7 @@ void UIConfigurationManager::impl_resetElementTypeData( ConfigurationEvent aEvent; aEvent.ResourceURL = rElement.aResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= rElement.xSettings; rRemoveNotifyContainer.push_back( aEvent ); @@ -460,6 +461,7 @@ void UIConfigurationManager::impl_reloadElementTypeData( Reference< XStorage > xElementStorage( rDocElementType.xStorage ); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); sal_Int16 nType = rDocElementType.nElementType; while ( pIter != rHashMap.end() ) @@ -478,7 +480,7 @@ void UIConfigurationManager::impl_reloadElementTypeData( aReplaceEvent.ResourceURL = rElement.aResourceURL; aReplaceEvent.Accessor <<= xThis; - aReplaceEvent.Source = xThis; + aReplaceEvent.Source = xIfac; aReplaceEvent.ReplacedElement <<= xOldSettings; aReplaceEvent.Element <<= rElement.xSettings; rReplaceNotifyContainer.push_back( aReplaceEvent ); @@ -492,7 +494,7 @@ void UIConfigurationManager::impl_reloadElementTypeData( aRemoveEvent.ResourceURL = rElement.aResourceURL; aRemoveEvent.Accessor <<= xThis; - aRemoveEvent.Source = xThis; + aRemoveEvent.Source = xIfac; aRemoveEvent.Element <<= rElement.xSettings; rRemoveNotifyContainer.push_back( aRemoveEvent ); @@ -866,13 +868,14 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la rElementType.bModified = true; Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Create event to notify listener about replaced element settings ConfigurationEvent aEvent; aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.ReplacedElement <<= xOldSettings; aEvent.Element <<= pDataSettings->xSettings; @@ -923,13 +926,14 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException rElementType.bModified = true; Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Create event to notify listener about removed element settings ConfigurationEvent aEvent; aEvent.ResourceURL = ResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= xRemovedSettings; aGuard.unlock(); @@ -999,13 +1003,14 @@ throw ( ElementExistException, IllegalArgumentException, IllegalAccessException, Reference< XIndexAccess > xInsertSettings( aUIElementData.xSettings ); Reference< XUIConfigurationManager > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xIfac( xThis, UNO_QUERY ); // Create event to notify listener about removed element settings ConfigurationEvent aEvent; aEvent.ResourceURL = NewResourceURL; aEvent.Accessor <<= xThis; - aEvent.Source = xThis; + aEvent.Source = xIfac; aEvent.Element <<= xInsertSettings; aGuard.unlock(); diff --git a/framework/source/uifactory/menubarfactory.cxx b/framework/source/uifactory/menubarfactory.cxx index cbda3ce4d6fc..a4317ee5457e 100644 --- a/framework/source/uifactory/menubarfactory.cxx +++ b/framework/source/uifactory/menubarfactory.cxx @@ -146,7 +146,7 @@ void MenuBarFactory::CreateUIElement(const OUString& ResourceURL if ( !bHasSettings ) { - OUString aModuleIdentifier = _xModuleManager->identify( xFrame ); + OUString aModuleIdentifier = _xModuleManager->identify( Reference<XInterface>( xFrame, UNO_QUERY ) ); if ( !aModuleIdentifier.isEmpty() ) { Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier = diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx index d1dd274e3501..7f14c98fbfcf 100644 --- a/framework/source/uifactory/uielementfactorymanager.cxx +++ b/framework/source/uifactory/uielementfactorymanager.cxx @@ -422,7 +422,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l try { if ( xFrame.is() && xManager.is() ) - aModuleId = xManager->identify( xFrame ); + aModuleId = xManager->identify( Reference<XInterface>( xFrame, UNO_QUERY ) ); Reference< XUIElementFactory > xUIElementFactory = getFactory( ResourceURL, aModuleId ); if ( xUIElementFactory.is() ) |