diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-21 08:56:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-21 08:56:51 +0200 |
commit | 08a943fc379c5f8af25128c935e93e6a9d82d136 (patch) | |
tree | 3a2e8dd41f7d52985630c168f60d98bdff375c04 /forms/source | |
parent | 4592d27dca75e73218ddca2039b1a1332adc828c (diff) |
Get rid of trivial comphelper::query_interface wrapper
Change-Id: I2b9dafd2a34d055dcd8b8c4d894be30dc821d3be
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/EventThread.cxx | 5 | ||||
-rw-r--r-- | forms/source/component/FormComponent.cxx | 4 | ||||
-rw-r--r-- | forms/source/component/FormattedField.cxx | 5 | ||||
-rw-r--r-- | forms/source/component/FormattedFieldWrapper.cxx | 15 | ||||
-rw-r--r-- | forms/source/component/RadioButton.cxx | 8 | ||||
-rw-r--r-- | forms/source/component/clickableimage.cxx | 2 |
6 files changed, 21 insertions, 18 deletions
diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 737774baa57b..f03ac9551d09 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -40,7 +40,7 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp // Hold a reference of the Control { InterfaceRef xIFace(static_cast<XWeak*>(pCompImpl)); - query_interface(xIFace, m_xComp); + m_xComp.set(xIFace, css::uno::UNO_QUERY); } // and add us at the Control @@ -189,7 +189,8 @@ void OComponentEventThread::run() // the mutex is locked. Reference<XControl> xControl; if ( xControlAdapter.is() ) - query_interface(xControlAdapter->queryAdapted(), xControl); + xControl.set( + xControlAdapter->queryAdapted(), css::uno::UNO_QUERY); if( xComp.is() ) processEvent( pCompImpl, pEvt.get(), xControl, bFlag ); diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 8f0aea69fbae..33f584a9dec3 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1748,8 +1748,8 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co } // Check if we and the given model have a common ancestor (up to the forms collection) - Reference<XChild> xCont; - query_interface(static_cast<XWeak*>(this), xCont); + Reference<XChild> xCont( + static_cast<XWeak*>(this), css::uno::UNO_QUERY); Reference< XInterface > xMyTopLevel = xCont->getParent(); while (xMyTopLevel.is()) { diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index f28c34774512..ac7112db484e 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -509,8 +509,9 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() const { - Reference<XChild> xMe; - query_interface(static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), xMe); + Reference<XChild> xMe( + static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), + css::uno::UNO_QUERY); // By this we make sure that we get the right object even when aggregating DBG_ASSERT(xMe.is(), "OFormattedModel::calcFormFormatsSupplier : I should have a content interface !"); // Iterate through until we reach a StartForm (starting with an own Parent) diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx index 3ae02677e079..963ab91a59cf 100644 --- a/forms/source/component/FormattedFieldWrapper.cxx +++ b/forms/source/component/FormattedFieldWrapper.cxx @@ -55,17 +55,17 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su if (bActAsFormatted) { // instantiate an FormattedModel - InterfaceRef xFormattedModel; // (instantiate it directly ..., as the OFormattedModel isn't // registered for any service names anymore) OFormattedModel* pModel = new OFormattedModel(pRef->m_xContext); - query_interface(static_cast<XWeak*>(pModel), xFormattedModel); + InterfaceRef xFormattedModel( + static_cast<XWeak*>(pModel), css::uno::UNO_QUERY); pRef->m_xAggregate = Reference<XAggregation> (xFormattedModel, UNO_QUERY); OSL_ENSURE(pRef->m_xAggregate.is(), "the OFormattedModel didn't have an XAggregation interface !"); // _before_ setting the delegator, give it to the member references - query_interface(xFormattedModel, pRef->m_xFormattedPart); + pRef->m_xFormattedPart.set(xFormattedModel, css::uno::UNO_QUERY); pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xContext)); } @@ -98,7 +98,8 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru xRef->m_xAggregate = Reference< XAggregation >(xClone, UNO_QUERY); OSL_ENSURE(xRef->m_xAggregate.is(), "invalid aggregate cloned !"); - query_interface( Reference< XInterface >(xClone.get() ), xRef->m_xFormattedPart); + xRef->m_xFormattedPart.set( + Reference< XInterface >(xClone.get()), css::uno::UNO_QUERY); if ( m_pEditPart.is() ) { @@ -217,8 +218,8 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream> // for this we transfer the current props of the formatted part to the edit part Reference<XPropertySet> xFormatProps(m_xFormattedPart, UNO_QUERY); - Reference<XPropertySet> xEditProps; - query_interface(static_cast<XWeak*>(m_pEditPart.get()), xEditProps); + Reference<XPropertySet> xEditProps( + static_cast<XWeak*>(m_pEditPart.get()), css::uno::UNO_QUERY); Locale aAppLanguage = Application::GetSettings().GetUILanguageTag().getLocale(); dbtools::TransferFormComponentProperties(xFormatProps, xEditProps, aAppLanguage); @@ -317,7 +318,7 @@ void OFormattedFieldWrapper::ensureAggregate() { // arghhh ... instantiate it directly ... it's dirty, but we really need this aggregate OEditModel* pModel = new OEditModel(m_xContext); - query_interface(static_cast<XWeak*>(pModel), xEditModel); + xEditModel.set(static_cast<XWeak*>(pModel), css::uno::UNO_QUERY); } m_xAggregate = Reference<XAggregation> (xEditModel, UNO_QUERY); diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx index 03781be00f8a..e02f8e45e719 100644 --- a/forms/source/component/RadioButton.cxx +++ b/forms/source/component/RadioButton.cxx @@ -149,8 +149,8 @@ void ORadioButtonModel::SetSiblingPropsTo(const OUString& rPropName, const Any& Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY); if (xIndexAccess.is()) { - Reference<XPropertySet> xMyProps; - query_interface(static_cast<XWeak*>(this), xMyProps); + Reference<XPropertySet> xMyProps( + static_cast<XWeak*>(this), css::uno::UNO_QUERY); OUString sCurrentGroup; sal_Int32 nNumSiblings = xIndexAccess->getCount(); for (sal_Int32 i=0; i<nNumSiblings; ++i) @@ -226,8 +226,8 @@ void ORadioButtonModel::setControlSource() this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName; this->getPropertyValue(PROPERTY_NAME) >>= sName; - Reference<XPropertySet> xMyProps; - query_interface(static_cast<XWeak*>(this), xMyProps); + Reference<XPropertySet> xMyProps( + static_cast<XWeak*>(this), css::uno::UNO_QUERY); for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i) { Reference<XPropertySet> xSiblingProperties(*static_cast<InterfaceRef const *>(xIndexAccess->getByIndex(i).getValue()), UNO_QUERY); diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index f8c178a29501..d8d3bd334ca1 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -738,7 +738,7 @@ namespace frm { Reference<XChild> xChild( xIfc, UNO_QUERY ); xIfc = xChild->getParent(); - query_interface(xIfc, xModel); + xModel.set(xIfc, css::uno::UNO_QUERY); } // Search for the Object shell by iterating over all Object shells |