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

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 06:56:02 UTC 2021


 include/vcl/filter/SvmReader.hxx    |    1 +
 include/vcl/metaact.hxx             |    3 +++
 vcl/source/filter/svm/SvmReader.cxx |   22 +++++++++++++++++++++-
 3 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 3f6c589530fbe7dbc418d777bdd5a7a1804e85bc
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Jul 5 14:50:39 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jul 8 08:55:29 2021 +0200

    Add Handler for MetaRoundRect Read
    
    The handler separates the MetaRoundRect::Read from the metaact.hxx
    Read Implementation is now in SvmReader.hxx
    
    Change-Id: Ic0b29b2119db3417c2feba8dc5fd44215256c040
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118433
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 6a134424a9c5..7df5a1a45e3a 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -43,6 +43,7 @@ public:
     rtl::Reference<MetaAction> PointHandler();
     rtl::Reference<MetaAction> PixelHandler();
     rtl::Reference<MetaAction> LineHandler();
+    rtl::Reference<MetaAction> RoundRectHandler();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index d433b5f3dc81..1b20cbf72952 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -256,6 +256,9 @@ public:
     const tools::Rectangle&    GetRect() const { return maRect; }
     sal_uInt32          GetHorzRound() const { return mnHorzRound; }
     sal_uInt32          GetVertRound() const { return mnVertRound; }
+    void                SetRect(const tools::Rectangle& rRect) { maRect = rRect; }
+    void                SetHorzRound(sal_uInt32 rHorzRound) { mnHorzRound = rHorzRound; }
+    void                SetVertRound(sal_uInt32 rVertRound) { mnVertRound = rVertRound; }
 };
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaEllipseAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index f2e87d224d7c..ba5311ac9ccf 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -171,7 +171,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
             return RectHandler();
             break;
         case MetaActionType::ROUNDRECT:
-            pAction = new MetaRoundRectAction;
+            return RoundRectHandler();
             break;
         case MetaActionType::ELLIPSE:
             pAction = new MetaEllipseAction;
@@ -443,4 +443,24 @@ rtl::Reference<MetaAction> SvmReader::LineHandler()
 
     return pAction;
 }
+
+rtl::Reference<MetaAction> SvmReader::RoundRectHandler()
+{
+    auto pAction = new MetaRoundRectAction();
+
+    VersionCompatRead aCompat(mrStream);
+    TypeSerializer aSerializer(mrStream);
+
+    tools::Rectangle aRectangle;
+    aSerializer.readRectangle(aRectangle);
+    sal_uInt32 HorzRound;
+    sal_uInt32 VertRound;
+    mrStream.ReadUInt32(HorzRound).ReadUInt32(VertRound);
+
+    pAction->SetRect(aRectangle);
+    pAction->SetHorzRound(HorzRound);
+    pAction->SetVertRound(VertRound);
+
+    return pAction;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list