diff options
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 28 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 4 |
4 files changed, 25 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 3004bbb28e97..ba92b6da0916 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -951,13 +951,14 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(String &rString, WW8_CP nS //Strip out fields, leaving the result long nDummy(0); lcl_StripFields(rString, nDummy); + OUString aString(rString); //Strip out word's special characters for the simple string - rString = comphelper::string::remove(rString, 0x1); - rString = comphelper::string::remove(rString, 0x5); - rString = comphelper::string::remove(rString, 0x8); - rString.SearchAndReplaceAllAscii("\007\007", OUString("\007\012")); - rString.SearchAndReplaceAll(0x7, ' '); - + aString = comphelper::string::remove(aString, 0x1); + aString = comphelper::string::remove(aString, 0x5); + aString = comphelper::string::remove(aString, 0x8); + aString = aString.replaceAll(OUString("\007\007"), OUString("\007\012")); + aString = aString.replace(0x7, ' '); + rString = aString; } return pRet; diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 61663e2ed495..26e56834082b 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1535,7 +1535,7 @@ private: String GetFieldResult( WW8FieldDesc* pF ); void MakeTagString( String& rStr, const String& rOrg ); void UpdateFields(); - void ConvertFFileName( String& rName, const String& rRaw ); + OUString ConvertFFileName(const OUString& rRaw); long Read_F_Tag( WW8FieldDesc* pF ); void InsertTagField( const sal_uInt16 nId, const String& rTagText ); long ImportExtSprm(WW8PLCFManResult* pRes); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index de7cb1b46919..09e957c4915e 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -418,20 +418,22 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) // ConvertFFileName uebersetzt FeldParameter-Namen u. ae. in den // System-Zeichensatz. // Gleichzeitig werden doppelte Backslashes in einzelne uebersetzt. -void SwWW8ImplReader::ConvertFFileName( String& rName, const String& rOrg ) +OUString SwWW8ImplReader::ConvertFFileName(const OUString& rOrg) { - rName = rOrg; - rName.SearchAndReplaceAllAscii( "\\\\", OUString( '\\' )); - rName.SearchAndReplaceAllAscii( "%20", OUString( ' ' )); + OUString aName = rOrg; + aName = aName.replaceAll("\\\\", OUString('\\')); + aName = aName.replaceAll("%20", OUString(' ')); // ggfs. anhaengende Anfuehrungszeichen entfernen - if( rName.Len() && '"' == rName.GetChar( rName.Len()-1 )) - rName.Erase( rName.Len()-1, 1); + if (!aName.isEmpty() && '"' == aName[aName.getLength()-1]) + aName = aName.copy(0, aName.getLength()-1); - // Need the more sophisticated url converter. cmc - if (rName.Len()) - rName = URIHelper::SmartRel2Abs( - INetURLObject(sBaseURL), rName, Link(), false); + // Need the more sophisticated url converter. + if (!aName.isEmpty()) + aName = URIHelper::SmartRel2Abs( + INetURLObject(sBaseURL), aName, Link(), false); + + return aName; } // ConvertUFNneme uebersetzt FeldParameter-Namen u. ae. in den @@ -2409,7 +2411,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, String& rStr ) { case -2: if (!aGrfName.Len()) - ConvertFFileName(aGrfName, aReadParam.GetResult()); + aGrfName = ConvertFFileName(aReadParam.GetResult()); break; case 'd': @@ -2485,7 +2487,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, String& rStr break; } } - ConvertFFileName(aPara, aPara); + aPara = ConvertFFileName(aPara); if (aBook.Len() && aBook.GetChar( 0 ) != '\\') { @@ -3540,7 +3542,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) { case -2: if (!sURL.Len() && !bOptions) - ConvertFFileName(sURL, aReadParam.GetResult()); + sURL = ConvertFFileName(aReadParam.GetResult()); break; case 'n': diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 4f981d41f1a6..5f1a8f58b1c4 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -809,8 +809,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) void* pData; WW8_CP nTest; pWkb->Get(nTest, pData); - String sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ]; - mrReader.ConvertFFileName(sSectionName, sSectionName); + OUString sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ]; + sSectionName = mrReader.ConvertFFileName(sSectionName); SwSectionData aSection(FILE_LINK_SECTION, sSectionName); aSection.SetLinkFileName( sSectionName ); aSection.SetProtectFlag(true); |