summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-23 09:16:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-23 11:13:25 +0100
commit3f89f88651f2c0b0c2edf37d9f13c4e48592091c (patch)
treea6b9c43a5a3fef11360433851f0e42234f649e3b /svtools
parent4a32dc6562f8e38dcc8d9c970c566c6bfcd3d7e4 (diff)
callcatcher: lots more unused post ww1 filter removal
Change-Id: I7bf6dc1d366093e797a19a8e555103c15b311ac8
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svhtml/parhtml.cxx107
1 files changed, 0 insertions, 107 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 47f7701de267..2f231ad4ba7a 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1843,113 +1843,6 @@ int HTMLParser::FilterListing( int nToken )
return nToken;
}
-bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
- bool bSwitchToUCS2,
- rtl_TextEncoding eEnc )
-{
- // If the string matches one of the following regular expressions then
- // the document is a HTML document.
-
- // ^[^<]*<[^ \t]*[> \t]
- // -------
- // ^<!
-
- // where the underlined subexpression has to be a HTML token
- OString sCmp;
- bool bUCS2B = false;
- if( bSwitchToUCS2 )
- {
- if( 0xfeU == (unsigned char)pHeader[0] &&
- 0xffU == (unsigned char)pHeader[1] )
- {
- eEnc = RTL_TEXTENCODING_UCS2;
- bUCS2B = true;
- }
- else if( 0xffU == (unsigned char)pHeader[0] &&
- 0xfeU == (unsigned char)pHeader[1] )
- {
- eEnc = RTL_TEXTENCODING_UCS2;
- }
- }
- if
- (
- RTL_TEXTENCODING_UCS2 == eEnc &&
- (
- (0xfe == (unsigned char)pHeader[0] && 0xff == (unsigned char)pHeader[1]) ||
- (0xff == (unsigned char)pHeader[0] && 0xfe == (unsigned char)pHeader[1])
- )
- )
- {
- if( 0xfe == (unsigned char)pHeader[0] )
- bUCS2B = true;
-
- sal_Int32 nLen = 2;
- while( pHeader[nLen] != 0 || pHeader[nLen+1] != 0 )
- nLen += 2;
-
- OStringBuffer sTmp( (nLen - 2)/2 );
- for( sal_Int32 nPos = 2; nPos < nLen; nPos += 2 )
- {
- sal_Unicode cUC;
- if( bUCS2B )
- cUC = (sal_Unicode(pHeader[nPos]) << 8) | pHeader[nPos+1];
- else
- cUC = (sal_Unicode(pHeader[nPos+1]) << 8) | pHeader[nPos];
- if( 0U == cUC )
- break;
-
- sTmp.append( cUC < 256U ? (sal_Char)cUC : '.' );
- }
- sCmp = sTmp.makeStringAndClear();
- }
- else
- {
- sCmp = pHeader;
- }
-
- sCmp = sCmp.toAsciiLowerCase();
-
- // A HTML document must have a '<' in the first line
- sal_Int32 nStart = sCmp.indexOf('<');
- if (nStart == -1)
- return false;
- nStart++;
-
- // followed by arbitrary characters followed by a blank or '>'
- sal_Char c;
- sal_Int32 nPos;
- for( nPos = nStart; nPos < sCmp.getLength(); ++nPos )
- {
- if( '>'==(c=sCmp[nPos]) || HTML_ISSPACE(c) )
- break;
- }
-
- // If the document ends after < it's no HTML
- if( nPos==nStart )
- return false;
-
- // the string following '<' has to be a known HTML token.
- // <DIR> is not interpreted as HTML. Otherwise the output of the DOS command "DIR"
- // could be interpreted as HTML.
- OUString sTest(OStringToOUString(sCmp.copy(nStart, nPos-nStart), RTL_TEXTENCODING_ASCII_US));
- int nTok = GetHTMLToken( sTest );
- if( 0 != nTok && HTML_DIRLIST_ON != nTok )
- return true;
-
- // "<!" at the very beginning of the file?
- if( nStart == 1 && '!' == sCmp[1] )
- return true;
-
- // <HTML> somewhere in the first 80 characters of the document
- nStart = sCmp.indexOf(OOO_STRING_SVTOOLS_HTML_html);
- if( nStart>0 && '<'==sCmp[nStart-1] &&
- nStart+4 < sCmp.getLength() && '>'==sCmp[nStart+4] )
- return true;
-
- // Else it's rather not a HTML document
- return false;
-}
-
bool HTMLParser::InternalImgToPrivateURL( OUString& rURL )
{
if( rURL.getLength() < 19 || 'i' != rURL[0] ||