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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 06:54:15 UTC 2021


 include/vcl/filter/SvmReader.hxx    |    1 +
 include/vcl/metaact.hxx             |    1 +
 vcl/source/filter/svm/SvmReader.cxx |   16 +++++++++++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit c23b42ce803f58e547637100e83bb6bab2843fe0
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Jul 5 09:56:48 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:53:40 2021 +0200

    Add Handler for MetaPoint Read
    
    The handler separates the MetaPointAction::Read from mataact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: Ic383be9029f5a74479c511b29cf8759815d55713
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118398
    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 0537eedb0b90..c2e1e2c07df6 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -40,6 +40,7 @@ public:
     rtl::Reference<MetaAction> LineColorHandler();
     rtl::Reference<MetaAction> FillColorHandler();
     rtl::Reference<MetaAction> RectHandler();
+    rtl::Reference<MetaAction> PointHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index cf18190c230f..940ba20f8fb8 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -154,6 +154,7 @@ public:
     virtual void        Scale( double fScaleX, double fScaleY ) override;
 
     const Point&        GetPoint() const { return maPt; }
+    void                SetPoint(Point& rPt) { maPt = rPt; }
 };
 
 class VCL_DLLPUBLIC MetaLineAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 7bc892102d20..b257460184fc 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -162,7 +162,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             pAction = new MetaPixelAction;
             break;
         case MetaActionType::POINT:
-            pAction = new MetaPointAction;
+            return PointHandler();
             break;
         case MetaActionType::LINE:
             pAction = new MetaLineAction;
@@ -384,4 +384,18 @@ rtl::Reference<MetaAction> SvmReader::RectHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::PointHandler()
+{
+    auto pAction = new MetaPointAction();
+
+    VersionCompatRead aCompat(mrStream);
+    TypeSerializer aSerializer(mrStream);
+
+    Point aPoint;
+    aSerializer.readPoint(aPoint);
+    pAction->SetPoint(aPoint);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list