summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-09 09:50:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-09 13:17:27 +0100
commit5089bdb234a93bcb62b597c18b8ab66048246b13 (patch)
tree0983967d89d9662b8484c88d2590cfdd7362fa43 /sw/source/filter
parent0ba03a38f022ca8d3705ae1370bb1d739e1e973f (diff)
Related: fdo#38838 remove UniString::EqualsAscii
Change-Id: I55c85c1c44452c7fb6ac40591aea7177d054affe
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/iodetect.cxx54
-rw-r--r--sw/source/filter/html/htmlcss1.cxx15
-rw-r--r--sw/source/filter/html/htmlplug.cxx9
-rw-r--r--sw/source/filter/ww8/styles.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx8
7 files changed, 47 insertions, 51 deletions
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 6bb1643a4821..ea681fa9884b 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -29,21 +29,20 @@ bool IsDocShellRegistered();
SwIoDetect aFilterDetect[] =
{
- SwIoDetect( FILTER_RTF, STRING_LEN ),
- SwIoDetect( FILTER_BAS, STRING_LEN ),
- SwIoDetect( sWW6, STRING_LEN ),
- SwIoDetect( FILTER_WW8, STRING_LEN ),
- SwIoDetect( sRtfWH, STRING_LEN ),
- SwIoDetect( sHTML, 4 ),
- SwIoDetect( sWW1, STRING_LEN ),
- SwIoDetect( sWW5, STRING_LEN ),
- SwIoDetect( FILTER_XML, 4 ),
- SwIoDetect( FILTER_TEXT_DLG, 8 ),
- SwIoDetect( FILTER_TEXT, 4 )
+ SwIoDetect( FILTER_RTF ),
+ SwIoDetect( FILTER_BAS ),
+ SwIoDetect( sWW6 ),
+ SwIoDetect( FILTER_WW8 ),
+ SwIoDetect( sRtfWH ),
+ SwIoDetect( sHTML ),
+ SwIoDetect( sWW1 ),
+ SwIoDetect( sWW5 ),
+ SwIoDetect( FILTER_XML ),
+ SwIoDetect( FILTER_TEXT_DLG ),
+ SwIoDetect( FILTER_TEXT )
};
-const sal_Char* SwIoDetect::IsReader(const sal_Char* pHeader, sal_uLong nLen_,
- const String & /*rFileName*/, const String& /*rUserData*/) const
+OUString SwIoDetect::IsReader(const sal_Char* pHeader, sal_uLong nLen_) const
{
// Filter erkennung
struct W1_FIB
@@ -63,12 +62,11 @@ const sal_Char* SwIoDetect::IsReader(const sal_Char* pHeader, sal_uLong nLen_,
};
int bRet = sal_False;
- OString aName( pName );
- if ( sHTML == aName )
+ if ( sHTML == sName )
bRet = HTMLParser::IsHTMLFormat( pHeader, sal_True, RTL_TEXTENCODING_DONTKNOW );
- else if ( FILTER_RTF == aName )
+ else if ( FILTER_RTF == sName )
bRet = 0 == strncmp( "{\\rtf", pHeader, 5 );
- else if ( sWW5 == aName )
+ else if ( sWW5 == sName )
{
W1_FIB *pW1Header = (W1_FIB*)pHeader;
if (pW1Header->wIdentGet() == 0xA5DC && pW1Header->nFibGet() == 0x65)
@@ -76,17 +74,17 @@ const sal_Char* SwIoDetect::IsReader(const sal_Char* pHeader, sal_uLong nLen_,
else if (pW1Header->wIdentGet() == 0xA5DB && pW1Header->nFibGet() == 0x2D)
bRet = true; /*WW2*/
}
- else if ( sWW1 == aName )
+ else if ( sWW1 == sName )
{
bRet = (( ((W1_FIB*)pHeader)->wIdentGet() == 0xA59C
&& ((W1_FIB*)pHeader)->nFibGet() == 0x21)
&& ((W1_FIB*)pHeader)->fComplexGet() == 0);
}
- else if ( FILTER_TEXT == aName )
+ else if ( FILTER_TEXT == sName )
bRet = SwIoSystem::IsDetectableText(pHeader, nLen_);
- else if ( FILTER_TEXT_DLG == aName)
+ else if ( FILTER_TEXT_DLG == sName)
bRet = SwIoSystem::IsDetectableText( pHeader, nLen_, 0, 0, 0, true);
- return bRet ? pName : 0;
+ return bRet ? sName : OUString();
}
const String SwIoSystem::GetSubStorageName( const SfxFilter& rFltr )
@@ -244,8 +242,8 @@ sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
{
if (aFilterDetect[i].IsFilter(rFmtName))
{
- bRet = 0 != aFilterDetect[i].IsReader( aBuffer, nBytesRead,
- rMedium.GetPhysicalName(), rUserData );
+ OUString sFilter(aFilterDetect[i].IsReader(aBuffer, nBytesRead));
+ bRet = !sFilter.isEmpty();
break;
}
}
@@ -382,14 +380,12 @@ const SfxFilter* SwIoSystem::GetFileFilter(const String& rFileName,
/* nie erkannt und es wird auch der ASCII-Filter returnt. */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
- const SfxFilter* pFilterTmp = 0;
- const sal_Char* pNm;
for( sal_uInt16 n = 0; n < MAXFILTER; ++n )
{
- String sEmptyUserData;
- pNm = aFilterDetect[n].IsReader(aBuffer, nBytesRead, rFileName, sEmptyUserData);
- pFilterTmp = pNm ? SwIoSystem::GetFilterOfFormat(OUString::createFromAscii(pNm), pFCntnr) : 0;
- if (pNm && pFilterTmp)
+ OUString sNm(aFilterDetect[n].IsReader(aBuffer, nBytesRead));
+ const SfxFilter* pFilterTmp =
+ sNm.isEmpty() ? 0 : SwIoSystem::GetFilterOfFormat(sNm, pFCntnr);
+ if (pFilterTmp)
{
return pFilterTmp;
}
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 0254957df955..915887f7833f 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1692,7 +1692,7 @@ _HTMLAttr **SwHTMLParser::GetAttrTabEntry( sal_uInt16 nWhich )
void SwHTMLParser::NewStyle()
{
- String sType;
+ OUString sType;
const HTMLOptions& rOptions2 = GetOptions();
for (size_t i = rOptions2.size(); i; )
@@ -1702,8 +1702,8 @@ void SwHTMLParser::NewStyle()
sType = rOption.GetString();
}
- bIgnoreRawData = sType.Len() &&
- !sType.GetToken(0,';').EqualsAscii(sCSS_mimetype);
+ bIgnoreRawData = !sType.getLength() &&
+ !sType.getToken(0,';').equalsAscii(sCSS_mimetype);
}
void SwHTMLParser::EndStyle()
@@ -1778,8 +1778,7 @@ void SwHTMLParser::InsertLink()
}
else
{
- OUString sRel;
- String sHRef, sType;
+ OUString sRel, sHRef, sType;
const HTMLOptions& rOptions2 = GetOptions();
for (size_t i = rOptions2.size(); i; )
@@ -1799,9 +1798,9 @@ void SwHTMLParser::InsertLink()
}
}
- if( sHRef.Len() && sRel.equalsIgnoreAsciiCase( "STYLESHEET" ) &&
- ( !sType.Len() ||
- sType.GetToken(0,';').EqualsAscii(sCSS_mimetype) ) )
+ if( !sHRef.isEmpty() && sRel.equalsIgnoreAsciiCase( "STYLESHEET" ) &&
+ ( sType.isEmpty() ||
+ sType.getToken(0,';').equalsAscii(sCSS_mimetype) ) )
{
if( GetMedium() )
{
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index d18033870cc5..dac331cced69 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -489,7 +489,8 @@ void SwHTMLParser::InsertEmbed()
#if HAVE_FEATURE_JAVA
void SwHTMLParser::NewObject()
{
- String aClassID, aName, aStandBy, aId, aStyle, aClass;
+ OUString aClassID;
+ String aName, aStandBy, aId, aStyle, aClass;
Size aSize( USHRT_MAX, USHRT_MAX );
Size aSpace( 0, 0 );
sal_Int16 eVertOri = text::VertOrientation::TOP;
@@ -581,10 +582,10 @@ void SwHTMLParser::NewObject()
// Java applets are supported.
sal_Bool bIsApplet = sal_False;
- if( !bDeclare && aClassID.Len() == 42 &&
- aClassID.EqualsAscii( "clsid:", 0, 6 ) )
+ if( !bDeclare && aClassID.getLength() == 42 &&
+ aClassID.startsWith("clsid:") )
{
- aClassID.Erase( 0, 6 );
+ aClassID = aClassID.copy(6);
SvGlobalName aCID;
if( aCID.MakeId( aClassID ) )
{
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index 71b322d5f399..b3fce4839b03 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -31,11 +31,11 @@ namespace
class SameName: public std::unary_function<const sal_Char*, bool>
{
private:
- const String &mrName;
+ const OUString &mrName;
public:
- explicit SameName(const String &rName) : mrName(rName) {}
+ explicit SameName(const OUString &rName) : mrName(rName) {}
bool operator() (const sal_Char *pEntry) const
- { return mrName.EqualsAscii(pEntry); }
+ { return mrName.equalsAscii(pEntry); }
};
const sal_Char **GetStiNames() throw()
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 471964a8f136..bdd05e920bdb 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3452,9 +3452,9 @@ MSWordSections& WW8Export::Sections() const
return *pSepx;
}
-SwWW8Writer::SwWW8Writer(const String& rFltName, const String& rBaseURL)
+SwWW8Writer::SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL)
: StgWriter(),
- m_bWrtWW8( rFltName.EqualsAscii( FILTER_WW8 ) ),
+ m_bWrtWW8( rFltName == FILTER_WW8 ),
m_pExport( NULL ),
mpMedium( 0 )
{
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index b7f4c5cb6050..72735c3e243c 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -858,7 +858,7 @@ friend void WW8_WrtRedlineAuthor::Write(Writer &rWrt);
SfxMedium *mpMedium;
public:
- SwWW8Writer( const String& rFltName, const String& rBaseURL );
+ SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL);
virtual ~SwWW8Writer();
virtual sal_uLong WriteStorage();
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 4023dcb67e62..bc60d6ed4b01 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2051,18 +2051,18 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
//helper function
//For MS MacroButton field, the symbol in plain text is always "(" (0x28),
//which should be mapped according to the macro type
-bool ConvertMacroSymbol( const String& rName, OUString& rReference )
+bool ConvertMacroSymbol( const OUString& rName, OUString& rReference )
{
bool bConverted = false;
if( rReference == "(" )
{
bConverted = true;
sal_Unicode cSymbol = sal_Unicode(); // silence false warning
- if( rName.EqualsAscii( "CheckIt" ) )
+ if (rName == "CheckIt")
cSymbol = 0xF06F;
- else if( rName.EqualsAscii( "UncheckIt" ) )
+ else if (rName == "UncheckIt")
cSymbol = 0xF0FE;
- else if( rName.EqualsAscii( "ShowExample" ) )
+ else if (rName == "ShowExample")
cSymbol = 0xF02A;
//else if... : todo
else