summaryrefslogtreecommitdiff
path: root/forms/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-02 07:38:44 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-02 06:17:21 +0000
commit1b41208608f472df8dd5879c27dca45cc2ea7740 (patch)
treeb779c5d0da8994d6e838e1667f3f3d011be2e634 /forms/source
parent37d41674c2b1a706c95c2c326cbfbd06b0c1a655 (diff)
use uno::Reference::set method instead of assignment
Change-Id: I3d94c94a9829161663a7ed18421ace38ce95a659 Reviewed-on: https://gerrit.libreoffice.org/19733 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'forms/source')
-rw-r--r--forms/source/component/ComboBox.cxx2
-rw-r--r--forms/source/component/DatabaseForm.cxx2
-rw-r--r--forms/source/component/FormComponent.cxx6
-rw-r--r--forms/source/component/FormattedFieldWrapper.cxx16
-rw-r--r--forms/source/component/ListBox.cxx2
-rw-r--r--forms/source/runtime/formoperations.cxx2
-rw-r--r--forms/source/xforms/model.cxx6
-rw-r--r--forms/source/xforms/submission.cxx3
-rw-r--r--forms/source/xforms/submission/replace.cxx6
-rw-r--r--forms/source/xforms/submission/serialization_urlencoded.cxx2
-rw-r--r--forms/source/xforms/submission/submission_get.cxx2
11 files changed, 23 insertions, 26 deletions
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 2893d52eca0e..19916a4c2cf1 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -609,7 +609,7 @@ void OComboBoxModel::loadData( bool _bForce )
Reference<XIndexAccess> xColumns;
if (xSupplyCols.is())
{
- xColumns = Reference<XIndexAccess>(xSupplyCols->getColumns(), UNO_QUERY);
+ xColumns.set(xSupplyCols->getColumns(), UNO_QUERY);
DBG_ASSERT(xColumns.is(), "OComboBoxModel::loadData : no columns supplied by the row set !");
}
Reference< XPropertySet > xDataField;
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index bc46d588493f..31005fc39bac 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -392,7 +392,7 @@ void ODatabaseForm::impl_construct()
// aggregate a row set
osl_atomic_increment(&m_refCount);
{
- m_xAggregate = Reference< XAggregation >( m_xContext->getServiceManager()->createInstanceWithContext(SRV_SDB_ROWSET, m_xContext), UNO_QUERY_THROW );
+ m_xAggregate.set( m_xContext->getServiceManager()->createInstanceWithContext(SRV_SDB_ROWSET, m_xContext), UNO_QUERY_THROW );
m_xAggregateAsRowSet.set( m_xAggregate, UNO_QUERY_THROW );
setAggregation( m_xAggregate );
}
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index f9e67b9c4c04..9f0bceb66622 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -518,7 +518,7 @@ OControlModel::OControlModel(
{
osl_atomic_increment(&m_refCount);
{
- m_xAggregate = Reference<XAggregation>(m_xContext->getServiceManager()->createInstanceWithContext(_rUnoControlModelTypeName, m_xContext), UNO_QUERY);
+ m_xAggregate.set(m_xContext->getServiceManager()->createInstanceWithContext(_rUnoControlModelTypeName, m_xContext), UNO_QUERY);
setAggregation(m_xAggregate);
if ( m_xAggregateSet.is() )
@@ -1971,8 +1971,8 @@ bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm)
m_nFieldType = nFieldType;
// listen to changing values
m_xField->addPropertyChangeListener( PROPERTY_VALUE, this );
- m_xColumnUpdate = Reference< XColumnUpdate >( m_xField, UNO_QUERY );
- m_xColumn = Reference< XColumn >( m_xField, UNO_QUERY );
+ m_xColumnUpdate.set( m_xField, UNO_QUERY );
+ m_xColumn.set( m_xField, UNO_QUERY );
sal_Int32 nNullableFlag = ColumnValue::NO_NULLS;
m_xField->getPropertyValue(PROPERTY_ISNULLABLE) >>= nNullableFlag;
m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag);
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index b35160ab0bd8..e7c8f0622b8a 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -61,12 +61,12 @@ css::uno::Reference<css::uno::XInterface> OFormattedFieldWrapper::createFormatte
css::uno::Reference<css::uno::XInterface> xFormattedModel(
static_cast<XWeak*>(pModel), css::uno::UNO_QUERY);
- pRef->m_xAggregate = Reference<XAggregation> (xFormattedModel, UNO_QUERY);
+ pRef->m_xAggregate.set(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
pRef->m_xFormattedPart.set(xFormattedModel, css::uno::UNO_QUERY);
- pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xContext));
+ pRef->m_pEditPart.set(new OEditModel(pRef->m_xContext));
}
osl_atomic_increment(&pRef->m_refCount);
@@ -95,7 +95,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru
if ( xCloneAccess.is() )
{
Reference< XCloneable > xClone = xCloneAccess->createClone();
- xRef->m_xAggregate = Reference< XAggregation >(xClone, UNO_QUERY);
+ xRef->m_xAggregate.set(xClone, UNO_QUERY);
OSL_ENSURE(xRef->m_xAggregate.is(), "invalid aggregate cloned !");
xRef->m_xFormattedPart.set(
@@ -103,7 +103,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru
if ( m_pEditPart.is() )
{
- xRef->m_pEditPart = rtl::Reference< OEditModel >( new OEditModel(m_pEditPart.get(), m_xContext));
+ xRef->m_pEditPart.set( new OEditModel(m_pEditPart.get(), m_xContext) );
}
}
else
@@ -284,15 +284,15 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
if (!pBasicReader->lastReadWasFormattedFake())
{
// yes -> all fine
- m_xAggregate = Reference< XAggregation >( pBasicReader.get() );
+ m_xAggregate.set( pBasicReader.get() );
}
else
{ // no -> substitute it with a formatted model
// let the formmatted model do the reading
- m_xFormattedPart = Reference< XPersistObject >(new OFormattedModel(m_xContext));
+ m_xFormattedPart.set(new OFormattedModel(m_xContext));
m_xFormattedPart->read(_rxInStream);
m_pEditPart = pBasicReader;
- m_xAggregate = Reference< XAggregation >( m_xFormattedPart, UNO_QUERY );
+ m_xAggregate.set( m_xFormattedPart, UNO_QUERY );
}
}
@@ -321,7 +321,7 @@ void OFormattedFieldWrapper::ensureAggregate()
xEditModel.set(static_cast<XWeak*>(pModel), css::uno::UNO_QUERY);
}
- m_xAggregate = Reference<XAggregation> (xEditModel, UNO_QUERY);
+ m_xAggregate.set(xEditModel, UNO_QUERY);
DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::ensureAggregate : the OEditModel didn't have an XAggregation interface !");
{
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 24e456ffa61e..ca1cb8b6b236 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -868,7 +868,7 @@ namespace frm
Reference<XIndexAccess> xColumns;
if (xSupplyCols.is())
{
- xColumns = Reference<XIndexAccess>(xSupplyCols->getColumns(), UNO_QUERY);
+ xColumns.set(xSupplyCols->getColumns(), UNO_QUERY);
DBG_ASSERT(xColumns.is(), "OListBoxModel::loadData : no columns supplied by the row set !");
}
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 776b1a9f189e..53dd2f41416a 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -662,7 +662,7 @@ namespace frm
if ( xConfirmDelete.is() )
{
RowChangeEvent aEvent;
- aEvent.Source = Reference< XInterface >( m_xCursor, UNO_QUERY );
+ aEvent.Source.set( m_xCursor, UNO_QUERY );
aEvent.Action = RowChangeAction::DELETE;
aEvent.Rows = 1;
bSuccess = xConfirmDelete->confirmDelete( aEvent );
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 3da165ef4837..4095073e1e3a 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -157,9 +157,7 @@ EvaluationContext Model::getEvaluationContext()
// no element found? Then insert default element 'instanceData'
if( ! xElement.is() )
{
- xElement = Reference<XNode>(
- xInstance->createElement( "instanceData" ),
- UNO_QUERY_THROW );
+ xElement.set( xInstance->createElement( "instanceData" ), UNO_QUERY_THROW );
xInstance->appendChild( xElement );
}
@@ -327,7 +325,7 @@ bool Model::setSimpleContent( const XNode_t& xConstNode,
// create text node, if none is found
if( ! xChild.is() )
{
- xChild = Reference<XNode>(
+ xChild.set(
xNode->getOwnerDocument()->createTextNode( OUString() ),
UNO_QUERY_THROW );
xNode->appendChild( xChild );
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index fbbd6a77b51a..0ec72bc5456f 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -591,8 +591,7 @@ Reference< XDocumentFragment > Submission::createSubmissionDocument(const Refere
{
aListItem = aList->item(i);
if (aListItem->getNodeType()==NodeType_DOCUMENT_NODE)
- aListItem = Reference< XNode >(
- (Reference< XDocument >(aListItem, UNO_QUERY))->getDocumentElement(), UNO_QUERY);
+ aListItem.set( (Reference< XDocument >(aListItem, UNO_QUERY))->getDocumentElement(), UNO_QUERY);
// copy relevant nodes from instance into fragment
_cloneNodes(*getModelImpl(), aFragment, aListItem, bRemoveWSNodes);
}
diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx
index 0abdab0c8dcd..0cbc86fefeb0 100644
--- a/forms/source/xforms/submission/replace.cxx
+++ b/forms/source/xforms/submission/replace.cxx
@@ -56,10 +56,10 @@ CSubmission::SubmissionResult CSubmission::replace(const OUString& aReplace, con
|| aReplace.equalsIgnoreAsciiCase("document")) {
Reference< XComponentLoader > xLoader;
if (aFrame.is())
- xLoader = Reference< XComponentLoader >(aFrame, UNO_QUERY);
+ xLoader.set(aFrame, UNO_QUERY);
if (!xLoader.is())
- xLoader = Reference< XComponentLoader >( Desktop::create(xContext), UNO_QUERY_THROW);
+ xLoader.set( Desktop::create(xContext), UNO_QUERY_THROW);
// open the stream from the result...
// build media descriptor
@@ -124,7 +124,7 @@ CSubmission::SubmissionResult CSubmission::replace(const OUString& aReplace, con
InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW);
CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper;
- pHelper->m_aProgressHandler = Reference< XProgressHandler >(pProgressHelper);
+ pHelper->m_aProgressHandler.set(pProgressHelper);
// UCB has ownership of environment...
_rOutEnv = pHelper;
diff --git a/forms/source/xforms/submission/serialization_urlencoded.cxx b/forms/source/xforms/submission/serialization_urlencoded.cxx
index 221ccc10f88f..a3dddb11c9fb 100644
--- a/forms/source/xforms/submission/serialization_urlencoded.cxx
+++ b/forms/source/xforms/submission/serialization_urlencoded.cxx
@@ -127,7 +127,7 @@ void CSerializationURLEncoded::serialize_node(const Reference< XNode >& aNode)
aChild = aChildList->item(i);
if (aChild->getNodeType() == NodeType_TEXT_NODE)
{
- aText = Reference< XText >(aChild, UNO_QUERY);
+ aText.set(aChild, UNO_QUERY);
aValue.append(aText->getData());
}
}
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx
index e5cfd3b2e5e4..e638213828e8 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -64,7 +64,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference<
pHelper->m_aInteractionHandler.set(
css::task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW);
CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper;
- pHelper->m_aProgressHandler = css::uno::Reference< XProgressHandler >(pProgressHelper);
+ pHelper->m_aProgressHandler.set(pProgressHelper);
// UCB has ownership of environment...
css::uno::Reference< XCommandEnvironment > aEnvironment(pHelper);