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

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


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

New commits:
commit e21558852131de5c6721264edd274ebbc6c72973
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Jul 5 10:28:15 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:54:14 2021 +0200

    Add Handler for MetaPixel Read
    
    The handler separates the MetaPixelAction::Read from metaact.hxx
    Read Implementation is now in SvmReader.hxx
    
    Change-Id: If45e8c46c28957c4f11c95d8a0ebbaeab01894d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118399
    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 c2e1e2c07df6..c62aff4355d1 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -41,6 +41,7 @@ public:
     rtl::Reference<MetaAction> FillColorHandler();
     rtl::Reference<MetaAction> RectHandler();
     rtl::Reference<MetaAction> PointHandler();
+    rtl::Reference<MetaAction> PixelHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 940ba20f8fb8..a2c0a1a9f67e 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -127,6 +127,8 @@ public:
 
     const Point&        GetPoint() const { return maPt; }
     const Color&        GetColor() const { return maColor; }
+    void                SetPoint(Point& rPt) { maPt = rPt; }
+    void                SetColor(Color& rColor) { maColor = rColor; }
 };
 
 class SAL_DLLPUBLIC_RTTI MetaPointAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index b257460184fc..3404650eebac 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -159,7 +159,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             pAction = new MetaAction;
             break;
         case MetaActionType::PIXEL:
-            pAction = new MetaPixelAction;
+            return PixelHandler();
             break;
         case MetaActionType::POINT:
             return PointHandler();
@@ -398,4 +398,22 @@ rtl::Reference<MetaAction> SvmReader::PointHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::PixelHandler()
+{
+    auto pAction = new MetaPixelAction();
+
+    VersionCompatRead aCompat(mrStream);
+    TypeSerializer aSerializer(mrStream);
+
+    Point aPoint;
+    aSerializer.readPoint(aPoint);
+    Color aColor;
+    ReadColor(aColor);
+
+    pAction->SetPoint(aPoint);
+    pAction->SetColor(aColor);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list