diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-01 12:50:45 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-04 11:33:51 +0200 |
commit | b5e094c20af952602b7bec1ab913774ebb54375b (patch) | |
tree | f54b53262fa043d35e897c95c7a1e1ec31232637 | |
parent | 14ca886136e4ce481dc32ed019b23a367c682c3e (diff) |
fix detection of Salesforce html
Change-Id: Ie777c253e221527cba8affaf766e2eddfc78c103
Reviewed-on: https://gerrit.libreoffice.org/10012
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 54c154838a14..13a56c3fa48e 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -1925,6 +1925,16 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader, sCmp = sCmp.toAsciiLowerCase(); + sal_Char c; + sal_Int32 nPos; + for (nPos = 0; nPos < sCmp.getLength(); ++nPos) + { + c = sCmp[nPos]; + if (c != ' ' && c != '\n' && c != '\t' && c != '\r' && c != '\f') + break; + } + sCmp = sCmp.copy(nPos); + // A HTML document must have a '<' in the first line sal_Int32 nStart = sCmp.indexOf('<'); if (nStart == -1) @@ -1932,8 +1942,6 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader, 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) ) |