summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-02-26 12:04:46 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-04-08 09:02:13 +0200
commit4208d95a292674c80592a7b0b69e5417939b31c1 (patch)
tree7534efda9a0fd1f34db4a6c9d9297938ddfc56f2 /oox
parentdad60bd52a25c1997d3724361ea81c0fe99b1872 (diff)
oox: add FormatScheme test case and make sure FillStyle is imorted
Extends ThemeTest in sw with the use cases relevant for import of FormatScheme into the model::Theme (as much as it is implemented currently). Change-Id: I888f64c24ba455913d688be256f095d9c298dc2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147693 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/themeelementscontext.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx
index 7d37145661cf..ae38d3eb8d43 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -45,17 +45,21 @@ public:
FillStyleListContext(ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList, model::FormatScheme& rFormatScheme);
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
-private:
+protected:
FillStyleList& mrFillStyleList;
- //model::FormatScheme& mrFormatScheme;
+ model::FormatScheme& mrFormatScheme;
+ virtual model::FillStyle* createAndAddFillStyle()
+ {
+ return mrFormatScheme.addFillStyle();
+ }
};
}
-FillStyleListContext::FillStyleListContext(ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList, model::FormatScheme& /*rFormatScheme*/)
+FillStyleListContext::FillStyleListContext(ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList, model::FormatScheme& rFormatScheme)
: ContextHandler2(rParent)
, mrFillStyleList(rFillStyleList)
- //, mrFormatScheme(rFormatScheme)
+ , mrFormatScheme(rFormatScheme)
{
}
@@ -71,7 +75,8 @@ ContextHandlerRef FillStyleListContext::onCreateContext( sal_Int32 nElement, con
case A_TOKEN( grpFill ):
{
mrFillStyleList.push_back(std::make_shared<FillProperties>());
- return FillPropertiesContext::createFillContext(*this, nElement, rAttribs, *mrFillStyleList.back(), nullptr);
+ model::FillStyle* pFillStyle = createAndAddFillStyle();
+ return FillPropertiesContext::createFillContext(*this, nElement, rAttribs, *mrFillStyleList.back(), pFillStyle);
}
}
return nullptr;
@@ -86,6 +91,12 @@ public:
BackgroundFillStyleListContext(ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList, model::FormatScheme& rFormatScheme)
: FillStyleListContext(rParent, rFillStyleList, rFormatScheme)
{}
+
+protected:
+ model::FillStyle* createAndAddFillStyle() override
+ {
+ return mrFormatScheme.addBackgroundFillStyle();
+ }
};
} // end anonymous ns