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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 9 22:41:42 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 fa17410b7cad394254818ca0dfcd92673fb642d0
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Fri Jul 9 14:10:13 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jul 10 00:41:09 2021 +0200

    Add Handler for BmpExScale Read
    
    The hanlder separates MetaBmpExScaleAction::Read from metaact.hxx
    Read implementation is now in SvmReader.hxx
    
    Change-Id: I2736e259955f2610ee6acd4a36be5d362df57b74
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118674
    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 fc82e47268bc..853a52a8ae3d 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -60,6 +60,7 @@ public:
     rtl::Reference<MetaAction> BmpScaleHandler();
     rtl::Reference<MetaAction> BmpScalePartHandler();
     rtl::Reference<MetaAction> BmpExHandler();
+    rtl::Reference<MetaAction> BmpExScaleHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index b3cd5e0b5e87..b71c59b5144f 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -867,6 +867,9 @@ public:
     const BitmapEx&     GetBitmapEx() const { return maBmpEx; }
     const Point&        GetPoint() const { return maPt; }
     const Size&         GetSize() const { return maSz; }
+    void                SetBitmapEx(BitmapEx& rBmpEx) { maBmpEx = rBmpEx; }
+    void                SetPoint(Point& rPt) { maPt = rPt; }
+    void                SetSize(Size& rSz) { maSz = rSz; }
     bool                IsTransparent() const override { return GetBitmapEx().IsAlpha(); }
 };
 
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index e53dbefeb45e..303e280e8680 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -223,7 +223,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return BmpExHandler();
             break;
         case MetaActionType::BMPEXSCALE:
-            pAction = new MetaBmpExScaleAction;
+            return BmpExScaleHandler();
             break;
         case MetaActionType::BMPEXSCALEPART:
             pAction = new MetaBmpExScalePartAction;
@@ -915,4 +915,24 @@ rtl::Reference<MetaAction> SvmReader::BmpExHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::BmpExScaleHandler()
+{
+    auto pAction = new MetaBmpExScaleAction();
+
+    VersionCompatRead aCompat(mrStream);
+    BitmapEx aBmpEx;
+    ReadDIBBitmapEx(aBmpEx, mrStream);
+    TypeSerializer aSerializer(mrStream);
+    Point aPoint;
+    aSerializer.readPoint(aPoint);
+    Size aSize;
+    aSerializer.readSize(aSize);
+
+    pAction->SetBitmapEx(aBmpEx);
+    pAction->SetPoint(aPoint);
+    pAction->SetSize(aSize);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list