diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-14 13:42:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-15 12:25:48 +0200 |
commit | 1331b4736f434147cf96b7704cf19e191899f81b (patch) | |
tree | 9389799ccb2c3effa6357c46956a66a9227e2987 /sw | |
parent | fa469b2e00d83459faebe4c1fcb3ea1aac5fb20d (diff) |
convert sw/source/filter/xml/*.cxx from String to OUString
Change-Id: Ia02ad8c31561abb672c8dbacc5985bb01cff4e70
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/table/swtable.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 6 |
9 files changed, 47 insertions, 48 deletions
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index c424822b63bb..bf575031553f 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1876,7 +1876,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt ) |* resulting from the position in the lines/boxes/tables. |* |*************************************************************************/ -void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ) +void sw_GetTblBoxColStr( sal_uInt16 nCol, OUString& rNm ) { const sal_uInt16 coDiff = 52; // 'A'-'Z' 'a' - 'z' sal_uInt16 nCalc; @@ -1884,9 +1884,9 @@ void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ) do { nCalc = nCol % coDiff; if( nCalc >= 26 ) - rNm.Insert( sal_Unicode('a' - 26 + nCalc ), 0 ); + rNm = OUString( sal_Unicode('a' - 26 + nCalc ) ) + rNm; else - rNm.Insert( sal_Unicode('A' + nCalc ), 0 ); + rNm = OUString( sal_Unicode('A' + nCalc ) ) + rNm; if( 0 == (nCol = nCol - nCalc) ) break; @@ -1905,7 +1905,7 @@ OUString SwTableBox::GetName() const const SwTable& rTbl = pSttNd->FindTableNode()->GetTable(); sal_uInt16 nPos; - String sNm, sTmp; + OUString sNm, sTmp; const SwTableBox* pBox = this; do { const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes(); @@ -1915,14 +1915,14 @@ OUString SwTableBox::GetName() const ? &pLine->GetUpper()->GetTabLines() : &rTbl.GetTabLines(); sTmp = OUString::number( nPos = pLines->GetPos( pLine ) + 1 ); - if( sNm.Len() ) - sNm.Insert( aDotStr, 0 ).Insert( sTmp, 0 ); + if( !sNm.isEmpty() ) + sNm = sTmp + aDotStr + sNm; else sNm = sTmp; sTmp = OUString::number(( nPos = pBoxes->GetPos( pBox )) + 1 ); if( 0 != ( pBox = pLine->GetUpper()) ) - sNm.Insert( aDotStr, 0 ).Insert( sTmp, 0 ); + sNm = sTmp + aDotStr + sNm; else sw_GetTblBoxColStr( nPos, sNm ); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 3b66f15f4dd9..7e12c92c6cc9 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -100,7 +100,7 @@ using namespace ::com::sun::star; using ::editeng::SvxBorderLine; // from swtable.cxx -extern void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ); +extern void sw_GetTblBoxColStr( sal_uInt16 nCol, OUString& rNm ); #define UNO_TABLE_COLUMN_SUM 10000 @@ -493,7 +493,7 @@ String sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow ) } #endif - String sCellName; + OUString sCellName; if (nColumn < 0 || nRow < 0) return sCellName; sw_GetTblBoxColStr( static_cast< sal_uInt16 >(nColumn), sCellName ); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 66c8d2831963..9c955e16195b 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -122,7 +122,7 @@ int XMLReader::GetReaderType() sal_Int32 ReadThroughComponent( uno::Reference<io::XInputStream> xInputStream, uno::Reference<XComponent> xModelComponent, - const String& rStreamName, + const OUString& rStreamName, uno::Reference<uno::XComponentContext> & rxContext, const sal_Char* pFilterName, const Sequence<Any>& rFilterArguments, @@ -202,11 +202,11 @@ sal_Int32 ReadThroughComponent( OSL_FAIL(aError.getStr()); #endif - String sErr( OUString::number( r.LineNumber )); - sErr += ','; + OUString sErr( OUString::number( r.LineNumber )); + sErr += ","; sErr += OUString::number( r.ColumnNumber ); - if( rStreamName.Len() ) + if( !rStreamName.isEmpty() ) { return *new TwoStringErrorInfo( (bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL @@ -381,9 +381,9 @@ static void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc ) { // array containing the names of the default outline styles ('Heading 1', // 'Heading 2', ..., 'Heading 10') - String aDefOutlStyleNames[ MAXLEVEL ]; + OUString aDefOutlStyleNames[ MAXLEVEL ]; { - String sStyleName; + OUString sStyleName; for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i ) { sStyleName = diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 174bc3a0f4ce..eec7ea2143d2 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -913,7 +913,7 @@ uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesC OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const { - String sServiceName; + OUString sServiceName; if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily ) sServiceName = OUString("com.sun.star.style.FrameStyle"); else diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 7c31973466aa..618748fe1ac4 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1176,7 +1176,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC if( !bIsUserSetting ) { // test over the hash value if the entry is in the table. - String aStr(pValues->Name); + OUString aStr(pValues->Name); bSet = aSet.find(aStr) == aSet.end(); } diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 450b1cc7a68c..4fa9d73b4dcf 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -301,7 +301,7 @@ bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt, return bInsert; } -void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ); +void sw_GetTblBoxColStr( sal_uInt16 nCol, OUString& rNm ); static void lcl_xmltble_appendBoxPrefix( OUStringBuffer& rBuffer, const OUString& rNamePrefix, sal_uInt32 nCol, sal_uInt32 nRow, sal_Bool bTop ) @@ -310,7 +310,7 @@ static void lcl_xmltble_appendBoxPrefix( OUStringBuffer& rBuffer, rBuffer.append( (sal_Unicode)'.' ); if( bTop ) { - String sTmp; + OUString sTmp; sw_GetTblBoxColStr( (sal_uInt16)nCol, sTmp ); rBuffer.append( sTmp ); } @@ -621,7 +621,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, sBuffer.append( (sal_Unicode)'.' ); if( bTop ) { - String sTmp; + OUString sTmp; sw_GetTblBoxColStr( nColumn, sTmp ); sBuffer.append( sTmp ); } @@ -1127,13 +1127,13 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd ) pDDEFldType->GetName() ); // DDE command - const String sCmd = pDDEFldType->GetCmd(); + const OUString sCmd = pDDEFldType->GetCmd(); AddAttribute( XML_NAMESPACE_OFFICE, XML_DDE_APPLICATION, - sCmd.GetToken(0, sfx2::cTokenSeparator) ); + sCmd.getToken(0, sfx2::cTokenSeparator) ); AddAttribute( XML_NAMESPACE_OFFICE, XML_DDE_ITEM, - sCmd.GetToken(1, sfx2::cTokenSeparator) ); + sCmd.getToken(1, sfx2::cTokenSeparator) ); AddAttribute( XML_NAMESPACE_OFFICE, XML_DDE_TOPIC, - sCmd.GetToken(2, sfx2::cTokenSeparator) ); + sCmd.getToken(2, sfx2::cTokenSeparator) ); // auto update if (pDDEFldType->GetType() == sfx2::LINKUPDATE_ALWAYS) diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 60815e00eb51..6efd84c01d83 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1171,17 +1171,17 @@ void SwXMLDDETableContext_Impl::StartElement( } // generate a new name for DDE field type (called by lcl_GetDDEFieldType below) -static String lcl_GenerateFldTypeName(OUString sPrefix, SwTableNode* pTableNode) +static OUString lcl_GenerateFldTypeName(OUString sPrefix, SwTableNode* pTableNode) { - String sPrefixStr(sPrefix); + OUString sPrefixStr(sPrefix); - if (sPrefixStr.Len() == 0) + if (sPrefixStr.isEmpty()) { - sPrefixStr = OUString('_'); + sPrefixStr = "_"; } // increase count until we find a name that is not yet taken - String sName; + OUString sName; sal_Int32 nCount = 0; do { @@ -1204,22 +1204,22 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, SwTableNode* pTableNode) { // make command string - String sCommand(pContext->GetDDEApplication()); - sCommand += sfx2::cTokenSeparator; - sCommand += String(pContext->GetDDEItem()); - sCommand += sfx2::cTokenSeparator; - sCommand += String(pContext->GetDDETopic()); + OUString sCommand(pContext->GetDDEApplication()); + sCommand += OUString(sfx2::cTokenSeparator); + sCommand += pContext->GetDDEItem(); + sCommand += OUString(sfx2::cTokenSeparator); + sCommand += pContext->GetDDETopic(); sal_uInt16 nType = static_cast< sal_uInt16 >(pContext->GetIsAutomaticUpdate() ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL); - String sName(pContext->GetConnectionName()); + OUString sName(pContext->GetConnectionName()); // field type to be returned SwDDEFieldType* pType = NULL; // valid name? - if (sName.Len() == 0) + if (sName.isEmpty()) { sName = lcl_GenerateFldTypeName(pContext->GetDDEApplication(), pTableNode); @@ -2138,9 +2138,9 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if( pTxtNode != NULL ) { // check text: does it look like some form of 0.0? - const String& rText = pTxtNode->GetTxt(); - if( ( rText.Len() > 10 ) || - ( rText.Search( '0' ) == STRING_NOTFOUND ) ) + const OUString& rText = pTxtNode->GetTxt(); + if( ( rText.getLength() > 10 ) || + ( rText.indexOf( '0' ) == -1 ) ) { bSuppressNumericContent = true; } diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index e9aac0715b1a..28344ba42de9 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -205,8 +205,7 @@ void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL( SwGrfNode *pGrfNd = GetNoTxtNode( rPropSet )->GetGrfNode(); if( !pGrfNd->IsGrfLink() ) { - String aNewURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") ); - aNewURL += String(rURL); + OUString aNewURL = "vnd.sun.star.Package:" + rURL; // #i15411# save-as will swap all graphics in; we need to swap // them out again, to prevent excessive memory use @@ -214,18 +213,18 @@ void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL( } } -static void lcl_addURL ( SvXMLExport &rExport, const String &rURL, +static void lcl_addURL ( SvXMLExport &rExport, const OUString &rURL, bool bToRel = true ) { - String sRelURL; + OUString sRelURL; - if( bToRel && (rURL.Len() > 0) ) + if( bToRel && !rURL.isEmpty() ) sRelURL = URIHelper::simpleNormalizedMakeRelative(rExport.GetOrigFileName(), rURL); else sRelURL = rURL; - if (sRelURL.Len()) + if (!sRelURL.isEmpty()) { rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, sRelURL ); rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 717c5949b604..98c516cc4667 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -306,7 +306,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( else { // check whether an object with this name already exists in the document - String aName; + OUString aName; SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { @@ -336,7 +336,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( } } - if ( !aName.Len() ) + if ( aName.isEmpty() ) aName = aObjName; // the correct aspect will be set later @@ -638,7 +638,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( SwApplet_Impl aAppletImpl ( aItemSet ); - String sCodeBase; + OUString sCodeBase; if( !rHRef.isEmpty() ) sCodeBase = GetXMLImport().GetAbsoluteReference( rHRef ); |