summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2020-08-04Avoid UBSan signed-integer-overflowStephan Bergmann
...during CppunitTest_sd_import_tests_smartart: > oox/source/drawingml/diagram/diagramlayoutatoms.cxx:656:50: runtime error: signed integer overflow: 1924451 - -2147483647 cannot be represented in type 'int' > #0 in oox::drawingml::AlgAtom::layoutShape(std::shared_ptr<oox::drawingml::Shape> const&, std::__debug::vector<oox::drawingml::Constraint, std::allocator<oox::drawingml::Constraint> > const&, std::__debug::vector<oox::drawingml::Rule, std::allocator<oox::drawingml::Rule> > const&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:656:50 > #1 in oox::drawingml::ShapeLayoutingVisitor::visit(oox::drawingml::AlgAtom&) at oox/source/drawingml/diagram/layoutatomvisitors.cxx:202:19 > #2 in oox::drawingml::AlgAtom::accept(oox::drawingml::LayoutAtomVisitor&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:386:14 > #3 in oox::drawingml::LayoutAtomVisitorBase::defaultVisit(oox::drawingml::LayoutAtom const&) at oox/source/drawingml/diagram/layoutatomvisitorbase.cxx:32:16 > #4 in oox::drawingml::ShapeLayoutingVisitor::visit(oox::drawingml::LayoutNode&) at oox/source/drawingml/diagram/layoutatomvisitors.cxx:243:5 > #5 in oox::drawingml::LayoutNode::accept(oox::drawingml::LayoutAtomVisitor&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:1452:14 > #6 in oox::drawingml::LayoutAtomVisitorBase::defaultVisit(oox::drawingml::LayoutAtom const&) at oox/source/drawingml/diagram/layoutatomvisitorbase.cxx:32:16 > #7 in oox::drawingml::ShapeLayoutingVisitor::visit(oox::drawingml::LayoutNode&) at oox/source/drawingml/diagram/layoutatomvisitors.cxx:245:5 > #8 in oox::drawingml::LayoutNode::accept(oox::drawingml::LayoutAtomVisitor&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:1452:14 > #9 in oox::drawingml::LayoutAtomVisitorBase::visit(oox::drawingml::ForEachAtom&) at oox/source/drawingml/diagram/layoutatomvisitorbase.cxx:98:20 > #10 in oox::drawingml::ForEachAtom::accept(oox::drawingml::LayoutAtomVisitor&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:167:14 > #11 in oox::drawingml::LayoutAtomVisitorBase::defaultVisit(oox::drawingml::LayoutAtom const&) at oox/source/drawingml/diagram/layoutatomvisitorbase.cxx:32:16 > #12 in oox::drawingml::ShapeLayoutingVisitor::visit(oox::drawingml::LayoutNode&) at oox/source/drawingml/diagram/layoutatomvisitors.cxx:245:5 > #13 in oox::drawingml::LayoutNode::accept(oox::drawingml::LayoutAtomVisitor&) at oox/source/drawingml/diagram/diagramlayoutatoms.cxx:1452:14 > #14 in oox::drawingml::Diagram::addTo(std::shared_ptr<oox::drawingml::Shape> const&) at oox/source/drawingml/diagram/diagram.cxx:122:30 > #15 in oox::drawingml::loadDiagram(std::shared_ptr<oox::drawingml::Shape> const&, oox::core::XmlFilterBase&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, oox::core::Relations const&) at oox/source/drawingml/diagram/diagram.cxx:356:15 > #16 in oox::drawingml::DiagramGraphicDataContext::onCreateContext(int, oox::AttributeList const&) at oox/source/drawingml/graphicshapecontext.cxx:252:9 > #17 in non-virtual thunk to oox::drawingml::DiagramGraphicDataContext::onCreateContext(int, oox::AttributeList const&) at oox/source/drawingml/graphicshapecontext.cxx > #18 in oox::core::ContextHandler2Helper::implCreateChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx:94:34 > #19 in oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx:191:12 > #20 in non-virtual thunk to oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx > #21 in (anonymous namespace)::Entity::startElement((anonymous namespace)::Event const*) at sax/source/fastparser/fastparser.cxx:432:44 > #22 in sax_fastparser::FastSaxParserImpl::callbackStartElement(unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:1246:21 > #23 in (anonymous namespace)::call_callbackStartElement(void*, unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:305:18 > #24 in xmlParseStartTag2 at workdir/UnpackedTarball/libxml2/parser.c:9588:6 > #25 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11378:14 > #26 in xmlParseChunk__internal_alias at workdir/UnpackedTarball/libxml2/parser.c:12280:13 > #27 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1046:21 > #28 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:866:9 > #29 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1369:13 > #30 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) at oox/source/core/fastparser.cxx:121:15 > #31 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) at oox/source/core/fastparser.cxx:129:5 > #32 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) at oox/source/core/xmlfilterbase.cxx:402:21 > #33 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) at oox/source/core/xmlfilterbase.cxx:331:12 > #34 in oox::ppt::PresentationFragmentHandler::importSlide(rtl::Reference<oox::core::FragmentHandler> const&, std::shared_ptr<oox::ppt::SlidePersist> const&) at oox/source/ppt/presentationfragmenthandler.cxx:610:17 > #35 in oox::ppt::PresentationFragmentHandler::importSlide(unsigned int, bool, bool) at oox/source/ppt/presentationfragmenthandler.cxx:348:13 > #36 in oox::ppt::PresentationFragmentHandler::finalizeImport() at oox/source/ppt/presentationfragmenthandler.cxx:499:17 > #37 in oox::core::FragmentHandler2::endDocument() at oox/source/core/fragmenthandler2.cxx:54:5 > #38 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:872:36 > #39 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1369:13 > #40 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) at oox/source/core/fastparser.cxx:121:15 > #41 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) at oox/source/core/fastparser.cxx:129:5 > #42 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) at oox/source/core/xmlfilterbase.cxx:402:21 > #43 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) at oox/source/core/xmlfilterbase.cxx:331:12 > #44 in oox::ppt::PowerPointImport::importDocument() at oox/source/ppt/pptimport.cxx:145:17 > #45 in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/core/filterbase.cxx:485:49 > #46 in oox::ppt::PowerPointImport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/ppt/pptimport.cxx:223:24 > #47 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2251:34 > #48 in sd::DrawDocShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sd/source/ui/docshell/docshel4.cxx:399:39 > #49 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:738:23 > #50 in SdModelTestBase::loadURL(rtl::OUString const&, int, std::shared_ptr<SfxAllItemSet>) at sd/qa/unit/sdmodeltestbase.hxx:181:30 > #51 in SdImportTestSmartArt::testText() at sd/qa/unit/import-tests-smartart.cxx:250:37 As discussed on IRC: > Jul 31 18:52:58 <vmiklos> sberg: yes, that looks reasonable, clearly the > expectation is that there is at least one element, in which case that > nVertMin grows from 0 and nVertMax shrinks from > std::numeric_limits<sal_Int32>::max() > Jul 31 18:54:43 <vmiklos> sberg: sounds like i made that mistake in > acdde3c643fde015214c546b1567727272ea799e, but recently i added a test that > now uncovered the problem :) (cherry picked from commit ae4a69d7559a537e86630b2890d28b0d8f6f47d0) Change-Id: I0ee11dbab568af788f9e2786c3dca2c1a5e1ee08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100112 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-15tdf#131175 oox chart import: fix char color of <dLbl>, inherited from <dLbls>Miklos Vajna
There were two problems here: 1) Our chart model expects the char formatting of a data label as direct formatting, so in case <c:dLbl> has no such formatting, but <c:dLbls> has, oox has to explicitly inherit. 2) The data label char formatting is represented using chart::FormattedString, but the char format of it is not (yet) exported to ODF. Given that the char format of the series and the individual data labels is the same, restore the same formatting on import to please rendering. With these, finally the chart labels in the bugdoc are white, not black (and have a dark background, so they are readable). (cherry picked from commit 8a43bfeffab9009c9f373e883fef87af1a7b3843) Change-Id: Iebac5ce0be31a59bafb0f9fe7636330585e33822 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98810 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-15Related: tdf#131175 OOXML chart: insert hatch definition into the right tableMiklos Vajna
Both the chart and the containing document has one, but the intention is to insert this into the chart one. This is needed, but not enough to render the right hatch for data labels. (cherry picked from commit e18bc316efbd815b047f4e19ebd033e7a842d10d) Conflicts: oox/source/drawingml/chart/seriesconverter.cxx Change-Id: I485d84e2ae33728963b648c05e730d418567fc0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98809 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-15Related: tdf#131175 OOXML chart: import data label fill patternGülşah Köse
(cherry picked from commit 6f752061d5153da50d6f536d506358c8f512a397) Conflicts: oox/source/drawingml/chart/seriesconverter.cxx Change-Id: I2db64489c86e4381167eb13af4ab5118113960d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98808 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-15tdf#131175 Import data label solid fill and color.Gülşah Köse
(cherry picked from commit 603df08a1e0211099ce2cf258cfe64a74ed6ded9) Conflicts: oox/source/drawingml/chart/seriesconverter.cxx Change-Id: I8a3ef6e60d4f2a13310bb9a8fc4eb873df3f9b4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98807 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-15PPTX export, custom shape, bitmap fill: fix source vs fill rect confusionMiklos Vajna
Commit 682ab832522b1349f1714bcb16f6e83468ea2920 (drawingML export\import: cropping of shape's fill texture, 2014-02-12) improved the DOCX filter, so the fill rectangle of a custom shape with bitmap fill is handled. The problem is drawingML has a source rectangle (similar to our crop rect) to limit the usage of the bitmap, and also it has a fill rectangle in case some margin is wanted around a stretched bitmap. We don't have a mapping for the later. Fix the problem by limiting the above work for DOCX, this way PPTX's source rectangle won't be turned into a stretch's fill rectangle. This way no unwanted margins will appear around the image -- those margins can be large enough that the image effectively disappears on export. (cherry picked from commit b00e43fa5848be0cc7ba81b185021511d94cdc00) Change-Id: Ic35063545a56eec9eaf885bbd397a854705d134f
2020-06-11tdf#106181 XLSX export: output form controlsSerge Krot
Prepared general algorithm to ouput form controls into XLSX. For now only CHECKBOX is supported with a possibility to link withem to any worksheet/cell. Change-Id: Ide8739d81ffb755aeae074c4ebecf24251383e34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94161 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit fd238380ae7820f12ac1f7c52d0f7180a93f3ba3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94835
2020-06-10PPTX import: handle adjust values from both the shape and its placeholderMiklos Vajna
The direct problem is a crash in CustomShapeProperties::pushToPropSet(), the code just hoped that the input file doesn't have more adjust values than the # of adjust values we allocate based on the preset type. Fix the crash, but there is a deeper problem here... The shape can inherit custom shape properties from a placeholder, then later it can have its own custom shape properties. When it comes to adjust values specifically, we used to just append own adjust values to the end of the list. This way we got the double of expected adjust values. And later rendering took the N expected adjust values from the start of the 2N element list, so we used the adjust values of the placeholder, not of the actual shape. Fix this by clearing the custom shape geometry once we know we have our own preset geometry. (cherry picked from commit 408ec7a4470741edbedbb034de07a2d776348593) Change-Id: I09f669bf59c33b552b906733d323eba7af5548e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96066 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-06-10tdf#131082 fix missing fill property of grouped shapesnd101
When shapes are grouped together, and fill property is specified at the group level in MSO, it fails to work in IMPRESS. This fix is to set the fill property when it is being imported. Change-Id: I89920e71fc558f54d49ef7b065c549a732bc2b10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89862 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96065 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-06-02tdf#132594 Chart XLSX import: fix legend entries in pie chartsTünde Tóth
Legend entry text of pie chart wasn't imported correctly in XLSX documents created with Excel 2007. Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8 (tdf#128016 Chart OOXML Import: fix duplicated category labels) Change-Id: I4567437a41fe66e124dccbd148c0c49196d5c007 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94864 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95294
2020-05-27oox smartart import, composite alg: implement vertical centeringMiklos Vajna
The bugdoc's case was that the total height would be used by 2 shapes, but then a constraint decreases the height of one shape, so not all vertical space is used. We used to just count from the top, need to center vertically, as PowerPoint does it. (cherry picked from commit acdde3c643fde015214c546b1567727272ea799e) Change-Id: I436019e9e837b73130e387c9bcd309e20045b0f9
2020-05-27oox smartart import: fix aspect ratio of shape with composite algoMiklos Vajna
The layout node has alg=composite, then a parTx and a desTx child layout nodes. No matter what order is used (parent first, child first), the result will be wrong, as the constraints refer to each other. I did not spot any description in ISO 29500-1 that would describe what is the expected behavior. Researching this, found "One other consideration when specifying composite constraints is that the constraints must be specified in the same order as the nested layout nodes." at <http://web.archive.org/web/20111015151600/http://msdn.microsoft.com/en-us/magazine/cc163470.aspx>, which suggests to handle constraints for each shape in a parent -> child order, but keep a shared state when iterating over the children which gives us: - parent node, all direct constraints - for each child node: - child's constraints from parent - child's own constraints This way the desTx top value can depend on the parTx's height, and it's supported to define parTx's height only in the parTx layout node, not in the composite parent. And after all, it matches what PowerPoint does, so the column headings in the bugdoc have a 4:10 height:width aspect ratio. (cherry picked from commit 414586649582e182b2603702f4f586f4beeed8a9) Change-Id: Ideb76c1ddd1ffff8d2a217cddf81106d1bb97eb9
2020-05-27smartart import: handle multiple <a:schemeClr> in <dgm:fillClrLst>Miklos Vajna
The TODO in the ColorFragmentHandler ctor was right: we only handled the last <a:schemeClr> child, but there can be multiple one. Use them based on the index of a shape in a <dgm:forEach> loop. Move the TODO to the only place which still assumes a single color in the color list. (cherry picked from commit 12bea6c897822964ad4705418da54411cb15749e) Conflicts: oox/source/drawingml/colorchoicecontext.cxx oox/source/drawingml/diagram/diagram.cxx sd/qa/unit/import-tests-smartart.cxx Change-Id: I1c5c4f82e621f1110ef06b0490ff79f82f60f214
2020-05-12tdf#130058 Import shadow size.Gülşah Köse
Change-Id: Ie1cee377a33567088fb76ea47f0e6fc51d47f0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92188 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93419 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-11oox: add PPTX import/export for semi-transparent shape textMiklos Vajna
And start a drawingml test suite in oox, so the test and the tested code is close to each other (just like how it's done in chart2/ already). (cherry picked from commit 1e64d9ebaa231caef5fb062009b8f76465e415f4) Conflicts: oox/Module_oox.mk Change-Id: I9a2810691f12604d240e4394e6a5ff4e7f52f1c1
2020-05-07tdf#79082 Export paragraph tab stops to ooxmlSamuel Mehrbrodt
Change-Id: I7d25dc1ab3c960aafc07a3be69b54f5aceef23fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93462 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 2c14bbd5820f854be3a4b1c0f49b9d9afa05b08c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93526 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-06tdf#132282: Revert fix for tdf#131554Xisco Fauli
912217285b3058efa54c2336f91fda4efdad6ff0 fixed the root cause of tdf#131554 and 69b83dc2d3014dd9b18402534e15c937dc082464 is no longer needed The unittest still passes Change-Id: I7c723b0c3cc2b56022978bbeb8bf6b3f6f93f1c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93063 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93073 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-29tdf#119087 Don't treat OOXML strict namespace as custom XMLSamuel Mehrbrodt
Change-Id: I5037ac09f57c92e02e330cbc906da3afbe4c747c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93056 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 9be543a27ab18427a1c4e66a70cc49b0332b6aa1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93128 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-28tdf#132174 Chart DOCX import: fix label number formatBalazs Varga
The inner data table of charts has no own cell number format, unlike the MSO embedded XLSX, so we always have to set the link number format to false, if we have an inner data table. Regression from commit: 9c1063ba13028244346528e307d5563d6faf949d (tdf#129173 tdf#129175 Fix number format of data labels) Change-Id: I5e7865cb8c19fc6fae5b68305c7dc302516c0ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92695 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Tünde Tóth <tundeth@gmail.com> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e0da00d655ecca5986eea3812a8a670c6adbc40f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93007 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-04-28tdf#78749 DOCX: import VML background imageAttila Bakos
of text boxes. DOCX relationship identifier wasn't handled earlier, only XLSX. Co-developer: Tibor Nagy Change-Id: I72f246e6f69d70d1e203087516ee93a57563f777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91933 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 9283cd9e13cd3e0dd7d6b831d930128931862a40) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92771 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-04-27tdf#131936 Correctly detect OOXML variant on importSamuel Mehrbrodt
Change-Id: I29a6b0454bf741ce8ad49078597b3412a83dedb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92278 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit ff93e4977cb1e23f355d248a77e8d0e56bb0f4b9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92766 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-23tdf#119187 fix: Top-aligned text in PPTX becomes bottom-alignednd101
Change-Id: Ic6c03e512ce3f6e240d86186fb16e24c86942343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92051 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92725
2020-04-02tdf#131554 placeholder iteration fails to stop when a match is foundnd101
Wrong placeholder is returned due to iteration not stopping when a match is found. It causes a text element position to be incorrectly set. Change-Id: I58be6825cec7a61f48b46418bdf28964c1afe4ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91023 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91472 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-01tdf#100751 DOCX VML shape import: fix arrow directionSzabolcs Toth
Flips along both the y- and x-axis weren't imported, resulting wrong direction of arrow and other shapes. Co-Author: Balázs Regényi Change-Id: Iac222ac2a6a6110289969c32b40828b83da0aefd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90646 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> (cherry picked from commit cb441c4d0adf698e6af9073c6c3285a66b76871e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91391 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-03-25tdf#131553 a null pointer crashes Impressnd101
When constructing a shape object from property EmbeddedObject, it may return null object. Check the returned value first. Change-Id: I9d7a2d9c0c919007ae2a34a0af86dea5639b1bd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit df1be683ab935fe5362750360508ba69eb415afb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90959 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-03-24Fix build with boost < 1.68Rico Tzschichholz
Follow-up fix for 73cac1031131021819a0fbd4d60554196aea230c "tdf130839: Corrects second level left margin in Smartart" Change-Id: Ie194062ba33cf505ad33fbfdc73c2f764b61d0aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90770 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-18tdf#131118 VML import: fix size of non-autosize shapes containing textMiklos Vajna
Regression from commit b92293b3943423324064a8513c2e114d18817179 (tdf#103983 VML import: handle <v:textbox style="mso-fit-shape-to-text:t">, 2020-01-20), the problem was that in case we disable autosize too late, then the size will be already set during adding text to the shape. Do it before adding text, this way adding text won't change the shape size, so it'll be correct at the end of the import. (cherry picked from commit 4ee7ee1c4a515479bc174543af4dbc400035c0ba) Change-Id: I9410fc695c3edfa5089d845864bf237e71c533c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90602 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-03-11tdf#130986 Chart OOXML export: fix number format of custom labelBalazs Varga
Export correct sourceLinked attribute in c:dLbls/c:dLbl/c:numFmt, as in c:dLbls/c:numFmt. Change-Id: I0e52720b3cb2c99550a779763f01ba12f762050d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89638 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89947 Tested-by: Jenkins
2020-03-04tdf#84399 VML import: map <v:shape o:spt="202"> to TextShapeMiklos Vajna
This partially reverts commit 81f9fe3a14f0fc99afbfa7ce3a26a9c7855d0919 (fdo#74401 VML groupshape import: only handle v:rect as TextShape, 2014-03-19), which wanted to map triangles to custom shapes. It was overlooked that we can have not only explicit rectangles and custom shapes, but also <v:shape> elements which have their shape type explicitly set to TextBox. The later is now again handled similar to rectangles. This keeps the triangle case working, but fixes the <v:shape o:spt="202"> case. We need to make this decision while parsing the XML, so some rework is needed to have earlier access to its container (group shape or draw page) and also to its shape type. (cherry picked from commit 198685ded79d64b21023ee85e9a15fa1b32705a0) Conflicts: include/oox/vml/vmlshapecontainer.hxx Change-Id: I33a4b3cd03b0df5d93cffa19e7ea834113df2bdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89876 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-02-26tdf#130657 OOXML chart import: fix charts without CrossBetweenBalazs Varga
by using default values for ShiftedCategoryPosition. Regression from commit 111c260ab2883b7906f1a66e222dbf4dc3c58c4f (tdf#127777 OOXML chart export: fix "CrossBetween" for not imported charts) Change-Id: Idd48a8343e7d6609b487daf7182e9716f2f5e01f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88709 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 8163f4ad81487ae187d00d3ce86214e520cb8b69) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89517 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-02-26tdf#130105 Chart OOXML Import: Fix data label positionBalazs Varga
The position of datapoint labels was overwritten with the position of series placement. Do not overwrite datapoint labels placement, if we have explicit datapoint label placement. Regression from commit: 70944a849dc59fa686e3f316a3983dbc8a47017f (tdf#109858: Override default point label placement setting...) Change-Id: Ic27c8a7eb93e8c3776389d1b3d285d120568f024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87137 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit a4cdd4d1266e77330d4745f369db85ee7dba265c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87594 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-02-24tdf130839: Corrects second level left margin in SmartartGülşah Köse
Change-Id: Ifec339759427336fd53012e0a8a906d240be9654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89085 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit eeaa7aba6e7ace8b69d7056645b15be2f996d8fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89277
2020-02-21tdf#130776 Show the bullet on second level in smartart.Gülşah Köse
Change-Id: Ie35867862d30d490a97dc6f245b50c7311dafe50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88993 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit 7865c662a4fdc9dc07f59d6ecd76b9c56d0020ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88962
2020-01-28tdf#103983 VML import: handle <v:textbox style="mso-fit-shape-to-text:t">Miklos Vajna
We used to always always set TextAutoGrowHeight to true, only do that when the matching VML attribute is detected, default to false. This helps the exporter, so it writes the correct markup on save of the bugdoc. Also adapt testGroupshapeChildRotation, which in practice tested the automatic height of the shape. The point of "auto" is that it changes as needed, hardcoding that value in a test is not a great idea. Rather test that the height is no longer automatic (there is no explicit markup in the file, and the default is false). (cherry picked from commit b92293b3943423324064a8513c2e114d18817179) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Ie39408b7da53f4923a2ade503e520c704a86bcf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87120 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-17tdf#128304 export TB_RL writing mode as eaVirtMark Hung
and import eaVirt to TextWritingMode instead of TextPreRotateAngle (-90) degree of CustomShapeGeometry. CJK text in TB_RL writing mode are upright in Writer. It corresponds to eaVirt by its defintion. Change-Id: I2a8bc6676ad6af06b06e023adaa2f201a028d426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86637 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Signed-off-by: xisco <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86960
2020-01-14tdf#129516 DOCX import: fix incorrect z-order with textboxesMiklos Vajna
Commit 3272c1eb5563f3bda2caa24f32b1018372622109 (related tdf#100074: prepare group shapes text input via writerfilter, 2018-10-01) tweaked the oox code, so that later it'll be able to call back to writerfilter to parse group shape text. That makes sense, but it also removed the reset of the group shape context, which means that two subsequent group shapes are now imported as a single group shape with a merged child list. Reset the group shape context again when writerfilter asks for the XShape from oox. If this causes a problem for the above scenario later, then it could be considered to handle this in ShapeContextHandler::endFastElement(). (cherry picked from commit 5960c6f4ca9dd6ab4b4081d3be7253468cd212c4) Change-Id: I14f7f0bab2c66c8430313d5b2daffe3160a58c27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86746 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-10oox: add missing nullptr checksXisco Fauli
See http://crashreport.libreoffice.org/stats/signature/oox::drawingml::chart::PlotAreaConverter::convertFromModel(oox::drawingml::chart::View3DModel%20&) Regression from 11473832b5717cb3222ce72baee885bc9e8e2386 Change-Id: I6cf08582fb384203ca1ce5736b88b85c11ff56da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit aa499120c4cb3935cd942751859b6d5d3689ea43) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86523 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-07tdf#107604 Handle predefined table styles.Gülşah Köse
Handle table styles that we have just style-id and have not corresponding style defination in tableStyle.xml Change-Id: Id06f5508d5eb1330b5bac1634c520c3066c09139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86068 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86325
2020-01-07tdf#125444 Percentage as custom chart labelTamas Bunth
Support importing ooxml charts with a field of type "PERCENTAGE" as custom label. Change-Id: Ie8931f77e3b6199d98635422d11d776e675f6e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86067 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86124 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-07tdf#129708 speed-up: check if we could create outline instead of creation of itSerge Krot
Change-Id: I0629b4e6ccae4ab9be0142fe39c627f2f9a8f5ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86199 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 92ccf53b2a8102299ac2c3e2612bb507d3a79c0f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86278
2019-12-17tdf#129143 FILESAVE: PPTX: bullets have a black border after RTNoel Grandin
Revert "no need to use AlphaMask in DrawingML::WriteParagraphNumbering" This reverts commit 126818d293982e578dfb4d977ee0ea64a1cff0de. Change-Id: I7326e7dbf2f00629ca5d08cff680e68c679f321a Reviewed-on: https://gerrit.libreoffice.org/85258 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 5c54778aad677d6bb6e6687f0f43dffad1aefa1e) Reviewed-on: https://gerrit.libreoffice.org/85269 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-14tdf#121991 Chart OOXML import: fix deleted legend entriesTünde Tóth
The legend showed deleted legend entries too. Change-Id: I1e205cdfc4262c73d2bb189237d6bc316781931d Reviewed-on: https://gerrit.libreoffice.org/84516 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit cea1ae2a4f7abdcfc3874d714bdafef801910c1c) Reviewed-on: https://gerrit.libreoffice.org/85024 Tested-by: Jenkins Reviewed-by: Tünde Tóth <tundeth@gmail.com>
2019-12-06tdf#127237 fix table background color in Impress importnd101
When the background color is set at the table level in PPTX, instead of at cell level, the background color fails to show up in Impress. Change-Id: I2838e5b56e4a2414494ee99c0f8975b7256ac6dc Reviewed-on: https://gerrit.libreoffice.org/78377 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 4c2254cbebca53c34fa48a1dd90cebe434f24274) Reviewed-on: https://gerrit.libreoffice.org/84644 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-03tdf#128429 VML import: let mso-layout-flow-alt:bottom-to-top imply verticalMiklos Vajna
Normally layout flow is set to vertical to denote TBRL, and then optionally there is a layout flow alt to denote BTLR, but the bugdoc shows that the first may be missing. So map to BTLR even in case only the alt layout flow is found in the file. (cherry picked from commit ca7004569b39721c3e7247551a43d544fd3204fe) Conflicts: oox/Module_oox.mk Change-Id: I06fce738fca9aedc0de90ccebda3a24e99425326 Reviewed-on: https://gerrit.libreoffice.org/84317 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-28tdf#113198 set default shape paragraph alignment..Tamas Bunth
to center when importing oox document. Using MS Office, the default aligment of a (text) paragraph inside a shape is centered. Change-Id: Id9bcaaab109df65f4124f733b2cfee438e82b79b Reviewed-on: https://gerrit.libreoffice.org/83193 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> (cherry picked from commit 89f0af144c18efafe2573801641689a1432c0cae) Reviewed-on: https://gerrit.libreoffice.org/83971 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-28tdf#127090 Export textbox rotation attribute.Gülşah Köse
In case "rotated textbox in a custom shape" handle draw:text-rotate-angle attribute while exporting ODP to PPTX. Change-Id: I13b99da586af5e77e51a7cc93a751ab21bed7170 Reviewed-on: https://gerrit.libreoffice.org/83888 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit 9b2f5d27cf0a0adcced813e18108d5878061d1ee) Reviewed-on: https://gerrit.libreoffice.org/83950
2019-11-22tdf#128952 Set the position of shape for 180 deg.Gülşah Köse
If the rotation value is 180, 540, 900... degree with mirror pShape->GetRotateAngle() returns 0. In that control 0 means no rotation but that is not true. For that cases (180, 540, 900) after the angle conversition GetRotateAngle() returns 0. We should recalculate the position for 0 too. Change-Id: I14e981235b2d6cd8382d4c9e151bccd2e73a3fd9 Reviewed-on: https://gerrit.libreoffice.org/83468 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit aca2e4d270f472b2cbdb9084a55f1855529ea705) Reviewed-on: https://gerrit.libreoffice.org/83534 Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-11-22tdf#123774 OOXML chart export: keep digits of percentages of data points Balazs Varga
by exporting PercentageNumberFormat, checking the "Label" format directly and taking the respective number format based on that. Note: also fix the "LinkNumberFormatToSource" property. If we create a pie chart with data labels and set the "Show value as number" or "Show value as percentage" and check on/off "Source format", this move is not set the property in the XPropertySet. Because of this, it fixes also the export of correct value of "link-data-style-to-source" property into ODS files. But this patch doesn't fix the export of old ODS files to OOXML, because they contain wrong (always true) "link-data-style-to-source" value. Change-Id: I4098a245dec5bf35cde20c9ccb79aca726230118 Reviewed-on: https://gerrit.libreoffice.org/82703 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit a59eb39c6ec01ae2a9d8ddbb61a9c27f527c9caa) Reviewed-on: https://gerrit.libreoffice.org/83410
2019-11-20tdf#128820: use wps namespace for simple text shapesMike Kaganski
Without that, simple text shapes inside groups were written in <pic:wsp> elements, with many child elements also having pic:: prefix. Change-Id: I114cf3499e03aa5ca042211d7b134aaf5b0e7fbf Reviewed-on: https://gerrit.libreoffice.org/82980 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Also consider saved exceptions when terminating parse As with previous commit 18ae77a065cb8ae6940d4067f6ab7e99a3f74047, this will start showing parse errors on invalid files which previously just opened without warnings, silently losing the invalid stream part. Any bug bisected to this commit is not a regression from this commit! The real problem was already before, and was just disclosed by this (which is the actual goal). Also simplify unit test data for tdf#128820, which will now be enough after the change. A unit test (testN779627) revealed unexpected throws when parsing; this was fixed. Change-Id: I5a21b9001874ec6e3b8273c10043ef930bf1cc82 Reviewed-on: https://gerrit.libreoffice.org/82981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> tdf#128820: improve unit test to not depend on opening bad file failing ... also test exported XML directly Change-Id: I50237593dd111e7c7974452769c8d49c22012713 Reviewed-on: https://gerrit.libreoffice.org/83005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Fix UBSan build after 9fdf8c0a5cc036ea9bd1e11dd8f2c1a6e601fae2 The said commit simplified a testdoc to testTdf128820, using a smallest possible SVG in it. This seems to produce the smallest possible PNG of size 8, which is passed into GraphicDescriptor::ImpDetectPNG. There its size is read into nTemp32 past the end of the file without checks, which keeps last value of the variable (which was the magic number 0x0d0a1a0a), which is then saved into the descriptor. Then that value is used in ImpGraphic::ImplGetSizePixel, and later multiplying it in lclConvertScreenPixelToHmm causes UB. Fix by checking all the reads in GraphicDescriptor::ImpDetectPNG. Change-Id: Ib4740fac2b87fbef57d5150151129b9852f3ecb8 Reviewed-on: https://gerrit.libreoffice.org/83119 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/83296
2019-11-17tdf128684: Rotate text in not preset custom shapeTamas Bunth
The TextPreRotateAngle property should be set in case of a not preset custom shape as well during ooxml import. Also add unit test for testing the TextPreRotateAngle property. Change-Id: Ib5b822286f8a78fe8398bf7e2014a36d7e0a24d5 Reviewed-on: https://gerrit.libreoffice.org/82643 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> (cherry picked from commit 742f59eaa38a3f13b6110573b1428de45c55b035) Reviewed-on: https://gerrit.libreoffice.org/83020 Reviewed-by: Andras Timar <andras.timar@collabora.com>