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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 11 07:19:51 UTC 2021


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

New commits:
commit 86433ad00e5ac0133e0657f335b08931784b7f34
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Thu Aug 5 09:36:46 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Aug 11 09:19:17 2021 +0200

    Add Handler for Mask Write
    
    The handler separates MetaMaskAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I8c204d767e8474fbf67fc5b8f610f4b8e5244903
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120256
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c57002e0a5d7..b1dae51ef845 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -62,6 +62,7 @@ public:
     void BmpExHandler(MetaBmpExAction* pAction);
     void BmpExScaleHandler(MetaBmpExScaleAction* pAction);
     void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
+    void MaskHandler(MetaMaskAction* 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 bd4557c0c653..dbe813b9c663 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -242,6 +242,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::MASK:
+        {
+            auto* pMetaAction = static_cast<MetaMaskAction*>(pAction);
+            MaskHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -672,6 +679,18 @@ void SvmWriter::BmpExScalePartHandler(MetaBmpExScalePartAction* pAction)
     }
 }
 
+void SvmWriter::MaskHandler(MetaMaskAction* pAction)
+{
+    if (!pAction->GetBitmap().IsEmpty())
+    {
+        mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+        VersionCompatWrite aCompat(mrStream, 1);
+        WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+        TypeSerializer aSerializer(mrStream);
+        aSerializer.writePoint(pAction->GetPoint());
+    }
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));


More information about the Libreoffice-commits mailing list