summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-08 17:45:31 +0300
committerpanoskorovesis <panoskorovesis@outlook.com>2021-07-08 17:45:31 +0300
commita59e3e78193c7d82d6c9fe98ffbd0bcc65b4ba73 (patch)
tree8b9cf33fe452a478454c3189255c8acb119a0d3a
parent017fff734c9b1fd473a1a78a53ff24e4a1d7428a (diff)
Add Handler for TextLine Read
The handler separates MetaTextLineAction::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I360fb83b6b399905d8c08c8a7cd2bc587ae093ec
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx5
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx35
3 files changed, 40 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index ab9654ea8d9a..fd8d81ce7295 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -55,6 +55,7 @@ public:
rtl::Reference<MetaAction> TextArrayHandler(ImplMetaReadData* pData);
rtl::Reference<MetaAction> StretchTextHandler(ImplMetaReadData* pData);
rtl::Reference<MetaAction> TextRectHandler(ImplMetaReadData* pData);
+ rtl::Reference<MetaAction> TextLineHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index b6509c12aaf8..731e901bd622 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -685,6 +685,11 @@ public:
FontStrikeout GetStrikeout() const { return meStrikeout; }
FontLineStyle GetUnderline() const { return meUnderline; }
FontLineStyle GetOverline() const { return meOverline; }
+ void SetStartPoint(Point& rPos) { maPos = rPos; }
+ void SetWidth(tools::Long rWidth) { mnWidth = rWidth; }
+ void SetStrikeout(FontStrikeout eStrikeout) { meStrikeout = eStrikeout; }
+ void SetUnderline(FontLineStyle eUnderline) { meUnderline = eUnderline; }
+ void SetOverline(FontLineStyle eOverline) { meOverline = eOverline; }
};
class VCL_DLLPUBLIC MetaBmpAction final : public MetaAction
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 1cfb6cd4ab75..43cd2e0e354a 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -207,7 +207,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return TextRectHandler(pData);
break;
case MetaActionType::TEXTLINE:
- pAction = new MetaTextLineAction;
+ return TextLineHandler();
break;
case MetaActionType::BMP:
pAction = new MetaBmpAction;
@@ -801,4 +801,37 @@ rtl::Reference<MetaAction> SvmReader::TextRectHandler(ImplMetaReadData* pData)
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::TextLineHandler()
+{
+ auto pAction = new MetaTextLineAction();
+
+ VersionCompatRead aCompat(mrStream);
+ TypeSerializer aSerializer(mrStream);
+
+ Point aPos;
+ aSerializer.readPoint(aPos);
+ sal_Int32 nTempWidth(0);
+ mrStream.ReadInt32(nTempWidth);
+
+ pAction->SetStartPoint(aPos);
+ pAction->SetWidth(nTempWidth);
+
+ sal_uInt32 nTempStrikeout(0);
+ mrStream.ReadUInt32(nTempStrikeout);
+ sal_uInt32 nTempUnderline(0);
+ mrStream.ReadUInt32(nTempUnderline);
+
+ pAction->SetStrikeout(static_cast<FontStrikeout>(nTempStrikeout));
+ pAction->SetUnderline(static_cast<FontLineStyle>(nTempUnderline));
+
+ if (aCompat.GetVersion() >= 2)
+ {
+ sal_uInt32 nTempOverline(0);
+ mrStream.ReadUInt32(nTempOverline);
+ pAction->SetOverline(static_cast<FontLineStyle>(nTempOverline));
+ }
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */