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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 2 13:52:06 UTC 2021


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

New commits:
commit cada12ebaf09ed764ca9762949cd05c42f162d23
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Sat Jul 31 14:02:58 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Aug 2 15:51:30 2021 +0200

    Add Handler for Chord Write
    
    The handler separates MetaChordAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: Ifea8783a4cf6494440b4905563165af62276b1f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119736
    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 e83afee8b5c1..cc7d07295643 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -47,4 +47,5 @@ public:
     void EllipseHandler(MetaEllipseAction* pAction);
     void ArcHandler(MetaArcAction* pAction);
     void PieHandler(MetaPieAction* pAction);
+    void ChordHandler(MetaChordAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 685230726836..6b5843369d36 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -134,6 +134,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::CHORD:
+        {
+            auto* pMetaAction = static_cast<MetaChordAction*>(pAction);
+            ChordHandler(pMetaAction);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -226,4 +233,15 @@ void SvmWriter::PieHandler(MetaPieAction* pAction)
     aSerializer.writePoint(pAction->GetStartPoint());
     aSerializer.writePoint(pAction->GetEndPoint());
 }
+
+void SvmWriter::ChordHandler(MetaChordAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+    VersionCompatWrite aCompat(mrStream, 1);
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writeRectangle(pAction->GetRect());
+    aSerializer.writePoint(pAction->GetStartPoint());
+    aSerializer.writePoint(pAction->GetEndPoint());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list