sc/inc/cellsuno.hxx | 2 +- sc/source/filter/oox/worksheethelper.cxx | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-)
New commits: commit 4d9efac96bef3220049dc948b9b1e0c5d192d9bb Author: Aya Jamal <[email protected]> AuthorDate: Thu Feb 19 04:21:39 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Feb 22 15:54:45 2026 +0100 tdf#48140 Remove uno calls from WorksheetGlobals::getCell Change-Id: Id4fab8c16daaa5247a8d02afc24f11824bb8793e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199674 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 032916e44199..989b0d014c8c 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -678,7 +678,7 @@ public: static const SvxItemPropertySet* GetEditPropertySet(); static const SfxItemPropertyMap& GetCellPropertyMap(); - ScCellObj(ScDocShell* pDocSh, const ScAddress& rP); + SC_DLLPUBLIC ScCellObj(ScDocShell* pDocSh, const ScAddress& rP); SC_DLLPUBLIC virtual ~ScCellObj() override; virtual void RefChanged() override; diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 3b24f22a81ab..f16a962d858e 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -227,7 +227,7 @@ public: const Reference< XSpreadsheet >& getSheet() const { return mxSheet; } /** Returns the XCell interface for the passed cell address. */ - Reference< XCell > getCell( const ScAddress& rAddress ) const; + rtl::Reference< ScCellObj > getCell( const ScAddress& rAddress ) const; /** Returns the XSheetCellRanges interface for the passed cell range addresses. */ rtl::Reference<ScCellRangesObj> getCellRangeList( const ScRangeList& rRanges ) const; @@ -451,15 +451,13 @@ WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& rHelper, ISegmentProgr } } -Reference< XCell > WorksheetGlobals::getCell( const ScAddress& rAddress ) const +rtl::Reference< ScCellObj > WorksheetGlobals::getCell( const ScAddress& rAddress ) const { - Reference< XCell > xCell; - if( mxSheet.is() ) try - { - xCell = mxSheet->getCellByPosition( rAddress.Col(), rAddress.Row() ); - } - catch( Exception& ) + rtl::Reference< ScCellObj > xCell; + ScDocShell* pDocShell = getScDocument().GetDocumentShell(); + if( pDocShell ) { + xCell = new ScCellObj( pDocShell, rAddress ); } return xCell; }
