[Libreoffice-commits] .: Branch 'libreoffice-3-4' - patches/dev300

Tor Lillqvist tml at kemper.freedesktop.org
Tue Apr 5 02:02:20 PDT 2011


 patches/dev300/svx-i18n-ordinal-autocorr.diff |   32 ++++++++------------------
 1 file changed, 11 insertions(+), 21 deletions(-)

New commits:
commit 63a9b86acfed1d406dc7b7feb6f44cc58452f3c5
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Tue Apr 5 12:01:45 2011 +0300

    Make svx-i18n-ordinal-autocorr.diff apply again

diff --git a/patches/dev300/svx-i18n-ordinal-autocorr.diff b/patches/dev300/svx-i18n-ordinal-autocorr.diff
index b70ebc0..44677cd 100644
--- a/patches/dev300/svx-i18n-ordinal-autocorr.diff
+++ b/patches/dev300/svx-i18n-ordinal-autocorr.diff
@@ -1,5 +1,3 @@
-diff --git editeng/source/misc/svxacorr.cxx editeng/source/misc/svxacorr.cxx
-index db86806..99aa65e 100644
 --- editeng/source/misc/svxacorr.cxx
 +++ editeng/source/misc/svxacorr.cxx
 @@ -47,6 +47,7 @@
@@ -7,9 +5,9 @@ index db86806..99aa65e 100644
  #include <unotools/collatorwrapper.hxx>
  #include <com/sun/star/i18n/CollatorOptions.hpp>
 +#include <com/sun/star/i18n/XOrdinalSuffix.hpp>
+ #include <com/sun/star/i18n/UnicodeScript.hpp>
  #include <unotools/localedatawrapper.hxx>
  #include <unotools/transliterationwrapper.hxx>
- #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 @@ -488,48 +489,58 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber(
          if( !lcl_IsInAsciiArr( sImplEndSkipChars, rTxt.GetChar( nEndPos - 1 ) ))
              break;
@@ -25,12 +23,12 @@ index db86806..99aa65e 100644
 +   
 +    do
      {
--        static sal_Char __READONLY_DATA
+-        static sal_Char const
 -            sAll[]		= "th",			/* rest */
 -            sFirst[]	= "st",      	/* 1 */
 -            sSecond[]	= "nd",       	/* 2 */
 -            sThird[]	= "rd";       	/* 3 */
--        static const sal_Char* __READONLY_DATA aNumberTab[ 4 ] =
+-        static const sal_Char* const aNumberTab[ 4 ] =
 +        i--;
 +        bool isDigit = rCC.isDigit( rTxt, i );
 +        if ( foundEnd )
@@ -71,7 +69,7 @@ index db86806..99aa65e 100644
 +    
 +        if ( xOrdSuffix.is( ) ) 
          {
--            // dann pruefe mal, ob alle bis zum Start alle Zahlen sind
+-            // then check to the start, if all are numbers 
 -            for( xub_StrLen n = nEndPos - 3; nSttPos < n; )
 -                if( !rCC.isDigit( rTxt, --n ) )
 +            uno::Sequence< rtl::OUString > aSuffixes = xOrdSuffix->getOrdinalSuffix( nNum, rCC.getLocale( ) );
@@ -96,7 +94,7 @@ index db86806..99aa65e 100644
 +                    }
                  }
 -
--            if( bChg )		// dann setze mal das Escapement Attribut
+-            if( bChg )		// then set the escapement attribute
 -            {
 -                SvxEscapementItem aSvxEscapementItem( DFLT_ESC_AUTO_SUPER,
 -                                                    DFLT_ESC_PROP, SID_ATTR_CHAR_ESCAPEMENT );
@@ -106,8 +104,6 @@ index db86806..99aa65e 100644
              }
          }
  
