From 252ce90e39648c47bcfdb39547d0ac82bacdbae6 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Tue, 9 Jan 2018 22:17:23 -0400 Subject: sw lokit: add page syles to header & footer Change-Id: I3c0b0603d1e03f1cc19af4324dd2b909320d9d4a Reviewed-on: https://gerrit.libreoffice.org/47687 Tested-by: Jenkins Reviewed-by: Henry Castro --- sfx2/source/control/unoctitm.cxx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 63df319437a5..2193914465f2 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1019,9 +1019,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "AlignLeft" || aEvent.FeatureURL.Path == "AlignHorizontalCenter" || aEvent.FeatureURL.Path == "AlignRight" || - aEvent.FeatureURL.Path == "DocumentRepair" || - aEvent.FeatureURL.Path == "InsertPageHeader" || - aEvent.FeatureURL.Path == "InsertPageFooter") + aEvent.FeatureURL.Path == "DocumentRepair") { bool bTemp = false; aEvent.State >>= bTemp; @@ -1197,6 +1195,27 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c } } } + else if (aEvent.FeatureURL.Path == "InsertPageHeader" || + aEvent.FeatureURL.Path == "InsertPageFooter") + { + if (aEvent.IsEnabled) + { + css::uno::Sequence< OUString > aSeq; + if (aEvent.State >>= aSeq) + { + aBuffer.append(u'{'); + for (sal_Int32 itSeq = 0; itSeq < aSeq.getLength(); itSeq++) + { + aBuffer.append("\"" + aSeq[itSeq]); + if (itSeq != aSeq.getLength() - 1) + aBuffer.append("\":true,"); + else + aBuffer.append("\":true"); + } + aBuffer.append(u'}'); + } + } + } else { return; -- cgit