summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-08-05 09:41:47 +0300
committerTomaž Vajngerl <quikee@gmail.com>2021-08-11 09:19:38 +0200
commitdc23042b6adb62eb5b0963be04aa121d0cd66ff5 (patch)
treee47750786779678e8c08a2f2e1279e651c3cd0ec
parent86433ad00e5ac0133e0657f335b08931784b7f34 (diff)
Add Handler for MaskScale Write
The handler separates MetaMaskScaleAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: I1fee84e7c79da96755d20611a36b58f92349585f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120257 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--include/vcl/filter/SvmWriter.hxx1
-rw-r--r--vcl/source/filter/svm/SvmWriter.cxx20
2 files changed, 21 insertions, 0 deletions
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index b1dae51ef845..4ec64cf9142f 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -63,6 +63,7 @@ public:
void BmpExScaleHandler(MetaBmpExScaleAction* pAction);
void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
void MaskHandler(MetaMaskAction* pAction);
+ void MaskScaleHandler(MetaMaskScaleAction* 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 dbe813b9c663..4f045d710d32 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -249,6 +249,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::MASKSCALE:
+ {
+ auto* pMetaAction = static_cast<MetaMaskScaleAction*>(pAction);
+ MaskScaleHandler(pMetaAction);
+ }
+ break;
+
case MetaActionType::OVERLINECOLOR:
{
auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -691,6 +698,19 @@ void SvmWriter::MaskHandler(MetaMaskAction* pAction)
}
}
+void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* 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());
+ aSerializer.writeSize(pAction->GetSize());
+ }
+}
+
void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
{
mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));