[Libreoffice-commits] core.git: sc/inc sc/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Wed Jul 20 06:45:18 UTC 2016


 sc/inc/global.hxx                   |    3 ---
 sc/source/core/tool/stringutil.cxx  |    2 +-
 sc/source/filter/excel/xihelper.cxx |    2 +-
 sc/source/ui/app/inputhdl.cxx       |    4 ++--
 sc/source/ui/view/hintwin.cxx       |    4 ++--
 sc/source/ui/view/tabvwshe.cxx      |    2 +-
 6 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 86639b757b470ac7b1326afe13e19a1245499c51
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Tue Jul 19 23:58:28 2016 +0200

    sc: remove CHAR_CR define
    
    Change-Id: Ief0ef8916166d479e868fc56887aa788aae63260
    Reviewed-on: https://gerrit.libreoffice.org/27327
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 7b8fc93..15769bd 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -54,9 +54,6 @@ enum class SvtScriptType;
 
 // characters
 
-//  '\r' does not work on a Mac...
-#define CHAR_CR     char(13)
-
 const sal_Unicode CHAR_NBSP     = 0x00A0;
 const sal_Unicode CHAR_SHY      = 0x00AD;
 const sal_Unicode CHAR_ZWSP     = 0x200B;
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 606c079..53347e7 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -477,7 +477,7 @@ bool ScStringUtil::isMultiline( const OUString& rStr )
     if (rStr.indexOf('\n') != -1)
         return true;
 
-    if (rStr.indexOf(CHAR_CR) != -1)
+    if (rStr.indexOf('\r') != -1)
         return true;
 
     return false;
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index 6a9c78c..be44668 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -237,7 +237,7 @@ void XclImpStringHelper::SetToDocument(
     else
     {
         const OUString& aStr = rString.GetText();
-        if (aStr.indexOf('\n') != -1 || aStr.indexOf(CHAR_CR) != -1)
+        if (aStr.indexOf('\n') != -1 || aStr.indexOf('\r') != -1)
         {
             // Multiline content.
             ScFieldEditEngine& rEngine = rDoc.getDoc().GetEditEngine();
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index c907425..aab0500 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3347,10 +3347,10 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
                 if (bDoEnter)
                 {
                     if (pTableView)
-                        if( pTableView->PostKeyEvent( KeyEvent( CHAR_CR, vcl::KeyCode(KEY_RETURN) ) ) )
+                        if( pTableView->PostKeyEvent( KeyEvent( '\r', vcl::KeyCode(KEY_RETURN) ) ) )
                             bUsed = true;
                     if (pTopView)
-                        if( pTopView->PostKeyEvent( KeyEvent( CHAR_CR, vcl::KeyCode(KEY_RETURN) ) ) )
+                        if( pTopView->PostKeyEvent( KeyEvent( '\r', vcl::KeyCode(KEY_RETURN) ) ) )
                             bUsed = true;
                 }
                 else if ( nAutoPar && nChar == ')' && CursorAtClosingPar() )
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index c0e630e..d2ebcae 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -47,7 +47,7 @@ ScHintWindow::ScHintWindow( vcl::Window* pParent, const OUString& rTit, const OU
     sal_Int32 nIndex = 0;
     while ( nIndex != -1 )
     {
-        OUString aLine = aMessage.getToken( 0, CHAR_CR, nIndex );
+        OUString aLine = aMessage.getToken( 0, '\r', nIndex );
         Size aLineSize( GetTextWidth( aLine ), GetTextHeight() );
         nTextHeight = aLineSize.Height();
         aTextSize.Height() += nTextHeight;
@@ -78,7 +78,7 @@ void ScHintWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangl
     Point aLineStart = aTextStart;
     while ( nIndex != -1 )
     {
-        OUString aLine = aMessage.getToken( 0, CHAR_CR, nIndex );
+        OUString aLine = aMessage.getToken( 0, '\r', nIndex );
         DrawText( aLineStart, aLine );
         aLineStart.Y() += nTextHeight;
     }
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index 844b664..137d856 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -107,7 +107,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
 
             if ( bInFormatDialog || bWholeWord || aRange.aEnd.Row() == aRange.aStart.Row() )
             {
-                aStrSelection = aStrSelection.replaceAll(OUStringLiteral1<CHAR_CR>(), " ");
+                aStrSelection = aStrSelection.replaceAll("\r", " ");
                 aStrSelection = aStrSelection.replaceAll("\t", " ");
                 aStrSelection = comphelper::string::stripEnd(aStrSelection, ' ');
             }


More information about the Libreoffice-commits mailing list