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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 3 02:52:21 UTC 2021


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

New commits:
commit 0c7cc718cd952e39957037e7fda3ac96e32b6d61
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Aug 2 20:13:03 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 3 04:51:49 2021 +0200

    Add Handler for TextLine Write
    
    The handler separates MetaTextLineAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: Iff1f22618d60f8f037a820ea2a03082b3a3bc926
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119903
    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 b4cc85cad7d3..9c1cd0d1d23b 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -55,4 +55,5 @@ public:
     void TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData* pData);
     void StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWriteData* pData);
     void TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData* pData);
+    void TextLineHandler(MetaTextLineAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index bf8fe01ad0c3..e3d6f3b4e791 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -190,6 +190,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::TEXTLINE:
+        {
+            auto* pMetaAction = static_cast<MetaTextLineAction*>(pAction);
+            TextLineHandler(pMetaAction);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -425,4 +432,20 @@ void SvmWriter::TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData*
 
     write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
 }
+
+void SvmWriter::TextLineHandler(MetaTextLineAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+    VersionCompatWrite aCompat(mrStream, 2);
+
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writePoint(pAction->GetStartPoint());
+
+    mrStream.WriteInt32(pAction->GetWidth());
+    mrStream.WriteUInt32(pAction->GetStrikeout());
+    mrStream.WriteUInt32(pAction->GetUnderline());
+    // new in version 2
+    mrStream.WriteUInt32(pAction->GetOverline());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list