diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 9f7709631778..fdf1c2816e1d 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -371,10 +371,11 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; }; -class UNLESS_MERGELIBS(SC_DLLPUBLIC) ScCellRangesObj final : public ScCellRangesBase, - public css::sheet::XSheetCellRangeContainer, - public css::container::XNameContainer, - public css::container::XEnumerationAccess +using ScCellRangesObj_BASE = cppu::ImplInheritanceHelper; +class UNLESS_MERGELIBS(SC_DLLPUBLIC) ScCellRangesObj final : public ScCellRangesObj_BASE { public: struct ScNamedEntry @@ -394,11 +395,6 @@ public: ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR); virtual ~ScCellRangesObj() override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - IF_MERGELIBS(SC_DLLPUBLIC) - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; // XSheetCellRanges @@ -448,30 +444,27 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; -class SAL_DLLPUBLIC_RTTI ScCellRangeObj : public ScCellRangesBase, - public css::sheet::XCellRangeAddressable, - public css::sheet::XSheetCellRange, - public css::sheet::XArrayFormulaRange, - public css::sheet::XArrayFormulaTokens, - public css::sheet::XCellRangeData, - public css::sheet::XCellRangeFormula, - public css::sheet::XMultipleOperation, - public css::util::XMergeable, - public css::sheet::XCellSeries, - public css::table::XAutoFormattable, - public css::util::XSortable, - public css::sheet::XSheetFilterableEx, - public css::sheet::XSubTotalCalculatable, - public css::util::XImportable, - public css::sheet::XCellFormatRangesSupplier, - public css::sheet::XUniqueCellFormatRangesSupplier, - public css::table::XColumnRowRange +using ScCellRangeObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScCellRangeObj : public ScCellRangeObj_BASE { private: const SfxItemPropertySet* pRangePropSet; @@ -502,11 +495,6 @@ public: static css::uno::Reference CreateRangeFromDoc( const ScDocument& rDoc, const ScRange& rR ); - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; // XCellRangeAddressable @@ -619,23 +607,20 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; //! really derive cell from range? -class SAL_DLLPUBLIC_RTTI ScCellObj final : public ScCellRangeObj, - public css::text::XText, - public css::container::XEnumerationAccess, - public css::table::XCell2, - public css::sheet::XFormulaTokens, - public css::sheet::XCellAddressable, - public css::sheet::XSheetAnnotationAnchor, - public css::text::XTextFieldsSupplier, - public css::document::XActionLockable +using ScCellObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScCellObj final : public ScCellObj_BASE { private: rtl::Reference mxUnoText; @@ -665,10 +650,6 @@ public: ScCellObj(ScDocShell* pDocSh, const ScAddress& rP); virtual ~ScCellObj() override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual void RefChanged() override; SvxUnoText& GetUnoText(); @@ -749,10 +730,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // XActionLockable virtual sal_Bool SAL_CALL isActionLocked() override; virtual void SAL_CALL addActionLock() override; @@ -761,26 +738,27 @@ public: virtual sal_Int16 SAL_CALL resetActionLocks() override; }; -class SAL_DLLPUBLIC_RTTI ScTableSheetObj final : public ScCellRangeObj, - public css::sheet::XSpreadsheet, - public css::container::XNamed, - public css::sheet::XSheetPageBreak, - public css::sheet::XCellRangeMovement, - public css::table::XTableChartsSupplier, - public css::table::XTablePivotChartsSupplier, - public css::sheet::XDataPilotTablesSupplier, - public css::sheet::XScenariosSupplier, - public css::sheet::XSheetAnnotationsSupplier, - public css::drawing::XDrawPageSupplier, - public css::sheet::XPrintAreas, - public css::sheet::XSheetLinkable, - public css::sheet::XSheetAuditing, - public css::sheet::XSheetOutline, - public css::util::XProtectable, - public css::sheet::XScenario, - public css::sheet::XScenarioEnhanced, - public css::sheet::XExternalSheetName, - public css::document::XEventsSupplier +using ScTableSheetObj_BASE = cppu::ImplInheritanceHelper; +class SAL_DLLPUBLIC_RTTI ScTableSheetObj final : public ScTableSheetObj_BASE { friend class ScTableSheetsObj; // for insertByName() @@ -802,10 +780,6 @@ public: void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab); - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XSpreadsheet virtual css::uno::Reference< css::sheet::XSheetCellCursor > SAL_CALL createCursor() override; @@ -952,14 +926,11 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; -class ScTableColumnObj final : public ScCellRangeObj, - public css::container::XNamed +using ScTableColumnObj_BASE = cppu::ImplInheritanceHelper; +class ScTableColumnObj final : public ScTableColumnObj_BASE { private: const SfxItemPropertySet* pColPropSet; @@ -974,11 +945,6 @@ public: ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab); virtual ~ScTableColumnObj() override; - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XNamed virtual OUString SAL_CALL getName() override; virtual void SAL_CALL setName( const OUString& aName ) override; @@ -991,10 +957,6 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; class ScTableRowObj final : public ScCellRangeObj diff --git a/sc/inc/cursuno.hxx b/sc/inc/cursuno.hxx index 5ba9403e8237..848156475fd8 100644 --- a/sc/inc/cursuno.hxx +++ b/sc/inc/cursuno.hxx @@ -24,20 +24,16 @@ #include #include -class ScCellCursorObj final : public ScCellRangeObj, - public css::sheet::XSheetCellCursor, - public css::sheet::XUsedAreaCursor, - public css::table::XCellCursor +using ScCellCursorObj_BASE = cppu::ImplInheritanceHelper; +class ScCellCursorObj final : public ScCellCursorObj_BASE { public: ScCellCursorObj(ScDocShell* pDocSh, const ScRange& rR); virtual ~ScCellCursorObj() override; - virtual css::uno::Any SAL_CALL queryInterface( - const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - // XSheetCellCursor virtual void SAL_CALL collapseToCurrentRegion() override; virtual void SAL_CALL collapseToCurrentArray() override; @@ -75,10 +71,6 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 29f437e77529..5bacf8a856b8 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3927,7 +3927,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference(this), - static_cast(this), - static_cast(this), - static_cast(static_cast(this)), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangesBase::queryInterface( rType ); -} - -void SAL_CALL ScCellRangesObj::acquire() noexcept -{ - ScCellRangesBase::acquire(); -} - -void SAL_CALL ScCellRangesObj::release() noexcept -{ - ScCellRangesBase::release(); -} - -uno::Sequence SAL_CALL ScCellRangesObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangesBase::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellRangesObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XCellRanges rtl::Reference ScCellRangesObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const @@ -4490,7 +4445,7 @@ uno::Reference ScCellRangeObj::CreateRangeFromDoc( const ScDo } ScCellRangeObj::ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR) : - ScCellRangesBase( pDocSh, rR ), + ScCellRangeObj_BASE( pDocSh, rR ), pRangePropSet( lcl_GetRangePropertySet() ), aRange( rR ) { @@ -4515,76 +4470,6 @@ void ScCellRangeObj::RefChanged() } } -uno::Any SAL_CALL ScCellRangeObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangesBase::queryInterface( rType ); -} - -void SAL_CALL ScCellRangeObj::acquire() noexcept -{ - ScCellRangesBase::acquire(); -} - -void SAL_CALL ScCellRangeObj::release() noexcept -{ - ScCellRangesBase::release(); -} - -uno::Sequence SAL_CALL ScCellRangeObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangesBase::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellRangeObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XCellRange // ColumnCount / RowCount vanished @@ -5713,7 +5598,7 @@ const SfxItemPropertyMap& ScCellObj::GetCellPropertyMap() } ScCellObj::ScCellObj(ScDocShell* pDocSh, const ScAddress& rP) : - ScCellRangeObj( pDocSh, ScRange(rP,rP) ), + ScCellObj_BASE( pDocSh, ScRange(rP,rP) ), pCellPropSet( lcl_GetCellPropertySet() ), aCellPos( rP ), nActionLockCount( 0 ) @@ -5754,61 +5639,6 @@ void ScCellObj::RefChanged() } } -uno::Any SAL_CALL ScCellObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScCellObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScCellObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScCellObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScCellObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // helper methods OUString ScCellObj::GetInputString_Impl(bool bEnglish) const // for getFormula / FormulaLocal @@ -6496,7 +6326,7 @@ static ScRange MaxDocRange(ScDocShell* pDocSh, SCTAB nTab) } ScTableSheetObj::ScTableSheetObj( ScDocShell* pDocSh, SCTAB nTab ) : - ScCellRangeObj( pDocSh, MaxDocRange(pDocSh, nTab) ), + ScTableSheetObj_BASE( pDocSh, MaxDocRange(pDocSh, nTab) ), pSheetPropSet(lcl_GetSheetPropertySet()) { } @@ -6511,78 +6341,6 @@ void ScTableSheetObj::InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab) InitInsertRange( pDocSh, ScRange(0,0,nTab, rDoc.MaxCol(),rDoc.MaxRow(),nTab) ); } -uno::Any SAL_CALL ScTableSheetObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScTableSheetObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScTableSheetObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScTableSheetObj::getTypes() -{ - static const uno::Sequence aTypes = comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); - return aTypes; -} - -uno::Sequence SAL_CALL ScTableSheetObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // Helper functions SCTAB ScTableSheetObj::GetTab_Impl() const @@ -8247,7 +8005,7 @@ uno::Sequence SAL_CALL ScTableSheetObj::getSupportedServiceNames() } ScTableColumnObj::ScTableColumnObj( ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab ) : - ScCellRangeObj( pDocSh, ScRange(nCol,0,nTab, nCol, pDocSh->GetDocument().MaxRow(),nTab) ), + ScTableColumnObj_BASE( pDocSh, ScRange(nCol,0,nTab, nCol, pDocSh->GetDocument().MaxRow(),nTab) ), pColPropSet(lcl_GetColumnPropertySet()) { } @@ -8256,38 +8014,6 @@ ScTableColumnObj::~ScTableColumnObj() { } -uno::Any SAL_CALL ScTableColumnObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScTableColumnObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScTableColumnObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScTableColumnObj::getTypes() -{ - return comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence { cppu::UnoType::get() } ); -} - -uno::Sequence SAL_CALL ScTableColumnObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XNamed OUString SAL_CALL ScTableColumnObj::getName() diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index 60744f720be6..76e41d024b0e 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -32,7 +32,7 @@ constexpr OUString SCSHEETCELLCURSOR_SERVICE = u"com.sun.star.sheet.SheetCellCur constexpr OUString SCCELLCURSOR_SERVICE = u"com.sun.star.table.CellCursor"_ustr; ScCellCursorObj::ScCellCursorObj(ScDocShell* pDocSh, const ScRange& rR) : - ScCellRangeObj( pDocSh, rR ) + ScCellCursorObj_BASE( pDocSh, rR ) { } @@ -40,45 +40,6 @@ ScCellCursorObj::~ScCellCursorObj() { } -uno::Any SAL_CALL ScCellCursorObj::queryInterface( const uno::Type& rType ) -{ - uno::Any aReturn = ::cppu::queryInterface(rType, - static_cast(this), - static_cast(this), - static_cast(this)); - if ( aReturn.hasValue() ) - return aReturn; - - return ScCellRangeObj::queryInterface( rType ); -} - -void SAL_CALL ScCellCursorObj::acquire() noexcept -{ - ScCellRangeObj::acquire(); -} - -void SAL_CALL ScCellCursorObj::release() noexcept -{ - ScCellRangeObj::release(); -} - -uno::Sequence SAL_CALL ScCellCursorObj::getTypes() -{ - return comphelper::concatSequences( - ScCellRangeObj::getTypes(), - uno::Sequence - { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - } ); -} - -uno::Sequence SAL_CALL ScCellCursorObj::getImplementationId() -{ - return css::uno::Sequence(); -} - // XSheetCellCursor void SAL_CALL ScCellCursorObj::collapseToCurrentRegion()