From d112761291b16c1d47bebdebf3169527f5e1249e Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 2 Mar 2019 23:49:57 +0100 Subject: use gfx namespace for DrawCommands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib2d97c4fee4e1bb433beeba4fb507fdc7d542af9 Reviewed-on: https://gerrit.libreoffice.org/68775 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- svgio/inc/svgvisitor.hxx | 6 +++--- svgio/qa/cppunit/SvgRead.cxx | 9 +++++---- svgio/source/svgreader/svgvisitor.cxx | 8 ++++---- svgio/source/svguno/xsvgparser.cxx | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'svgio') diff --git a/svgio/inc/svgvisitor.hxx b/svgio/inc/svgvisitor.hxx index ea56e4cd189a..46adbfb22924 100644 --- a/svgio/inc/svgvisitor.hxx +++ b/svgio/inc/svgvisitor.hxx @@ -22,8 +22,8 @@ namespace svgreader class SvgDrawVisitor : public Visitor { private: - std::shared_ptr mpDrawRoot; - std::shared_ptr mpCurrent; + std::shared_ptr mpDrawRoot; + std::shared_ptr mpCurrent; public: SvgDrawVisitor(); @@ -31,7 +31,7 @@ public: void visit(svgio::svgreader::SvgNode const& rNode) override; void goToChildren(svgio::svgreader::SvgNode const& rNode); - std::shared_ptr const& getDrawRoot() { return mpDrawRoot; } + std::shared_ptr const& getDrawRoot() { return mpDrawRoot; } }; } } diff --git a/svgio/qa/cppunit/SvgRead.cxx b/svgio/qa/cppunit/SvgRead.cxx index 9077f92db7b6..3c7974794e1b 100644 --- a/svgio/qa/cppunit/SvgRead.cxx +++ b/svgio/qa/cppunit/SvgRead.cxx @@ -84,14 +84,15 @@ void Test::test() uno::Any aAny = xSvgParser->getDrawCommands(xStream, aPath); CPPUNIT_ASSERT(aAny.has()); - DrawRoot* pDrawRoot = reinterpret_cast(aAny.get()); + gfx::DrawRoot* pDrawRoot = reinterpret_cast(aAny.get()); CPPUNIT_ASSERT_EQUAL(size_t(1), pDrawRoot->maChildren.size()); CPPUNIT_ASSERT_EQUAL(basegfx::B2DRange(0, 0, 120, 120), pDrawRoot->maRectangle); - CPPUNIT_ASSERT_EQUAL(DrawCommandType::Rectangle, pDrawRoot->maChildren[0]->getType()); - CPPUNIT_ASSERT_EQUAL(basegfx::B2DRange(10, 10, 110, 110), - static_cast(pDrawRoot->maChildren[0].get())->maRectangle); + CPPUNIT_ASSERT_EQUAL(gfx::DrawCommandType::Rectangle, pDrawRoot->maChildren[0]->getType()); + CPPUNIT_ASSERT_EQUAL( + basegfx::B2DRange(10, 10, 110, 110), + static_cast(pDrawRoot->maChildren[0].get())->maRectangle); } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/svgio/source/svgreader/svgvisitor.cxx b/svgio/source/svgreader/svgvisitor.cxx index 841a1cb7022e..9ac651c66cc7 100644 --- a/svgio/source/svgreader/svgvisitor.cxx +++ b/svgio/source/svgreader/svgvisitor.cxx @@ -24,7 +24,7 @@ namespace svgio namespace svgreader { SvgDrawVisitor::SvgDrawVisitor() - : mpDrawRoot(std::make_shared()) + : mpDrawRoot(std::make_shared()) , mpCurrent(mpDrawRoot) { } @@ -42,7 +42,7 @@ void SvgDrawVisitor::visit(svgio::svgreader::SvgNode const& rNode) double w = rSvgNode.getWidth().getNumber(); double h = rSvgNode.getHeight().getNumber(); - static_cast(mpCurrent.get())->maRectangle + static_cast(mpCurrent.get())->maRectangle = basegfx::B2DRange(x, y, x + w, y + h); } break; @@ -70,7 +70,7 @@ void SvgDrawVisitor::visit(svgio::svgreader::SvgNode const& rNode) double h = rRectNode.getHeight().getNumber(); auto pRectangle - = std::make_shared(basegfx::B2DRange(x, y, x + w, y + h)); + = std::make_shared(basegfx::B2DRange(x, y, x + w, y + h)); mpCurrent->maChildren.push_back(pRectangle); } break; @@ -80,7 +80,7 @@ void SvgDrawVisitor::visit(svgio::svgreader::SvgNode const& rNode) auto pPath = rPathNode.getPath(); if (pPath) { - auto pDrawPath = std::make_shared(*pPath); + auto pDrawPath = std::make_shared(*pPath); mpCurrent->maChildren.push_back(pDrawPath); } } diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx index 3ed675763f72..e188e43dfa6e 100644 --- a/svgio/source/svguno/xsvgparser.cxx +++ b/svgio/source/svguno/xsvgparser.cxx @@ -194,7 +194,7 @@ namespace svgio { mpVisitor = std::make_shared(); pCandidate->accept(*mpVisitor); - std::shared_ptr pDrawRoot(mpVisitor->getDrawRoot()); + std::shared_ptr pDrawRoot(mpVisitor->getDrawRoot()); sal_uInt64 nPointer = reinterpret_cast(pDrawRoot.get()); aAnyResult <<= sal_uInt64(nPointer); } -- cgit