[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Oct 1 07:45:58 PDT 2015


 sc/source/core/data/postit.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e108b24c1b63128f3ace77d0642d56179172ffed
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Sep 27 21:05:13 2015 +0200

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 9eeabbf..733df67 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();
     }


More information about the Libreoffice-commits mailing list