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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 13 14:07:44 UTC 2021


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

New commits:
commit c6a399ebfbb2275fa1f3b59d6d9c3a6349170944
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Tue Jul 13 13:23:07 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jul 13 16:07:09 2021 +0200

    Add Handler for MaskScale Read
    
    The handler separates MetaMaskScale::Read from metaact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: I20aec9f6c767f82ba8bac0198e4e733511f33fab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118829
    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 0adcf65a9015..9544bb2f8e4d 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -63,6 +63,7 @@ public:
     rtl::Reference<MetaAction> BmpExScaleHandler();
     rtl::Reference<MetaAction> BmpExScalePartHandler();
     rtl::Reference<MetaAction> MaskHandler();
+    rtl::Reference<MetaAction> MaskScaleHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index cb482d9a3ac2..92d19ede781a 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -987,6 +987,9 @@ public:
     const Color&        GetColor() const { return maColor; }
     const Point&        GetPoint() const { return maPt; }
     const Size&         GetSize() const { return maSz; }
+    void                SetBitmap(Bitmap& rBmp) { maBmp = rBmp; }
+    void                SetPoint(Point& rPt) { maPt = rPt; }
+    void                SetSize(Size& rSz) { maSz = rSz; }
 };
 
 class SAL_DLLPUBLIC_RTTI MetaMaskScalePartAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 3ce12a2f5604..806774f4a8c3 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -232,7 +232,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return MaskHandler();
             break;
         case MetaActionType::MASKSCALE:
-            pAction = new MetaMaskScaleAction;
+            return MaskScaleHandler();
             break;
         case MetaActionType::MASKSCALEPART:
             pAction = new MetaMaskScalePartAction;
@@ -976,4 +976,24 @@ rtl::Reference<MetaAction> SvmReader::MaskHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::MaskScaleHandler()
+{
+    auto pAction = new MetaMaskScaleAction();
+
+    VersionCompatRead aCompat(mrStream);
+    Bitmap aBmp;
+    ReadDIB(aBmp, mrStream, true);
+    TypeSerializer aSerializer(mrStream);
+    Point aPoint;
+    aSerializer.readPoint(aPoint);
+    Size aSize;
+    aSerializer.readSize(aSize);
+
+    pAction->SetBitmap(aBmp);
+    pAction->SetPoint(aPoint);
+    pAction->SetSize(aSize);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list