include/vcl/filter/SvmReader.hxx | 1 + include/vcl/metaact.hxx | 3 +++ vcl/source/filter/svm/SvmReader.cxx | 19 ++++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-)
New commits: commit 882f8a34f6829bcdc113ccc96da66c376e38b437 Author: panoskorovesis <panoskorove...@outlook.com> AuthorDate: Fri Jul 2 11:45:26 2021 +0300 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Jul 5 08:56:04 2021 +0200 Add Handler for MetaFillColor Read The handler seperates the read method from MetaAct.hxx Required set methods are added. Change-Id: I93bb581c6ea6b4e6171da30cfff572406e822f40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118275 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx index 0c2b01d79ee1..c8ece1c5043c 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -38,6 +38,7 @@ public: SvStream& Read(GDIMetaFile& rMetaFile, ImplMetaReadData* pData = nullptr); rtl::Reference<MetaAction> MetaActionHandler(ImplMetaReadData* pData); rtl::Reference<MetaAction> LineColorHandler(); + rtl::Reference<MetaAction> FillColorHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 1829340e63db..657a06c9227a 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1252,6 +1252,9 @@ public: const Color& GetColor() const { return maColor; } bool IsSetting() const { return mbSet; } + void SetSetting(bool rSet) { mbSet = rSet; } + void SetColor(Color& rColor) { maColor = rColor; } + }; class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaTextColorAction final : public MetaAction diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index a8b55b3eab46..e30984148517 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -264,7 +264,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return LineColorHandler(); break; case MetaActionType::FILLCOLOR: - pAction = new MetaFillColorAction; + return FillColorHandler(); break; case MetaActionType::TEXTCOLOR: pAction = new MetaTextColorAction; @@ -353,4 +353,21 @@ rtl::Reference<MetaAction> SvmReader::LineColorHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::FillColorHandler() +{ + auto pAction = new MetaFillColorAction(); + + VersionCompatRead aCompat(mrStream); + + Color aColor; + ReadColor(aColor); + bool aBool; + mrStream.ReadCharAsBool(aBool); + + pAction->SetColor(aColor); + pAction->SetSetting(aBool); + + return pAction; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits