summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2018-01-09 22:17:23 -0400
committerHenry Castro <hcastro@collabora.com>2018-01-18 20:55:56 +0100
commit252ce90e39648c47bcfdb39547d0ac82bacdbae6 (patch)
treee3cd98634c37a73859eb4e8839310f10c6345e0d /desktop
parent494297afe3a14d9aeef6b54515b7dceff5e1cc5f (diff)
sw lokit: add page syles to header & footer
Change-Id: I3c0b0603d1e03f1cc19af4324dd2b909320d9d4a Reviewed-on: https://gerrit.libreoffice.org/47687 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx1
-rw-r--r--desktop/source/lib/init.cxx29
2 files changed, 30 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index d5d7cb26f18b..4488aa8c155c 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -309,6 +309,7 @@ void DesktopLOKTest::testGetStyles()
rPair.first != "CellStyles" &&
rPair.first != "ShapeStyles" &&
rPair.first != "TableStyles" &&
+ rPair.first != "HeaderFooter" &&
rPair.first != "Commands")
{
CPPUNIT_FAIL("Unknown style family: " + rPair.first);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4c0b96b85951..126861d7877a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2769,6 +2769,35 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
}
+ // Header & Footer Styles
+ {
+ OUString sName;
+ bool bIsPhysical;
+ boost::property_tree::ptree aChild;
+ uno::Reference<beans::XPropertySet> xProperty;
+ boost::property_tree::ptree aChildren;
+ uno::Reference<container::XNameContainer> xContainer;
+
+ if (xStyleFamilies->getByName("PageStyles") >>= xContainer)
+ {
+ uno::Sequence<OUString> aSeqNames = xContainer->getElementNames();
+ for (sal_Int32 itName = 0; itName < aSeqNames.getLength(); itName++)
+ {
+ sName = aSeqNames[itName];
+ xProperty.set(xContainer->getByName(sName), uno::UNO_QUERY);
+ if (xProperty.is() && (xProperty->getPropertyValue("IsPhysical") >>= bIsPhysical) && bIsPhysical)
+ {
+ xProperty->getPropertyValue("DisplayName") >>= sName;
+ aChild.put("", sName.toUtf8());
+ aChildren.push_back(std::make_pair("", aChild));
+ }
+ else
+ bIsPhysical = false;
+ }
+ aValues.add_child("HeaderFooter", aChildren);
+ }
+ }
+
{
boost::property_tree::ptree aCommandList;