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-17 21:45:28 +0200
commitab6a83bc4cb13976ed2971502c2a4cc827151a7f (patch)
tree5c59e9ed4377548b33a88a019ea8e032ca33146f
parent739330c2fe83e6644491789ae1e92af6bd9741d8 (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> 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 b0b750236448..2f6c0e1ee653 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -263,6 +263,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)
{
@@ -271,11 +278,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
{