summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-07 10:31:55 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-07 10:31:55 +0300
commitc4c186efd367526fbd7caf6a55ed66c8481471bb (patch)
treecfd75b88405ff8b17f0898a7c362bb3aa439552b
parentAdd Handler for MetaEllipse Read (diff)
downloadcore-c4c186efd367526fbd7caf6a55ed66c8481471bb.tar.gz
core-c4c186efd367526fbd7caf6a55ed66c8481471bb.zip
Add Handler for MetaArc Read
The handler separates the MetaArcAction::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I2d6e6bfa53b00811ba473db7e4d2255a1ca4becf
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx3
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx23
3 files changed, 26 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index acee4279eb22..d7fa1ef2974c 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -45,6 +45,7 @@ public:
rtl::Reference<MetaAction> LineHandler();
rtl::Reference<MetaAction> RoundRectHandler();
rtl::Reference<MetaAction> EllipseHandler();
+ rtl::Reference<MetaAction> ArcHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 44c1e5db4917..e899755e36db 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -321,6 +321,9 @@ public:
const tools::Rectangle& GetRect() const { return maRect; }
const Point& GetStartPoint() const { return maStartPt; }
const Point& GetEndPoint() const { return maEndPt; }
+ void SetRect(tools::Rectangle& rRect) { maRect = rRect; }
+ void SetStartPoint(Point& rPoint) { maStartPt = rPoint; }
+ void SetEndPoint(Point& rPoint) { maEndPt = rPoint; }
};
class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaPieAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 87969933cee4..58333a188f83 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -177,7 +177,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return EllipseHandler();
break;
case MetaActionType::ARC:
- pAction = new MetaArcAction;
+ return ArcHandler();
break;
case MetaActionType::PIE:
pAction = new MetaPieAction;
@@ -478,4 +478,25 @@ rtl::Reference<MetaAction> SvmReader::EllipseHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::ArcHandler()
+{
+ auto pAction = new MetaArcAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ tools::Rectangle aRectangle;
+ aSerializer.readRectangle(aRectangle);
+ Point aPoint;
+ aSerializer.readPoint(aPoint);
+ Point aEndPoint;
+ aSerializer.readPoint(aEndPoint);
+
+ pAction->SetRect(aRectangle);
+ pAction->SetStartPoint(aPoint);
+ pAction->SetEndPoint(aEndPoint);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */