diff options
author | Thomas Lange <tl@openoffice.org> | 2001-03-19 13:49:20 +0000 |
---|---|---|
committer | Thomas Lange <tl@openoffice.org> | 2001-03-19 13:49:20 +0000 |
commit | bd0622ef0fe1392f8149ec60d4c556f588a77a4c (patch) | |
tree | 776901edd9e09a725e9567524c009b1b37091689 /linguistic | |
parent | e7db735a308586c085d251f3da1d10d66ec4eb03 (diff) |
#81069 IsVers2 modified to accept version 6 dictionaries and renamed to IsVers2OrNewer
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/dlistimp.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index c297f1e27888..3048dfb3d40e 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlistimp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tl $ $Date: 2001-02-27 14:28:12 $ + * last change: $Author: tl $ $Date: 2001-03-19 14:49:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,15 +121,12 @@ SV_IMPL_OBJARR(ActDicArray, ActDic); #define VERS2_NOLANGUAGE 1024 static sal_Char aBuf[ BUFSIZE ]; -static const sal_Char* aDicExt = "dic"; -static const sal_Char* aVerStr2 = "WBSWG2"; -static const sal_Char* aVerStr5 = "WBSWG5"; // forward dedclarations -static BOOL IsVers2( const String& rFileURL, USHORT& nLng, BOOL& bNeg, - sal_Char* pWordBuf); +static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg, + sal_Char* pWordBuf); static void AddInternal( Reference< XDictionary > &rDic, const OUString& rNew ); @@ -457,7 +454,7 @@ void DicList::searchForDictionaries( ActDicArray &rDicList, USHORT nLang = LANGUAGE_NONE; BOOL bNeg = FALSE; - if(!::IsVers2( aName, nLang, bNeg, aBuf )) + if(!::IsVers2OrNewer( aName, nLang, bNeg, aBuf )) { // Wenn kein xub_StrLen nPos = aName.Search('.'); @@ -933,13 +930,13 @@ static void AddUserData( const Reference< XDictionary > &rDic ) #pragma optimize("ge",off) -static BOOL IsVers2( const String& rFileURL, USHORT& nLng, BOOL& bNeg, - sal_Char* pWordBuf) +static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg, + sal_Char* pWordBuf) { if (rFileURL.Len() == 0) return FALSE; - String aDIC( String::CreateFromAscii( aDicExt ) ); + String aDIC( GetDicExtension() ); String aExt; xub_StrLen nPos = rFileURL.SearchBackward( '.' ); if (STRING_NOTFOUND != nPos) @@ -966,7 +963,10 @@ static BOOL IsVers2( const String& rFileURL, USHORT& nLng, BOOL& bNeg, pStream->Read( pWordBuf, nLen); *( pWordBuf + nLen ) = 0; // Version 2.0 oder Version 5.0 ? - if( !strcmp( pWordBuf, aVerStr2 ) || !strcmp( pWordBuf, aVerStr5 ) ) + int nDicVersion = GetDicVersion( pWordBuf ); + if (2 == nDicVersion || + 5 == nDicVersion || + 6 == nDicVersion) { // Sprache des Dictionaries *pStream >> nLng; |