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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 06:49:22 UTC 2021


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

New commits:
commit 78b74ddc3da9dbc4d728b71f93626b0528870f31
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 28 11:35:38 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jul 31 08:48:50 2021 +0200

    Add Handler for Rect Write
    
    The handler separates MetaRectAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I67a1728b2e9c3fdac727345007ee9b2e4448674a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119593
    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 b767eee5c94d..3ffaf0bf5f94 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -42,4 +42,5 @@ public:
     void PixelHandler(MetaPixelAction* pAction);
     void PointHandler(MetaPointAction* pAction);
     void LineHandler(MetaLineAction* pAction);
+    void RectHandler(MetaRectAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index c0eeb443877e..f2fb33c6cd4a 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -99,6 +99,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::RECT:
+        {
+            auto* pMetaAction = static_cast<MetaRectAction*>(pAction);
+            RectHandler(pMetaAction);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -141,4 +148,13 @@ void SvmWriter::LineHandler(MetaLineAction* pAction)
     // Version 2
     WriteLineInfo(mrStream, pAction->GetLineInfo());
 }
+
+void SvmWriter::RectHandler(MetaRectAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+    VersionCompatWrite aCompat(mrStream, 1);
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writeRectangle(pAction->GetRect());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list