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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 14 06:54:07 UTC 2021


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

New commits:
commit 4d8262cab5537409a8cdf0b33b6d4703f7b27c9a
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Tue Jul 13 14:05:44 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jul 14 08:53:33 2021 +0200

    Add Handler for Hatch Read
    
    The handler separates MetaHatchActions::Read from metaact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: If231710b3ed776fd5ee8f63d706d8a8b3edaa5d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118836
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 1bd6628bb165..d075955db479 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -67,6 +67,7 @@ public:
     rtl::Reference<MetaAction> MaskScalePartHandler();
     rtl::Reference<MetaAction> GradientHandler();
     rtl::Reference<MetaAction> GradientExHandler();
+    rtl::Reference<MetaAction> HatchHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 28470520fe09..ccca055522df 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1131,6 +1131,8 @@ public:
 
     const tools::PolyPolygon&  GetPolyPolygon() const { return maPolyPoly; }
     const Hatch&        GetHatch() const { return maHatch; }
+    void                SetPolyPolygon(tools::PolyPolygon& rPolyPoly) { maPolyPoly = rPolyPoly; }
+    void                SetHatch(Hatch& rHatch) { maHatch = rHatch; }
 };
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaWallpaperAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 3cfe762de652..357cd338db4c 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -244,7 +244,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return GradientExHandler();
             break;
         case MetaActionType::HATCH:
-            pAction = new MetaHatchAction;
+            return HatchHandler();
             break;
         case MetaActionType::WALLPAPER:
             pAction = new MetaWallpaperAction;
@@ -1060,4 +1060,20 @@ rtl::Reference<MetaAction> SvmReader::GradientExHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::HatchHandler()
+{
+    auto pAction = new MetaHatchAction();
+
+    VersionCompatRead aCompat(mrStream);
+    tools::PolyPolygon aPolyPoly;
+    ReadPolyPolygon(mrStream, aPolyPoly);
+    Hatch aHatch;
+    ReadHatch(mrStream, aHatch);
+
+    pAction->SetPolyPolygon(aPolyPoly);
+    pAction->SetHatch(aHatch);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list