Kaydet (Commit) 91a418d2 authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString->rtl::OString

üst dbfa0518
...@@ -117,13 +117,12 @@ sal_Bool CommunicationManagerClientViaSocketTT::KillApplication() ...@@ -117,13 +117,12 @@ sal_Bool CommunicationManagerClientViaSocketTT::KillApplication()
#define GETSET(aVar, KeyName, Dafault) \ #define GETSET(aVar, KeyName, Dafault) \
aVar = aConf.ReadKey(KeyName,"No Entry"); \ aVar = aConf.ReadKey(KeyName,"No Entry"); \
if ( aVar.CompareTo("No Entry") == COMPARE_EQUAL ) \ if (aVar.equalsL(RTL_CONSTASCII_STRINGPARAM("No Entry"))) \
{ \ { \
aVar = ByteString(Dafault); \ aVar = Dafault; \
aConf.WriteKey(KeyName, aVar); \ aConf.WriteKey(KeyName, aVar); \
} }
String GetHostConfig() String GetHostConfig()
{ {
String aHostToTalk; String aHostToTalk;
...@@ -138,12 +137,12 @@ String GetHostConfig() ...@@ -138,12 +137,12 @@ String GetHostConfig()
return Application::GetCommandLineParam( i ).Copy(6); return Application::GetCommandLineParam( i ).Copy(6);
} }
ByteString abHostToTalk; rtl::OString abHostToTalk;
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Communication"); aConf.SetGroup("Communication");
GETSET( abHostToTalk, "Host", DEFAULT_HOST ); GETSET( abHostToTalk, "Host", DEFAULT_HOST );
return UniString( abHostToTalk, RTL_TEXTENCODING_UTF8 ); return rtl::OStringToOUString(abHostToTalk, RTL_TEXTENCODING_UTF8);
} }
...@@ -164,13 +163,13 @@ sal_uLong GetTTPortConfig() ...@@ -164,13 +163,13 @@ sal_uLong GetTTPortConfig()
} }
} }
ByteString abPortToTalk; rtl::OString abPortToTalk;
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Communication"); aConf.SetGroup("Communication");
GETSET( abPortToTalk, "TTPort", GETSET( abPortToTalk, "TTPort",
rtl::OString::valueOf(static_cast<sal_Int32>(TESTTOOL_DEFAULT_PORT)) ); rtl::OString::valueOf(static_cast<sal_Int32>(TESTTOOL_DEFAULT_PORT)) );
return (sal_uLong)abPortToTalk.ToInt32(); return (sal_uLong)abPortToTalk.toInt32();
} }
...@@ -191,13 +190,13 @@ sal_uLong GetUnoPortConfig() ...@@ -191,13 +190,13 @@ sal_uLong GetUnoPortConfig()
} }
} }
ByteString abPortToTalk; rtl::OString abPortToTalk;
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Communication"); aConf.SetGroup("Communication");
GETSET( abPortToTalk, "UnoPort", GETSET( abPortToTalk, "UnoPort",
rtl::OString::valueOf(static_cast<sal_Int32>(UNO_DEFAULT_PORT)) ); rtl::OString::valueOf(static_cast<sal_Int32>(UNO_DEFAULT_PORT)) );
return (sal_uLong)abPortToTalk.ToInt32(); return (sal_uLong)abPortToTalk.toInt32();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -515,12 +515,10 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) ...@@ -515,12 +515,10 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig )
aNFCRPort.SetUseThousandSep( sal_False ); aNFCRPort.SetUseThousandSep( sal_False );
ByteString aTemp;
aConfig.SetGroup("Crashreporter"); aConfig.SetGroup("Crashreporter");
aTemp = aConfig.ReadKey( "UseProxy", "false" ); rtl::OString aTemp = aConfig.ReadKey( "UseProxy", "false" );
if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) if ( aTemp.equalsIgnoreAsciiCase("true") || aTemp.equals("1") )
aCBUseProxy.Check(); aCBUseProxy.Check();
else else
aCBUseProxy.Check( sal_False ); aCBUseProxy.Check( sal_False );
...@@ -529,13 +527,13 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) ...@@ -529,13 +527,13 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig )
LINK( this, CrashreportOptions, CheckProxy ).Call( NULL ); // call once to initialize LINK( this, CrashreportOptions, CheckProxy ).Call( NULL ); // call once to initialize
aTemp = aConfig.ReadKey( "ProxyServer" ); aTemp = aConfig.ReadKey( "ProxyServer" );
aEDCRHost.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) ); aEDCRHost.SetText(rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_UTF8));
aTemp = aConfig.ReadKey( "ProxyPort", "8080" ); aTemp = aConfig.ReadKey( "ProxyPort", "8080" );
aNFCRPort.SetValue( aTemp.ToInt32() ); aNFCRPort.SetValue(aTemp.toInt32());
aTemp = aConfig.ReadKey( "AllowContact", "false" ); aTemp = aConfig.ReadKey( "AllowContact", "false" );
if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) if ( aTemp.equalsIgnoreAsciiCase("true") || aTemp.equals("1") )
aCBAllowContact.Check(); aCBAllowContact.Check();
else else
aCBAllowContact.Check( sal_False ); aCBAllowContact.Check( sal_False );
...@@ -544,7 +542,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) ...@@ -544,7 +542,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig )
LINK( this, CrashreportOptions, CheckResponse ).Call( NULL ); // call once to initialize LINK( this, CrashreportOptions, CheckResponse ).Call( NULL ); // call once to initialize
aTemp = aConfig.ReadKey( "ReturnAddress" ); aTemp = aConfig.ReadKey( "ReturnAddress" );
aEDEMail.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) ); aEDEMail.SetText(rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_UTF8));
} }
...@@ -659,8 +657,8 @@ void MiscOptions::Save( Config &aConfig ) ...@@ -659,8 +657,8 @@ void MiscOptions::Save( Config &aConfig )
rtl::OString::valueOf(static_cast<sal_Int32>(aServerTimeout.GetTime().GetTime()))); rtl::OString::valueOf(static_cast<sal_Int32>(aServerTimeout.GetTime().GetTime())));
aConfig.SetGroup("LRU"); aConfig.SetGroup("LRU");
ByteString aTemp = aConfig.ReadKey( "MaxLRU", "4" ); rtl::OString aTemp = aConfig.ReadKey( "MaxLRU", "4" );
sal_uInt16 nOldMaxLRU = (sal_uInt16)aTemp.ToInt32(); sal_uInt16 nOldMaxLRU = (sal_uInt16)aTemp.toInt32();
sal_uInt16 n; sal_uInt16 n;
for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- ) for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- )
{ {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <math.h> #include <math.h>
#include <sal/macros.h> #include <sal/macros.h>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <comphelper/string.hxx>
ResId SaneResId( sal_uInt32 nID ) ResId SaneResId( sal_uInt32 nID )
{ {
...@@ -1196,36 +1197,41 @@ sal_Bool SaneDlg::LoadState() ...@@ -1196,36 +1197,41 @@ sal_Bool SaneDlg::LoadState()
if( mrSane.IsOpen() ) if( mrSane.IsOpen() )
{ {
int iMax = aConfig.GetKeyCount(); int iMax = aConfig.GetKeyCount();
for( i = 0; i < iMax; i++ ) for (i = 0; i < iMax; ++i)
{ {
aString = aConfig.GetKeyName( i ); aString = aConfig.GetKeyName( i );
ByteString aValue = aConfig.ReadKey( i ); rtl::OString aValue = aConfig.ReadKey( i );
int nOption = mrSane.GetOptionByName( aString.GetBuffer() ); int nOption = mrSane.GetOptionByName( aString.GetBuffer() );
if( nOption != -1 ) if( nOption == -1 )
continue;
using comphelper::string::matchL;
if (matchL(aValue, RTL_CONSTASCII_USTRINGPARAM("BOOL=")))
{ {
if( aValue.CompareTo( "BOOL=", 5 ) == COMPARE_EQUAL ) aValue = aValue.copy(RTL_CONSTASCII_LENGTH("BOOL="));
{ sal_Bool aBOOL = (sal_Bool)aValue.toInt32();
aValue.Erase( 0, 5 ); mrSane.SetOptionValue( nOption, aBOOL );
sal_Bool aBOOL = (sal_Bool)aValue.ToInt32(); }
mrSane.SetOptionValue( nOption, aBOOL ); else if (matchL(aValue, RTL_CONSTASCII_USTRINGPARAM("STRING=")))
} {
else if( aValue.CompareTo( "STRING=", 7 ) == COMPARE_EQUAL ) aValue = aValue.copy(RTL_CONSTASCII_LENGTH("STRING="));
{ mrSane.SetOptionValue(nOption,rtl::OStringToOUString(aValue, osl_getThreadTextEncoding()) );
aValue.Erase( 0, 7 ); }
mrSane.SetOptionValue( nOption, String( aValue, osl_getThreadTextEncoding() ) ); else if (matchL(aValue, RTL_CONSTASCII_USTRINGPARAM("NUMERIC=")))
} {
else if( aValue.CompareTo( "NUMERIC=", 8 ) == COMPARE_EQUAL ) aValue = aValue.copy(RTL_CONSTASCII_LENGTH("NUMERIC="));
sal_Int32 nIndex = 0;
int n = 0;
do
{ {
aValue.Erase( 0, 8 ); rtl::OString aSub = aValue.getToken(0, ':', nIndex);
int nMax = aValue.GetTokenCount( ':' );
double fValue=0.0; double fValue=0.0;
for( int n = 0; n < nMax ; n++ ) sscanf(aSub.getStr(), "%lg", &fValue);
{ SetAdjustedNumericalValue(aString.GetBuffer(), fValue, n++);
ByteString aSub = aValue.GetToken( n, ':' );
sscanf( aSub.GetBuffer(), "%lg", &fValue );
SetAdjustedNumericalValue( aString.GetBuffer(), fValue, n );
}
} }
while ( nIndex >= 0 );
} }
} }
} }
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
#include "vcl/msgbox.hxx" #include "vcl/msgbox.hxx"
#include "vcl/strhelper.hxx" #include "vcl/strhelper.hxx"
#include "osl/thread.h" #include <osl/thread.h>
#include <rtl/strbuf.hxx>
#include <comphelper/string.hxx>
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
using namespace psp; using namespace psp;
using namespace padmin; using namespace padmin;
using namespace std; using namespace std;
...@@ -507,29 +507,31 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent ) ...@@ -507,29 +507,31 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
ByteString aDefCopies( aConfig.ReadKey( "Copies" ) ); ByteString aDefCopies( aConfig.ReadKey( "Copies" ) );
ByteString aDefDPI( aConfig.ReadKey( "DPI" ) ); ByteString aDefDPI( aConfig.ReadKey( "DPI" ) );
using comphelper::string::getToken;
aConfig.SetGroup( "devices" ); aConfig.SetGroup( "devices" );
int nDevices = aConfig.GetKeyCount(); int nDevices = aConfig.GetKeyCount();
for( int nKey = 0; nKey < nDevices; nKey++ ) for( int nKey = 0; nKey < nDevices; nKey++ )
{ {
aConfig.SetGroup( "devices" ); aConfig.SetGroup( "devices" );
ByteString aPrinter( aConfig.GetKeyName( nKey ) ); rtl::OString aPrinter(aConfig.GetKeyName(nKey));
ByteString aValue( aConfig.ReadKey( aPrinter ) ); rtl::OString aValue(aConfig.ReadKey(aPrinter));
ByteString aPort( aValue.GetToken( 1, ',' ) ); rtl::OString aPort(getToken(aValue, 1, ','));
ByteString aDriver( aValue.GetToken( 0, ' ' ) ); rtl::OString aDriver(getToken(aValue, 0, ' '));
ByteString aPS( aValue.GetToken( 0, ',' ).GetToken( 1, ' ' ) ); rtl::OString aPS( getToken(getToken(aValue, 0, ','), 1, ' ') );
ByteString aNewDriver( aDriver ); rtl::OString aNewDriver(aDriver);
if( aDriver == "GENERIC" ) if( aDriver.equalsL(RTL_CONSTASCII_STRINGPARAM("GENERIC")))
aNewDriver = "SGENPRT"; aNewDriver = rtl::OString(RTL_CONSTASCII_STRINGPARAM("SGENPRT"));
if( aPS != "PostScript" ) if( aPS != "PostScript" )
continue; continue;
const PPDParser* pParser = PPDParser::getParser( String( aNewDriver, aEncoding ) ); const PPDParser* pParser = PPDParser::getParser(rtl::OStringToOUString(aNewDriver, aEncoding));
if( pParser == NULL ) if( pParser == NULL )
{ {
String aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) ); String aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s1" ) ), String( aPrinter, aEncoding ) ); aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s1" ) ), rtl::OStringToOUString(aPrinter, aEncoding) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s2" ) ), String( aDriver, aEncoding ) ); aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s2" ) ), rtl::OStringToOUString(aDriver, aEncoding) );
InfoBox aBox( this, aText ); InfoBox aBox( this, aText );
aBox.Execute(); aBox.Execute();
continue; continue;
...@@ -541,66 +543,66 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent ) ...@@ -541,66 +543,66 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
if( ! aCommand.Len() ) if( ! aCommand.Len() )
{ {
String aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) ); String aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), String( aPrinter, aEncoding ) ); aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), rtl::OStringToOUString(aPrinter, aEncoding) );
InfoBox aBox( this, aText ); InfoBox aBox( this, aText );
aBox.Execute(); aBox.Execute();
continue; continue;
} }
String aUPrinter( AddPrinterDialog::uniquePrinterName( String( aPrinter, aEncoding ) ) ); String aUPrinter( AddPrinterDialog::uniquePrinterName(rtl::OStringToOUString(aPrinter, aEncoding)) );
PrinterInfo aInfo; PrinterInfo aInfo;
aInfo.m_aDriverName = String( aNewDriver, aEncoding ); aInfo.m_aDriverName = rtl::OStringToOUString(aNewDriver, aEncoding);
aInfo.m_pParser = pParser; aInfo.m_pParser = pParser;
aInfo.m_aContext.setParser( pParser ); aInfo.m_aContext.setParser( pParser );
aInfo.m_aPrinterName = aUPrinter; aInfo.m_aPrinterName = aUPrinter;
aInfo.m_aCommand = String( aCommand, aEncoding ); aInfo.m_aCommand = rtl::OStringToOUString(aCommand, aEncoding);
// read the printer settings // read the printer settings
ByteString aGroup( aDriver ); rtl::OStringBuffer aGroup(aDriver);
aGroup += ",PostScript,"; aGroup.append(RTL_CONSTASCII_STRINGPARAM(",PostScript,"));
aGroup += aPort; aGroup.append(aPort);
aConfig.SetGroup( aGroup ); aConfig.SetGroup(aGroup.makeStringAndClear());
aValue = aConfig.ReadKey( "PageSize", aDefPageSize ); aValue = aConfig.ReadKey( "PageSize", aDefPageSize );
int nLeft, nRight, nTop, nBottom; int nLeft, nRight, nTop, nBottom;
if( aValue.Len() && if( aValue.getLength() &&
aInfo.m_pParser->getMargins( String( aValue, aEncoding ), aInfo.m_pParser->getMargins( rtl::OStringToOUString(aValue, aEncoding),
nLeft, nRight, nTop, nBottom ) ) nLeft, nRight, nTop, nBottom ) )
{ {
const PPDKey* pKey = aInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); const PPDKey* pKey = aInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
const PPDValue* pValue = pKey ? pKey->getValue( String( aValue, aEncoding ) ) : NULL; const PPDValue* pValue = pKey ? pKey->getValue( rtl::OStringToOUString(aValue, aEncoding) ) : NULL;
if( pKey && pValue ) if( pKey && pValue )
aInfo.m_aContext.setValue( pKey, pValue ); aInfo.m_aContext.setValue( pKey, pValue );
aValue = aConfig.ReadKey( "MarginLeft", aDefMarginLeft ); aValue = aConfig.ReadKey( "MarginLeft", aDefMarginLeft );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nLeftMarginAdjust = aValue.ToInt32() - (int)((double)nLeft * 35.27777778 ); aInfo.m_nLeftMarginAdjust = aValue.toInt32() - (int)((double)nLeft * 35.27777778 );
aValue = aConfig.ReadKey( "MarginRight", aDefMarginRight ); aValue = aConfig.ReadKey( "MarginRight", aDefMarginRight );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nRightMarginAdjust = aValue.ToInt32() - (int)((double)nRight * 35.27777778 ); aInfo.m_nRightMarginAdjust = aValue.toInt32() - (int)((double)nRight * 35.27777778 );
aValue = aConfig.ReadKey( "MarginTop", aDefMarginTop ); aValue = aConfig.ReadKey( "MarginTop", aDefMarginTop );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nTopMarginAdjust = aValue.ToInt32() - (int)((double)nTop * 35.27777778 ); aInfo.m_nTopMarginAdjust = aValue.toInt32() - (int)((double)nTop * 35.27777778 );
aValue = aConfig.ReadKey( "MarginBottom", aDefMarginBottom ); aValue = aConfig.ReadKey( "MarginBottom", aDefMarginBottom );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nBottomMarginAdjust = aValue.ToInt32() - (int)((double)nBottom * 35.27777778 ); aInfo.m_nBottomMarginAdjust = aValue.toInt32() - (int)((double)nBottom * 35.27777778 );
} }
aValue = aConfig.ReadKey( "Copies", aDefScale ); aValue = aConfig.ReadKey( "Copies", aDefScale );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nCopies = aValue.ToInt32(); aInfo.m_nCopies = aValue.toInt32();
aValue = aConfig.ReadKey( "Comment" ); aValue = aConfig.ReadKey( "Comment" );
aInfo.m_aComment = String( aValue, aEncoding ); aInfo.m_aComment = rtl::OStringToOUString(aValue, aEncoding);
aValue = aConfig.ReadKey( "Level" ); aValue = aConfig.ReadKey( "Level" );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_nPSLevel = aValue.ToInt32(); aInfo.m_nPSLevel = aValue.toInt32();
aValue = aConfig.ReadKey( "Orientation", aDefOrientation ); aValue = aConfig.ReadKey( "Orientation", aDefOrientation );
if( aValue.Len() ) if (!aValue.isEmpty())
aInfo.m_eOrientation = aValue.CompareIgnoreCaseToAscii( "landscape" ) == COMPARE_EQUAL ? orientation::Landscape : orientation::Portrait; aInfo.m_eOrientation = aValue.equalsIgnoreAsciiCase( "landscape" ) == COMPARE_EQUAL ? orientation::Landscape : orientation::Portrait;
int nGroupKeys = aConfig.GetKeyCount(); int nGroupKeys = aConfig.GetKeyCount();
for( int nPPDKey = 0; nPPDKey < nGroupKeys; nPPDKey++ ) for( int nPPDKey = 0; nPPDKey < nGroupKeys; nPPDKey++ )
{ {
...@@ -617,7 +619,7 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent ) ...@@ -617,7 +619,7 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
aValue = aConfig.ReadKey( nPPDKey ); aValue = aConfig.ReadKey( nPPDKey );
aPPDKey.Erase( 0, 4 ); aPPDKey.Erase( 0, 4 );
const PPDKey* pKey = aInfo.m_pParser->getKey( String( aPPDKey, RTL_TEXTENCODING_ISO_8859_1 ) ); const PPDKey* pKey = aInfo.m_pParser->getKey( String( aPPDKey, RTL_TEXTENCODING_ISO_8859_1 ) );
const PPDValue* pValue = pKey ? ( aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ) ) : NULL; const PPDValue* pValue = pKey ? ( aValue.equalsL(RTL_CONSTASCII_STRINGPARAM("*nil")) ? NULL : pKey->getValue(rtl::OStringToOUString(aValue, RTL_TEXTENCODING_ISO_8859_1)) ) : NULL;
if( pKey ) if( pKey )
aInfo.m_aContext.setValue( pKey, pValue, true ); aInfo.m_aContext.setValue( pKey, pValue, true );
} }
......
...@@ -433,13 +433,13 @@ sal_Bool ImplSdPPTImport::Import() ...@@ -433,13 +433,13 @@ sal_Bool ImplSdPPTImport::Import()
{ {
sal_uInt32 nPageNumber = 0; sal_uInt32 nPageNumber = 0;
String aString( pHyperlink->aSubAdress ); String aString( pHyperlink->aSubAdress );
ByteString aStringAry[ 3 ]; rtl::OString aStringAry[ 3 ];
sal_uInt16 nTokenCount = aString.GetTokenCount( ',' ); sal_uInt16 nTokenCount = aString.GetTokenCount( ',' );
if ( nTokenCount > 3 ) if ( nTokenCount > 3 )
nTokenCount = 3; nTokenCount = 3;
sal_uInt16 nToken; sal_uInt16 nToken;
for( nToken = 0; nToken < nTokenCount; nToken++ ) for( nToken = 0; nToken < nTokenCount; nToken++ )
aStringAry[ nToken ] = ByteString( aString.GetToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8 ); aStringAry[nToken] = rtl::OUStringToOString(aString.GetToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8);
sal_Bool bSucceeded = sal_False; sal_Bool bSucceeded = sal_False;
...@@ -448,7 +448,7 @@ sal_Bool ImplSdPPTImport::Import() ...@@ -448,7 +448,7 @@ sal_Bool ImplSdPPTImport::Import()
{ {
if (comphelper::string::isAsciiDecimalString(aStringAry[nToken])) if (comphelper::string::isAsciiDecimalString(aStringAry[nToken]))
{ {
sal_Int32 nNumber = aStringAry[ nToken ].ToInt32(); sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
if ( nNumber & ~0xff ) if ( nNumber & ~0xff )
{ {
PptSlidePersistList* pPageList = GetPageList( PPT_SLIDEPAGE ); PptSlidePersistList* pPageList = GetPageList( PPT_SLIDEPAGE );
...@@ -486,7 +486,7 @@ sal_Bool ImplSdPPTImport::Import() ...@@ -486,7 +486,7 @@ sal_Bool ImplSdPPTImport::Import()
{ {
if (comphelper::string::isAsciiDecimalString(aStringAry[nToken])) if (comphelper::string::isAsciiDecimalString(aStringAry[nToken]))
{ {
sal_Int32 nNumber = aStringAry[ nToken ].ToInt32(); sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
if ( ( nNumber & ~0xff ) == 0 ) if ( ( nNumber & ~0xff ) == 0 )
{ {
nPageNumber = (sal_uInt32)nNumber - 1; nPageNumber = (sal_uInt32)nNumber - 1;
......
...@@ -48,27 +48,27 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) ...@@ -48,27 +48,27 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream )
if( pStrm ) if( pStrm )
delete pStrm, pStrm = 0; delete pStrm, pStrm = 0;
ByteString sLine, sVersion; rtl::OString sLine, sVersion;
sal_uIntPtr nStt = 0, nEnd = 0; sal_uIntPtr nStt = 0, nEnd = 0;
sal_uInt16 nIndex = 0; sal_Int32 nIndex = 0;
rStream.Seek(STREAM_SEEK_TO_BEGIN); rStream.Seek(STREAM_SEEK_TO_BEGIN);
rStream.ResetError(); rStream.ResetError();
if( rStream.ReadLine( sLine ) && if( rStream.ReadLine( sLine ) &&
sLine.GetToken( 0, ':', nIndex ) == "Version" ) sLine.getToken( 0, ':', nIndex ) == "Version" )
{ {
sVersion = sLine.Copy( nIndex ); sVersion = sLine.copy( nIndex );
while( rStream.ReadLine( sLine ) ) while( rStream.ReadLine( sLine ) )
{ {
nIndex = 0; nIndex = 0;
ByteString sTmp( sLine.GetToken( 0, ':', nIndex ) ); rtl::OString sTmp(sLine.getToken(0, ':', nIndex));
if( sTmp == "StartHTML" ) if (sTmp.equalsL(RTL_CONSTASCII_STRINGPARAM("StartHTML")))
nStt = (sal_uIntPtr)(sLine.Erase( 0, nIndex ).ToInt32()); nStt = (sal_uIntPtr)(sLine.copy(nIndex).toInt32());
else if( sTmp == "EndHTML" ) else if (sTmp.equalsL(RTL_CONSTASCII_STRINGPARAM("EndHTML")))
nEnd = (sal_uIntPtr)(sLine.Erase( 0, nIndex ).ToInt32()); nEnd = (sal_uIntPtr)(sLine.copy(nIndex).toInt32());
else if( sTmp == "SourceURL" ) else if (sTmp.equalsL(RTL_CONSTASCII_STRINGPARAM("SourceURL")))
sBaseURL = String(S2U(sLine.Erase( 0, nIndex ))); sBaseURL = S2U(sLine.copy(nIndex));
if( nEnd && nStt && if( nEnd && nStt &&
( sBaseURL.Len() || rStream.Tell() >= nStt )) ( sBaseURL.Len() || rStream.Tell() >= nStt ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment