sc/inc/document.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 6377298a417eb2d2ef9710271090a86e469e9a2a Author: Mike Kaganski <[email protected]> AuthorDate: Mon Nov 24 07:35:10 2025 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Mon Nov 24 09:45:25 2025 +0100 Use StaticWhichCast, which has some useful asserts Change-Id: I10bf2fd1073e8714ada7ed129f7fb3378d74eca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194407 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index b76afc608cbc..743c642fcf51 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1881,19 +1881,19 @@ public: SC_DLLPUBLIC const SfxPoolItem& GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const; template<class T> const T& GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedWhichId<T> nWhich ) const { - return static_cast<const T&>(GetAttr(nCol, nRow, nTab, sal_uInt16(nWhich))); + return GetAttr(nCol, nRow, nTab, sal_uInt16(nWhich)).StaticWhichCast(nWhich); } SC_DLLPUBLIC const SfxPoolItem& GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich, SCROW& nStartRow, SCROW& nEndRow ) const; template<class T> const T& GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedWhichId<T> nWhich, SCROW& nStartRow, SCROW& nEndRow ) const { - return static_cast<const T&>(GetAttr(nCol, nRow, nTab, sal_uInt16(nWhich), nStartRow, nEndRow)); + return GetAttr(nCol, nRow, nTab, sal_uInt16(nWhich), nStartRow, nEndRow).StaticWhichCast(nWhich); } SC_DLLPUBLIC const SfxPoolItem& GetAttr( const ScAddress& rPos, sal_uInt16 nWhich ) const; template<class T> const T& GetAttr( const ScAddress& rPos, TypedWhichId<T> nWhich ) const { - return static_cast<const T&>(GetAttr(rPos, sal_uInt16(nWhich))); + return GetAttr(rPos, sal_uInt16(nWhich)).StaticWhichCast(nWhich); } SC_DLLPUBLIC const ScPatternAttr* GetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; SC_DLLPUBLIC const ScPatternAttr* GetPattern( const ScAddress& rPos ) const;
