summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unoftn.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore/unoftn.cxx')
-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
{