summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2023-05-31Fix typoAndrea Gelmini
Change-Id: Ie108cc69cfd0d0e2837de3f1d38329f578866bd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152461 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31Fix typoAndrea Gelmini
Change-Id: I4b877a06c1fc09fa866c29dc39cb9478a50581b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152459 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31Fix typoAndrea Gelmini
Change-Id: I0dfd64a270a2b669bceba435c2e01472ecf277f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152462 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31MCGR: tdf#155437 handling of TransparencePrimitive2D for metafilesArmin Le Grand (allotropia)
In VclMetafileProcessor2D we need to take care of changed circumstances for gradients with the MCGR adaptions. The method processTransparencePrimitive2D tries to detect the special case that the trapsparency part of the handled TransparencePrimitive2D is a single TransparencyGradient. If detected, this is handed directly to vcl using a MetaFloatTransparentAction which contains a class 'Gradient', but the limited form from vcl (see include/vcl/gradient.hxx). This class can only in very limited scenarios directly handle/hold a gradient from the model (even before MCGR). For that case there is the helper method 'cannotBeHandledByVCL' that is already used to decide if limited direct rendering using vcl can be used. This has also be used here. Also reworked the conversion to Bitmap as needed, the existing versions created slight errors. For more details see additional comments in the code. Change-Id: If9af8b1423df5354eaf9ba8ca6243a1b3ad1b965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152392 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-18improved B2DHomMatrixNoel Grandin
since we know that this is a matrix only used for 2D transforms, we know that the last row of the matrix is always { 0, 0, 1 }. Therefore, we don't need to store that information, and we can simplify some of the computations. Also remove operations like operator+ which are not legal for such a matrix. Change-Id: I482de9a45ebbedf79e3b6033575aab590e61c2d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151909 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-18Fix typoAndrea Gelmini
Change-Id: I7a79c2a4d145d1d847d71e5b36ccdb42278b06cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151946 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I006c882aacf316dda0ecb3302835ca021d45ecc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151812 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I77c647c513c4b605917888bd9054385b2f7f7bf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151814 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I77c5760a38b07541eaceae765cd0e14eaddb6d11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151818 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Idce8a85c80c21ee4667810ec6f397389077432d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151810 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Ib9150f390574dc9467335451f42a10749bd915d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151811 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Id6f8a07f62e5861c4ad37b4537436632243b1a1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151809 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-15MCGR: consolidations/cleanups for changes so farArmin Le Grand (allotropia)
Change-Id: I85cf40e4803b0485bb40349d8e81adc8123666c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151706 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-09MCGR: Correct interpolate TextureMap due to possible zero valueArmin Le Grand (allotropia)
Change-Id: I5b2fe354077bea659f522e5b5c839be1f4cae1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151568 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-08Avoid more division by zeroStephan Bergmann
Similar to <https://gerrit.libreoffice.org/c/core/+/151495> "Avoid division by zero", CppunitTest_sw_ooxmlexport7 CPPUNIT_TEST_NAME=testFdo78957::TestBody started to fail with > drawinglayer/source/texture/texture.cxx:470:71: runtime error: division by zero > #0 in drawinglayer::texture::GeoTexSvxGradientRadial::appendTransformationsAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) at drawinglayer/source/texture/texture.cxx:470:71 > #1 in drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) const at drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:99:31 > #2 in drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D(drawinglayer::primitive2d::FillGradientPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:1017:24 > #3 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:363:13 > #4 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #5 in drawinglayer::processor2d::VclProcessor2D::RenderMaskPrimitive2DPixel(drawinglayer::primitive2d::MaskPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:866:9 > #6 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:257:13 > #7 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #8 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #9 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #10 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #11 in drawinglayer::processor2d::VclPixelProcessor2D::processPolyPolygonGradientPrimitive2D(drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:490:9 > #12 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:232:13 > #13 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #14 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #15 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #16 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #17 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #18 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #19 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #20 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #21 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #22 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #23 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #24 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #25 in drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const at include/drawinglayer/primitive2d/groupprimitive2d.hxx:76:90 > #26 in drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/groupprimitive2d.cxx:53:13 > #27 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #28 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #29 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #30 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #31 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #32 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #33 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #34 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #35 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #36 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #37 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #38 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #39 in drawinglayer::convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::geometry::ViewInformation2D const&, unsigned int, unsigned int, unsigned int) at drawinglayer/source/tools/converters.cxx:217:24 > #40 in drawinglayer::convertPrimitive2DContainerToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&&, basegfx::B2DRange const&, unsigned int, o3tl::Length, std::optional<Size> const&) at drawinglayer/source/tools/converters.cxx:332:28 > #41 in SvxShape::GetBitmap(bool) const at svx/source/unodraw/unoshape.cxx:717:21 > #42 in SvxShape::getPropertyValueImpl(rtl::OUString const&, SfxItemPropertyMapEntry const*, com::sun::star::uno::Any&) at svx/source/unodraw/unoshape.cxx:2597:18 > #43 in SvxCustomShape::getPropertyValueImpl(rtl::OUString const&, SfxItemPropertyMapEntry const*, com::sun::star::uno::Any&) at svx/source/unodraw/unoshap2.cxx:1780:26 > #44 in SvxShape::_getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx:1638:14 > #45 in SvxShape::getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx:1622:16 > #46 in non-virtual thunk to SvxShape::getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx > #47 in SwXShape::_getPropAtAggrObj(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx:1823:23 > #48 in SwXShape::getPropertyValue(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx:1753:20 > #49 in non-virtual thunk to SwXShape::getPropertyValue(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx > #50 in writerfilter::TagLogger::unoPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&) at writerfilter/source/dmapper/TagLogger.cxx:123:47 > #51 in writerfilter::dmapper::DomainMapper_Impl::PushShapeContext(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/DomainMapper_Impl.cxx:4204:38 > #52 in writerfilter::dmapper::DomainMapper::lcl_startShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/DomainMapper.cxx:3680:18 > #53 in writerfilter::LoggedStream::startShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/LoggedResources.cxx:139:5 > #54 in writerfilter::ooxml::OOXMLFastContextHandlerShape::sendShape(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1810:19 > #55 in writerfilter::ooxml::OOXMLFastContextHandlerShape::lcl_endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1829:9 > #56 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:223:9 > #57 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27 > #58 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1330:17 > #59 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18 > #60 in xmlParseEndTag2 at workdir/UnpackedTarball/libxml2/parser.c:9742:2 > #61 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11642:14 > #62 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:12351:13 > #63 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1111:25 > #64 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:891:9 > #65 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1469:13 > #66 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:515:18 > #67 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at writerfilter/source/dmapper/DomainMapper_Impl.cxx:9143:14 > #68 in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>>) at writerfilter/source/dmapper/DomainMapper.cxx:4390:14 > #69 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>>) at writerfilter/source/dmapper/LoggedResources.cxx:272:5 > #70 in writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&, unsigned int) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:126:13 > #71 in writerfilter::ooxml::OOXMLDocumentImpl::resolveHeader(writerfilter::Stream&, int, rtl::OUString const&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:385:10 > #72 in writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader(int, rtl::OUString const&) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:888:35 > #73 in writerfilter::ooxml::OOXMLHeaderHandler::finalize() at writerfilter/source/ooxml/Handler.cxx:214:20 > #74 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleHdrFtr() at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1113:28 > #75 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at workdir/CustomTarget/writerfilter/source/ooxml/OOXMLFactory_wml.cxx:7482:26 > #76 in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at writerfilter/source/ooxml/OOXMLFactory.cxx:157:19 > #77 in writerfilter::ooxml::OOXMLFastContextHandler::endAction() at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:316:5 > #78 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1034:9 > #79 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:223:9 > #80 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27 > #81 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1330:17 > #82 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18 > #83 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11493:8 > #84 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:12351:13 > #85 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1086:21 > #86 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:891:9 > #87 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1469:13 > #88 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:515:18 > #89 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/WriterFilter.cxx:208:24 > #90 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2272:34 > #91 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:739:23 > #92 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1940:36 > #93 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:720:28 > #94 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37 > #95 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20 > #96 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:308:5 > #97 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:168:14 > #98 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:593:16 > #99 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx > #100 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62 > #101 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:115:11 > #102 in SwModelTestBase::loadURL(rtl::OUString const&, char const*, char const*) at sw/qa/unit/swmodeltestbase.cxx:470:20 > #103 in SwModelTestBase::load(char const*, char const*) at sw/qa/inc/swmodeltestbase.hxx:353:16 > #104 in SwModelTestBase::loadAndSave(char const*) at sw/qa/unit/swmodeltestbase.cxx:523:5 > #105 in testFdo78957::TestBody() at sw/qa/extras/ooxmlexport/ooxmlexport7.cxx:783:5 Change-Id: Ifbc7da0b6c971df61e9908cc02b10a9f50769fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151496 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-08Avoid division by zeroStephan Bergmann
bb198176684c3d9377e26c04a29ec66deb811949 "MCGR: Make MCGR default for oox im/export, cleanup" started to cause CppunitTest_chart2_geometry CPPUNIT_TEST_NAME=Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import to fail with the below UBSan failure (even though the relevant code appears to be even older than that commit). At least for now, lets silence that by explicitly using +INF in case the divisor is zero (and the dividend is known non-negative). > /drawinglayer/source/texture/texture.cxx:246:71: runtime error: division by zero > #0 0x7f2e61d80f7f in drawinglayer::texture::GeoTexSvxGradientLinear::appendTransformationsAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) /drawinglayer/source/texture/texture.cxx:246:71 > #1 0x7f2e616e187d in drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:75:31 > #2 0x7f2e616e4f4f in drawinglayer::primitive2d::FillGradientPrimitive2D::createFill(drawinglayer::primitive2d::Primitive2DContainer&, bool) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:172:17 > #3 0x7f2e616e66ca in drawinglayer::primitive2d::FillGradientPrimitive2D::create2DDecomposition(drawinglayer::primitive2d::Primitive2DContainer&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:269:17 > #4 0x7f2e76cecd04 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:36:9 > #5 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #6 0x7f2e61a38a25 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:917:13 > #7 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #8 0x7f2e61a5cc3e in drawinglayer::processor2d::VclMetafileProcessor2D::processMaskPrimitive2D(drawinglayer::primitive2d::MaskPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2139:13 > #9 0x7f2e61a3734a in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:833:13 > #10 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #11 0x7f2e619b952c in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #12 0x7f2e76ced03a in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #13 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #14 0x7f2e61a595e3 in drawinglayer::processor2d::VclMetafileProcessor2D::processPolyPolygonGradientPrimitive2D(drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2014:9 > #15 0x7f2e61a36fc0 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:821:13 > #16 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #17 0x7f2e61a2e0da in drawinglayer::processor2d::VclMetafileProcessor2D::impDumpToMetaFile(drawinglayer::primitive2d::Primitive2DContainer const&, GDIMetaFile&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:244:5 > #18 0x7f2e61a60f4a in drawinglayer::processor2d::VclMetafileProcessor2D::processTransparencePrimitive2D(drawinglayer::primitive2d::TransparencePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2292:52 > #19 0x7f2e61a378cb in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:851:13 > #20 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #21 0x7f2e619b952c in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #22 0x7f2e76ced03a in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #23 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #24 0x7f2e61a38a25 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:917:13 > #25 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #26 0x7f2e61a68781 in drawinglayer::processor2d::VclMetafileProcessor2D::processObjectInfoPrimitive2D(drawinglayer::primitive2d::ObjectInfoPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:965:5 > #27 0x7f2e61a38916 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:910:13 > #28 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #29 0x7f2df2676731 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) /svx/source/sdr/contact/objectcontactofpageview.cxx:277:31 > #30 0x7f2df26741be in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) /svx/source/sdr/contact/objectcontactofpageview.cxx:117:21 > #31 0x7f2df291809d in SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/sdrpagewindow.cxx:357:28 > #32 0x7f2df363584c in SdrPageView::CompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpagv.cxx:239:18 > #33 0x7f2df36a80b0 in SdrPaintView::DoCompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpntv.cxx:609:21 > #34 0x7f2df36a7b61 in SdrPaintView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpntv.cxx:522:5 > #35 0x7f2df3ec0413 in (anonymous namespace)::GraphicExporter::GetGraphic((anonymous namespace)::ExportSettings const&, Graphic&, bool) /svx/source/unodraw/UnoGraphicExporter.cxx:740:24 > #36 0x7f2df3ec857b in (anonymous namespace)::GraphicExporter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /svx/source/unodraw/UnoGraphicExporter.cxx:1037:19 > #37 0x7f2db53f082a in chart::ChartView::getMetaFile(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, bool) /chart2/source/view/main/ChartView.cxx:263:20 > #38 0x7f2db53f1d43 in chart::ChartView::getTransferData(com::sun::star::datatransfer::DataFlavor const&) /chart2/source/view/main/ChartView.cxx:285:11 > #39 0x7f2db53f28ae in non-virtual thunk to chart::ChartView::getTransferData(com::sun::star::datatransfer::DataFlavor const&) /chart2/source/view/main/ChartView.cxx > #40 0x7f2db586547f in chart::ChartModel::getPreferredVisualRepresentation(long) /chart2/source/model/main/ChartModel.cxx:1054:44 > #41 0x7f2db586779e in non-virtual thunk to chart::ChartModel::getPreferredVisualRepresentation(long) /chart2/source/model/main/ChartModel.cxx > #42 0x7f2db8401589 in OCommonEmbeddedObject::getPreferredVisualRepresentation(long) /embeddedobj/source/commonembedding/visobj.cxx:186:48 > #43 0x7f2e95742555 in comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream(long, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&, rtl::OUString*) /comphelper/source/container/embeddedobjectcontainer.cxx:1428:54 > #44 0x7f2e9573f6b4 in comphelper::EmbeddedObjectContainer::StoreAsChildren(bool, bool, bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) /comphelper/source/container/embeddedobjectcontainer.cxx:1198:31 > #45 0x7f2e044c7a1f in SfxObjectShell::SaveAsChildren(SfxMedium&) /sfx2/source/doc/objstor.cxx:3316:38 > #46 0x7f2e044c6d0c in SfxObjectShell::SaveAs(SfxMedium&) /sfx2/source/doc/objstor.cxx:160:12 > #47 0x7f2e0c509471 in sd::DrawDocShell::SaveAs(SfxMedium&) /sd/source/ui/docshell/docshel4.cxx:602:33 > #48 0x7f2e0453a4ec in SfxObjectShell::SaveAsOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3256:16 > #49 0x7f2e0c513d7d in sd::DrawDocShell::SaveAsOwnFormat(SfxMedium&) /sd/source/ui/docshell/docshel4.cxx:924:28 > #50 0x7f2e044f8b0c in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1457:23 > #51 0x7f2e04534ef5 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2993:39 > #52 0x7f2e0452c40c in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2783:9 > #53 0x7f2e04486556 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t> >, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objserv.cxx:319:19 > #54 0x7f2e046d7afe in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) /sfx2/source/doc/sfxbasemodel.cxx:3151:42 > #55 0x7f2e046de8db in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1785:13 > #56 0x7f2dff75b078 in UnoApiTest::save(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:174:16 > #57 0x7f2e63063d61 in Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() /chart2/qa/extras/chart2geometry.cxx:322:5 (<>https://ci.libreoffice.org//job/lo_ubsan/2766/) Change-Id: I72650fba2ee7ba339ec78d24dd690487c31e2600 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151495 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-07use AlphaMask for variables when calling GetAlphaMaskNoel Grandin
Right now this doesn't make any difference, since Bitmap is the superclass of AlphaMask. But when I switch to using alpha instead of transparency, passing AlphaMask around is going to mean something different to passing plain Bitmap around. Change-Id: Ic1541e5f0a3b97331793cd23e23115faa7f382b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151463 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-28Move all handling of AA allowing from svt to drawinglayerMike Kaganski
Commit 444bf8710d5da7b584fbcb94693e4ed8d2e29297 (Update handling of AntiAliasing settings and processor2d, 2022-11-08) moved the actual variable holding the AA state to drawinglayer, which introduced a duplication of the information. This moves all the handling from svt to drawinglayer, so that svt functions only use respective drawinglayer functions. Well, almost: the IsAAPossibleOnThisSystem function needs vcl, so stays in svt. Change-Id: I887307fbca1ca0cff1f5f32446e3599817099c3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151163 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-27EMF+ tdf#103859 Optimize EmfPlusFillRects and EmfPlusDrawRectsBartosz Kosiorek
Change-Id: Iac96cf2d4291646fb69cc87c471d2f68ed905d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-24EMF+ Minor optimization and clean up code of DrawBeziersBartosz Kosiorek
Change-Id: Id560b3d3a6182270853fd05a6f2d1e44452c0013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150894 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-23tdf#154789 EMF+ Performance boost of the EmfPlusRecordTypeDrawBeziersBartosz Kosiorek
There is several benefits of such performance optimization: 1. We are drawing single curve instead of hundreds of small curves. In the loop we are creating single Polygon and outside of the loop we are invoking EMFPPlusDrawPolygon drawing method only once. As https://bugs.documentfoundation.org/attachment.cgi?id=186725 image is using single EmfPlusRecordTypeDrawBeziers EMF+ record with hundreds of curves, with using single EMFPPlusDrawPolygon call, there is no lnger need for individual line creation (e.g. line color, weight, line caps, line joints, line dashes, etc.) - The PDF export performance without optimizations of the https://bugs.documentfoundation.org/attachment.cgi?id=186725: time ./instdir/program/soffice --headless --convert-to "pdf:writer_pdf_Export" --outdir ~ ~/Pobrane/problem.docx real 24m18,471s user 2m56,004s sys 1m37,816 - The PDF export performance with optimizations: real 0m37,527s user 0m37,004s sys 0m0,531s - With Libreoffice 7.5.2 from Ubuntu 22.04, the conversion was crashed. 2. The PDF export for document: https://bugs.documentfoundation.org/attachment.cgi?id=186725 was not working correctly for me. The original image is containing chart. Without optimization, the exported chart was empty. Current export is working correctly, and graph is visible. 3. The standard opening of the document from https://bugs.documentfoundation.org/attachment.cgi?id=186725 is now much faster. The zooming in, move image operations are also noticible faster. Change-Id: Ic77d4c20a462587bb5da4a4df757e30c5ca04fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150821 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-22tdf#154957 Revert "use OutputDevice clipping if its just a set of rectangles"Caolán McNamara
it was an attempt at an optimization, but if it doesn't work just revert it. The non-antialias case also doesn't work so the reverted commit wasn't itself the problem but the existing path has some flaw I'm not going to invest in figuring out. This reverts commit ee0d5e7bb8614c50e71dd074b8440f412eb62ff3. Change-Id: I8d4f126e3bfe135d39a085f28cea6708ae8f833f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150773 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-21MCGR: Reduce diverse GradientStyle enums to single UNO API oneArmin Le Grand (allotropia)
Change-Id: Ie0cd26a308a75ddead9451c53e874a39cc6eeb63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150705 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-04-18tdf#150020 pptx import: handle algn for outerShdwSarper Akdemir
Introduces RectangleAlignmentItem that holds a value of the enum model::RectangleAlignment. Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow. Implements import of algn for outerShdw. Makes the alignment considered while the shadow is being scaled. Also adds a unit test that covers this. Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
2023-04-06tdf#152234 drawinglayer: PDF/UA export: fallback for unsupported formsMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.1, Test number: 3 Content shall be marked as Artifact or tagged as real content Form element can only be used for those form controls for which PDFWriterImpl can produce a Widget annotation; see createDefaultWidget(). For a label control, it's not editable so it's not a PDF widget. For an image button, it could be implemented in VCL but isn't currently. So a fallback is required in any case, "Figure" or "Div" can be used. Change-Id: I454030ff7c67a8a8101fcc59e945fe9dbc5f87a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150059 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-04-04MCGR: Improve performance for texture-mapped MCGR processingArmin Le Grand (allotropia)
Change-Id: I20b32e7c272112c6c3d9f7ee0ef59c6d4d006d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150020 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-04-04tdf#152234 vcl,drawinglayer: PDF/UA export: produce Role for form controlsMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.18.4, Test number: 2 If the Form element omits a Role attribute (Table 348), it shall have only one child: an object reference (14.7.4.3) identifying the widget annotation per ISO 32000-1:2008, 14.8.4.5, Table 340. LO forms produce both page content in an MCID and an /Annot, so Role is needed. Change-Id: Ic231931a7c35d8da37ca76e02d97501edb43347c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149626 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-04-02SDPR: Use currently added lambda to render GradientsArmin Le Grand (Allotropia)
Change-Id: I9fba920c60690f136cae956dae17e2f5e5081f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149839 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-27tdf#152234 drawinglayer,svx: PDF/UA export: add Alt text to form controlsMichael Stahl
Specification: ISO 14289-1:2014, Clause: 7.18.1, Test number: 3 A form field whose hidden flag is not set and whose rectangle is not outside the crop-box shall have a TU key present or all its Widget annotations shall have alternative descriptions (in the form of an Alt entry in the enclosing structure elements) Form controls are weird because they have an SdrObject with the usual name/title/description plus a property "HelpText" on the control itself which is already exported as "/TU" on the /Annot unless it's empty. Exporting the SdrObject properties via ObjectInfoPrimitive2D doesn't work as tragically that is only created for form controls when painting to the screen while PDF export takes a detour that needs special handling. Change-Id: Id96f7dd13f190ab439c099cd1f4acb70c1c9fdc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149554 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-03-26Fix typosAndrea Gelmini
Change-Id: Ib2c8055cc3caae5bab476609f8097046f1981f11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149536 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-24Fix typoAndrea Gelmini
Change-Id: I8106dc197585b823b52d675698533e8a5167819b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149537 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-24drawinglayer: remove obsolete commentMichael Stahl
The code is now in vcl/source/gdi/formpdfexport.cxx Change-Id: I07ca1d87eedadc9778e08a491a77adc88f393586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149468 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-03-23MCGR: Speedup Gradient Paint for VCLPixelProcessorArmin Le Grand (allotropia)
To do this, I re-organized FillGradientPrimitive2D and how it creates it's decompose. This provides the needed tooling to also do a more direct rendering in primitive processors if needed. The decompose no longer collects the matrices & colors as a 1st step in a helper data struecture (so I removed B2DHomMatrixAndBColor). It now uses a lambda function callback that hands over the matrix & color for each created step, so you can process it directly, in this case to create the needed primitives. NOTE: The decompositions are both tested. There was createNonOverlappingFill, but also createOverlappingFill that I am not sure is still used - and if in re-creating an old, strange XOR-using gradient paint mechanism in old metafiles (encapsulated with gradient info anyways), but I converted that and made sure it works. To do so I forced it to be used in paint. This is not really usable in paint since we need to paint using AA (else we would get staircase effects, esp. in new 'hard' color changes in multi-color gradients) and - as should be known - same edges painted in AA do *not* add up to full opacity, but leave behind awful 'jaggies' (e.g. opacity 0.5 and 0.5 create 0.75 and *not* 1.0). Still important to have the working geometry creation for this case. This already makes the decompose faster, but the main purpose is to use it as tooling for painting in own primitive renderers. Thus processFillGradientPrimitive2D now uses that instead of using the decomposition by default. This avoids one level of primitive creation, use that new FillGradientPrimitive2D tooling to directly create needed geoemtry & color for getting better performance (to partially compensate for potentially more expensive multi color gradients). It then paints directly using OutputDevice calls. NOTE: This can also be used in SDPRs as a 1st step to just directly and rapidly render filled single- color polygons, but of course there an implementation using the back-transformations (which are also adapted for MCGRs aleady and work) will be superior. Change-Id: I5079f76d6d8fe86007a098614c276447f2bfebce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149456 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-22MCGR: Corrected error with Case16 wrong gradient shortcutArmin Le Grand (allotropia)
Also simplified using the test cases, these now depend on an ENV VAR called MCGR_TEST. Fallback is no test. For seeing a multi-color gradient use 1, for Case16 use 16. If active, all gradients are replaced with the one active for the test, 2D and 3D. This is temporary but also for pro build to check for speed there. Change-Id: I90f3c7e59d9d0a3e070a849af3f9ea1c9e5462a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149316 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-22vcl,drawinglayer,svx,sw,sd: PDF/UA export: Annot StructElem for SdrMediaObjMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.18.1, Test number: 1 An annotation, excluding annotations of subtype Widget, Popup or Link, shall be nested within an Annot tag This is very similar to Link annotations, that is to say, extremely complicated to get it thought the convoluted PDF export code, with additional complication that the StructElem is produced by drawinglayer and the page annotation by sw. Put another map into PDFExtOutDevData where sw code puts stuff for the SdrObject that drawinglayer can find. The test had the problem that PDFObjectParser::parse() could not handle: <</Nums[ 0 [ 6 0 R ] 1 6 0 R ]>> Fix dropping the "1". Change-Id: If5bf7c552e26ebb7e631030b8aaecd4281e77acc (cherry picked from commit c78e90bd28cc4d6d3bde473535107784b12d9c0d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149008 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-03-22Fix typosAndrea Gelmini
Change-Id: Iaf63fce5295f00e5d6fff020498a01a25fc0ee93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149262 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-21MCGR: Model data changes for ColorSteps (II)Armin Le Grand (allotropia)
The biggest change here is to allow multiple ColorStops with the same Offset. That allows to define gradients with 'hard' color changes at any place using two ColorStops with the same Offset and different Colors. This required quite some adaptions, but works well. Also removed in this context checking for all Colors being the same to not mix up things. Also works well. Also changed the need for having Start/EndColors AKA ColorStops for 0.0 and 1.0 in place, instead 'imply' the 1st ColorStop to also define the StartColor and the last one the EndColor. This allows e.g. Gradient definitions with two GradientStops at the same Offset e.g. 0.5 with different colors to already define a full Gradient. Also added a tooling method to reverse ColorSteps, which changes the order and mirrors the Offsets (what even keeps an existing sort valid). This is useful e.g. for GradientAxial which is the only one where for decomposition the Gradient had to be interpreted 'reverse' since it's defined from center to edge, but for creating correct filled polygons to represent this the inverse order had to be used, creating polygons from edge to center. This led to 'wild' code for this one of six cases and prevented unifications with the other cases (also made your brain flip). Thus I adapted this now to use the reversed ColorSteps consequently, and the same principle loops than the other implementations to make things easier for the future and to use common tooling. Change-Id: If2943348d17d5b9cd165f4d78f22638a1dff5237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149208 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-19MCGR: Model data changes for ColorStepsArmin Le Grand (allotropia)
Added tooling replaceStart/EndColor to allow simple transition for code that does not immediately adapt to multi color gradients. Also added createColorStepsFromStartEndColor for the same purpose. Adapted XGradient to no longer have Start/EndColor at all, but only use ColorSteps. Adapted all usages of XGradient to no longer use Get/Set/Start/EndColor, but access the ColorSteps instead. Replaced quite some XGradient constructors that used XGradient() as Start/EndColor since this is already the default. Adapted ColorBlending to black AKA Start/EndIntens in XGradient to work now on all ColorSteps in the required linearly-scaled manner. UNO API changes: Added com::sun::star::awt::ColorStep as basic data element that holds a pair of Offset and Color. Added com::sun::star::awt::ColorStepSequence to handle an array of sorted entries. Added com::sun::star::awt::Gradient2 derived from com::sun::star::awt::Gradient, extended by the needed com::sun::star::awt::ColorStepSequence. Added MID_GRADIENT_COLORSTEPSEQUENCE to UNO API to provide access to ColorSteps directly. Adapted XFillGradientItem::QueryValue/PutValue to make use of new UNO API data structures. To do so, added tooling methods for data transition: - fillColorStepSequenceFromColorSteps - fillGradient2FromXGradient - fillColorStepsFromAny - fillXGradientFromAny and adapted - case '0' (all data) - MID_FILLGRADIENT - MID_GRADIENT_COLORSTEPSEQUENCE - MID_GRADIENT_START/ENDCOLOR to make use of these. Tested usage of these in the office. Renamed from GradientStep to GradientStop after discussions with members on the list to make this closer related to other norms/definitions. Also renamed classes and class members to better reflect to GradientStop, so grepping/finding will be easier (e.g. 'Color' just exists pretty often, but 'StopColor' is more precise). Changed the used UNO API class for reprsenting the Color to better reflect to ranges [0.0 .. 1.0] and usage of RGB. Change-Id: I1eeb3e97e81d6785967615d1ff256551fc3b882d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148849 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-09crashtesting: assert seen on load of moz1297206-1.svgCaolán McNamara
Change-Id: Ide16b0086ef81bb9580b93f63c2c5220459d74d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148478 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-05Fix typoAndrea Gelmini
Change-Id: I511583f0b8ce586fe9e6c3096597f0410c55b9fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148263 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-04MCGR: ColorSteps handling moved to toolingArmin Le Grand (allotropia)
Due to the fact that handling of a vector GradientSteps will get used more often with ongoing changes I moved some handling to tooling, see sortAndCorrectColorSteps. That method sorts and corrects a vector of ColorSteps so that only valid entreis remain in a sorted order, for details please refer to the docu at function definition. I took the occasion to rearrange that to work on the single provided vector which is better for speed & ressources. Also changed the ColorStep constructor to not automatically correct constructed entries: While that is formally correct, it moves an invalid entry to 0.0 or 1.0, thus creating additional wrong Start/EndColor entries. Those may then 'overlay' the correct entry when corrections are applied to the vector of entries which leads to getting the wanted Start/EndColor to be factically deleted, what is an error. Also rearranged FillGradientAttribute to now work initially with ColorSteps, no longer requires the Start/EndColor, also adapted all usages. This securely allows start/end and in-between single-color sections in gradients. Also needed to re-formulate GradientRect & GradientElliptical ::appendTransformationsAndColors method for correct 2D mapping(s) - always incrementing from the start to end conflicts with the adaption of the start value for the inner loop mainly because increment is at start of inner loop (pre-increment). Corrected errors from clang plugin, but also some wrong initialiations for basegfx::ColorSteps. Change-Id: I292592ed9abcfa591f68a680479f4fcdda46cbeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148196 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-02tdf#153672 Use RelativeMapMode so text in gdis are scaled/offset correctlyCaolán McNamara
otherwise it overrides the outer GdiMetaFiles efforts to position the origin and the text is rendered off-canvas in this scenario Change-Id: If81692dce81fb6f00d5051228e1de13cdcae1770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148136 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-01Fix typoAndrea Gelmini
Change-Id: I6bc3777231bada3a1abf2a1e57645d9ceb93acb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148048 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-01MCGR: support ColorSteps in emf exportArmin Le Grand (allotropia)
Change-Id: I7a784587dd86efee0934fdead26f615ba7f396e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147960 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-01Fix typoAndrea Gelmini
Change-Id: I46f400646bc7d2b7456d294290dc2e159ba14874 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147966 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-27MCGR: Adapted other Gradient* to make use of MCGRArmin Le Grand (allotropia)
Added to make GeoTexSvxGradientElliptical GeoTexSvxGradientSquare GeoTexSvxGradientRect work using the MCGR. It is still 100% backward-compatible, so as long as there is no source using this it will stay invisible - by purpose. Tests look good with all three, see the static variable nUseGradientSteps. NOTE: GeoTexSvxGradientElliptical still looks not optimal due to texture back-mapping method getEllipticalGradientAlpha, see notes in commit "MCGR: Adapted GradientRadial to make use of MCGR" ac824594c577ab4880177b3411a25297b1d08074 Change-Id: I56b82b867af88fe532f840dde15e0f5c299ed6a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147662 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-25Fix typoAndrea Gelmini
Change-Id: I17a06f2cce87f6f6edb3517750e9869de9cdd5b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147668 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-24MCGR: Adapted GradientRadial to make use of MCGRArmin Le Grand (allotropia)
Added to make GradientRadial work using the MCGR. It is still 100% backward-compatible, so as long as there is no source using this it will stay invisible - by purpose. Tests look good with this one, see the static variable nUseGradientSteps. Change-Id: Ie7134fe2995b23ceb180c7daf3f5b2310c8a8a78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147617 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-23MCGR: Adapted GradientAxial to make use of MCGRArmin Le Grand (allotropia)
Added to make GradientAxial work using the MCGR as 2nd of six types. This one was complicated since it uses the gradient(s) 'reversed' when you look at it, from outside to inside. Had to do quite some tickeling to get it all work, but looks good now. For modifyBColor I Could re-use the started tooling as planned. To get the reverse usage working I ended up in 1st adapting the previous usage to make more use of std::iterator and reverse_iterator to be able to use the reversed state of the ColorSteps more 'controlled' as if trying to adapt the numerical indices to the vector (that ended in chaos). It is still 100% backward-compatible, so as long as there is no source using this it will stay invisible - by purpose. Tests look good with this one, see the static variable nUseGradientSteps. Change-Id: I0117ec9a24b5e55869b3e2741c67fb87b549db97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147510 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-22Fix typoAndrea Gelmini
Change-Id: Ibb51b7ea2a404156459fb7454e5260d0375fc842 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147472 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>