diff options
-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 fd8d81ce7295..c34c7db1df4e 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -56,6 +56,7 @@ public: rtl::Reference<MetaAction> StretchTextHandler(ImplMetaReadData* pData); rtl::Reference<MetaAction> TextRectHandler(ImplMetaReadData* pData); rtl::Reference<MetaAction> TextLineHandler(); + rtl::Reference<MetaAction> BmpHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 731e901bd622..464f2b32777e 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -720,6 +720,8 @@ public: const Bitmap& GetBitmap() const { return maBmp; } const Point& GetPoint() const { return maPt; } + void SetBitmap(Bitmap& rBmp) { maBmp = rBmp; } + void SetPoint(Point& rPt) { maPt = rPt; } }; class VCL_DLLPUBLIC MetaBmpScaleAction final : public MetaAction diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 43cd2e0e354a..8f2c503ffc7b 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <tools/stream.hxx> #include <tools/vcompat.hxx> +#include <vcl/dibtools.hxx> #include <vcl/TypeSerializer.hxx> #include <vcl/gdimtf.hxx> #include <vcl/metaact.hxx> @@ -210,7 +211,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return TextLineHandler(); break; case MetaActionType::BMP: - pAction = new MetaBmpAction; + return BmpHandler(); break; case MetaActionType::BMPSCALE: pAction = new MetaBmpScaleAction; @@ -834,4 +835,21 @@ rtl::Reference<MetaAction> SvmReader::TextLineHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::BmpHandler() +{ + auto pAction = new MetaBmpAction(); + + 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: */ |