[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 10 07:49:09 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
New commits:
commit b7aaa928e019eb71f41f9a4413b785b86719f7c5
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Aug 4 15:58:04 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 10 09:48:29 2021 +0200
Add Handler for Bmp Write
The handler separates MetaBmpAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: Ic1a34231128fd3562f627afdc8d09ff5ab79bfef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120153
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 93d907a36522..d6b771b4f54d 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -56,6 +56,7 @@ public:
void StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWriteData* pData);
void TextRectHandler(MetaTextRectAction* pAction, ImplMetaWriteData* pData);
void TextLineHandler(MetaTextLineAction* pAction);
+ void BmpHandler(MetaBmpAction* pAction);
void OverlineColorHandler(MetaOverlineColorAction* pAction);
void TextAlignHandler(MetaTextAlignAction* pAction);
void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index c9f4ad52ec97..6ed61e7c0e53 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -19,6 +19,7 @@
#include <vcl/filter/SvmWriter.hxx>
#include <vcl/TypeSerializer.hxx>
+#include <vcl/dibtools.hxx>
#include <tools/vcompat.hxx>
@@ -199,6 +200,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::BMP:
+ {
+ auto* pMetaAction = static_cast<MetaBmpAction*>(pAction);
+ BmpHandler(pMetaAction);
+ }
+ break;
+
case MetaActionType::OVERLINECOLOR:
{
auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -549,6 +557,18 @@ void SvmWriter::TextLineHandler(MetaTextLineAction* pAction)
mrStream.WriteUInt32(pAction->GetOverline());
}
+void SvmWriter::BmpHandler(MetaBmpAction* pAction)
+{
+ if (!pAction->GetBitmap().IsEmpty())
+ {
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+ VersionCompatWrite aCompat(mrStream, 1);
+ WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+ TypeSerializer aSerializer(mrStream);
+ aSerializer.writePoint(pAction->GetPoint());
+ }
+}
+
void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
{
mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
More information about the Libreoffice-commits
mailing list