[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 8 06:55:22 UTC 2021
include/vcl/filter/SvmReader.hxx | 1 +
include/vcl/metaact.hxx | 3 +++
vcl/source/filter/svm/SvmReader.cxx | 29 ++++++++++++++++++++++++++++-
3 files changed, 32 insertions(+), 1 deletion(-)
New commits:
commit 082554ee94e61008c75595c45bdcf01af989241a
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Jul 5 10:56:36 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:54:49 2021 +0200
Add Hanlder for MetaLine Read
The handler separates the MetaLineAction::Read from the metaact.hxx
Read Implementation is now in SvmReader.hxx
Change-Id: I27bfcc4323e8d351e8277898334fc623d6a53dd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118403
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 c62aff4355d1..6a134424a9c5 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -42,6 +42,7 @@ public:
rtl::Reference<MetaAction> RectHandler();
rtl::Reference<MetaAction> PointHandler();
rtl::Reference<MetaAction> PixelHandler();
+ rtl::Reference<MetaAction> LineHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index a2c0a1a9f67e..d433b5f3dc81 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -191,6 +191,9 @@ public:
const Point& GetStartPoint() const { return maStartPt; }
const Point& GetEndPoint() const { return maEndPt; }
const LineInfo& GetLineInfo() const { return maLineInfo; }
+ void SetStartPoint(Point& rPoint) { maStartPt = rPoint; }
+ void SetEndPoint(Point& rPoint) { maEndPt = rPoint; }
+ void SetLineInfo(LineInfo& rLineInfo) { maLineInfo = rLineInfo; }
};
class VCL_DLLPUBLIC MetaRectAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 3404650eebac..f2e87d224d7c 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -165,7 +165,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return PointHandler();
break;
case MetaActionType::LINE:
- pAction = new MetaLineAction;
+ return LineHandler();
break;
case MetaActionType::RECT:
return RectHandler();
@@ -416,4 +416,31 @@ rtl::Reference<MetaAction> SvmReader::PixelHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::LineHandler()
+{
+ auto pAction = new MetaLineAction();
+
+ VersionCompatRead aCompat(mrStream);
+
+ // Version 1
+ TypeSerializer aSerializer(mrStream);
+ Point aPoint;
+ Point aEndPoint;
+ aSerializer.readPoint(aPoint);
+ aSerializer.readPoint(aEndPoint);
+
+ pAction->SetStartPoint(aPoint);
+ pAction->SetEndPoint(aEndPoint);
+
+ // Version 2
+ if (aCompat.GetVersion() >= 2)
+ {
+ LineInfo aLineInfo;
+ ReadLineInfo(mrStream, aLineInfo);
+ pAction->SetLineInfo(aLineInfo);
+ }
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list