summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-09 22:07:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-10 09:28:39 +0000
commit8e482e60c52ba427199a29045711b3f9cc870ac0 (patch)
treec10d502127e9a097953955ca45c317f30ec1a813 /svtools
parent0a2286a7244ca80f8109765f0ff78a7c36e7cd68 (diff)
an indexOfL would be useful
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/imap.hxx4
-rw-r--r--svtools/source/misc/imap2.cxx27
2 files changed, 16 insertions, 15 deletions
diff --git a/svtools/inc/svtools/imap.hxx b/svtools/inc/svtools/imap.hxx
index 1d89ca30a49a..9418d987bfe4 100644
--- a/svtools/inc/svtools/imap.hxx
+++ b/svtools/inc/svtools/imap.hxx
@@ -67,12 +67,12 @@ protected:
sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
- void ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL );
+ void ImpReadCERNLine( const rtl::OString& rLine, const String& rBaseURL );
Point ImpReadCERNCoords( const char** ppStr );
long ImpReadCERNRadius( const char** ppStr );
String ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
- void ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL );
+ void ImpReadNCSALine( const rtl::OString& rLine, const String& rBaseURL );
String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
Point ImpReadNCSACoords( const char** ppStr );
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 6ff6cad985e9..98b0ee3fa0fd 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
+#include <comphelper/string.hxx>
#include <string.h>
#include <rtl/strbuf.hxx>
#include <vcl/svapp.hxx>
@@ -250,18 +251,17 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBas
sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
{
- ByteString aStr;
-
// alten Inhalt loeschen
ClearImageMap();
+ rtl::OString aStr;
while ( rIStm.ReadLine( aStr ) )
ImpReadCERNLine( aStr, rBaseURL );
return IMAP_ERR_OK;
}
-void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL )
+void ImageMap::ImpReadCERNLine( const rtl::OString& rLine, const String& rBaseURL )
{
ByteString aStr( rLine );
@@ -394,18 +394,17 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
{
- ByteString aStr;
-
// alten Inhalt loeschen
ClearImageMap();
+ rtl::OString aStr;
while ( rIStm.ReadLine( aStr ) )
ImpReadNCSALine( aStr, rBaseURL );
return IMAP_ERR_OK;
}
-void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL )
+void ImageMap::ImpReadNCSALine( const rtl::OString& rLine, const String& rBaseURL )
{
ByteString aStr( rLine );
@@ -532,20 +531,22 @@ sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
// untersuchen wir das Format
if ( memcmp( cMagic, IMAPMAGIC, sizeof( cMagic ) ) )
{
- ByteString aStr;
long nCount = 128;
rIStm.Seek( nPos );
+ rtl::OString aStr;
while ( rIStm.ReadLine( aStr ) && nCount-- )
{
- aStr.ToLowerAscii();
+ aStr = aStr.toAsciiLowerCase();
+
+ using comphelper::string::indexOfL;
- if ( ( aStr.Search( "rect" ) != STRING_NOTFOUND ) ||
- ( aStr.Search( "circ" ) != STRING_NOTFOUND ) ||
- ( aStr.Search( "poly" ) != STRING_NOTFOUND ) )
+ if ( (indexOfL(aStr, RTL_CONSTASCII_STRINGPARAM("rect")) != -1) ||
+ (indexOfL(aStr, RTL_CONSTASCII_USTRINGPARAM("circ")) != -1) ||
+ (indexOfL(aStr, RTL_CONSTASCII_USTRINGPARAM("poly")) != -1) )
{
- if ( ( aStr.Search( '(' ) != STRING_NOTFOUND ) &&
- ( aStr.Search( ')' ) != STRING_NOTFOUND ) )
+ if ( ( aStr.indexOf('(') != -1 ) &&
+ ( aStr.indexOf(')') != -1 ) )
{
nRet = IMAP_FORMAT_CERN;
}