sw/source/core/unocore/unoftn.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit a02d7cbd70f3c5703f61f380caf91c460aa3a530 Author: Oliver Specht <[email protected]> Date: Thu Sep 3 10:36:53 2015 +0200 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 <[email protected]> Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit 089d7f53ea232972961c14706a54187f075fa973) Reviewed-on: https://gerrit.libreoffice.org/18297 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> (cherry picked from commit adf39dbade8652ceca9007484bfa20f04c5ebec0) Signed-off-by: Michael Stahl <[email protected]> Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1 diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index b0b7502..2f6c0e1 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 {
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
