basic/source/basmgr/basicmanagerrepository.cxx                    |    3 -
 basic/source/uno/dlgcont.cxx                                      |    2 
 basic/source/uno/namecont.cxx                                     |   10 ++--
 comphelper/source/processfactory/processfactory.cxx               |    4 -
 dbaccess/source/core/dataaccess/connection.cxx                    |    2 
 filter/source/svg/svgexport.cxx                                   |    6 +-
 filter/source/svg/svgwriter.cxx                                   |   10 ++--
 forms/source/misc/InterfaceContainer.cxx                          |    2 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   23 
++++++----
 framework/source/uiconfiguration/uiconfigurationmanager.cxx       |   17 
++++---
 framework/source/uifactory/menubarfactory.cxx                     |    2 
 framework/source/uifactory/uielementfactorymanager.cxx            |    2 
 scripting/source/dlgprov/dlgprov.cxx                              |    4 -
 scripting/source/stringresource/stringresource.cxx                |    4 -
 sd/source/core/sdpage2.cxx                                        |    4 -
 sd/source/ui/view/ViewShellBase.cxx                               |    2 
 svx/source/form/fmobj.cxx                                         |    2 
 svx/source/form/fmshimp.cxx                                       |    4 -
 svx/source/form/fmtools.cxx                                       |    2 
 svx/source/form/fmundo.cxx                                        |    4 -
 svx/source/form/fmvwimp.cxx                                       |    2 
 svx/source/form/formcontroller.cxx                                |    6 +-
 svx/source/form/navigatortree.cxx                                 |    2 
 ucb/source/ucp/file/bc.cxx                                        |    2 
 ucb/source/ucp/file/filglob.cxx                                   |    8 +--
 ucb/source/ucp/ftp/ftpcontent.cxx                                 |    2 
 unotools/source/config/configitem.cxx                             |    2 
 xmloff/source/text/txtparai.cxx                                   |    2 
 28 files changed, 73 insertions(+), 62 deletions(-)

New commits:
commit b0c1ad45408de8d328ce4c6d707ec7ab3b62dbc6
Author: Noel Grandin <n...@peralex.com>
Date:   Wed Jun 25 08:43:20 2014 +0200

    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 <sberg...@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 <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/basic/source/basmgr/basicmanagerrepository.cxx 
b/basic/source/basmgr/basicmanagerrepository.cxx
index 4aece49..7228b8b 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 1190f2d..c3ee643 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -240,7 +240,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 28efa64..dfdb2c9 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) );
 }
 
 //============================================================================
@@ -2992,7 +2992,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 32aff0f..c93f966 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 6f3b682..96eebd0 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -692,7 +692,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)
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 59b8ae4..a9cfc01 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1150,7 +1150,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  );
@@ -1710,7 +1710,7 @@ sal_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 );
@@ -1892,7 +1892,7 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const 
Reference< XDrawPage > & r
                                 {
                                     // 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 3a26b52..b08037f 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -842,7 +842,7 @@ sal_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 );
@@ -1006,7 +1006,7 @@ sal_Bool SVGTextWriter::nextParagraph()
                 return sal_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 
);
@@ -1114,7 +1114,7 @@ sal_Bool SVGTextWriter::nextTextPortion()
                                         {
                                             implRegisterInterface( 
xPortionTextRange );
 
-                                            const OUString& rTextPortionId = 
implGetValidIDFromInterface( xPortionTextRange );
+                                            const OUString& rTextPortionId = 
implGetValidIDFromInterface( Reference<XInterface>(xPortionTextRange, 
UNO_QUERY) );
                                             if( !rTextPortionId.isEmpty() )
                                             {
                                                 msHyperlinkIdList += 
rTextPortionId;
@@ -1566,7 +1566,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";
@@ -1585,7 +1585,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 bab4df8..76bba25 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 f67b5c4..6c14f2b 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 82dfc41..feeb95f 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 cbda3ce..a4317ee 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 d1dd274..7f14c98 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() )
diff --git a/scripting/source/dlgprov/dlgprov.cxx 
b/scripting/source/dlgprov/dlgprov.cxx
index a0c0480..b19ae84 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 f245f02..b59a9f0 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 994727d..0b9a552 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -615,7 +615,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 ) );
     }
 }
 
@@ -635,7 +635,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 86a1888..57af114 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1106,7 +1106,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 f4321fb..b658a8b 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -586,7 +586,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 2865dbd..5e5d4d4 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2523,7 +2523,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 ));
                     }
                 }
             }
@@ -2712,7 +2712,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( sal_True );
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 3cbc674..fb1a30f 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 3137572..c1c53d0 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -794,7 +794,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();
 }
 
@@ -802,7 +802,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 4d6ee1a..6b24c35 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -370,7 +370,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 69cd855..add1ef3 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -2009,7 +2009,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;
             }
         }
@@ -2036,7 +2036,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;
             }
         }
@@ -3043,7 +3043,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 5d47a21..4db6eaf 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1370,7 +1370,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,sal_True,sal_True);
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 73f734d..f5b9576 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -743,7 +743,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 143724b..588730f 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 4f456d1..cdf6428 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -673,7 +673,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 d3127c8..c8b1ce7 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -388,7 +388,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 2867e5d..9be6cef 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -1959,7 +1959,7 @@ XMLParaContext::~XMLParaContext()
         {
             xIdCursor->gotoRange( xEnd, sal_True );
             GetImport().getInterfaceToIdentifierMapper().registerReference(
-                m_sXmlId, xIdCursor);
+                m_sXmlId, Reference<XInterface>( xIdCursor, UNO_QUERY ));
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to