removed tab in UTF-8 Indicator + fixed recognition for old files

This commit is contained in:
Gregor Hartmann
2001-11-07 09:38:59 +00:00
parent a9e5581b33
commit 71853e7784
2 changed files with 18 additions and 5 deletions

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: app.cxx,v $
*
* $Revision: 1.24 $
* $Revision: 1.25 $
*
* last change: $Author: gh $ $Date: 2001-10-16 14:20:21 $
* last change: $Author: gh $ $Date: 2001-11-07 10:38:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -239,6 +239,19 @@ BOOL TTUniqueId::IsStrId() const
return IsStrId( aUIdType );
}
// #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors
// this routine became necessary
BOOL IsTTSignatureForUnicodeTextfile( String aLine )
{
aLine.SearchAndReplace( '\t', ' ' );
String ThreeBlanks = CUniString(" ");
String TwoBlanks = CUniString(" ");
while ( aLine.SearchAndReplace( ThreeBlanks, TwoBlanks ) != STRING_NOTFOUND )
{}
return aLine.EqualsAscii( TT_SIGNATURE_FOR_UNICODE_TEXTFILES );
}
BasicApp aBasicApp; // Applikations-Instanz
#ifndef SAL_MODULENAME // should be defined from src612 on

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: textedit.cxx,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: gh $ $Date: 2001-10-09 10:29:45 $
* last change: $Author: gh $ $Date: 2001-11-07 10:38:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -844,7 +844,7 @@ DBG_CHKTHIS(TextEdit,0);
while( !aStrm.IsEof() && bOk )
{
aStrm.ReadByteStringLine( aLine, aFileEncoding );
if ( bIsFirstLine && aLine.EqualsAscii( TT_SIGNATURE_FOR_UNICODE_TEXTFILES ) )
if ( bIsFirstLine && IsTTSignatureForUnicodeTextfile( aLine ) )
{
aFileEncoding = RTL_TEXTENCODING_UTF8;
bFileWasUTF8 = TRUE;