diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-09-27 21:05:13 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 14:45:35 +0000 |
commit | e108b24c1b63128f3ace77d0642d56179172ffed (patch) | |
tree | da784b0a9a671c64215711bb7328f655a4d27215 /sc/source/core | |
parent | db17079fcff6f9a068c499b17f2501cc4c82d10b (diff) |
don't try to create OUString from editeng directly, tdf#94542
editeng uses special control characters (apparently 0x01) that need to
be translated by editeng to the real characters. Let EditEngine handle
the conversion from editeng string to OUString.
Change-Id: If5014e1ada7f1df933a084b17bb307035ce01cc6
Reviewed-on: https://gerrit.libreoffice.org/19065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/postit.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 9eeabbfb49d5..733df671a63b 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -45,6 +45,7 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "detfunc.hxx" +#include "editutil.hxx" #include <utility> @@ -545,11 +546,14 @@ OUString ScPostIt::GetText() const if( const EditTextObject* pEditObj = GetEditTextObject() ) { OUStringBuffer aBuffer; - for( sal_Int32 nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara ) + ScNoteEditEngine& rEngine = mrDoc.GetNoteEngine(); + rEngine.SetText(*pEditObj); + sal_Int32 nParaCount = rEngine.GetParagraphCount(); + for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara ) { if( nPara > 0 ) aBuffer.append( '\n' ); - aBuffer.append( pEditObj->GetText( nPara ) ); + aBuffer.append(rEngine.GetText(nPara)); } return aBuffer.makeStringAndClear(); } |