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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 14 09:14:44 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 98042f96c8d6806c9ce01c13b6b75cebfb8405de
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Tue Jul 13 15:52:51 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jul 14 11:14:09 2021 +0200

    Add Handler for ClipRegion Read
    
    The handler separates MetaClipRegionAction::Read from metaact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: I14c7bb721defea8d18305e7cc24facf3d7e6e05c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118845
    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 c5c8568c25ef..002157ff932b 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -69,6 +69,7 @@ public:
     rtl::Reference<MetaAction> GradientExHandler();
     rtl::Reference<MetaAction> HatchHandler();
     rtl::Reference<MetaAction> WallpaperHandler();
+    rtl::Reference<MetaAction> ClipRegionHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index df027889b4dd..40d31a6f452b 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1195,6 +1195,8 @@ public:
 
     const vcl::Region&  GetRegion() const { return maRegion; }
     bool                IsClipping() const { return mbClip; }
+    void                SetRegion(vcl::Region& rRegion) { maRegion = rRegion; }
+    void                SetClipping(bool bClip) { mbClip = bClip; }
 };
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaISectRectClipRegionAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 5abf191a440a..b01acffd92ad 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -250,7 +250,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return WallpaperHandler();
             break;
         case MetaActionType::CLIPREGION:
-            pAction = new MetaClipRegionAction;
+            return ClipRegionHandler();
             break;
         case MetaActionType::ISECTRECTCLIPREGION:
             pAction = new MetaISectRectClipRegionAction;
@@ -1089,4 +1089,20 @@ rtl::Reference<MetaAction> SvmReader::WallpaperHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::ClipRegionHandler()
+{
+    auto pAction = new MetaClipRegionAction();
+
+    VersionCompatRead aCompat(mrStream);
+    vcl::Region aRegion;
+    ReadRegion(mrStream, aRegion);
+    bool aClip;
+    mrStream.ReadCharAsBool(aClip);
+
+    pAction->SetRegion(aRegion);
+    pAction->SetClipping(aClip);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list