Skip to content

Commit

Permalink
nPara[1] needs clamping too, after all
Browse files Browse the repository at this point in the history
Follow-up to 4bf2b13 "Clamp equation values
when exporting to binary MS format", during CppunitTest_sw_ooxmlexport6:

> filter/source/msfilter/escherex.cxx:2935:50: runtime error: implicit conversion from type 'sal_Int32' (aka 'int') of value 2700000 (32-bit, signed) to type 'sal_Int16' (aka 'short') changed the value to 13024 (16-bit, signed)
>  #0 in EscherPropertyContainer::CreateCustomShapeProperties(MSO_SPT, com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at filter/source/msfilter/escherex.cxx:2935:50
>  LibreOffice#1 in ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, EscherSolverContainer&, bool) at filter/source/msfilter/eschesdo.cxx:283:26
>  LibreOffice#2 in ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, EscherSolverContainer&, bool) at filter/source/msfilter/eschesdo.cxx:215:25
>  LibreOffice#3 in ImplEESdrWriter::ImplWriteTheShape(ImplEESdrObject&, bool) at filter/source/msfilter/eschesdo.cxx:932:12
>  LibreOffice#4 in EscherEx::AddSdrObject(SdrObject const&, bool) at filter/source/msfilter/eschesdo.cxx:951:35
>  LibreOffice#5 in oox::vml::VMLExport::AddSdrObject(SdrObject const&, short, short, short, short, bool) at oox/source/export/vmlexport.cxx:1425:15
>  LibreOffice#6 in DocxSdrExport::writeVMLDrawing(SdrObject const*, SwFrameFormat const&) at sw/source/filter/ww8/docxsdrexport.cxx:844:40
>  LibreOffice#7 in DocxSdrExport::writeDMLAndVMLDrawing(SdrObject const*, SwFrameFormat const&, int) at sw/source/filter/ww8/docxsdrexport.cxx:1051:9
>  LibreOffice#8 in DocxAttributeOutput::OutputFlyFrame_Impl(ww8::Frame const&, Point const&) at sw/source/filter/ww8/docxattributeoutput.cxx:5586:57
>  LibreOffice#9 in AttributeOutputBase::OutputFlyFrame(ww8::Frame const&) at sw/source/filter/ww8/wrtw8nds.cxx:3265:5
>  LibreOffice#10 in SwWW8AttrIter::OutFlys(int) at sw/source/filter/ww8/wrtw8nds.cxx:665:41
>  LibreOffice#11 in MSWordExportBase::OutputTextNode(SwTextNode&) at sw/source/filter/ww8/wrtw8nds.cxx:2274:42
>  LibreOffice#12 in MSWordExportBase::OutputContentNode(SwContentNode&) at sw/source/filter/ww8/wrtw8nds.cxx:3329:13
>  LibreOffice#13 in MSWordExportBase::WriteText() at sw/source/filter/ww8/wrtww8.cxx:2725:13
>  LibreOffice#14 in DocxExport::WriteMainText() at sw/source/filter/ww8/docxexport.cxx:1489:5
>  LibreOffice#15 in DocxExport::ExportDocument_Impl() at sw/source/filter/ww8/docxexport.cxx:527:5
>  LibreOffice#16 in MSWordExportBase::ExportDocument(bool) at sw/source/filter/ww8/wrtww8.cxx:3210:19
>  LibreOffice#17 in DocxExportFilter::exportDocument() at sw/source/filter/ww8/docxexportfilter.cxx:86:17
>  LibreOffice#18 in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/core/filterbase.cxx:497:55
>  LibreOffice#19 in WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/WriterFilter.cxx:150:23
>  LibreOffice#20 in SfxObjectShell::ExportTo(SfxMedium&) at sfx2/source/doc/objstor.cxx:2414:25
>  LibreOffice#21 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1496:19
>  LibreOffice#22 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&) at sfx2/source/doc/objstor.cxx:2821:39
>  LibreOffice#23 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objstor.cxx:2678:9
>  LibreOffice#24 in SfxObjectShell::APISaveAs_Impl(rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objserv.cxx:323:19
>  LibreOffice#25 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:3018:42
>  LibreOffice#26 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1689:13
>  LibreOffice#27 in SwModelTestBase::reload(char const*, char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:796:20
>  LibreOffice#28 in SwModelTestBase::executeImportExportImportTest(char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:283:9
>  LibreOffice#29 in testDmlGroupshapeRelsize::Import_Export_Import() at sw/qa/extras/ooxmlexport/ooxmlexport6.cxx:80:1
[...]

Change-Id: I40fdbcc599960aecabc4b2c96820eb3492509be0
Reviewed-on: https://gerrit.libreoffice.org/68715
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
  • Loading branch information
stbergmann authored and tuffnatty committed Mar 13, 2019
1 parent b920ea6 commit febe5de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion filter/source/msfilter/escherex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,10 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
std::clamp(
equation.nPara[ 0 ], sal_Int32(SAL_MIN_INT16),
sal_Int32(SAL_MAX_INT16)) )
.WriteInt16( equation.nPara[ 1 ] )
.WriteInt16(
std::clamp(
equation.nPara[ 1 ], sal_Int32(SAL_MIN_INT16),
sal_Int32(SAL_MAX_INT16)) )
.WriteInt16(
std::clamp(
equation.nPara[ 2 ], sal_Int32(SAL_MIN_INT16),
Expand Down

0 comments on commit febe5de

Please sign in to comment.