summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-05 14:50:39 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-06 13:11:29 +0300
commit04f8b43f792132ab4cddf1cef15713ac248ac337 (patch)
tree800b82e3a7e6747943808d2957f32d4dbbfb1c60
parentfa3de5c30a86104b18e6fa5e9baf318df762a820 (diff)
Add Handler for MetaRoundRect Read
The handler separates the MetaRoundRect::Read from the metaact.hxx Read Implementation is now in SvmReader.hxx Change-Id: Ic0b29b2119db3417c2feba8dc5fd44215256c040
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx3
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx22
3 files changed, 25 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 6a134424a9c5..7df5a1a45e3a 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -43,6 +43,7 @@ public:
rtl::Reference<MetaAction> PointHandler();
rtl::Reference<MetaAction> PixelHandler();
rtl::Reference<MetaAction> LineHandler();
+ rtl::Reference<MetaAction> RoundRectHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index d433b5f3dc81..1b20cbf72952 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -256,6 +256,9 @@ public:
const tools::Rectangle& GetRect() const { return maRect; }
sal_uInt32 GetHorzRound() const { return mnHorzRound; }
sal_uInt32 GetVertRound() const { return mnVertRound; }
+ void SetRect(const tools::Rectangle& rRect) { maRect = rRect; }
+ void SetHorzRound(sal_uInt32 rHorzRound) { mnHorzRound = rHorzRound; }
+ void SetVertRound(sal_uInt32 rVertRound) { mnVertRound = rVertRound; }
};
class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaEllipseAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index f2e87d224d7c..ba5311ac9ccf 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -171,7 +171,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return RectHandler();
break;
case MetaActionType::ROUNDRECT:
- pAction = new MetaRoundRectAction;
+ return RoundRectHandler();
break;
case MetaActionType::ELLIPSE:
pAction = new MetaEllipseAction;
@@ -443,4 +443,24 @@ rtl::Reference<MetaAction> SvmReader::LineHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::RoundRectHandler()
+{
+ auto pAction = new MetaRoundRectAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ tools::Rectangle aRectangle;
+ aSerializer.readRectangle(aRectangle);
+ sal_uInt32 HorzRound;
+ sal_uInt32 VertRound;
+ mrStream.ReadUInt32(HorzRound).ReadUInt32(VertRound);
+
+ pAction->SetRect(aRectangle);
+ pAction->SetHorzRound(HorzRound);
+ pAction->SetVertRound(VertRound);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */