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

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


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

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

    Add Handler for TextRect Write
    
    The handler separates MetaTextRectAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I4827df579bb866dcb3f40d22387a1c0a24fde210
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119902
    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 d42780b828af..b4cc85cad7d3 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -54,4 +54,5 @@ public:
     void TextHandler(MetaTextAction* pAction, ImplMetaWriteData* pData);
     void TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData* pData);
     void StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWriteData* pData);
+    void TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData* pData);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 830013b357b4..bf8fe01ad0c3 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -183,6 +183,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::TEXTRECT:
+        {
+            auto* pMetaAction = static_cast<MetaTextRectAction*>(pAction);
+            TextRectHandler(pMetaAction, pData);
+        }
+        break;
+
         /* default case prevents test failure and will be
         removed once all the handlers are completed */
         default:
@@ -405,4 +412,17 @@ void SvmWriter::StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWrite
 
     write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
 }
+
+void SvmWriter::TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData* pData)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+    VersionCompatWrite aCompat(mrStream, 2);
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writeRectangle(pAction->GetRect());
+    mrStream.WriteUniOrByteString(pAction->GetText(), pData->meActualCharSet);
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetStyle()));
+
+    write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list