summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-09-03 10:36:53 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-09-03 10:49:36 +0000
commit089d7f53ea232972961c14706a54187f075fa973 (patch)
tree113f7c856e686eef23db3aebd08a599e6aebff82
parent187017ee35386018ac4bf249d30c863dd839df07 (diff)
tdf#79018: Prevent line break as footnote label
footnote labels must not contain line breaks Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1 Reviewed-on: https://gerrit.libreoffice.org/18292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/source/core/unocore/unoftn.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index bf1babb5c60f..9c9c85b0b2ce 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -262,7 +262,12 @@ void SAL_CALL
SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
-
+ OUString newLabel(aLabel);
+ //new line must not occur as footnote label
+ if(newLabel.indexOf('\n') >=0 )
+ {
+ newLabel = newLabel.replace('\n', ' ');
+ }
SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat();
if(pFormat)
{
@@ -271,11 +276,11 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std:
SwTextNode& rTextNode = (SwTextNode&)pTextFootnote->GetTextNode();
SwPaM aPam(rTextNode, pTextFootnote->GetStart());
- GetDoc()->SetCurFootnote(aPam, aLabel, pFormat->GetNumber(), pFormat->IsEndNote());
+ GetDoc()->SetCurFootnote(aPam, newLabel, pFormat->GetNumber(), pFormat->IsEndNote());
}
else if (m_pImpl->m_bIsDescriptor)
{
- m_pImpl->m_sLabel = aLabel;
+ m_pImpl->m_sLabel = newLabel;
}
else
{