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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 11 07:23:42 UTC 2021


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

New commits:
commit 79522b8e63c6435331f3cbf623c25f0849d7fd43
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Thu Aug 5 09:54:02 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Aug 11 09:23:08 2021 +0200

    Add Handler for GradientEx Write
    
    The handler separates MetaGradientExAction::Write from metaact.hxx
    Write implementation is now in SvmWriter.hxx
    
    Change-Id: I984e21b7d4b19b16432cabe9709d41f07187f268
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120263
    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 c1dccf57525b..c52b7387d79a 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -66,6 +66,7 @@ public:
     void MaskScaleHandler(MetaMaskScaleAction* pAction);
     void MaskScalePartHandler(MetaMaskScalePartAction* pAction);
     void GradientHandler(MetaGradientAction* pAction);
+    void GradientExHandler(MetaGradientExAction* pAction);
     void OverlineColorHandler(MetaOverlineColorAction* pAction);
     void TextAlignHandler(MetaTextAlignAction* pAction);
     void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 3296221d6f11..8e9972e08a0d 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -270,6 +270,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
         }
         break;
 
+        case MetaActionType::GRADIENTEX:
+        {
+            auto* pMetaAction = static_cast<MetaGradientExAction*>(pAction);
+            GradientExHandler(pMetaAction);
+        }
+        break;
+
         case MetaActionType::OVERLINECOLOR:
         {
             auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -750,6 +757,20 @@ void SvmWriter::GradientHandler(MetaGradientAction* pAction)
     aSerializer.writeGradient(pAction->GetGradient());
 }
 
+void SvmWriter::GradientExHandler(MetaGradientExAction* pAction)
+{
+    mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+    VersionCompatWrite aCompat(mrStream, 1);
+
+    // #i105373# see comment at MetaTransparentAction::Write
+    tools::PolyPolygon aNoCurvePolyPolygon;
+    pAction->GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+    WritePolyPolygon(mrStream, aNoCurvePolyPolygon);
+    TypeSerializer aSerializer(mrStream);
+    aSerializer.writeGradient(pAction->GetGradient());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
     mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));


More information about the Libreoffice-commits mailing list