Kaydet (Commit) 5118cb28 authored tarafından Noel Grandin's avatar Noel Grandin

convert linguistic/source/convdic.hxx from String to OUString

Change-Id: Id4dc56902722ea139e06e727a7090b9b10e3b347
üst 6317e4fa
...@@ -123,18 +123,18 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) ...@@ -123,18 +123,18 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
} }
} }
sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ) sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType )
{ {
sal_Bool bRes = sal_False; sal_Bool bRes = sal_False;
if (rFileURL.Len() == 0) if (rFileURL.isEmpty())
return bRes; return bRes;
// check if file extension matches CONV_DIC_EXT // check if file extension matches CONV_DIC_EXT
String aExt; String aExt;
xub_StrLen nPos = rFileURL.SearchBackward( '.' ); sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
if (STRING_NOTFOUND != nPos) if (-1 != nPos)
aExt = rFileURL.Copy( nPos + 1 ); aExt = rFileURL.copy( nPos + 1 );
aExt.ToLowerAscii(); aExt.ToLowerAscii();
if (!aExt.EqualsAscii( CONV_DIC_EXT )) if (!aExt.EqualsAscii( CONV_DIC_EXT ))
return bRes; return bRes;
...@@ -164,11 +164,11 @@ sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvTy ...@@ -164,11 +164,11 @@ sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvTy
ConvDic::ConvDic( ConvDic::ConvDic(
const String &rName, const OUString &rName,
sal_Int16 nLang, sal_Int16 nLang,
sal_Int16 nConvType, sal_Int16 nConvType,
sal_Bool bBiDirectional, sal_Bool bBiDirectional,
const String &rMainURL) : const OUString &rMainURL) :
aFlushListeners( GetLinguMutex() ) aFlushListeners( GetLinguMutex() )
{ {
aName = rName; aName = rName;
...@@ -188,7 +188,7 @@ ConvDic::ConvDic( ...@@ -188,7 +188,7 @@ ConvDic::ConvDic(
bIsModified = bIsActive = sal_False; bIsModified = bIsActive = sal_False;
bIsReadonly = sal_False; bIsReadonly = sal_False;
if( rMainURL.Len() > 0 ) if( !rMainURL.isEmpty() )
{ {
sal_Bool bExists = sal_False; sal_Bool bExists = sal_False;
bIsReadonly = IsReadOnly( rMainURL, &bExists ); bIsReadonly = IsReadOnly( rMainURL, &bExists );
...@@ -232,7 +232,7 @@ void ConvDic::Load() ...@@ -232,7 +232,7 @@ void ConvDic::Load()
void ConvDic::Save() void ConvDic::Save()
{ {
DBG_ASSERT( !bNeedEntries, "saving while entries missing" ); DBG_ASSERT( !bNeedEntries, "saving while entries missing" );
if (aMainURL.Len() == 0 || bNeedEntries) if (aMainURL.isEmpty() || bNeedEntries)
return; return;
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL"); DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary" #define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary"
sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ); sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType );
struct StrLT struct StrLT
{ {
...@@ -87,7 +87,7 @@ protected: ...@@ -87,7 +87,7 @@ protected:
std::auto_ptr< PropTypeMap > pConvPropType; std::auto_ptr< PropTypeMap > pConvPropType;
String aMainURL; // URL to file OUString aMainURL; // URL to file
OUString aName; OUString aName;
sal_Int16 nLanguage; sal_Int16 nLanguage;
sal_Int16 nConversionType; sal_Int16 nConversionType;
...@@ -108,11 +108,11 @@ protected: ...@@ -108,11 +108,11 @@ protected:
void Save(); void Save();
public: public:
ConvDic( const String &rName, ConvDic( const OUString &rName,
sal_Int16 nLanguage, sal_Int16 nLanguage,
sal_Int16 nConversionType, sal_Int16 nConversionType,
sal_Bool bBiDirectional, sal_Bool bBiDirectional,
const String &rMainURL); const OUString &rMainURL);
virtual ~ConvDic(); virtual ~ConvDic();
// XConversionDictionary // XConversionDictionary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment