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

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


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

New commits:
commit 940ef7d652f0916adf7c3499682e6f81b86404c8
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Sat Jul 31 14:07:45 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Aug 2 15:51:57 2021 +0200

    Add Handler for PolyLine Write
    
    The handler separates MetaPolyLineAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I62a3d6d70b33966f0096260aa01f3790a3e87e55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119737
    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 cc7d07295643..891c3853e1ba 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -48,4 +48,5 @@ public:
     void ArcHandler(MetaArcAction* pAction);
     void PieHandler(MetaPieAction* pAction);
     void ChordHandler(MetaChordAction* pAction);
+    void PolyLineHandler(MetaPolyLineAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 6b5843369d36..eb64c40e7fdd 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -141,6 +141,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::POLYLINE:
+        {
+            auto* pMetaAction = static_cast<MetaPolyLineAction*>(pAction);
+            PolyLineHandler(pMetaAction);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -244,4 +251,22 @@ void SvmWriter::ChordHandler(MetaChordAction* pAction)
     aSerializer.writePoint(pAction->GetStartPoint());
     aSerializer.writePoint(pAction->GetEndPoint());
 }
+
+void SvmWriter::PolyLineHandler(MetaPolyLineAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+    VersionCompatWrite aCompat(mrStream, 3);
+
+    tools::Polygon aSimplePoly;
+    pAction->GetPolygon().AdaptiveSubdivide(aSimplePoly);
+
+    WritePolygon(mrStream, aSimplePoly); // Version 1
+    WriteLineInfo(mrStream, pAction->GetLineInfo()); // Version 2
+
+    bool bHasPolyFlags = pAction->GetPolygon().HasFlags(); // Version 3
+    mrStream.WriteBool(bHasPolyFlags);
+    if (bHasPolyFlags)
+        pAction->GetPolygon().Write(mrStream);
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list