[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 8 06:58:23 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 18b8e90ec255ce5cd94fd6fd0b3dc1729043552f
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 7 15:35:15 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:57:50 2021 +0200
Add Handler for MetaChord Read
The handler separates the MetaChordAction::Read from metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: Id4251e270bab9dc609c220ad0f304ee38b9ed2bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118565
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 04ed88d5880c..3b64225f37eb 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -47,6 +47,7 @@ public:
rtl::Reference<MetaAction> EllipseHandler();
rtl::Reference<MetaAction> ArcHandler();
rtl::Reference<MetaAction> PieHandler();
+ rtl::Reference<MetaAction> ChordHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 461006525272..d8b1f31b6a28 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -393,6 +393,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) MetaPolyLineAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 3ccd2ae0d5c2..50d2ed8a7415 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -183,7 +183,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return PieHandler();
break;
case MetaActionType::CHORD:
- pAction = new MetaChordAction;
+ return ChordHandler();
break;
case MetaActionType::POLYLINE:
pAction = new MetaPolyLineAction;
@@ -520,4 +520,25 @@ rtl::Reference<MetaAction> SvmReader::PieHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::ChordHandler()
+{
+ auto pAction = new MetaChordAction();
+
+ 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