[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 13 12:01:47 UTC 2021
include/vcl/filter/SvmReader.hxx | 1 +
include/vcl/metaact.hxx | 2 ++
vcl/source/filter/svm/SvmReader.cxx | 19 ++++++++++++++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
New commits:
commit aa0e31fcbfbd0f143e744788ed97a335354c17f8
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Fri Jul 9 19:15:38 2021 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jul 13 14:01:14 2021 +0200
Add Handler for Mask Read
The handler separates MetaMaskAction::Read from metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: I00fb652271055d071e36f7a1bbe7a48b00f47085
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118698
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 9ce071448dca..0adcf65a9015 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -62,6 +62,7 @@ public:
rtl::Reference<MetaAction> BmpExHandler();
rtl::Reference<MetaAction> BmpExScaleHandler();
rtl::Reference<MetaAction> BmpExScalePartHandler();
+ rtl::Reference<MetaAction> MaskHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 68c16b978fa7..cb482d9a3ac2 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -949,6 +949,8 @@ public:
const Bitmap& GetBitmap() const { return maBmp; }
const Color& GetColor() const { return maColor; }
const Point& GetPoint() const { return maPt; }
+ void SetBitmap(Bitmap& rBmp) { maBmp = rBmp; }
+ void SetPoint(Point& rPt) { maPt = rPt; }
};
class SAL_DLLPUBLIC_RTTI MetaMaskScaleAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 04c89af445d1..3ce12a2f5604 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -229,7 +229,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return BmpExScalePartHandler();
break;
case MetaActionType::MASK:
- pAction = new MetaMaskAction;
+ return MaskHandler();
break;
case MetaActionType::MASKSCALE:
pAction = new MetaMaskScaleAction;
@@ -959,4 +959,21 @@ rtl::Reference<MetaAction> SvmReader::BmpExScalePartHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::MaskHandler()
+{
+ auto pAction = new MetaMaskAction();
+
+ VersionCompatRead aCompat(mrStream);
+ Bitmap aBmp;
+ ReadDIB(aBmp, mrStream, true);
+ TypeSerializer aSerializer(mrStream);
+ Point aPoint;
+ aSerializer.readPoint(aPoint);
+
+ pAction->SetBitmap(aBmp);
+ pAction->SetPoint(aPoint);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list