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

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


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

New commits:
commit 1f875634f8edaf40dcf083024f03e6a623e48599
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Thu Aug 5 09:47:54 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Aug 11 09:20:00 2021 +0200

    Add Handler for MaskScalePart Write
    
    The handler separates MetaMaskScalePartAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I3c881495c013e6827c91027319a9cedcea7f96c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120258
    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 4ec64cf9142f..3763ef8ab8c2 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -64,6 +64,7 @@ public:
     void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
     void MaskHandler(MetaMaskAction* pAction);
     void MaskScaleHandler(MetaMaskScaleAction* pAction);
+    void MaskScalePartHandler(MetaMaskScalePartAction* 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 4f045d710d32..879909267071 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -256,6 +256,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::MASKSCALEPART:
+        {
+            auto* pMetaAction = static_cast<MetaMaskScalePartAction*>(pAction);
+            MaskScalePartHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -711,6 +718,22 @@ void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* pAction)
     }
 }
 
+void SvmWriter::MaskScalePartHandler(MetaMaskScalePartAction* pAction)
+{
+    if (!pAction->GetBitmap().IsEmpty())
+    {
+        mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+        VersionCompatWrite aCompat(mrStream, 1);
+        WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+        WriteColor(pAction->GetColor());
+        TypeSerializer aSerializer(mrStream);
+        aSerializer.writePoint(pAction->GetDestPoint());
+        aSerializer.writeSize(pAction->GetDestSize());
+        aSerializer.writePoint(pAction->GetSrcPoint());
+        aSerializer.writeSize(pAction->GetSrcSize());
+    }
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));


More information about the Libreoffice-commits mailing list