diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-15 11:50:34 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-07-27 08:04:19 +0200 |
commit | 96294b206f02c9856dbcb8a21a0b20ce1180dd8c (patch) | |
tree | 2b4f185a8e35d233b367ea2546558fd6e1d5bcd4 | |
parent | f8847233c5b935d7ad1ea82bd464868d2bc3f69e (diff) |
Add Handler for RefPoint Read
The handler separates MetaRefPointAction::Read from metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: I0de2cbefbb91a89e24b8c6e43fea80a7595baa5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119193
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | include/vcl/filter/SvmReader.hxx | 1 | ||||
-rw-r--r-- | include/vcl/metaact.hxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/svm/SvmReader.cxx | 20 |
3 files changed, 22 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx index d19922cf774d..3ef53c4a7962 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -86,6 +86,7 @@ public: rtl::Reference<MetaAction> TransparentHandler(); rtl::Reference<MetaAction> FloatTransparentHandler(ImplMetaReadData* pData); rtl::Reference<MetaAction> EPSHandler(); + rtl::Reference<MetaAction> RefPointHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 1914c31c192e..fe79942ac28e 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1759,6 +1759,8 @@ public: MetaRefPointAction( const Point& rRefPoint, bool bSet ); const Point& GetRefPoint() const { return maRefPoint; } + void SetRefPoint(const Point& rRefPoint) { maRefPoint = rRefPoint; } + void SetSetting(const bool bSet) { mbSet = bSet; } bool IsSetting() const { return mbSet; } }; diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 44c6705007b3..675bba95f7da 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -308,7 +308,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return EPSHandler(); break; case MetaActionType::REFPOINT: - pAction = new MetaRefPointAction; + return RefPointHandler(); break; case MetaActionType::COMMENT: pAction = new MetaCommentAction; @@ -1359,4 +1359,22 @@ rtl::Reference<MetaAction> SvmReader::EPSHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::RefPointHandler() +{ + auto pAction = new MetaRefPointAction(); + + VersionCompatRead aCompat(mrStream); + TypeSerializer aSerializer(mrStream); + + Point aRefPoint; + aSerializer.readPoint(aRefPoint); + bool bSet; + mrStream.ReadCharAsBool(bSet); + + pAction->SetRefPoint(aRefPoint); + pAction->SetSetting(bSet); + + return pAction; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |