summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-09-03 10:36:53 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-28 10:18:44 +0200
commit27e6c7c457ab43dcff79153265a906b6a7e9b9f9 (patch)
treee64a84f504318cab31b835d4f5115c11c0ae398b
parent5bfc93bc689c9a694c4d7279499c4acf2217469d (diff)
tdf#79018: Prevent line break as footnote label
footnote labels must not contain line breaks Reviewed-on: https://gerrit.libreoffice.org/18292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 089d7f53ea232972961c14706a54187f075fa973) Reviewed-on: https://gerrit.libreoffice.org/18297 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit adf39dbade8652ceca9007484bfa20f04c5ebec0) Signed-off-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit ab6a83bc4cb13976ed2971502c2a4cc827151a7f) Conflicts: sw/source/core/unocore/unoftn.cxx Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1
-rw-r--r--sw/source/core/unocore/unoftn.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index bdf91c63ad86..118ec52f33f9 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -262,6 +262,13 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std:
{
SolarMutexGuard aGuard;
+ OUString newLabel(aLabel);
+ //new line must not occur as footnote label
+ if(newLabel.indexOf('\n') >=0 )
+ {
+ newLabel = newLabel.replace('\n', ' ');
+ }
+
SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat();
if(pFmt)
{
@@ -270,11 +277,11 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std:
SwTxtNode& rTxtNode = (SwTxtNode&)pTxtFtn->GetTxtNode();
SwPaM aPam(rTxtNode, *pTxtFtn->GetStart());
- GetDoc()->SetCurFtn(aPam, aLabel, pFmt->GetNumber(), pFmt->IsEndNote());
+ GetDoc()->SetCurFtn(aPam, newLabel, pFmt->GetNumber(), pFmt->IsEndNote());
}
else if (m_pImpl->m_bIsDescriptor)
{
- m_pImpl->m_sLabel = aLabel;
+ m_pImpl->m_sLabel = newLabel;
}
else
{