summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-03-02 23:49:57 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-08-29 20:10:50 +0900
commit4a702cbea9a2d467aa2878a1549221723f515c15 (patch)
treeeccbf9713eac12b5e29fa85f950620538d3d8763 /svgio
parent965f644970b267a472f27ae398738ae66a08010d (diff)
use gfx namespace for DrawCommands
Change-Id: Ib2d97c4fee4e1bb433beeba4fb507fdc7d542af9 Reviewed-on: https://gerrit.libreoffice.org/68775 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit d112761291b16c1d47bebdebf3169527f5e1249e)
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgvisitor.hxx6
-rw-r--r--svgio/qa/cppunit/SvgRead.cxx9
-rw-r--r--svgio/source/svgreader/svgvisitor.cxx8
-rw-r--r--svgio/source/svguno/xsvgparser.cxx2
4 files changed, 13 insertions, 12 deletions
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<DrawRoot> mpDrawRoot;
- std::shared_ptr<DrawBase> mpCurrent;
+ std::shared_ptr<gfx::DrawRoot> mpDrawRoot;
+ std::shared_ptr<gfx::DrawBase> 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<DrawRoot> const& getDrawRoot() { return mpDrawRoot; }
+ std::shared_ptr<gfx::DrawRoot> 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<sal_uInt64>());
- DrawRoot* pDrawRoot = reinterpret_cast<DrawRoot*>(aAny.get<sal_uInt64>());
+ gfx::DrawRoot* pDrawRoot = reinterpret_cast<gfx::DrawRoot*>(aAny.get<sal_uInt64>());
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<DrawRectangle*>(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<gfx::DrawRectangle*>(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<DrawRoot>())
+ : mpDrawRoot(std::make_shared<gfx::DrawRoot>())
, 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<DrawRoot*>(mpCurrent.get())->maRectangle
+ static_cast<gfx::DrawRoot*>(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<DrawRectangle>(basegfx::B2DRange(x, y, x + w, y + h));
+ = std::make_shared<gfx::DrawRectangle>(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<DrawPath>(*pPath);
+ auto pDrawPath = std::make_shared<gfx::DrawPath>(*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<SvgDrawVisitor>();
pCandidate->accept(*mpVisitor);
- std::shared_ptr<DrawRoot> pDrawRoot(mpVisitor->getDrawRoot());
+ std::shared_ptr<gfx::DrawRoot> pDrawRoot(mpVisitor->getDrawRoot());
sal_uInt64 nPointer = reinterpret_cast<sal_uInt64>(pDrawRoot.get());
aAnyResult <<= sal_uInt64(nPointer);
}