-diff --git i18npool/inc/ordinalsuffix.hxx i18npool/inc/ordinalsuffix.hxx
-index e91b5ec..1f067f0 100644
 --- i18npool/inc/ordinalsuffix.hxx
 +++ i18npool/inc/ordinalsuffix.hxx
 @@ -44,7 +44,7 @@ class OrdinalSuffix : public cppu::WeakImplHelper2
@@ -119,8 +115,6 @@ index e91b5ec..1f067f0 100644
  
          // XServiceInfo
          virtual rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
-diff --git i18npool/source/ordinalsuffix/ordinalsuffix.cxx i18npool/source/ordinalsuffix/ordinalsuffix.cxx
-index 378a95b..4f629f1 100644
 --- i18npool/source/ordinalsuffix/ordinalsuffix.cxx
 +++ i18npool/source/ordinalsuffix/ordinalsuffix.cxx
 @@ -31,10 +31,14 @@
@@ -168,7 +162,7 @@ index 378a95b..4f629f1 100644
 +    if ( U_SUCCESS( nCode ) ) 
      {
 -        case 11: case 12: case 13:
--            retValue = OUString::createFromAscii( "th" );
+-            retValue = OUString(RTL_CONSTASCII_USTRINGPARAM("th"));
 -            break;
 -        default:
 -            switch( nNumber % 10 )
@@ -184,16 +178,16 @@ index 378a95b..4f629f1 100644
 +            if ( U_SUCCESS( nCode ) )
              {
 -                case 1:
--                    retValue = OUString::createFromAscii( "st" );
+-                    retValue = OUString(RTL_CONSTASCII_USTRINGPARAM("st"));
 -                    break;
 -                case 2:
--                    retValue = OUString::createFromAscii( "nd" );
+-                    retValue = OUString(RTL_CONSTASCII_USTRINGPARAM("nd"));
 -                    break;
 -                case 3:
--                    retValue = OUString::createFromAscii( "rd" );
+-                    retValue = OUString(RTL_CONSTASCII_USTRINGPARAM("rd"));
 -                    break;
 -                default:
--                    retValue = OUString::createFromAscii( "th" );
+-                    retValue = OUString(RTL_CONSTASCII_USTRINGPARAM("th"));
 -                    break;
 +                // Apply NFKC normalization to get normal letters
 +                icu::UnicodeString normalized;
@@ -235,8 +229,6 @@ index 378a95b..4f629f1 100644
  const sal_Char cOrdinalSuffix[] = "com.sun.star.i18n.OrdinalSuffix";
  
  OUString SAL_CALL OrdinalSuffix::getImplementationName(void) throw( RuntimeException )
-diff --git offapi/com/sun/star/i18n/XOrdinalSuffix.idl offapi/com/sun/star/i18n/XOrdinalSuffix.idl
-index e88c900..083e67f 100644
 --- offapi/com/sun/star/i18n/XOrdinalSuffix.idl
 +++ offapi/com/sun/star/i18n/XOrdinalSuffix.idl
 @@ -45,22 +45,24 @@ module com { module sun { module star { module i18n {
@@ -245,7 +237,7 @@ index e88c900..083e67f 100644
      change without notice and should not be used outside the OOo core.
 -    The current version is a draft and works only for English language
 -    locales. Future enhancements adding functionality for other locales
--    should use the 'ordinal' RuleBasedNumberFormat of the ICU if
+-    should use the "ordinal" RuleBasedNumberFormat of the ICU if
 -    possible, see
 -    http://icu.sourceforge.net/apiref/icu4c/classRuleBasedNumberFormat.html
 -    which might make it necessary to change the interface.
@@ -274,8 +266,6 @@ index e88c900..083e67f 100644
  };
  
  //============================================================================
-diff --git sc/source/core/data/globalx.cxx sc/source/core/data/globalx.cxx
-index f1a1c8e..36314da 100644
 --- sc/source/core/data/globalx.cxx
 +++ sc/source/core/data/globalx.cxx
 @@ -159,8 +159,12 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)


More information about the Libreoffice-commits mailing list