diff options
Diffstat (limited to 'svtools/source/misc/langtab.cxx')
-rw-r--r-- | svtools/source/misc/langtab.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 1a139a2ff966..2edf816a29af 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,24 +52,24 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) const USHORT nLen = rText.Len(); if (nLen == 0) return String(); - + const sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding const sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding const sal_Unicode cPopDirectionalFormat = 0x202C; // the unicode PDF (POP_DIRECTIONAL_FORMAT) char that terminates an LRE/RLE embedding - + // check if there are alreay embedding characters at the strings start // if so change nothing const sal_Unicode cChar = rText.GetBuffer()[0]; if (cChar == cLRE_Embedding || cChar == cRLE_Embedding) return rText; - + // since we only call the function getCharacterDirection // it does not matter which locale the CharClass is for. // Thus we can readily make use of SvtSysLocale::GetCharClass() // which should come at no cost... SvtSysLocale aSysLocale; const CharClass &rCharClass = aSysLocale.GetCharClass(); - + // we should look for the first non-neutral LTR or RTL character // and use that to determine the embedding of the whole text... // Thus we can avoid to check every character of the text. @@ -87,27 +87,27 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) case i18n::DirectionProperty_ARABIC_NUMBER : // yes! arabic numbers are written from left to right { bIsRtlText = false; - bFound = true; + bFound = true; break; } - + case i18n::DirectionProperty_RIGHT_TO_LEFT : case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC : case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING : case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE : - { + { bIsRtlText = true; - bFound = true; + bFound = true; break; } - + default: { // nothing to be done, character is considered to be neutral we need to look further ... - } - } + } + } } - + sal_Unicode cStart = cLRE_Embedding; // default is to use LRE embedding characters if (bIsRtlText) cStart = cRLE_Embedding; // then use RLE embedding @@ -121,7 +121,7 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) } return aRes; -} +} //------------------------------------------------------------------------ @@ -151,7 +151,7 @@ const String& SvtLanguageTable::GetString( const LanguageType eType ) const // generally raise an error. OSL_ENSURE( eLang == LANGUAGE_ENGLISH, "language entry not found in resource" ); - + nPos = FindIndex( LANGUAGE_DONTKNOW ); if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() ) @@ -181,7 +181,7 @@ LanguageType SvtLanguageTable::GetType( const String& rStr ) const eType = LanguageType( GetValue( i ) ); break; } - } + } return eType; } @@ -191,7 +191,7 @@ sal_uInt32 SvtLanguageTable::GetEntryCount() const { return Count(); } - + //------------------------------------------------------------------------ LanguageType SvtLanguageTable::GetTypeAtIndex( sal_uInt32 nIndex ) const |