summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-13 14:05:44 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-13 15:23:13 +0300
commitdf199f79982e1b0cfe8105ecc0c922712711852f (patch)
treead61516b2c6d783c6cd1a9f28c4fc3dbf32e6e05
parentd2ceb28dc191e436f7d40e1e38e090238a7f6301 (diff)
Add Handler for Hatch Read
The handler separates MetaHatchActions::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: If231710b3ed776fd5ee8f63d706d8a8b3edaa5d9
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx2
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx18
3 files changed, 20 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 1bd6628bb165..d075955db479 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -67,6 +67,7 @@ public:
rtl::Reference<MetaAction> MaskScalePartHandler();
rtl::Reference<MetaAction> GradientHandler();
rtl::Reference<MetaAction> GradientExHandler();
+ rtl::Reference<MetaAction> HatchHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index d8de6305ca6a..a37857e7a36d 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1131,6 +1131,8 @@ public:
const tools::PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
const Hatch& GetHatch() const { return maHatch; }
+ void SetPolyPolygon(tools::PolyPolygon& rPolyPoly) { maPolyPoly = rPolyPoly; }
+ void SetHatch(Hatch& rHatch) { maHatch = rHatch; }
};
class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaWallpaperAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index a473a2575f21..9c3676bebe83 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -244,7 +244,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return GradientExHandler();
break;
case MetaActionType::HATCH:
- pAction = new MetaHatchAction;
+ return HatchHandler();
break;
case MetaActionType::WALLPAPER:
pAction = new MetaWallpaperAction;
@@ -1062,4 +1062,20 @@ rtl::Reference<MetaAction> SvmReader::GradientExHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::HatchHandler()
+{
+ auto pAction = new MetaHatchAction();
+
+ VersionCompatRead aCompat(mrStream);
+ tools::PolyPolygon aPolyPoly;
+ ReadPolyPolygon(mrStream, aPolyPoly);
+ Hatch aHatch;
+ ReadHatch(mrStream, aHatch);
+
+ pAction->SetPolyPolygon(aPolyPoly);
+ pAction->SetHatch(aHatch);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */