diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-04 23:45:11 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-04-05 08:33:33 +0200 |
commit | 7327260de3c0c627e62f7c3fddbe3d71ea88e88f (patch) | |
tree | 363e7e71702b0f13d4c9b1b4c89d4533ede74619 /unodevtools/source | |
parent | 5d0700bd3afef6d39b63fe813aaa0ac856ff5785 (diff) |
tdf#120703: partially revert commit 85456fae54029edd26df2277a9eec5e2fe3d9739
... to take into account possible differences of results of dynamic_cast
vs static_cast; the change casts dynamically, as before the commit, and
only adds asserts on the result of the cast.
Thanks to sberg for pointing my mistake out!
Change-Id: Ib77d443e5a858e744f369f58542de603f948fd1c
Reviewed-on: https://gerrit.libreoffice.org/70274
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unodevtools/source')
-rw-r--r-- | unodevtools/source/skeletonmaker/cpptypemaker.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx index 1e9d459f0551..5f9ed159ac8d 100644 --- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx +++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx @@ -64,10 +64,10 @@ static void printType( if (defaultvalue && referenceType == 16) { if (sort == codemaker::UnoType::Sort::Enum) { - assert(dynamic_cast<unoidl::EnumTypeEntity *>(entity.get())); + auto pEnumTypeEntity(dynamic_cast<unoidl::EnumTypeEntity *>(entity.get())); + assert(pEnumTypeEntity); o << nucleus.copy(nucleus.lastIndexOf('.') + 1) << "_" - << static_cast<unoidl::EnumTypeEntity*>(entity.get())-> - getMembers()[0].name; + << pEnumTypeEntity->getMembers()[0].name; } return; } @@ -927,11 +927,11 @@ void generateDocumentation(std::ostream & o, o << "; construction methods:\n"; printConstructors(o, options, manager, nucleus); } - assert(dynamic_cast<unoidl::SingleInterfaceBasedServiceEntity*>(entity.get())); generateDocumentation( o, options, manager, - static_cast<unoidl::SingleInterfaceBasedServiceEntity*>( - entity.get())->getBase().toUtf8(), + dynamic_cast<unoidl::SingleInterfaceBasedServiceEntity&>(*entity.get()) + .getBase() + .toUtf8(), delegate); break; |