summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-05 10:28:15 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-06 13:11:27 +0300
commit9a446dd18f3a42ef41524b01da469dcdf9bef06c (patch)
treef7814f4fa302b07127c37a88cc03f79b1ae2cd4e
parentAdd Handler for MetaPoint Read (diff)
downloadcore-9a446dd18f3a42ef41524b01da469dcdf9bef06c.tar.gz
core-9a446dd18f3a42ef41524b01da469dcdf9bef06c.zip
Add Handler for MetaPixel Read
The handler separates the MetaPixelAction::Read from metaact.hxx Read Implementation is now in SvmReader.hxx Change-Id: If45e8c46c28957c4f11c95d8a0ebbaeab01894d6
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx2
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx20
3 files changed, 22 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index c2e1e2c07df6..c62aff4355d1 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -41,6 +41,7 @@ public:
rtl::Reference<MetaAction> FillColorHandler();
rtl::Reference<MetaAction> RectHandler();
rtl::Reference<MetaAction> PointHandler();
+ rtl::Reference<MetaAction> PixelHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 940ba20f8fb8..a2c0a1a9f67e 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -127,6 +127,8 @@ public:
const Point& GetPoint() const { return maPt; }
const Color& GetColor() const { return maColor; }
+ void SetPoint(Point& rPt) { maPt = rPt; }
+ void SetColor(Color& rColor) { maColor = rColor; }
};
class SAL_DLLPUBLIC_RTTI MetaPointAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index b257460184fc..3404650eebac 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -159,7 +159,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
pAction = new MetaAction;
break;
case MetaActionType::PIXEL:
- pAction = new MetaPixelAction;
+ return PixelHandler();
break;
case MetaActionType::POINT:
return PointHandler();
@@ -398,4 +398,22 @@ rtl::Reference<MetaAction> SvmReader::PointHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::PixelHandler()
+{
+ auto pAction = new MetaPixelAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ Point aPoint;
+ aSerializer.readPoint(aPoint);
+ Color aColor;
+ ReadColor(aColor);
+
+ pAction->SetPoint(aPoint);
+ pAction->SetColor(aColor);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */