summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-06-25 08:43:20 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-26 19:33:21 +0000
commit1249dd9f358681f61c8ec69a90ce61829601fd0b (patch)
treeb3187f00f64a9995a1df441e23a9d08bf499ce6b
parentdb298f22a04e409a555d7c3ccec4c1dae91a6e1b (diff)
fixes for up-casting to Reference<XInterface>
Fix regressions introduced with 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new type-checking Reference constructor to reduce code noise" Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687 Signed-off-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 533c6cb6bad6ef0432e8eebbfd4daf90ef71f3b4) Reviewed-on: https://gerrit.libreoffice.org/9919 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx3
-rw-r--r--basic/source/uno/dlgcont.cxx2
-rw-r--r--basic/source/uno/namecont.cxx10
-rw-r--r--comphelper/source/processfactory/processfactory.cxx4
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx6
-rw-r--r--filter/source/svg/svgwriter.cxx10
-rw-r--r--forms/source/misc/InterfaceContainer.cxx2
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx23
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx17
-rw-r--r--framework/source/uifactory/menubarfactory.cxx2
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx2
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx4
-rw-r--r--scripting/source/stringresource/stringresource.cxx4
-rw-r--r--sd/source/core/sdpage2.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx2
-rw-r--r--svx/source/form/fmobj.cxx2
-rw-r--r--svx/source/form/fmshimp.cxx4
-rw-r--r--svx/source/form/fmtools.cxx2
-rw-r--r--svx/source/form/fmundo.cxx4
-rw-r--r--svx/source/form/fmvwimp.cxx2
-rw-r--r--svx/source/form/formcontroller.cxx6
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--ucb/source/ucp/file/bc.cxx2
-rw-r--r--ucb/source/ucp/file/filglob.cxx8
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx2
-rw-r--r--unotools/source/config/configitem.cxx2
-rw-r--r--xmloff/source/text/txtparai.cxx2
28 files changed, 73 insertions, 62 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index f062de05fba8..45cb4682eb48 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -381,9 +381,10 @@ namespace basic
BasicManagerPointer& ImplRepository::impl_getLocationForModel( const Reference< XModel >& _rxDocumentModel )
{
+ Reference< XInterface > xNormalized( _rxDocumentModel, UNO_QUERY );
DBG_ASSERT( _rxDocumentModel.is(), "ImplRepository::impl_getLocationForModel: invalid model!" );
- BasicManagerPointer& location = m_aStore[ _rxDocumentModel ];
+ BasicManagerPointer& location = m_aStore[ xNormalized ];
return location;
}
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index a759eea503da..a90baec1cde2 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -241,7 +241,7 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
UNO_QUERY );
::xmlscript::importDialogModel( xInput, xDialogModel, mxContext, mxOwnerDocument );
std::vector< OUString > vEmbeddedImageURLs;
- GraphicObject::InspectForGraphicObjectImageURL( xDialogModel, vEmbeddedImageURLs );
+ GraphicObject::InspectForGraphicObjectImageURL( Reference<XInterface>(xDialogModel, UNO_QUERY), vEmbeddedImageURLs );
if ( !vEmbeddedImageURLs.empty() )
{
// Export the images to the storage
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 52d3494f23ef..854f437f60cc 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -297,7 +297,7 @@ void SAL_CALL NameContainer::addContainerListener( const Reference< XContainerLi
throw RuntimeException("addContainerListener called with null xListener",
static_cast< cppu::OWeakObject * >(this));
}
- maContainerListeners.addInterface( xListener );
+ maContainerListeners.addInterface( Reference<XInterface>(xListener, UNO_QUERY) );
}
void SAL_CALL NameContainer::removeContainerListener( const Reference< XContainerListener >& xListener )
@@ -307,7 +307,7 @@ void SAL_CALL NameContainer::removeContainerListener( const Reference< XContaine
{
throw RuntimeException();
}
- maContainerListeners.removeInterface( xListener );
+ maContainerListeners.removeInterface( Reference<XInterface>(xListener, UNO_QUERY) );
}
// Methods XChangesNotifier
@@ -318,7 +318,7 @@ void SAL_CALL NameContainer::addChangesListener( const Reference< XChangesListen
{
throw RuntimeException();
}
- maChangesListeners.addInterface( xListener );
+ maChangesListeners.addInterface( Reference<XInterface>(xListener, UNO_QUERY) );
}
void SAL_CALL NameContainer::removeChangesListener( const Reference< XChangesListener >& xListener )
@@ -328,7 +328,7 @@ void SAL_CALL NameContainer::removeChangesListener( const Reference< XChangesLis
{
throw RuntimeException();
}
- maChangesListeners.removeInterface( xListener );
+ maChangesListeners.removeInterface( Reference<XInterface>(xListener, UNO_QUERY) );
}
@@ -2978,7 +2978,7 @@ void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifie
leaveMethod();
Reference< XModel > xModel = mxOwnerDocument; // weak-ref -> ref
- vba::VBAScriptEvent aEvent( xModel, nIdentifier, rModuleName );
+ vba::VBAScriptEvent aEvent( Reference<XInterface>(xModel, UNO_QUERY), nIdentifier, rModuleName );
maVBAScriptListeners.notify( aEvent );
}
diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx
index 65c08ebad790..82b30e36b808 100644
--- a/comphelper/source/processfactory/processfactory.cxx
+++ b/comphelper/source/processfactory/processfactory.cxx
@@ -80,14 +80,14 @@ Reference< XComponentContext > getComponentContext(
catch (beans::UnknownPropertyException & e) {
throw DeploymentException(
"unknown service factory DefaultContext property: " + e.Message,
- factory );
+ Reference<XInterface>(factory, UNO_QUERY) );
}
}
if ( !xRet.is() )
{
throw DeploymentException(
"no service factory DefaultContext",
- factory );
+ Reference<XInterface>(factory, UNO_QUERY) );
}
return xRet;
}
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index 811db40ea8c4..c5ba676bf21a 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -657,7 +657,7 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s
return aFind->second;
}
}
- return xRet;
+ return Reference<XInterface>(xRet, UNO_QUERY);
}
Reference< XInterface > SAL_CALL OConnection::createInstanceWithArguments( const OUString& _sServiceSpecifier, const Sequence< Any >& /*Arguments*/ ) throw (Exception, RuntimeException, std::exception)
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 00016cd324c4..07cf0a40da10 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1213,7 +1213,7 @@ void SVGFilter::implExportTextShapeIndex()
{
OUString sTextShapeIdList = mTextShapeIdListMap[xDrawPage].trim();
- const OUString& rPageId = implGetValidIDFromInterface( xDrawPage );
+ const OUString& rPageId = implGetValidIDFromInterface( Reference<XInterface>(xDrawPage, UNO_QUERY) );
if( !rPageId.isEmpty() && !sTextShapeIdList.isEmpty() )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, rPageId );
@@ -1783,7 +1783,7 @@ bool SVGFilter::implExportShape( const Reference< XShape >& rxShape,
}
- const OUString& rShapeId = implGetValidIDFromInterface( rxShape );
+ const OUString& rShapeId = implGetValidIDFromInterface( Reference<XInterface>(rxShape, UNO_QUERY) );
if( !rShapeId.isEmpty() )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", rShapeId );
@@ -1976,7 +1976,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag
{
// We create a map of text shape ids.
implRegisterInterface( rxShape );
- const OUString& rShapeId = implGetValidIDFromInterface( rxShape );
+ const OUString& rShapeId = implGetValidIDFromInterface( Reference<XInterface>(rxShape, UNO_QUERY) );
if( !rShapeId.isEmpty() )
{
mTextShapeIdListMap[rxPage] += rShapeId;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 913f2523664a..beb38d19f07b 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -849,7 +849,7 @@ bool SVGTextWriter::createParagraphEnumeration()
{
if( mrTextShape.is() )
{
- msShapeId = implGetValidIDFromInterface( mrTextShape );
+ msShapeId = implGetValidIDFromInterface( Reference<XInterface>(mrTextShape, UNO_QUERY) );
Reference< XEnumerationAccess > xEnumerationAccess( mrTextShape, UNO_QUERY_THROW );
Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW );
@@ -1013,7 +1013,7 @@ bool SVGTextWriter::nextParagraph()
return false;
}
- const OUString& rParagraphId = implGetValidIDFromInterface( xTextContent );
+ const OUString& rParagraphId = implGetValidIDFromInterface( Reference<XInterface>(xTextContent, UNO_QUERY) );
if( !rParagraphId.isEmpty() )
{
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId );
@@ -1121,7 +1121,7 @@ bool SVGTextWriter::nextTextPortion()
{
implRegisterInterface( xPortionTextRange );
- const OUString& rTextPortionId = implGetValidIDFromInterface( xPortionTextRange );
+ const OUString& rTextPortionId = implGetValidIDFromInterface( Reference<XInterface>(xPortionTextRange, UNO_QUERY) );
if( !rTextPortionId.isEmpty() )
{
msHyperlinkIdList += rTextPortionId;
@@ -1573,7 +1573,7 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
implRegisterInterface( mrCurrentTextParagraph );
// Add the needed info to the BulletListItemMap
- OUString sId = implGetValidIDFromInterface( mrCurrentTextParagraph );
+ OUString sId = implGetValidIDFromInterface( Reference<XInterface>(mrCurrentTextParagraph, UNO_QUERY) );
if( !sId.isEmpty() )
{
sId += ".bp";
@@ -1592,7 +1592,7 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
}
}
- const OUString& rTextPortionId = implGetValidIDFromInterface( mrCurrentTextPortion );
+ const OUString& rTextPortionId = implGetValidIDFromInterface( Reference<XInterface>(mrCurrentTextPortion, UNO_QUERY) );
if( !rTextPortionId.isEmpty() )
{
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rTextPortionId );
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 636d35db3fae..a69c8dd8935a 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -261,7 +261,7 @@ void OInterfaceContainer::disposing()
// revoke event knittings
if ( m_xEventAttacher.is() )
{
- m_xEventAttacher->detach( i - 1, xSet );
+ m_xEventAttacher->detach( i - 1, Reference<XInterface>(xSet, UNO_QUERY) );
m_xEventAttacher->removeEntry( i - 1 );
}
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 42c57f0bc882..4ef4b833afa0 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -637,6 +637,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;
@@ -656,7 +657,7 @@ void ModuleUIConfigurationManager::impl_resetElementTypeData(
ui::ConfigurationEvent aReplaceEvent;
aReplaceEvent.ResourceURL = rElement.aResourceURL;
aReplaceEvent.Accessor <<= xThis;
- aReplaceEvent.Source = xThis;
+ aReplaceEvent.Source = xIfac;
aReplaceEvent.ReplacedElement <<= xOldSettings;
aReplaceEvent.Element <<= rElement.xSettings;
@@ -673,7 +674,7 @@ void ModuleUIConfigurationManager::impl_resetElementTypeData(
ui::ConfigurationEvent aEvent;
aEvent.ResourceURL = rElement.aResourceURL;
aEvent.Accessor <<= xThis;
- aEvent.Source = xThis;
+ aEvent.Source = xIfac;
aEvent.Element <<= rElement.xSettings;
rRemoveNotifyContainer.push_back( aEvent );
@@ -706,6 +707,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() )
@@ -724,7 +726,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 );
@@ -742,7 +744,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 );
@@ -759,7 +761,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 );
@@ -1232,12 +1234,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
ui::ConfigurationEvent aEvent;
aEvent.ResourceURL = ResourceURL;
aEvent.Accessor <<= xThis;
- aEvent.Source = xThis;
+ aEvent.Source = xIfac;
aEvent.ReplacedElement <<= xOldSettings;
aEvent.Element <<= pDataSettings->xSettings;
@@ -1279,13 +1282,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
ui::ConfigurationEvent aEvent;
aEvent.ResourceURL = ResourceURL;
aEvent.Accessor <<= xThis;
- aEvent.Source = xThis;
+ aEvent.Source = xIfac;
aEvent.ReplacedElement <<= pDataSettings->xSettings;
aEvent.Element <<= aUIElementData.xSettings;
@@ -1338,6 +1342,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 );
@@ -1348,7 +1353,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
aEvent.ResourceURL = ResourceURL;
aEvent.Accessor <<= xThis;
- aEvent.Source = xThis;
+ aEvent.Source = xIfac;
aEvent.Element <<= xRemovedSettings;
aEvent.ReplacedElement <<= pDefaultDataSettings->xSettings;
@@ -1363,7 +1368,7 @@ throw ( NoSuchElementException, IllegalArgumentException, IllegalAccessException
aEvent.ResourceURL = ResourceURL;
aEvent.Accessor <<= xThis;
- aEvent.Source = xThis;
+ aEvent.Source = xIfac;
aEvent.Element <<= xRemovedSettings;
aGuard.clear();
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 717a3cfd4061..2e0ad2a56557 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -547,6 +547,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!
@@ -559,7 +560,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 );
@@ -588,6 +589,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() )
@@ -606,7 +608,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 );
@@ -620,7 +622,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 );
@@ -992,13 +994,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;
@@ -1049,13 +1052,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.clear();
@@ -1125,13 +1129,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.clear();
diff --git a/framework/source/uifactory/menubarfactory.cxx b/framework/source/uifactory/menubarfactory.cxx
index 1a139c4f76ec..55afe317e5b6 100644
--- a/framework/source/uifactory/menubarfactory.cxx
+++ b/framework/source/uifactory/menubarfactory.cxx
@@ -118,7 +118,7 @@ void MenuBarFactory::CreateUIElement(const OUString& ResourceURL
{
Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager =
ModuleManager::create( _rxContext );
- 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 b18f82a43cf4..932b90b55f1d 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -453,7 +453,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
{
OUString aModuleId;
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() )
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 70a82c30480e..d5f506231320 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -539,11 +539,11 @@ static OUString aResourceResolverPropName("ResourceResolver");
Reference< XInterface >* pObjects = aObjects.getArray();
for ( sal_Int32 i = 0; i < nControlCount; ++i )
{
- pObjects[i] = pControls[i];
+ pObjects[i] = Reference<XInterface>( pControls[i], UNO_QUERY );
}
// also add the dialog control itself to the sequence
- pObjects[nControlCount] = rxControl;
+ pObjects[nControlCount] = Reference<XInterface>( rxControl, UNO_QUERY );
Reference< XScriptEventsAttacher > xScriptEventsAttacher = new DialogEventsAttacherImpl
( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess,
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index ebb3495b156b..2ff7d59841b2 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -159,7 +159,7 @@ void StringResourceImpl::addModifyListener( const Reference< XModifyListener >&
throw RuntimeException();
::osl::MutexGuard aGuard( getMutex() );
- m_aListenerContainer.addInterface( aListener );
+ m_aListenerContainer.addInterface( Reference<XInterface>( aListener, UNO_QUERY ) );
}
void StringResourceImpl::removeModifyListener( const Reference< XModifyListener >& aListener )
@@ -169,7 +169,7 @@ void StringResourceImpl::removeModifyListener( const Reference< XModifyListener
throw RuntimeException();
::osl::MutexGuard aGuard( getMutex() );
- m_aListenerContainer.removeInterface( aListener );
+ m_aListenerContainer.removeInterface( Reference<XInterface>( aListener, UNO_QUERY ) );
}
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index d76d29a3fb77..778bc1f48d40 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -636,7 +636,7 @@ void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIn
if( pModel )
{
pModel->SetChanged();
- NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), "OnAnnotationInserted" , xAnnotation );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), "OnAnnotationInserted", Reference<XInterface>( xAnnotation, UNO_QUERY ) );
}
}
@@ -656,7 +656,7 @@ void SdPage::removeAnnotation( const Reference< XAnnotation >& xAnnotation )
if( pModel )
{
pModel->SetChanged();
- NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), OUString( "OnAnnotationRemoved" ), xAnnotation );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), "OnAnnotationRemoved", Reference<XInterface>( xAnnotation, UNO_QUERY ) );
}
}
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 96c15633a346..1cb57133a17d 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1109,7 +1109,7 @@ OUString ImplRetrieveLabelFromCommand( const Reference< XFrame >& xFrame, const
Reference< XModuleManager2 > xModuleManager( ModuleManager::create(xContext) );
- OUString aModuleIdentifier( xModuleManager->identify( xFrame ) );
+ OUString aModuleIdentifier( xModuleManager->identify( Reference<XInterface>( xFrame, UNO_QUERY_THROW ) ) );
if( !aModuleIdentifier.isEmpty() )
{
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 7f8cc17290f4..ed347e91bb6a 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -582,7 +582,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
}
while ( nTokIndex >= 0 );
- return xDestContainer;
+ return Reference<XInterface>( xDestContainer, UNO_QUERY );
}
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 732d947b5e2d..d800d3e9ea4b 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2510,7 +2510,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
m_arrRelativeGridColumn.push_back(-1);
// and for the formatted search...
- pfmscContextInfo->arrFields.push_back(xControl);
+ pfmscContextInfo->arrFields.push_back(Reference<XInterface>( xControl, UNO_QUERY ));
}
}
}
@@ -2699,7 +2699,7 @@ void FmXFormShell::selectionChanged(const EventObject& rEvent) throw(::com::sun:
Reference< XForm > xNewForm( GetForm( rEvent.Source ) );
InterfaceBag aNewSelection;
- aNewSelection.insert( xSelObj );
+ aNewSelection.insert( Reference<XInterface>( xSelObj, UNO_QUERY ) );
if ( setCurrentSelection( aNewSelection ) && IsPropBrwOpen() )
ShowSelectionProperties( true );
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 73459db395a7..67de133c7ee9 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -176,7 +176,7 @@ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAcce
Reference< XInterface > xNormalized( xElement, UNO_QUERY );
- DBG_ASSERT( xElement.is(), "getElementPos: invalid element!" );
+ DBG_ASSERT( xNormalized.is(), "getElementPos: invalid element!" );
if ( xNormalized.is() )
{
// Feststellen an welcher Position sich das Kind befindet
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index cc7ea753b31a..5c18b9862516 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -787,7 +787,7 @@ void SAL_CALL FmXUndoEnvironment::modified( const EventObject& /*aEvent*/ ) thro
void FmXUndoEnvironment::AddForms(const Reference< XNameContainer > & rForms)
{
Lock();
- AddElement(rForms);
+ AddElement(Reference<XInterface>( rForms, UNO_QUERY ));
UnLock();
}
@@ -795,7 +795,7 @@ void FmXUndoEnvironment::AddForms(const Reference< XNameContainer > & rForms)
void FmXUndoEnvironment::RemoveForms(const Reference< XNameContainer > & rForms)
{
Lock();
- RemoveElement(rForms);
+ RemoveElement(Reference<XInterface>( rForms, UNO_QUERY ));
UnLock();
}
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index af99789063b6..990b7ea37f90 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -367,7 +367,7 @@ void FormViewPageWindowAdapter::setController(const Reference< XForm > & xForm,
// attaching the events
Reference< XEventAttacherManager > xEventManager( xForm->getParent(), UNO_QUERY );
- xEventManager->attach(m_aControllerList.size() - 1, xController, makeAny(xController) );
+ xEventManager->attach(m_aControllerList.size() - 1, Reference<XInterface>( xController, UNO_QUERY ), makeAny(xController) );
}
// jetzt die Subforms durchgehen
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 2ea872c55a5c..44ac87a415d0 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -1995,7 +1995,7 @@ void FormController::addToEventAttacher(const Reference< XControl > & xControl)
m_xModelAsIndex->getByIndex(--nPos) >>= xTemp;
if ((XFormComponent*)xComp.get() == (XFormComponent*)xTemp.get())
{
- m_xModelAsManager->attach( nPos, xControl, makeAny(xControl) );
+ m_xModelAsManager->attach( nPos, Reference<XInterface>( xControl, UNO_QUERY ), makeAny(xControl) );
break;
}
}
@@ -2022,7 +2022,7 @@ void FormController::removeFromEventAttacher(const Reference< XControl > & xCont
m_xModelAsIndex->getByIndex(--nPos) >>= xTemp;
if ((XFormComponent*)xComp.get() == (XFormComponent*)xTemp.get())
{
- m_xModelAsManager->detach( nPos, xControl );
+ m_xModelAsManager->detach( nPos, Reference<XInterface>( xControl, UNO_QUERY ) );
break;
}
}
@@ -3029,7 +3029,7 @@ void SAL_CALL FormController::addChildController( const Reference< XFormControll
m_xModelAsIndex->getByIndex(--nPos) >>= xTemp;
if ( xFormOfChild == xTemp )
{
- m_xModelAsManager->attach( nPos, _ChildController, makeAny( _ChildController) );
+ m_xModelAsManager->attach( nPos, Reference<XInterface>( _ChildController, UNO_QUERY ), makeAny( _ChildController) );
break;
}
}
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index f1254f1cf1cd..806320406593 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1369,7 +1369,7 @@ namespace svxform
if( pFormShell )
{
InterfaceBag aSelection;
- aSelection.insert( xNewForm );
+ aSelection.insert( Reference<XInterface>( xNewForm, UNO_QUERY ) );
pFormShell->GetImpl()->setCurrentSelection( aSelection );
pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_PROPERTIES, true, true);
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 3b59a3141fd1..392ba1fac28f 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -729,7 +729,7 @@ BaseContent::getParent(
try
{
- return m_pMyShell->m_pProvider->queryContent( Identifier );
+ return Reference<XInterface>( m_pMyShell->m_pProvider->queryContent( Identifier ), UNO_QUERY );
}
catch (const IllegalIdentifierException&)
{
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index c0bd6f915feb..fd9b0e73b43c 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -554,7 +554,7 @@ namespace fileaccess {
NameClashException excep;
excep.Name = getTitle(aUncPath);
excep.Classification = InteractionClassification_ERROR;
- excep.Context = xComProc;
+ excep.Context = Reference<XInterface>( xComProc, UNO_QUERY );
excep.Message = "file exists and overwrite forbidden";
aAny <<= excep;
cancelCommandExecution( aAny,xEnv );
@@ -576,7 +576,7 @@ namespace fileaccess {
seq[0] <<= prop;
excep.Arguments = seq;
excep.Classification = InteractionClassification_ERROR;
- excep.Context = xComProc;
+ excep.Context = Reference<XInterface>( xComProc, UNO_QUERY );
excep.Message = "the name contained invalid characters";
if(isHandled)
throw excep;
@@ -853,7 +853,7 @@ namespace fileaccess {
NameClashException excep;
excep.Name = getTitle(aUncPath);
excep.Classification = InteractionClassification_ERROR;
- excep.Context = xComProc;
+ excep.Context = Reference<XInterface>( xComProc, UNO_QUERY );
excep.Message = "name clash during copy or move";
aAny <<= excep;
@@ -864,7 +864,7 @@ namespace fileaccess {
{
UnsupportedNameClashException excep;
excep.NameClash = minorCode;
- excep.Context = xComProc;
+ excep.Context = Reference<XInterface>( xComProc, UNO_QUERY );
excep.Message = "name clash value not supported during copy or move";
aAny <<= excep;
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index fcd649daa37d..13c3fe2f9a11 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -695,7 +695,7 @@ FTPContent::getParent( )
{
Reference<XContentIdentifier>
xIdent(new FTPContentIdentifier(m_aFTPURL.parent(false)));
- return m_xProvider->queryContent(xIdent);
+ return Reference<XInterface>( m_xProvider->queryContent(xIdent), UNO_QUERY );
}
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index 1adbb527c3a9..f8ebe58de277 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -382,7 +382,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
}
else
{
- xNode = xHierarchyAccess;
+ xNode = Reference<XInterface>( xHierarchyAccess, UNO_QUERY );
}
xSet = Reference< XPropertySet >(xNode, UNO_QUERY);
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 736064bc226c..5ab5c10b0c75 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -1962,7 +1962,7 @@ XMLParaContext::~XMLParaContext()
{
xIdCursor->gotoRange( xEnd, sal_True );
GetImport().getInterfaceToIdentifierMapper().registerReference(
- m_sXmlId, xIdCursor);
+ m_sXmlId, Reference<XInterface>( xIdCursor, UNO_QUERY ));
}
}