Kaydet (Commit) 089d7f53 authored tarafından Oliver Specht's avatar Oliver Specht Kaydeden (comit) Thorsten Behrens

tdf#79018: Prevent line break as footnote label

footnote labels must not contain line breaks

Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1
Reviewed-on: https://gerrit.libreoffice.org/18292Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 187017ee
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment