/git-hooks/

'> cgit logo index : lo/core
LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/drawinglayer/source/texture/texture.cxx
AgeCommit message (Collapse)Author
2024-07-29cid#1554812 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1555227 COPY_INSTEAD_OF_MOVE cid#1555329 COPY_INSTEAD_OF_MOVE cid#1555384 COPY_INSTEAD_OF_MOVE cid#1555387 COPY_INSTEAD_OF_MOVE cid#1555399 COPY_INSTEAD_OF_MOVE cid#1555400 COPY_INSTEAD_OF_MOVE cid#1555406 COPY_INSTEAD_OF_MOVE Change-Id: I85dc45e2686c6b3e8b97a23872cb26416edc27c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171178 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-18tdf#160084 Simplify comparing with zero when using fToolsRMZeroFour
As part of the efforts in #160084 to simplify parts of the codebase by replacing basegfx::fTools::more/less calls with direct comparisions against zero, this commit performs the changes in a few files in the drawinglayer/ module. PS-2: Fix wrong identifier, courtesy of an accidental backspace press... Change-Id: I52a183dda5ae11989f8ffc8b26ff16ac77d6ebb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165600 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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-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-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-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-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-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-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-22MCGR: Adapted GradientLinear to make use of MCGRArmin Le Grand (allotropia)
Added to make GradientLinear work using the MCGR as 1st of six types. Had to do quite some tickeling to get it all work, but looks good. Five more to go, already started to put some things to tooling to make re-usable for the other types. Besides adapting this the main change is that the adaption of defined step-count (versus automatic) has to be done in modifyBColor now instead of the back-mapping methods (e.g. getLinearGradientAlpha). It is still 100% backward-compatible, so as long as there is no source using this it will stay invisible - by purpose. I started to do quite some tests (and fixes/ adaptions in consequence), see the static variable nUseGradientSteps. If you want to play with this, you might set it to '1' instead of '0' and use a linear gradient on an object. Change-Id: I9d61934defb0674456247f2879f0a89b6a5e50f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147413 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-15MCGR: Add GradientSteps to GeoTexSvxGradientArmin Le Grand (allotropia)
Move GradientSteps data to GeoTexSvxGradient and adapt interfaces. Also move tooling to more isolated place in gradienttools in basegfx. Keep everything still compatible, the work will be now to adapt all six different derivations of GeoTexSvxGradient to make use of the evtl. given GradientSteps. Change-Id: Iaa212763c603d46de0a94b1b203b979bb7ce359d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147050 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-02tdf#136370 Very large Shape with pattern/hatch makes scrolling slowNoel Grandin
reduce some time spent in the 3-d rendering Change-Id: I5d622799bc101b5b988d382a039b5a3b03818d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139256 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-31clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I95918275653714577e2d6728dd3947c7fbb66d8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-19loplugin:flatten in drawinglayerNoel Grandin
Change-Id: Ieb5f682ec627c8d8ddfc286ec0e4422104b4d847 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92494 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14drawinglayer: refactor GeoTexSvxTiled::iterateTilesMark Hung
to provide a more generic callback interface and expose it as public to allow other usage. Change-Id: I6bc62a05fee750586f7281d8c24f2133884e77ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-21move headers inside modulesNoel Grandin
Change-Id: Iad5c414861eb807e6246b8a988b94d66ef5f687d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-09drawinglayer: move getRandomColorRange to be private to GeoTexSvxTomaž Vajngerl
Change-Id: I9b306277a67b793ffd065d40446909ac59da0641 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90190 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-20clang-tidy modernize-concat-nested-namespace in drawinglayerNoel Grandin
Change-Id: If2644743ab0d9b78d42d1d2fe6fa22c83472d2c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-11Drop o3tl/clamp.hxx, use C++17 std::clamp insteadStephan Bergmann
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: https://gerrit.libreoffice.org/66177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-17Consolidate: basegfx::clamp -> o3tl::clampStephan Bergmann
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1 Reviewed-on: https://gerrit.libreoffice.org/59265 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-12More loplugin:cstylecast: drawinglayerStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I38baea4d1dd354e48eb90fc2fc385ef60485b5e3
2017-10-23loplugin:includeform: drawinglayerStephan Bergmann
Change-Id: I52693e59a37e36fa0bb21732efe90af84fe6d6c6
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-22<drawinglayer/tools/converters.hxx> can be internal to drawinglayerTor Lillqvist
And while moving it, get rid of the 'drawinglyer::tools' subnamespace. Less potential confusion with the global 'tools' namespace. Change-Id: Iab3c25be0cec7f3d182228d122837e9f2ac9a529 Reviewed-on: https://gerrit.libreoffice.org/42619 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2017-05-02loplugin:checkunusedparams in drawinglayerNoel Grandin
Change-Id: Ib497b284a80fae69930f226d2e70368cb9e962ef Reviewed-on: https://gerrit.libreoffice.org/37072 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-17Drop :: prefix from std in [de]*/Tor Lillqvist
Change-Id: I3247894fe022dce7f0aa351bd85fefcd7c545dd4 Reviewed-on: https://gerrit.libreoffice.org/34377 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-07-07tdf#82214 optimize performance for primitivesArmin Le Grand
See svg bug doc, which is processed quite slowly. Beyond needing faster renderers, there is also demand to improve the handling of primitives created by SVG import. Conflicts: drawinglayer/source/primitive2d/patternfillprimitive2d.cxx vcl/win/gdi/gdiimpl.cxx Change-Id: I10992a5746b8b2d6b50e3ee3fe415a035685c9ba
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-10-25tdf#39440: fix several warnings reported by cppcheckSerge Krot
Change-Id: I560d28b7cc67740c6479494d0e5aa62d2ac6ffae Reviewed-on: https://gerrit.libreoffice.org/19587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-09-30Fix typosAndrea Gelmini
Change-Id: I9dbe1e05cf73af20c25392e639a807854e87fc6e Reviewed-on: https://gerrit.libreoffice.org/18946 Reviewed-by: Oliver Specht <oliver.specht@cib.de> Tested-by: Oliver Specht <oliver.specht@cib.de>
2014-10-06use comphelper::rng::uniform_*_distribution everywhereCaolán McNamara
and automatically seed from time on first use coverity#1242393 Don't call rand coverity#1242404 Don't call rand coverity#1242410 Don't call rand and additionally allow 0xFF as a value coverity#1242409 Don't call rand coverity#1242399 Don't call rand coverity#1242372 Don't call rand coverity#1242377 Don't call rand coverity#1242378 Don't call rand coverity#1242379 Don't call rand coverity#1242382 Don't call rand coverity#1242383 Don't call rand coverity#1242402 Don't call rand coverity#1242397 Don't call rand coverity#1242390 Don't call rand coverity#1242389 Don't call rand coverity#1242388 Don't call rand coverity#1242386 Don't call rand coverity#1242384 Don't call rand coverity#1242394 Don't call rand Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf