summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-05 09:56:48 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-06 13:11:25 +0300
commit0eb63f18f3d67e7672336243b8868f4a5b66eb0c (patch)
treec5b044d82e3032ad2e2fbb90e10357f912e4c283
parent183ac11da61400a064508074be526982b8410c27 (diff)
Add Handler for MetaPoint Read
The handler separates the MetaPointAction::Read from mataact.hxx Read implementation is now in SvmReader.hxx Change-Id: Ic383be9029f5a74479c511b29cf8759815d55713
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx1
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx16
3 files changed, 17 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 0537eedb0b90..c2e1e2c07df6 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -40,6 +40,7 @@ public:
rtl::Reference<MetaAction> LineColorHandler();
rtl::Reference<MetaAction> FillColorHandler();
rtl::Reference<MetaAction> RectHandler();
+ rtl::Reference<MetaAction> PointHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index cf18190c230f..940ba20f8fb8 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -154,6 +154,7 @@ public:
virtual void Scale( double fScaleX, double fScaleY ) override;
const Point& GetPoint() const { return maPt; }
+ void SetPoint(Point& rPt) { maPt = rPt; }
};
class VCL_DLLPUBLIC MetaLineAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 7bc892102d20..b257460184fc 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -162,7 +162,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
pAction = new MetaPixelAction;
break;
case MetaActionType::POINT:
- pAction = new MetaPointAction;
+ return PointHandler();
break;
case MetaActionType::LINE:
pAction = new MetaLineAction;
@@ -384,4 +384,18 @@ rtl::Reference<MetaAction> SvmReader::RectHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::PointHandler()
+{
+ auto pAction = new MetaPointAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ Point aPoint;
+ aSerializer.readPoint(aPoint);
+ pAction->SetPoint(aPoint);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */