summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-07-14 23:06:33 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-07-15 11:50:03 +0200
commitac42d6d01fcb64e8093d7f7b2833e9f9e3538369 (patch)
treec80b9f1b8c31b805035a44f9457ad5bde5b5ba73
parent0ce3a9dcc071094121252a286aa88529ee09a4eb (diff)
Add Handler for TextLineColor Read
The handler separates MetaTextLineColorAction::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I30848cea0d4f22f8d9fe327dc74f9ef16ae45d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118956 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--include/vcl/filter/SvmReader.hxx1
-rw-r--r--include/vcl/metaact.hxx2
-rw-r--r--vcl/source/filter/svm/SvmReader.cxx18
3 files changed, 20 insertions, 1 deletions
diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx
index ce35d15c8165..c9439ecb6c06 100644
--- a/include/vcl/filter/SvmReader.hxx
+++ b/include/vcl/filter/SvmReader.hxx
@@ -75,6 +75,7 @@ public:
rtl::Reference<MetaAction> MoveClipRegionHandler();
rtl::Reference<MetaAction> TextColorHandler();
rtl::Reference<MetaAction> TextFillColorHandler();
+ rtl::Reference<MetaAction> TextLineColorHandler();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index b1c1b42e1bbf..81adb9c0cd1a 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -1427,6 +1427,8 @@ public:
MetaTextLineColorAction( const Color& rColor, bool bSet );
const Color& GetColor() const { return maColor; }
+ void SetColor(const Color& rColor) { maColor = rColor; }
+ void SetSetting(bool bSet) { mbSet = bSet; }
bool IsSetting() const { return mbSet; }
};
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx
index 2a0af4cd9441..663fd3955c30 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -274,7 +274,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData)
return TextFillColorHandler();
break;
case MetaActionType::TEXTLINECOLOR:
- pAction = new MetaTextLineColorAction;
+ return TextLineColorHandler();
break;
case MetaActionType::OVERLINECOLOR:
pAction = new MetaOverlineColorAction;
@@ -1183,4 +1183,20 @@ rtl::Reference<MetaAction> SvmReader::TextFillColorHandler()
return pAction;
}
+
+rtl::Reference<MetaAction> SvmReader::TextLineColorHandler()
+{
+ auto pAction = new MetaTextLineColorAction();
+
+ VersionCompatRead aCompat(mrStream);
+ Color aColor;
+ ReadColor(aColor);
+ bool bSet;
+ mrStream.ReadCharAsBool(bSet);
+
+ pAction->SetColor(aColor);
+ pAction->SetSetting(bSet);
+
+ return pAction;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */