include/vcl/filter/SvmWriter.hxx    |    1 +
 vcl/source/filter/svm/SvmWriter.cxx |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit 640508cb3783fa9ba8ecf8acd257356c68b9cf48
Author:     panoskorovesis <panoskorove...@outlook.com>
AuthorDate: Wed Aug 4 16:13:27 2021 +0300
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Aug 10 09:49:55 2021 +0200

    Add Handler for BmpExScale Write
    
    The handler separates MetaBmpExScaleAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: Ie00f4a4d886c9c01a00c963b97dd905e05851b94
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120157
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 54deb03a52dc..9bf3a3f50bc6 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -60,6 +60,7 @@ public:
     void BmpScaleHandler(MetaBmpScaleAction* pAction);
     void BmpScalePartHandler(MetaBmpScalePartAction* pAction);
     void BmpExHandler(MetaBmpExAction* pAction);
+    void BmpExScaleHandler(MetaBmpExScaleAction* pAction);
     void OverlineColorHandler(MetaOverlineColorAction* pAction);
     void TextAlignHandler(MetaTextAlignAction* pAction);
     void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index acd14be4ddda..d0e72957ff0a 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -228,6 +228,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::BMPEXSCALE:
+        {
+            auto* pMetaAction = static_cast<MetaBmpExScaleAction*>(pAction);
+            BmpExScaleHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -630,6 +637,19 @@ void SvmWriter::BmpExHandler(MetaBmpExAction* pAction)
     }
 }
 
+void SvmWriter::BmpExScaleHandler(MetaBmpExScaleAction* pAction)
+{
+    if (!pAction->GetBitmapEx().GetBitmap().IsEmpty())
+    {
+        mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+        VersionCompatWrite aCompat(mrStream, 1);
+        WriteDIBBitmapEx(pAction->GetBitmapEx(), mrStream);
+        TypeSerializer aSerializer(mrStream);
+        aSerializer.writePoint(pAction->GetPoint());
+        aSerializer.writeSize(pAction->GetSize());
+    }
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));

Reply via email to