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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 8 14:14:20 UTC 2021


 sw/source/filter/ww8/writerhelper.hxx |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 939dff83ba8bc2dd124a73cc5460e52b8a642d9f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Sep 8 13:35:55 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 8 16:13:46 2021 +0200

    no need to do this dynamic_cast in a release build
    
    just make it an assert
    
    Change-Id: I6cd84c9988a3d5111d24b44aae46dc6d69ca06ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121813
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index 9ad16d0c2f14..91b881eaf57c 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -224,8 +224,7 @@ namespace sw
         */
         template<class T> const T & item_cast(const SfxPoolItem &rItem)
         {
-            if (dynamic_cast<const T *>(&rItem) == nullptr)
-                throw std::bad_cast();
+            assert(dynamic_cast<const T *>(&rItem) && "bad type cast");
             return static_cast<const T &>(rItem);
         }
 


More information about the Libreoffice-commits mailing list