Avoid division by zero

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 9 May 2018 19:00 EDT

...as happens during CppunitTest_sd_export_tests:

> sd/source/filter/eppt/epptso.cxx:118:76: runtime error: division by zero > #0 in PPTExBulletProvider::GetId(Graphic const&, Size&) at sd/source/filter/eppt/epptso.cxx:118:76 (instdir/program/libsdfiltlo.so +0x38e7e7) > #1 in ParagraphObj::ImplGetNumberingLevel(PPTExBulletProvider*, short, bool, bool) at sd/source/filter/eppt/pptx-text.cxx:897:46 (instdir/program/libsdfiltlo.so +0x55464d) > #2 in ParagraphObj::ImplGetParagraphValues(PPTExBulletProvider*, bool) at sd/source/filter/eppt/pptx-text.cxx:1114:5 (instdir/program/libsdfiltlo.so +0x54c01d) > #3 in ParagraphObj::ParagraphObj(com::sun::star::uno::Reference const&, ParaFlags, FontCollection&, PPTExBulletProvider&) at sd/source/filter/eppt/pptx-text.cxx:741:9 (instdir/program/libsdfiltlo.so +0x54e373) > #4 in TextObj::TextObj(com::sun::star::uno::Reference const&, int, FontCollection&, PPTExBulletProvider&) at sd/source/filter/eppt/pptx-text.cxx:1313:47 (instdir/program/libsdfiltlo.so +0x5574a4) > #5 in TextObjBinary::TextObjBinary(com::sun::star::uno::Reference const&, int, FontCollection&, PPTExBulletProvider&) at sd/source/filter/eppt/eppt.hxx:141:101 (instdir/program/libsdfiltlo.so +0x4068e7) > #6 in PPTWriter::ImplWritePage(PHLayout const&, EscherSolverContainer&, PageType, bool, int) at sd/source/filter/eppt/epptso.cxx:2367:39 (instdir/program/libsdfiltlo.so +0x3dc5bb) > #7 in PPTWriter::ImplWriteSlide(unsigned int, unsigned int, unsigned short, bool, com::sun::star::uno::Reference const&) at sd/source/filter/eppt/eppt.cxx:312:5 (instdir/program/libsdfiltlo.so +0x327239) > #8 in PPTWriterBase::CreateSlide(unsigned int) at sd/source/filter/eppt/pptx-epptbase.cxx:399:5 (instdir/program/libsdfiltlo.so +0x49896a) > #9 in PPTWriterBase::exportPPT(std::__debug::vector > const&) at sd/source/filter/eppt/pptx-epptbase.cxx:233:15 (instdir/program/libsdfiltlo.so +0x48ff5e) > #10 in ExportPPT at sd/source/filter/eppt/eppt.cxx:1451:17 (instdir/program/libsdfiltlo.so +0x34dfdc) > #11 in SdPPTFilter::Export() at sd/source/filter/sdpptwrp.cxx:173:24 (instdir/program/libsdlo.so +0x26b070d) > #12 in sd::DrawDocShell::ConvertTo(SfxMedium&) at sd/source/ui/docshell/docshel4.cxx:662:29 (instdir/program/libsdlo.so +0x2c454b7) > #13 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1508:19 (instdir/program/libsfxlo.so +0x2baa19d) > #14 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&) at sfx2/source/doc/objstor.cxx:2792:39 (instdir/program/libsfxlo.so +0x2bcdc17) > #15 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objstor.cxx:2650:9 (instdir/program/libsfxlo.so +0x2bc86cf) > #16 in SfxObjectShell::APISaveAs_Impl(rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objserv.cxx:302:19 (instdir/program/libsfxlo.so +0x2b69519) > #17 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:2959:46 (instdir/program/libsfxlo.so +0x2cbd740) > #18 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence const&) at sfx2/source/doc/sfxbasemodel.cxx:1638:13 (instdir/program/libsfxlo.so +0x2cc26b5) > #19 in SdExportTest::testBulletsAsImage() at sd/qa/unit/export-tests.cxx:934:20 (workdir/LinkTarget/CppunitTest/libtest_sd_export_tests.so +0x8988c)

Change-Id: I516bb2367d6a7fae23e2d474e63ab50af925208b Reviewed-on: https://gerrit.libreoffice.org/54034

c330f795ae1e Avoid division by zero
sd/source/filter/eppt/epptso.cxx | 47 ++++++++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 16 deletions(-)

Upstream: cgit.freedesktop.org


  • Share