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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 07:49:36 UTC 2021


 include/vcl/filter/SvmWriter.hxx    |    2 +
 vcl/source/filter/svm/SvmWriter.cxx |   42 ++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

New commits:
commit 80a3d51f8c09d4c2aaabee95ee134fdd13cac5d2
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Aug 4 16:07:36 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 10 09:49:14 2021 +0200

    Add Handler for BmpScalePart Write
    
    The handler separates MetaBmpScalePartAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I8d7f6eb8ee7b7f62190f3d4517ef62df7c0a2b15
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120155
    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 027a3bd580b1..54a968837290 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -58,6 +58,7 @@ public:
     void TextLineHandler(MetaTextLineAction* pAction);
     void BmpHandler(MetaBmpAction* pAction);
     void BmpScaleHandler(MetaBmpScaleAction* pAction);
+    void BmpScalePartHandler(MetaBmpScalePartAction* 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 97a748ff9505..e38f724aa8a8 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -214,6 +214,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::BMPSCALEPART:
+        {
+            auto* pMetaAction = static_cast<MetaBmpScalePartAction*>(pAction);
+            BmpScalePartHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -589,6 +596,21 @@ void SvmWriter::BmpScaleHandler(MetaBmpScaleAction* pAction)
     }
 }
 
+void SvmWriter::BmpScalePartHandler(MetaBmpScalePartAction* 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->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()));
commit 8d73346ae2afa31c4d954843c71d2eb1c2faef5e
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Aug 4 16:02:04 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 10 09:48:55 2021 +0200

    Add Handler for BmpScale Write
    
    The handler separates MetaBmpScaleAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I653cde9fd306ba052326db0884010a6ea3b48306
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120154
    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 d6b771b4f54d..027a3bd580b1 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -57,6 +57,7 @@ public:
     void TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData* pData);
     void TextLineHandler(MetaTextLineAction* pAction);
     void BmpHandler(MetaBmpAction* pAction);
+    void BmpScaleHandler(MetaBmpScaleAction* 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 6ed61e7c0e53..97a748ff9505 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -207,6 +207,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::BMPSCALE:
+        {
+            auto* pMetaAction = static_cast<MetaBmpScaleAction*>(pAction);
+            BmpScaleHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -569,6 +576,19 @@ void SvmWriter::BmpHandler(MetaBmpAction* pAction)
     }
 }
 
+void SvmWriter::BmpScaleHandler(MetaBmpScaleAction* 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());
+        aSerializer.writeSize(pAction->GetSize());
+    }
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));


More information about the Libreoffice-commits mailing list