fdo#46808, clean up some old queryInterface() calls

clean up stuff like this
  xI->queryInterface( getCppuType((const Reference< XExtendedInputSequenceChecker>*)0) ) >>= xISC;
to
  xISC.set(xI, UNO_QUERY);

Change-Id: I3b16a38c2a363440f6079cfe6ae47f009d3940db
This commit is contained in:
Noel Grandin 2013-02-12 17:20:49 +02:00
parent 587c294dab
commit 57dbe20c2b
10 changed files with 17 additions and 18 deletions

View file

@ -549,7 +549,7 @@ sal_Bool SAL_CALL BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUS
OUString("com.sun.star.i18n.BreakIterator_") + aLocaleName, m_xContext);
if ( xI.is() ) {
xI->queryInterface( getCppuType((const Reference< XBreakIterator>*)0) ) >>= xBI;
xBI.set(xI, UNO_QUERY);
if (xBI.is()) {
lookupTable.push_back(new lookupTableItem(Locale(aLocaleName, aLocaleName, aLocaleName), xBI));
return sal_True;

View file

@ -86,7 +86,7 @@ CalendarImpl::loadCalendar(const OUString& uniqueID, const Locale& rLocale ) thr
}
if ( xI.is() )
xI->queryInterface(::getCppuType((const Reference< XCalendar3>*)0)) >>= xCalendar;
xCalendar.set(xI, UNO_QUERY);
else
throw ERROR;

View file

@ -145,7 +145,7 @@ sal_Bool SAL_CALL CharacterClassificationImpl::createLocaleSpecificCharacterClas
Reference < XCharacterClassification > xCI;
if ( xI.is() ) {
xI->queryInterface(::getCppuType((const Reference< XCharacterClassification>*)0) ) >>= xCI;
xCI.set( xI, UNO_QUERY );
if (xCI.is()) {
lookupTable.push_back( cachedItem = new lookupTableItem(rLocale, serviceName, xCI) );
return sal_True;

View file

@ -159,7 +159,7 @@ CollatorImpl::createCollator(const lang::Locale& rLocale, const OUString& servic
if (xI.is()) {
Reference < XCollator > xC;
xI->queryInterface( getCppuType((const Reference< XCollator>*)0) ) >>= xC;
xC.set( xI, UNO_QUERY );
if (xC.is()) {
lookupTable.push_back(cachedItem = new lookupTableItem(rLocale, rSortAlgorithm, serviceName, xC));
return sal_True;

View file

@ -105,7 +105,7 @@ sal_Bool SAL_CALL IndexEntrySupplier::createLocaleSpecificIndexEntrySupplier(con
OUString("com.sun.star.i18n.IndexEntrySupplier_") + name, m_xContext);
if ( xI.is() ) {
xI->queryInterface( ::getCppuType((const Reference< com::sun::star::i18n::XExtendedIndexEntrySupplier>*)0) ) >>= xIES;
xIES.set( xI, UNO_QUERY );
return xIES.is();
}
return sal_False;

View file

@ -102,7 +102,7 @@ TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale) throw
OUString("_") + aLocale.Variant, m_xContext);
if (xI.is())
xI->queryInterface( getCppuType((const Reference< XTextConversion>*)0) ) >>= xTC;
xTC.set( xI, UNO_QUERY );
else if (xTC.is())
xTC.clear();
}

View file

@ -49,7 +49,7 @@ TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xCo
OUString("com.sun.star.i18n.ConversionDictionary_ko"), xContext);
if ( xI.is() )
xI->queryInterface( getCppuType((const Reference< XConversionDictionary>*)0) ) >>= xCD;
xCD.set( xI, UNO_QUERY );
xCDL = ConversionDictionaryList::create(xContext);

View file

@ -120,7 +120,7 @@ sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< ut
{
uno::Reference< drawing::XDrawPage > xPage( mpPage );
xPage->queryInterface( ITYPE( drawing::XShapes ) ) >>= xShapes;
xShapes.set( xPage, uno::UNO_QUERY );
if( xShapes.is() && (xShapes->getCount() > 0) )
{
@ -223,7 +223,7 @@ uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL SdUnoSearch
if(mpPage)
{
uno::Reference< drawing::XDrawPage > xPage( mpPage );
xPage->queryInterface( ITYPE( drawing::XShapes ) ) >>= xShapes;
xShapes.set( xPage, uno::UNO_QUERY );
if( xShapes.is() && xShapes->getCount() > 0 )
{
@ -267,9 +267,9 @@ uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL SdUnoSearch
// test if its a group
uno::Reference< drawing::XShapes > xGroupShape;
uno::Any aAny( xShape->queryInterface( ITYPE( drawing::XShapes )));
xGroupShape.set( xShape, uno::UNO_QUERY );
if( (aAny >>= xGroupShape ) && xGroupShape->getCount() > 0 )
if( xGroupShape.is() && xGroupShape->getCount() > 0 )
{
pContext = new SearchContext_impl( xGroupShape, pContext );
xShape = pContext->firstShape();
@ -382,7 +382,7 @@ uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SdUnoSearchReplaceS
else
xCurrentShape = NULL;
xCurrentShape->queryInterface( ITYPE( text::XTextRange ) ) >>= xRange;
xRange.set( xCurrentShape, uno::UNO_QUERY );
if(!(xCurrentShape.is() && (xRange.is())))
xRange = NULL;
}
@ -468,8 +468,7 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere
if( !xParent.is() )
{
uno::Any aAny( xText->queryInterface( ITYPE( text::XText )) );
aAny >>= xParent;
xParent.set( xText, uno::UNO_QUERY );
}
const OUString aText( xParent->getString() );
@ -684,7 +683,7 @@ uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetShape( uno::Refer
{
do
{
xText->queryInterface( ITYPE( drawing::XShape )) >>= xShape;
xShape.set( xText, uno::UNO_QUERY );
if(!xShape.is())
{
uno::Reference< text::XText > xParent( xText->getText() );

View file

@ -265,8 +265,8 @@ void AccessibleControlShape::Init()
if ( xNativeControlContext.is() )
{
m_xControlContextProxy = xFactory->createProxy( xNativeControlContext );
OSL_VERIFY( xNativeControlContext->queryInterface( ::getCppuType( &m_xControlContextTypeAccess ) ) >>= m_xControlContextTypeAccess );
OSL_VERIFY( xNativeControlContext->queryInterface( ::getCppuType( &m_xControlContextComponent ) ) >>= m_xControlContextComponent );
m_xControlContextTypeAccess.set( xNativeControlContext, UNO_QUERY_THROW );
m_xControlContextComponent.set( xNativeControlContext, UNO_QUERY_THROW );
// aggregate the proxy
osl_atomic_increment( &m_refCount );

View file

@ -311,7 +311,7 @@ Reference< XWindow > UnoControl::getParentPeer() const
{
Reference< XWindowPeer > xP = xContComp->getPeer();
if ( xP.is() )
xP->queryInterface( ::getCppuType((const Reference< XWindow >*)0) ) >>= xPeer;
xPeer.set( xP, UNO_QUERY );
}
}
return xPeer;