[Libreoffice-commits] core.git: include/vcl vcl/source

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 06:57: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 4fc97b63f144d2fa2eeb05f3e88b5c863fd4f12b
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 7 10:31:55 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:56:49 2021 +0200

    Add Handler for MetaArc Read
    
    The handler separates the MetaArcAction::Read from metaact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: I2d6e6bfa53b00811ba473db7e4d2255a1ca4becf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118545
    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 acee4279eb22..d7fa1ef2974c 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -45,6 +45,7 @@ public:
     rtl::Reference<MetaAction> LineHandler();
     rtl::Reference<MetaAction> RoundRectHandler();
     rtl::Reference<MetaAction> EllipseHandler();
+    rtl::Reference<MetaAction> ArcHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 44c1e5db4917..e899755e36db 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -321,6 +321,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) MetaPieAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 87969933cee4..58333a188f83 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -177,7 +177,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return EllipseHandler();
             break;
         case MetaActionType::ARC:
-            pAction = new MetaArcAction;
+            return ArcHandler();
             break;
         case MetaActionType::PIE:
             pAction = new MetaPieAction;
@@ -478,4 +478,25 @@ rtl::Reference<MetaAction> SvmReader::EllipseHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::ArcHandler()
+{
+    auto pAction = new MetaArcAction();
+
+    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