summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-13 13:54:37 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-13 15:23:12 +0300
commitd2ceb28dc191e436f7d40e1e38e090238a7f6301 (patch)
tree2d68a5c8eaac4ae353958502aef6ae4a3693f7eb
parent4aeec25a36ba729ba0d42ffdf930bf35efbfa3cc (diff)
Add Handler for GradientEx Read
The handler separates MetaGradientExAction::Read metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I01f0de7ab62cf658bc88cf2232622197b127cc9a
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx2
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx19
3 files changed, 21 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index c4c3080b7af6..1bd6628bb165 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -66,6 +66,7 @@ public:
rtl::Reference<MetaAction> MaskScaleHandler();
rtl::Reference<MetaAction> MaskScalePartHandler();
rtl::Reference<MetaAction> GradientHandler();
+ rtl::Reference<MetaAction> GradientExHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 1b74eeaf18b7..d8de6305ca6a 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1099,6 +1099,8 @@ public:
const tools::PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
const Gradient& GetGradient() const { return maGradient; }
+ void SetPolyPolygon(tools::PolyPolygon& rPolyPoly) { maPolyPoly = rPolyPoly; }
+ void SetGradient(Gradient& rGradient) { maGradient = rGradient; }
};
class SAL_DLLPUBLIC_RTTI MetaHatchAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index f77dafe2c319..a473a2575f21 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -241,7 +241,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return GradientHandler();
break;
case MetaActionType::GRADIENTEX:
- pAction = new MetaGradientExAction;
+ return GradientExHandler();
break;
case MetaActionType::HATCH:
pAction = new MetaHatchAction;
@@ -1045,4 +1045,21 @@ rtl::Reference<MetaAction> SvmReader::GradientHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::GradientExHandler()
+{
+ auto pAction = new MetaGradientExAction();
+
+ VersionCompatRead aCompat(mrStream);
+ tools::PolyPolygon aPolyPoly;
+ ReadPolyPolygon(mrStream, aPolyPoly);
+ TypeSerializer aSerializer(mrStream);
+ Gradient aGradient;
+ aSerializer.readGradient(aGradient);
+
+ pAction->SetGradient(aGradient);
+ pAction->SetPolyPolygon(aPolyPoly);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */