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

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


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

New commits:
commit 858176c120b82f626aa8625fbb87dd23c4391c03
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 28 10:06:35 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jul 31 08:46:51 2021 +0200

    Add Handler for Pixel Write
    
    The handler separates MetaPixelAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I042bc7ae50319c7bf2a75716b4cf968675670e70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119580
    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 644cb55f9aff..c3502e3979c5 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -39,4 +39,5 @@ public:
     SvStream& Write(GDIMetaFile& rMetaFile);
     void MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData);
     void ActionHandler(MetaAction* pAction);
+    void PixelHandler(MetaPixelAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 8c07bffe5d53..37720b5d385e 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -27,6 +27,11 @@ SvmWriter::SvmWriter(SvStream& rIStm)
 {
 }
 
+void SvmWriter::WriteColor(::Color aColor)
+{
+    mrStream.WriteUInt32(static_cast<sal_uInt32>(aColor));
+}
+
 SvStream& SvmWriter::Write(GDIMetaFile& rMetaFile)
 {
     const SvStreamCompressFlags nStmCompressMode = mrStream.GetCompressMode();
@@ -73,6 +78,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::PIXEL:
+        {
+            auto* pMetaAction = static_cast<MetaPixelAction*>(pAction);
+            PixelHandler(pMetaAction);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -84,4 +96,13 @@ void SvmWriter::ActionHandler(MetaAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
 }
+
+void SvmWriter::PixelHandler(MetaPixelAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+    VersionCompatWrite aCompat(mrStream, 1);
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writePoint(pAction->GetPoint());
+    WriteColor(pAction->GetColor());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list