[Libreoffice-commits] core.git: sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 26 11:34:43 UTC 2021


 sc/source/core/tool/formularesult.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit d4d87c35e7e166cc6df92aa5be83eb3a65c2d02a
Author:     Noel Grandin <noel at peralex.com>
AuthorDate: Tue Jan 26 11:19:00 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jan 26 12:33:56 2021 +0100

    dynamic_cast unnecessary here
    
    Change-Id: I25b2c174bab07117849104fbc77fe3568c7f3d6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109935
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx
index 0b91a1a20d02..396f0408c27b 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -545,9 +545,8 @@ const OUString& ScFormulaResult::GetHybridFormula() const
 {
     if (GetType() == formula::svHybridCell)
     {
-        const ScHybridCellToken* p = dynamic_cast<const ScHybridCellToken*>(mpToken);
-        if (p)
-            return p->GetFormula();
+        const ScHybridCellToken* p = static_cast<const ScHybridCellToken*>(mpToken);
+        return p->GetFormula();
     }
     return EMPTY_OUSTRING;
 }
@@ -633,7 +632,7 @@ void ScFormulaResult::SetMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRe
 const ScMatrixFormulaCellToken* ScFormulaResult::GetMatrixFormulaCellToken() const
 {
     return (GetType() == formula::svMatrixCell ?
-            dynamic_cast<const ScMatrixFormulaCellToken*>(mpToken) : nullptr);
+            static_cast<const ScMatrixFormulaCellToken*>(mpToken) : nullptr);
 }
 
 ScMatrixFormulaCellToken* ScFormulaResult::GetMatrixFormulaCellTokenNonConst()


More information about the Libreoffice-commits mailing list