diff options
| author | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-02-25 13:11:01 +0200 |
|---|---|---|
| committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-02-25 15:36:26 +0100 |
| commit | 9b07819fbaaefacf7668560ce8872e6e34d024b3 (patch) | |
| tree | 0cfbb0da0608c07808f8f1acd6ba66054be665a3 | |
| parent | 30306fd300c876e46cf41509656187624c50222e (diff) | |
use more concrete UNO types in some local vars
found by a little plugin I created.
Change-Id: I5ff1f279c3510dbec2d6b208b09f3cd7f55e75b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182161
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
| -rw-r--r-- | sc/source/core/data/attrib.cxx | 4 | ||||
| -rw-r--r-- | sc/source/filter/oox/commentsbuffer.cxx | 3 | ||||
| -rw-r--r-- | sc/source/filter/xml/XMLTrackedChangesContext.cxx | 16 | ||||
| -rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 13 | ||||
| -rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 5 | ||||
| -rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 11 | ||||
| -rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 6 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/TablePivotCharts.cxx | 4 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/afmtuno.cxx | 8 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 8 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 8 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 16 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 12 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 32 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 2 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/linkuno.cxx | 20 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/nameuno.cxx | 12 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 16 | ||||
| -rw-r--r-- | sc/source/ui/unoobj/viewuno.cxx | 4 | ||||
| -rw-r--r-- | sc/source/ui/vba/vbasheetobjects.cxx | 4 |
20 files changed, 94 insertions, 110 deletions
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 21e7cb350756..81f2f598ef89 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -417,9 +417,7 @@ bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const new ScHeaderFooterContentObj(); xContent->Init(pLeftArea.get(), pCenterArea.get(), pRightArea.get()); - uno::Reference<sheet::XHeaderFooterContent> xCont(xContent); - - rVal <<= xCont; + rVal <<= uno::Reference<sheet::XHeaderFooterContent>(xContent); return true; } diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index 6f650d5cb00e..83f9f9ac0304 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -174,9 +174,8 @@ namespace } // insert text and convert text formatting - Reference< XText > xAnnoText( xAnnoShape ); xAnnoShape->addActionLock(); - mxText->convert( xAnnoText ); + mxText->convert( Reference< XText >( xAnnoShape ) ); xAnnoShape->removeActionLock(); } diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 29d0ab99740d..ee30c04ca084 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -830,18 +830,14 @@ void ScXMLChangeCellContext::CreateTextPContext(bool bIsNewParagraph) mpEditTextObj = new ScEditEngineTextObj(); mpEditTextObj->GetEditEngine()->SetEditTextObjectPool(pDoc->GetEditPool()); - uno::Reference <text::XText> xText(mpEditTextObj); - if (xText.is()) + uno::Reference<text::XTextCursor> xTextCursor(mpEditTextObj->createTextCursor()); + if (bIsNewParagraph) { - uno::Reference<text::XTextCursor> xTextCursor(xText->createTextCursor()); - if (bIsNewParagraph) - { - xText->setString(sText); - xTextCursor->gotoEnd(false); - xText->insertControlCharacter(xTextCursor, text::ControlCharacter::PARAGRAPH_BREAK, false); - } - GetScImport().GetTextImport()->SetCursor(xTextCursor); + mpEditTextObj->setString(sText); + xTextCursor->gotoEnd(false); + mpEditTextObj->insertControlCharacter(xTextCursor, text::ControlCharacter::PARAGRAPH_BREAK, false); } + GetScImport().GetTextImport()->SetCursor(xTextCursor); } void SAL_CALL ScXMLChangeCellContext::endFastElement( sal_Int32 /*nElement*/ ) diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index d992fd2c5f84..0fb17cee4921 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -976,8 +976,7 @@ void ScXMLImport::SetStyleToRanges() if (!sPrevStyleName.isEmpty()) { - uno::Reference <beans::XPropertySet> xProperties (mxSheetCellRanges); - if (xProperties.is()) + if (mxSheetCellRanges.is()) { XMLTableStylesContext *pStyles(static_cast<XMLTableStylesContext *>(GetAutoStyles())); XMLTableStyleContext* pStyle = nullptr; @@ -986,12 +985,12 @@ void ScXMLImport::SetStyleToRanges() XmlStyleFamily::TABLE_CELL, sPrevStyleName, true))); if (pStyle) { - pStyle->FillPropertySet(xProperties); + pStyle->FillPropertySet(mxSheetCellRanges); // here needs to be the cond format import method sal_Int32 nNumberFormat(pStyle->GetNumberFormat()); - SetType(xProperties, nNumberFormat, nPrevCellType, sPrevCurrency); + SetType(mxSheetCellRanges, nNumberFormat, nPrevCellType, sPrevCurrency); - css::uno::Any aAny = xProperties->getPropertyValue(u"FormatID"_ustr); + css::uno::Any aAny = mxSheetCellRanges->getPropertyValue(u"FormatID"_ustr); sal_uInt64 nKey = 0; if ((aAny >>= nKey) && nKey) { @@ -1016,10 +1015,10 @@ void ScXMLImport::SetStyleToRanges() } else { - xProperties->setPropertyValue(SC_UNONAME_CELLSTYL, uno::Any(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName ))); + mxSheetCellRanges->setPropertyValue(SC_UNONAME_CELLSTYL, uno::Any(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName ))); sal_Int32 nNumberFormat(GetStyleNumberFormats()->GetStyleNumberFormat(sPrevStyleName)); bool bInsert(nNumberFormat == -1); - SetType(xProperties, nNumberFormat, nPrevCellType, sPrevCurrency); + SetType(mxSheetCellRanges, nNumberFormat, nPrevCellType, sPrevCurrency); if (bInsert) GetStyleNumberFormats()->AddStyleNumberFormat(sPrevStyleName, nNumberFormat); } diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index bf4e055440db..e601675fb1fc 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -890,7 +890,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) auto xObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *pObjSh, SvXMLEmbeddedObjectHelperMode::Write); - uno::Reference<document::XEmbeddedObjectResolver> xObjectResolver(xObjectHelper); // styles export @@ -901,7 +900,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) Any(xGraphicStorageHandler), Any(xStatusIndicator), Any(xWriter), - Any(xObjectResolver) + Any(uno::Reference<document::XEmbeddedObjectResolver>(xObjectHelper)) }; SAL_INFO( "sc.filter", "styles export start" ); @@ -926,7 +925,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) Any(xGraphicStorageHandler), Any(xStatusIndicator), Any(xWriter), - Any(xObjectResolver) + Any(uno::Reference<document::XEmbeddedObjectResolver>(xObjectHelper)) }; SAL_INFO( "sc.filter", "content export start" ); diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 5658ee2a27a9..55e031c18dc7 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -487,7 +487,7 @@ ScChildrenShapes::GetAccessibleCaption (const css::uno::Reference < css::drawing if (it == maShapesMap.end()) return nullptr; ScAccessibleShapeData* pShape = it->second; - css::uno::Reference< css::accessibility::XAccessible > xNewChild( pShape->pAccShape ); + rtl::Reference< ::accessibility::AccessibleShape > xNewChild( pShape->pAccShape ); if(xNewChild) return xNewChild; return nullptr; @@ -1089,8 +1089,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X aEvent.EventId = AccessibleEventId::SELECTION_CHANGED; } aEvent.Source = uno::Reference< XAccessible >(mpAccessibleDocument); - uno::Reference< XAccessible > xChild( rpShape->pAccShape ); - aEvent.NewValue <<= xChild; + aEvent.NewValue <<= uno::Reference< XAccessible >( rpShape->pAccShape ); mpAccessibleDocument->CommitChange(aEvent); } } @@ -1099,8 +1098,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE; aEvent.Source = uno::Reference< XAccessible >(mpAccessibleDocument); - uno::Reference< XAccessible > xChild( rpShape->pAccShape ); - aEvent.NewValue <<= xChild; + aEvent.NewValue <<= uno::Reference< XAccessible >( rpShape->pAccShape ); mpAccessibleDocument->CommitChange(aEvent); } for(ScAccessibleShapeData*& pShapeData : aShapesList) @@ -1505,9 +1503,8 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) mpTempAccEdit = new ScAccessibleEditObject(this, rViewData.GetEditView(meSplitPos), mpViewShell->GetWindowByPos(meSplitPos), GetCurrentCellName(), ScResId(STR_ACC_EDITLINE_DESCR), ScAccessibleEditObject::CellInEditMode); - uno::Reference<XAccessible> xAcc = mpTempAccEdit; - AddChild(xAcc, true); + AddChild(uno::Reference<XAccessible>(mpTempAccEdit), true); if (mpAccessibleSpreadsheet.is()) mpAccessibleSpreadsheet->LostFocus(); diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 5ba18208d110..fa2c3d975d86 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1216,11 +1216,10 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint if (mpTable.is()) // if there is no table there is nothing to notify, because no one recognizes the change { { - uno::Reference<XAccessible> xAcc = mpTable; AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::CHILD; aEvent.Source = uno::Reference< XAccessibleContext >(this); - aEvent.OldValue <<= xAcc; + aEvent.OldValue <<= uno::Reference<XAccessible>(mpTable); aEvent.IndexHint = -1; CommitChange(aEvent); } @@ -1250,11 +1249,10 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint mpTable->Init(); { - uno::Reference<XAccessible> xAcc = mpTable; AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::CHILD; aEvent.Source = uno::Reference< XAccessibleContext >(this); - aEvent.NewValue <<= xAcc; + aEvent.NewValue <<= uno::Reference<XAccessible>(mpTable); aEvent.IndexHint = -1; CommitChange(aEvent); } diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx index c08c5aa78bc4..688d872ef864 100644 --- a/sc/source/ui/unoobj/TablePivotCharts.cxx +++ b/sc/source/ui/unoobj/TablePivotCharts.cxx @@ -128,8 +128,6 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName, rtl::Reference<sc::PivotTableDataProvider> pPivotTableDataProvider(new sc::PivotTableDataProvider(rDoc)); pPivotTableDataProvider->setPivotTableName(rDataPilotName); - uno::Reference<chart2::data::XDataProvider> xDataProvider(pPivotTableDataProvider); - uno::Reference<chart2::data::XDataReceiver> xReceiver; if (xObject.is()) @@ -137,7 +135,7 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName, if (xReceiver.is()) { - xReceiver->attachDataProvider(xDataProvider); + xReceiver->attachDataProvider(uno::Reference<chart2::data::XDataProvider>(pPivotTableDataProvider)); uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(cppu::getXWeak(m_pDocShell->GetModel()), uno::UNO_QUERY); xReceiver->attachNumberFormatsSupplier(xNumberFormatsSupplier); diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index bd1776fd0760..696fc32815c8 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -275,10 +275,10 @@ sal_Int32 SAL_CALL ScAutoFormatsObj::getCount() uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference< container::XNamed > xFormat(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); + rtl::Reference< ScAutoFormatObj > xFormat(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); if (!xFormat.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xFormat); + return uno::Any(uno::Reference< container::XNamed >(xFormat)); } uno::Type SAL_CALL ScAutoFormatsObj::getElementType() @@ -297,10 +297,10 @@ sal_Bool SAL_CALL ScAutoFormatsObj::hasElements() uno::Any SAL_CALL ScAutoFormatsObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference< container::XNamed > xFormat(GetObjectByName_Impl(aName)); + rtl::Reference< ScAutoFormatObj > xFormat(GetObjectByName_Impl(aName)); if (!xFormat.is()) throw container::NoSuchElementException(); - return uno::Any(xFormat); + return uno::Any(uno::Reference< container::XNamed >(xFormat)); } uno::Sequence<OUString> SAL_CALL ScAutoFormatsObj::getElementNames() diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 5bacf8a856b8..83f8953010e1 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -4398,11 +4398,11 @@ sal_Int32 SAL_CALL ScCellRangesObj::getCount() uno::Any SAL_CALL ScCellRangesObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<table::XCellRange> xRange(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScCellRangeObj> xRange(GetObjectByIndex_Impl(nIndex)); if (!xRange.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRange); + return uno::Any(uno::Reference<table::XCellRange>(xRange)); } @@ -8575,11 +8575,11 @@ uno::Any SAL_CALL ScCellFormatsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<table::XCellRange> xRange(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScCellRangeObj> xRange(GetObjectByIndex_Impl(nIndex)); if (!xRange.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRange); + return uno::Any(uno::Reference<table::XCellRange>(xRange)); } diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index c0d88b031789..1e61358bf429 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -325,11 +325,11 @@ sal_Int32 SAL_CALL ScChartsObj::getCount() uno::Any SAL_CALL ScChartsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<table::XTableChart> xChart(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScChartObj> xChart(GetObjectByIndex_Impl(nIndex)); if (!xChart.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xChart); + return uno::Any(uno::Reference<table::XTableChart>(xChart)); } uno::Type SAL_CALL ScChartsObj::getElementType() @@ -346,11 +346,11 @@ sal_Bool SAL_CALL ScChartsObj::hasElements() uno::Any SAL_CALL ScChartsObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<table::XTableChart> xChart(GetObjectByName_Impl(aName)); + rtl::Reference<ScChartObj> xChart(GetObjectByName_Impl(aName)); if (!xChart.is()) throw container::NoSuchElementException(); - return uno::Any(xChart); + return uno::Any(uno::Reference<table::XTableChart>(xChart)); } uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index e8ace63308bd..a1d59b5faa87 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -490,10 +490,10 @@ sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() Any SAL_CALL ScDataPilotTablesObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - Reference<XDataPilotTable2> xTable(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScDataPilotTableObj> xTable(GetObjectByIndex_Impl(nIndex)); if (!xTable.is()) throw IndexOutOfBoundsException(); - return Any( xTable ); + return Any( Reference<XDataPilotTable2>(xTable) ); } uno::Type SAL_CALL ScDataPilotTablesObj::getElementType() @@ -512,10 +512,10 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasElements() Any SAL_CALL ScDataPilotTablesObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - Reference<XDataPilotTable2> xTable(GetObjectByName_Impl(aName)); + rtl::Reference<ScDataPilotTableObj> xTable(GetObjectByName_Impl(aName)); if (!xTable.is()) throw NoSuchElementException(); - return Any( xTable ); + return Any( Reference<XDataPilotTable2>(xTable) ); } Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames() @@ -1559,10 +1559,10 @@ sal_Int32 SAL_CALL ScDataPilotFieldsObj::getCount() Any SAL_CALL ScDataPilotFieldsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - Reference< XPropertySet > xField( GetObjectByIndex_Impl( nIndex ) ); + rtl::Reference< ScDataPilotFieldObj > xField( GetObjectByIndex_Impl( nIndex ) ); if (!xField.is()) throw IndexOutOfBoundsException(); - return Any( xField ); + return Any( Reference< XPropertySet >(xField) ); } // XElementAccess @@ -1583,10 +1583,10 @@ sal_Bool SAL_CALL ScDataPilotFieldsObj::hasElements() Any SAL_CALL ScDataPilotFieldsObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - Reference<XPropertySet> xField(GetObjectByName_Impl(aName)); + rtl::Reference<ScDataPilotFieldObj> xField(GetObjectByName_Impl(aName)); if (!xField.is()) throw NoSuchElementException(); - return Any( xField ); + return Any( Reference<XPropertySet>(xField) ); } Sequence<OUString> SAL_CALL ScDataPilotFieldsObj::getElementNames() diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 99cb53d48222..5a8e16395f3c 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -587,11 +587,11 @@ sal_Int32 SAL_CALL ScSubTotalDescriptorBase::getCount() uno::Any SAL_CALL ScSubTotalDescriptorBase::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XSubTotalField> xField(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); + rtl::Reference<ScSubTotalFieldObj> xField(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); if (!xField.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xField); + return uno::Any(uno::Reference<sheet::XSubTotalField>(xField)); } uno::Type SAL_CALL ScSubTotalDescriptorBase::getElementType() @@ -2187,11 +2187,11 @@ uno::Any SAL_CALL ScDatabaseRangesObj::getByIndex( sal_Int32 nIndex ) if (nIndex < 0) throw lang::IndexOutOfBoundsException(); - uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByIndex_Impl(static_cast<size_t>(nIndex))); + rtl::Reference<ScDatabaseRangeObj> xRange(GetObjectByIndex_Impl(static_cast<size_t>(nIndex))); if (!xRange.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRange); + return uno::Any(uno::Reference<sheet::XDatabaseRange>(xRange)); } uno::Type SAL_CALL ScDatabaseRangesObj::getElementType() @@ -2210,11 +2210,11 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasElements() uno::Any SAL_CALL ScDatabaseRangesObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByName_Impl(aName)); + rtl::Reference<ScDatabaseRangeObj> xRange(GetObjectByName_Impl(aName)); if (!xRange.is()) throw container::NoSuchElementException(); - return uno::Any(xRange); + return uno::Any(uno::Reference<sheet::XDatabaseRange>(xRange)); } uno::Sequence<OUString> SAL_CALL ScDatabaseRangesObj::getElementNames() diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 7511d9fce378..f15a8c02bbe9 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -4458,11 +4458,11 @@ sal_Int32 SAL_CALL ScTableSheetsObj::getCount() uno::Any SAL_CALL ScTableSheetsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScTableSheetObj> xSheet(GetObjectByIndex_Impl(nIndex)); if (!xSheet.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xSheet); + return uno::Any(uno::Reference<sheet::XSpreadsheet>(xSheet)); // return uno::Any(); } @@ -4483,11 +4483,11 @@ sal_Bool SAL_CALL ScTableSheetsObj::hasElements() uno::Any SAL_CALL ScTableSheetsObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByName_Impl(aName)); + rtl::Reference<ScTableSheetObj> xSheet(GetObjectByName_Impl(aName)); if (!xSheet.is()) throw container::NoSuchElementException(); - return uno::Any(xSheet); + return uno::Any(uno::Reference<sheet::XSpreadsheet>(xSheet)); } uno::Sequence<OUString> SAL_CALL ScTableSheetsObj::getElementNames() @@ -4629,11 +4629,11 @@ sal_Int32 SAL_CALL ScTableColumnsObj::getCount() uno::Any SAL_CALL ScTableColumnsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<table::XCellRange> xColumn(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScTableColumnObj> xColumn(GetObjectByIndex_Impl(nIndex)); if (!xColumn.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xColumn); + return uno::Any(uno::Reference<table::XCellRange>(xColumn)); } @@ -4651,11 +4651,11 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasElements() uno::Any SAL_CALL ScTableColumnsObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<table::XCellRange> xColumn(GetObjectByName_Impl(aName)); + rtl::Reference<ScTableColumnObj> xColumn(GetObjectByName_Impl(aName)); if (!xColumn.is()) throw container::NoSuchElementException(); - return uno::Any(xColumn); + return uno::Any(uno::Reference<table::XCellRange>(xColumn)); } uno::Sequence<OUString> SAL_CALL ScTableColumnsObj::getElementNames() @@ -4871,11 +4871,11 @@ sal_Int32 SAL_CALL ScTableRowsObj::getCount() uno::Any SAL_CALL ScTableRowsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<table::XCellRange> xRow(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScTableRowObj> xRow(GetObjectByIndex_Impl(nIndex)); if (!xRow.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRow); + return uno::Any(uno::Reference<table::XCellRange>(xRow)); } uno::Type SAL_CALL ScTableRowsObj::getElementType() @@ -5180,11 +5180,11 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount() uno::Any SAL_CALL ScAnnotationsObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XSheetAnnotation> xAnnotation(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScAnnotationObj> xAnnotation(GetObjectByIndex_Impl(nIndex)); if (!xAnnotation.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xAnnotation); + return uno::Any(uno::Reference<sheet::XSheetAnnotation>(xAnnotation)); } uno::Type SAL_CALL ScAnnotationsObj::getElementType() @@ -5334,11 +5334,11 @@ sal_Int32 SAL_CALL ScScenariosObj::getCount() uno::Any SAL_CALL ScScenariosObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XScenario> xScen(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScTableSheetObj> xScen(GetObjectByIndex_Impl(nIndex)); if (!xScen.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xScen); + return uno::Any(uno::Reference<sheet::XScenario>(xScen)); } uno::Type SAL_CALL ScScenariosObj::getElementType() @@ -5355,11 +5355,11 @@ sal_Bool SAL_CALL ScScenariosObj::hasElements() uno::Any SAL_CALL ScScenariosObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XScenario> xScen(GetObjectByName_Impl(aName)); + rtl::Reference<ScTableSheetObj> xScen(GetObjectByName_Impl(aName)); if (!xScen.is()) throw container::NoSuchElementException(); - return uno::Any(xScen); + return uno::Any(uno::Reference<sheet::XScenario>(xScen)); } uno::Sequence<OUString> SAL_CALL ScScenariosObj::getElementNames() diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 110b9ddc2ddd..92728de2560c 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -1165,7 +1165,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScEditFieldObj::getAnchor() uno::Reference<beans::XPropertySetInfo> SAL_CALL ScEditFieldObj::getPropertySetInfo() { SolarMutexGuard aGuard; - uno::Reference<beans::XPropertySetInfo> aRef = pPropSet->getPropertySetInfo(); + rtl::Reference<SfxItemPropertySetInfo> aRef = pPropSet->getPropertySetInfo(); return aRef; } diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 53e34a58a059..e7531b42a352 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -469,11 +469,11 @@ sal_Int32 SAL_CALL ScSheetLinksObj::getCount() uno::Any SAL_CALL ScSheetLinksObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<beans::XPropertySet> xLink(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScSheetLinkObj> xLink(GetObjectByIndex_Impl(nIndex)); if (!xLink.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xLink); + return uno::Any(uno::Reference<beans::XPropertySet>(xLink)); } uno::Type SAL_CALL ScSheetLinksObj::getElementType() @@ -490,11 +490,11 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasElements() uno::Any SAL_CALL ScSheetLinksObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<beans::XPropertySet> xLink(GetObjectByName_Impl(aName)); + rtl::Reference<ScSheetLinkObj> xLink(GetObjectByName_Impl(aName)); if (!xLink.is()) throw container::NoSuchElementException(); - return uno::Any(xLink); + return uno::Any(uno::Reference<beans::XPropertySet>(xLink)); } sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName ) @@ -967,11 +967,11 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() uno::Any SAL_CALL ScAreaLinksObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XAreaLink> xLink(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScAreaLinkObj> xLink(GetObjectByIndex_Impl(nIndex)); if (!xLink.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xLink); + return uno::Any(uno::Reference<sheet::XAreaLink>(xLink)); } @@ -1251,11 +1251,11 @@ sal_Int32 SAL_CALL ScDDELinksObj::getCount() uno::Any SAL_CALL ScDDELinksObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XDDELink> xLink(GetObjectByIndex_Impl(nIndex)); + rtl::Reference<ScDDELinkObj> xLink(GetObjectByIndex_Impl(nIndex)); if (!xLink.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xLink); + return uno::Any(uno::Reference<sheet::XDDELink>(xLink)); } uno::Type SAL_CALL ScDDELinksObj::getElementType() @@ -1272,11 +1272,11 @@ sal_Bool SAL_CALL ScDDELinksObj::hasElements() uno::Any SAL_CALL ScDDELinksObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XDDELink> xLink(GetObjectByName_Impl(aName)); + rtl::Reference<ScDDELinkObj> xLink(GetObjectByName_Impl(aName)); if (!xLink.is()) throw container::NoSuchElementException(); - return uno::Any(xLink); + return uno::Any(uno::Reference<sheet::XDDELink>(xLink)); } uno::Sequence<OUString> SAL_CALL ScDDELinksObj::getElementNames() diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index c96700f3474c..5497e0fc7569 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -592,11 +592,11 @@ sal_Int32 SAL_CALL ScNamedRangesObj::getCount() uno::Any SAL_CALL ScNamedRangesObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference< sheet::XNamedRange > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); + rtl::Reference< ScNamedRangeObj > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); if ( !xRange.is() ) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRange); + return uno::Any(uno::Reference< sheet::XNamedRange >(xRange)); } uno::Type SAL_CALL ScNamedRangesObj::getElementType() @@ -642,11 +642,11 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScNamedRangesObj ) uno::Any SAL_CALL ScNamedRangesObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference< sheet::XNamedRange > xRange(GetObjectByName_Impl(aName)); + rtl::Reference< ScNamedRangeObj > xRange(GetObjectByName_Impl(aName)); if ( !xRange.is() ) throw container::NoSuchElementException(); - return uno::Any(xRange); + return uno::Any(uno::Reference< sheet::XNamedRange >(xRange)); } uno::Sequence<OUString> SAL_CALL ScNamedRangesObj::getElementNames() @@ -1126,11 +1126,11 @@ sal_Int32 SAL_CALL ScLabelRangesObj::getCount() uno::Any SAL_CALL ScLabelRangesObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference< sheet::XLabelRange > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); + rtl::Reference< ScLabelRangeObj > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); if ( !xRange.is() ) throw lang::IndexOutOfBoundsException(); - return uno::Any(xRange); + return uno::Any(uno::Reference< sheet::XLabelRange >(xRange)); } uno::Type SAL_CALL ScLabelRangesObj::getElementType() diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 417fded19368..21fe7e6525cf 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -503,11 +503,11 @@ sal_Int32 SAL_CALL ScStyleFamiliesObj::getCount() uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference< container::XNameContainer > xFamily(GetObjectByIndex_Impl(nIndex)); + rtl::Reference< ScStyleFamilyObj > xFamily(GetObjectByIndex_Impl(nIndex)); if (!xFamily.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xFamily); + return uno::Any(uno::Reference< container::XNameContainer >(xFamily)); } uno::Type SAL_CALL ScStyleFamiliesObj::getElementType() @@ -526,11 +526,11 @@ sal_Bool SAL_CALL ScStyleFamiliesObj::hasElements() uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference< container::XNameContainer > xFamily(GetObjectByName_Impl(aName)); + rtl::Reference< ScStyleFamilyObj > xFamily(GetObjectByName_Impl(aName)); if (!xFamily.is()) throw container::NoSuchElementException(); - return uno::Any(xFamily); + return uno::Any(uno::Reference< container::XNameContainer >(xFamily)); } uno::Sequence<OUString> SAL_CALL ScStyleFamiliesObj::getElementNames() @@ -827,11 +827,11 @@ sal_Int32 SAL_CALL ScStyleFamilyObj::getCount() uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference< style::XStyle > xObj(GetObjectByIndex_Impl(nIndex)); + rtl::Reference< ScStyleObj > xObj(GetObjectByIndex_Impl(nIndex)); if (!xObj.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xObj); + return uno::Any(uno::Reference< style::XStyle >(xObj)); } uno::Type SAL_CALL ScStyleFamilyObj::getElementType() @@ -850,12 +850,12 @@ sal_Bool SAL_CALL ScStyleFamilyObj::hasElements() uno::Any SAL_CALL ScStyleFamilyObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; - uno::Reference< style::XStyle > xObj( + rtl::Reference< ScStyleObj > xObj( GetObjectByName_Impl( ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ) )); if (!xObj.is()) throw container::NoSuchElementException(); - return uno::Any(xObj); + return uno::Any(uno::Reference< style::XStyle >(xObj)); } uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames() diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 02f66358cb25..f88710e4355f 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1014,11 +1014,11 @@ sal_Int32 SAL_CALL ScTabViewObj::getCount() uno::Any SAL_CALL ScTabViewObj::getByIndex( sal_Int32 nIndex ) { SolarMutexGuard aGuard; - uno::Reference<sheet::XViewPane> xPane(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); + rtl::Reference<ScViewPaneObj> xPane(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))); if (!xPane.is()) throw lang::IndexOutOfBoundsException(); - return uno::Any(xPane); + return uno::Any(uno::Reference<sheet::XViewPane>(xPane)); } uno::Type SAL_CALL ScTabViewObj::getElementType() diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index ebd854f305ad..10eccf035b24 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -220,8 +220,8 @@ sal_Int32 ScVbaObjectContainer::insertShape( const uno::Reference< drawing::XSha uno::Any ScVbaObjectContainer::createCollectionObject( const uno::Any& rSource ) { uno::Reference< drawing::XShape > xShape( rSource, uno::UNO_QUERY_THROW ); - uno::Reference< excel::XSheetObject > xSheetObject( implCreateVbaObject( xShape ) ); - return uno::Any( xSheetObject ); + rtl::Reference< ScVbaSheetObjectBase > xSheetObject( implCreateVbaObject( xShape ) ); + return uno::Any( uno::Reference< excel::XSheetObject >(xSheetObject) ); } uno::Any ScVbaObjectContainer::getItemByStringIndex( const OUString& rIndex ) |
