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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 07:49:29 UTC 2019


 filter/source/msfilter/escherex.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1e73e4a2b607c15ab9e0dd9fa40d2016262f7fc2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Mar 4 23:04:14 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Mar 5 08:49:01 2019 +0100

    nPara[1] needs clamping too, after all
    
    Follow-up to 4bf2b13647030d4e5a44d6a23d5570aeea70c333 "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
    >  #1 in ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, EscherSolverContainer&, bool) at filter/source/msfilter/eschesdo.cxx:283:26
    >  #2 in ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, EscherSolverContainer&, bool) at filter/source/msfilter/eschesdo.cxx:215:25
    >  #3 in ImplEESdrWriter::ImplWriteTheShape(ImplEESdrObject&, bool) at filter/source/msfilter/eschesdo.cxx:932:12
    >  #4 in EscherEx::AddSdrObject(SdrObject const&, bool) at filter/source/msfilter/eschesdo.cxx:951:35
    >  #5 in oox::vml::VMLExport::AddSdrObject(SdrObject const&, short, short, short, short, bool) at oox/source/export/vmlexport.cxx:1425:15
    >  #6 in DocxSdrExport::writeVMLDrawing(SdrObject const*, SwFrameFormat const&) at sw/source/filter/ww8/docxsdrexport.cxx:844:40
    >  #7 in DocxSdrExport::writeDMLAndVMLDrawing(SdrObject const*, SwFrameFormat const&, int) at sw/source/filter/ww8/docxsdrexport.cxx:1051:9
    >  #8 in DocxAttributeOutput::OutputFlyFrame_Impl(ww8::Frame const&, Point const&) at sw/source/filter/ww8/docxattributeoutput.cxx:5586:57
    >  #9 in AttributeOutputBase::OutputFlyFrame(ww8::Frame const&) at sw/source/filter/ww8/wrtw8nds.cxx:3265:5
    >  #10 in SwWW8AttrIter::OutFlys(int) at sw/source/filter/ww8/wrtw8nds.cxx:665:41
    >  #11 in MSWordExportBase::OutputTextNode(SwTextNode&) at sw/source/filter/ww8/wrtw8nds.cxx:2274:42
    >  #12 in MSWordExportBase::OutputContentNode(SwContentNode&) at sw/source/filter/ww8/wrtw8nds.cxx:3329:13
    >  #13 in MSWordExportBase::WriteText() at sw/source/filter/ww8/wrtww8.cxx:2725:13
    >  #14 in DocxExport::WriteMainText() at sw/source/filter/ww8/docxexport.cxx:1489:5
    >  #15 in DocxExport::ExportDocument_Impl() at sw/source/filter/ww8/docxexport.cxx:527:5
    >  #16 in MSWordExportBase::ExportDocument(bool) at sw/source/filter/ww8/wrtww8.cxx:3210:19
    >  #17 in DocxExportFilter::exportDocument() at sw/source/filter/ww8/docxexportfilter.cxx:86:17
    >  #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
    >  #19 in WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/WriterFilter.cxx:150:23
    >  #20 in SfxObjectShell::ExportTo(SfxMedium&) at sfx2/source/doc/objstor.cxx:2414:25
    >  #21 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1496:19
    >  #22 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&) at sfx2/source/doc/objstor.cxx:2821:39
    >  #23 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objstor.cxx:2678:9
    >  #24 in SfxObjectShell::APISaveAs_Impl(rtl::OUString const&, SfxItemSet&) at sfx2/source/doc/objserv.cxx:323:19
    >  #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
    >  #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
    >  #27 in SwModelTestBase::reload(char const*, char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:796:20
    >  #28 in SwModelTestBase::executeImportExportImportTest(char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:283:9
    >  #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 at redhat.com>

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 32756294d391..e4d230e3a3ea 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -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),


More information about the Libreoffice-commits mailing list