diff options
author | Henry Castro <hcastro@collabora.com> | 2018-01-09 22:17:23 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-02-09 17:44:25 +0100 |
commit | 83202ea1341c98a216871f14702548ce5aabd94a (patch) | |
tree | 8e1d642afbd5253a20d143f4e95963f5fb99a82e /desktop | |
parent | e189dd061bb0817e1f9e872c9b8dc82b72bfffc5 (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>
Reviewed-on: https://gerrit.libreoffice.org/48236
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 1 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 29 |
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 d35faff93900..163db824c32d 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -306,6 +306,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 1de022c3fa68..0c20f6936a28 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2795,6 +2795,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; |