[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 8 06:57:50 UTC 2021
include/vcl/filter/SvmReader.hxx | 1 +
include/vcl/metaact.hxx | 3 +++
vcl/source/filter/svm/SvmReader.cxx | 23 ++++++++++++++++++++++-
3 files changed, 26 insertions(+), 1 deletion(-)
New commits:
commit e935e60431ab138eab044573355e2ed27bb1b8fa
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 7 12:46:13 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:57:17 2021 +0200
Add Handler for MetaPie Read
The handler separates the MetaPieAction::Read from the metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: I7b601a6ef03f4b0e777558e36aff87cd24588573
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118550
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index d7fa1ef2974c..04ed88d5880c 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -46,6 +46,7 @@ public:
rtl::Reference<MetaAction> RoundRectHandler();
rtl::Reference<MetaAction> EllipseHandler();
rtl::Reference<MetaAction> ArcHandler();
+ rtl::Reference<MetaAction> PieHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index e899755e36db..461006525272 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -357,6 +357,9 @@ public:
const tools::Rectangle& GetRect() const { return maRect; }
const Point& GetStartPoint() const { return maStartPt; }
const Point& GetEndPoint() const { return maEndPt; }
+ void SetRect(tools::Rectangle& rRect) { maRect = rRect; }
+ void SetStartPoint(Point& rPoint) { maStartPt = rPoint; }
+ void SetEndPoint(Point& rPoint) { maEndPt = rPoint; }
};
class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaChordAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 58333a188f83..3ccd2ae0d5c2 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -180,7 +180,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return ArcHandler();
break;
case MetaActionType::PIE:
- pAction = new MetaPieAction;
+ return PieHandler();
break;
case MetaActionType::CHORD:
pAction = new MetaChordAction;
@@ -499,4 +499,25 @@ rtl::Reference<MetaAction> SvmReader::ArcHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::PieHandler()
+{
+ auto pAction = new MetaPieAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ tools::Rectangle aRectangle;
+ aSerializer.readRectangle(aRectangle);
+ Point aPoint;
+ aSerializer.readPoint(aPoint);
+ Point aEndPoint;
+ aSerializer.readPoint(aEndPoint);
+
+ pAction->SetRect(aRectangle);
+ pAction->SetStartPoint(aPoint);
+ pAction->SetEndPoint(aEndPoint);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list