[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 14 06:50:04 UTC 2021
include/vcl/filter/SvmReader.hxx | 1 +
include/vcl/metaact.hxx | 6 ++++++
vcl/source/filter/svm/SvmReader.cxx | 31 ++++++++++++++++++++++++++++++-
3 files changed, 37 insertions(+), 1 deletion(-)
New commits:
commit 9256284b785b119baa2eddeab5e9c5d8e464da02
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Tue Jul 13 13:35:09 2021 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jul 14 08:49:30 2021 +0200
Add Handler for MaskScalePart Read
The handler separates MetaMaskScaleAction::Read from metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: I3642bc16d015e93a83e68e3e69cdab5da595efac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118830
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index 9544bb2f8e4d..720480e7fd57 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -64,6 +64,7 @@ public:
rtl::Reference<MetaAction> BmpExScalePartHandler();
rtl::Reference<MetaAction> MaskHandler();
rtl::Reference<MetaAction> MaskScaleHandler();
+ rtl::Reference<MetaAction> MaskScalePartHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 92d19ede781a..eb9c47c560d2 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1031,6 +1031,12 @@ public:
const Size& GetDestSize() const { return maDstSz; }
const Point& GetSrcPoint() const { return maSrcPt; }
const Size& GetSrcSize() const { return maSrcSz; }
+ void SetBitmap(Bitmap& rBmp) { maBmp = rBmp; }
+ void SetColor(Color& rColor) { maColor = rColor; }
+ void SetDestPoint(Point& rPt) { maDstPt = rPt; }
+ void SetDestSize(Size& rSz) { maDstSz = rSz; }
+ void SetSrcPoint(Point& rPt) { maSrcPt = rPt; }
+ void SetSrcSize(Size& rSz) { maSrcSz = rSz; }
};
class SAL_DLLPUBLIC_RTTI MetaGradientAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 806774f4a8c3..077c7834c086 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -235,7 +235,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return MaskScaleHandler();
break;
case MetaActionType::MASKSCALEPART:
- pAction = new MetaMaskScalePartAction;
+ return MaskScalePartHandler();
break;
case MetaActionType::GRADIENT:
pAction = new MetaGradientAction;
@@ -996,4 +996,33 @@ rtl::Reference<MetaAction> SvmReader::MaskScaleHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::MaskScalePartHandler()
+{
+ auto pAction = new MetaMaskScalePartAction();
+
+ VersionCompatRead aCompat(mrStream);
+ Bitmap aBmp;
+ ReadDIB(aBmp, mrStream, true);
+ Color aColor;
+ ReadColor(aColor);
+ TypeSerializer aSerializer(mrStream);
+ Point aDstPt;
+ aSerializer.readPoint(aDstPt);
+ Size aDstSz;
+ aSerializer.readSize(aDstSz);
+ Point aSrcPt;
+ aSerializer.readPoint(aSrcPt);
+ Size aSrcSz;
+ aSerializer.readSize(aSrcSz);
+
+ pAction->SetBitmap(aBmp);
+ pAction->SetColor(aColor);
+ pAction->SetDestPoint(aDstPt);
+ pAction->SetDestSize(aDstSz);
+ pAction->SetSrcPoint(aSrcPt);
+ pAction->SetSrcSize(aSrcSz);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list