diff options
24 files changed, 231 insertions, 232 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 60ab1b153ecd..1ff4474f3f32 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -187,7 +187,7 @@ public: virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet ) = 0; /// Output text (without markup). - virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) = 0; + virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) = 0; /// Output ruby start. virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ) = 0; @@ -196,12 +196,12 @@ public: virtual void EndRuby() = 0; /// Output URL start. - virtual bool StartURL( const String& rUrl, const String& rTarget ) = 0; + virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ) = 0; /// Output URL end. virtual bool EndURL() = 0; - virtual void FieldVanish( const String& rTxt, ww::eField eType ) = 0; + virtual void FieldVanish( const OUString& rTxt, ww::eField eType ) = 0; void StartTOX( const SwSection& rSect ); @@ -260,7 +260,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ) = 0; /// Start of a style in the styles table. - virtual void StartStyle( const String& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ) = 0; @@ -337,7 +337,7 @@ public: sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush = 0) = 0; // #i120928 export graphic of bullet protected: @@ -584,9 +584,9 @@ protected: /// Write the expanded field virtual void WriteExpand( const SwField* pFld ) = 0; - virtual void RefField( const SwField& rFld, const String& rRef ) = 0; + virtual void RefField( const SwField& rFld, const OUString& rRef ) = 0; virtual void HiddenField( const SwField& rFld ) = 0; - virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ) = 0; + virtual void SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ) = 0; virtual void PostitField( const SwField* pFld ) = 0; virtual bool DropdownField( const SwField* pFld ) = 0; virtual bool PlaceholderField( const SwField* pFld ) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 45bb75112b85..6436ae0f9484 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -914,7 +914,7 @@ void DocxAttributeOutput::CmdField_Impl( FieldInfos& rInfos ) for ( xub_StrLen i = 0; i < nNbToken; i++ ) { - OUString sToken = rInfos.sCmd.GetToken( i, '\t' ); + OUString sToken = rInfos.sCmd.getToken( i, '\t' ); if ( rInfos.eType == ww::eCREATEDATE || rInfos.eType == ww::eSAVEDATE || rInfos.eType == ww::ePRINTDATE @@ -999,7 +999,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos ) bool bIsSetField = rInfos.pField->GetTyp( )->Which( ) == RES_SETEXPFLD; bool bShowRef = ( !bIsSetField || ( nSubType & nsSwExtendedSubType::SUB_INVISIBLE ) ) ? false : true; - if ( ( m_sFieldBkm.Len( ) > 0 ) && bShowRef ) + if ( ( !m_sFieldBkm.isEmpty() ) && bShowRef ) { // Write the field beginning m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); @@ -1009,9 +1009,9 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos ) m_pSerializer->endElementNS( XML_w, XML_r ); rInfos.sCmd = FieldString( ww::eREF ); - rInfos.sCmd.AppendAscii( "\"" ); + rInfos.sCmd += "\""; rInfos.sCmd += m_sFieldBkm; - rInfos.sCmd.AppendAscii( "\" " ); + rInfos.sCmd += "\" "; // Clean the field bookmark data to avoid infinite loop m_sFieldBkm = String( ); @@ -1268,7 +1268,7 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pEnd, false ); } -void DocxAttributeOutput::RawText( const String& /*rText*/, bool /*bForceUnicode*/, rtl_TextEncoding /*eCharSet*/ ) +void DocxAttributeOutput::RawText( const OUString& /*rText*/, bool /*bForceUnicode*/, rtl_TextEncoding /*eCharSet*/ ) { OSL_TRACE("TODO DocxAttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet )" ); } @@ -1366,7 +1366,7 @@ bool DocxAttributeOutput::AnalyzeURL( const OUString& rUrl, const OUString& rTar return bBookMarkOnly; } -bool DocxAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) +bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarget ) { OUString sMark; OUString sUrl; @@ -1435,7 +1435,7 @@ bool DocxAttributeOutput::EndURL() return true; } -void DocxAttributeOutput::FieldVanish( const String& rTxt, ww::eField eType ) +void DocxAttributeOutput::FieldVanish( const OUString& rTxt, ww::eField eType ) { WriteField_Impl( NULL, eType, rTxt, WRITEFIELD_ALL ); } @@ -3596,7 +3596,7 @@ oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML() return m_rDrawingML; } -void DocxAttributeOutput::StartStyle( const String& rName, bool bPapFmt, +void DocxAttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate ) { m_pSerializer->startElementNS( XML_w, XML_style, @@ -3941,10 +3941,10 @@ void DocxAttributeOutput::SectionType( sal_uInt8 nBreakCode ) FSEND ); } -void DocxAttributeOutput::StartFont( const String& rFamilyName ) const +void DocxAttributeOutput::StartFont( const OUString& rFamilyName ) const { m_pSerializer->startElementNS( XML_w, XML_font, - FSNS( XML_w, XML_name ), OUStringToOString( OUString( rFamilyName ), RTL_TEXTENCODING_UTF8 ).getStr(), + FSNS( XML_w, XML_name ), OUStringToOString( rFamilyName, RTL_TEXTENCODING_UTF8 ).getStr(), FSEND ); } @@ -3953,10 +3953,10 @@ void DocxAttributeOutput::EndFont() const m_pSerializer->endElementNS( XML_w, XML_font ); } -void DocxAttributeOutput::FontAlternateName( const String& rName ) const +void DocxAttributeOutput::FontAlternateName( const OUString& rName ) const { m_pSerializer->singleElementNS( XML_w, XML_altName, - FSNS( XML_w, XML_val ), OUStringToOString( OUString( rName ), RTL_TEXTENCODING_UTF8 ).getStr(), + FSNS( XML_w, XML_val ), OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), FSEND ); } @@ -4181,7 +4181,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush) { m_pSerializer->startElementNS( XML_w, XML_lvl, @@ -4744,7 +4744,7 @@ void DocxAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt ) m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } -void DocxAttributeOutput::RefField( const SwField& rFld, const String& rRef ) +void DocxAttributeOutput::RefField( const SwField& rFld, const OUString& rRef ) { sal_uInt16 nType = rFld.GetTyp( )->Which( ); if ( nType == RES_GETEXPFLD ) @@ -4853,7 +4853,7 @@ void DocxAttributeOutput::WritePendingPlaceholder() m_pSerializer->endElementNS( XML_w, XML_sdt ); } -void DocxAttributeOutput::SetField( const SwField& rFld, ww::eField eType, const String& rCmd ) +void DocxAttributeOutput::SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ) { // field bookmarks are handled in the EndRun method GetExport().OutputField(&rFld, eType, rCmd ); @@ -4866,7 +4866,7 @@ void DocxAttributeOutput::WriteExpand( const SwField* pFld ) m_rExport.OutputField( pFld, ww::eUNKNOWN, sCmd ); } -void DocxAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode ) +void DocxAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField eType, const OUString& rFldCmd, sal_uInt8 nMode ) { struct FieldInfos infos; if (pFld) diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 3725de73f0df..5a53d34edeb1 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -50,7 +50,7 @@ struct FieldInfos ww::eField eType; bool bOpen; bool bClose; - String sCmd; + OUString sCmd; FieldInfos() : pField(NULL), pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){} }; @@ -149,7 +149,7 @@ public: virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ); /// Output text (without markup). - virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); + virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); @@ -158,12 +158,12 @@ public: virtual void EndRuby(); /// Output URL start. - virtual bool StartURL( const String& rUrl, const String& rTarget ); + virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ); /// Output URL end. virtual bool EndURL(); - virtual void FieldVanish( const String& rTxt, ww::eField eType ); + virtual void FieldVanish( const OUString& rTxt, ww::eField eType ); /// Output redlining. /// @@ -225,7 +225,7 @@ public: void OutputDefaultItem(const SfxPoolItem& rHt); /// Start of a style in the styles table. - virtual void StartStyle( const String& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ); @@ -279,13 +279,13 @@ public: virtual void SectionType( sal_uInt8 nBreakCode ); /// Start the font. - void StartFont( const String& rFamilyName ) const; + void StartFont( const OUString& rFamilyName ) const; /// End the font. void EndFont() const; /// Alternate name for the font. - void FontAlternateName( const String& rName ) const; + void FontAlternateName( const OUString& rName ) const; /// Font charset. void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const; @@ -320,10 +320,10 @@ public: sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush = 0 ); - void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode ); + void WriteField_Impl( const SwField* pFld, ww::eField eType, const OUString& rFldCmd, sal_uInt8 nMode ); void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark ); void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds ); @@ -612,9 +612,9 @@ protected: /// Write the expanded field virtual void WriteExpand( const SwField* pFld ); - virtual void RefField( const SwField& rFld, const String& rRef ); + virtual void RefField( const SwField& rFld, const OUString& rRef ); virtual void HiddenField( const SwField& rFld ); - virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); + virtual void SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); virtual bool PlaceholderField( const SwField* pFld ); @@ -677,7 +677,7 @@ private: /// Field data to remember in the text run std::vector< FieldInfos > m_Fields; - String m_sFieldBkm; + OUString m_sFieldBkm; sal_Int32 m_nNextMarkId; /// Bookmarks to output diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 3abb5467a97b..7403e3b9b9a3 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -233,7 +233,7 @@ void DocxExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags, #endif } -void DocxExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, sal_uInt8 nMode ) +void DocxExport::OutputField( const SwField* pFld, ww::eField eFldType, const OUString& rFldCmd, sal_uInt8 nMode ) { m_pAttrOutput->WriteField_Impl( pFld, eFldType, rFldCmd, nMode ); } diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 6080cbc49637..55945de59651 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -127,7 +127,7 @@ public: /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, - const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); + const OUString& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5df5f7d41b0a..47731f4be4d4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -439,7 +439,7 @@ OStringBuffer& RtfAttributeOutput::Styles() return m_aStyles; } -void RtfAttributeOutput::RawText( const String& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet ) +void RtfAttributeOutput::RawText( const OUString& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); m_aRunText->append(msfilter::rtfutil::OutString(rText, eCharSet)); @@ -455,7 +455,7 @@ void RtfAttributeOutput::EndRuby() SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } -bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) +bool RtfAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarget ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); @@ -474,7 +474,7 @@ bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) m_aStyles.append("\" "); } - if( rTarget.Len() ) + if( !rTarget.isEmpty() ) { m_aStyles.append("\\\\t \""); m_aStyles.append(msfilter::rtfutil::OutString( rTarget, m_rExport.eCurrentEncoding)); @@ -498,7 +498,7 @@ bool RtfAttributeOutput::EndURL() return true; } -void RtfAttributeOutput::FieldVanish( const String& /*rTxt*/, ww::eField /*eType*/ ) +void RtfAttributeOutput::FieldVanish( const OUString& /*rTxt*/, ww::eField /*eType*/ ) { SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } @@ -1061,11 +1061,11 @@ void RtfAttributeOutput::DefaultStyle( sal_uInt16 /*nStyle*/ ) /* noop, the default style is always 0 in RTF */ } -void RtfAttributeOutput::StartStyle( const String& rName, bool bPapFmt, +void RtfAttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool /* bAutoUpdate */ ) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << OUString(rName) << "'"); + SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << rName << "'"); m_aStylesheet.append('{'); if (bPapFmt) @@ -1322,7 +1322,7 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 /*nListTabPos*/, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); @@ -1383,14 +1383,14 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, SVX_NUM_BITMAP == nNumberingType ) { m_rExport.Strm() << "\\'01"; - sal_Unicode cChar = rNumberingString.GetChar(0); + sal_Unicode cChar = rNumberingString[0]; m_rExport.Strm() << "\\u"; m_rExport.OutULong(cChar); m_rExport.Strm() << " ?"; } else { - m_rExport.Strm() << "\\'" << msfilter::rtfutil::OutHex( rNumberingString.Len(), 2 ).getStr(); + m_rExport.Strm() << "\\'" << msfilter::rtfutil::OutHex( rNumberingString.getLength(), 2 ).getStr(); m_rExport.Strm() << msfilter::rtfutil::OutString( rNumberingString, m_rExport.eDefaultEncoding, /*bUnicode =*/ false ).getStr(); } @@ -1424,12 +1424,12 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, m_rExport.Strm() << '}'; } -void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const String& rFldCmd, sal_uInt8 /*nMode*/ ) +void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const OUString& rFldCmd, sal_uInt8 /*nMode*/ ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); // If there are no field instructions, don't export it as a field. - bool bHasInstructions = rFldCmd.Len() > 0; + bool bHasInstructions = !rFldCmd.isEmpty(); if (bHasInstructions) { m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD); @@ -3154,7 +3154,7 @@ void RtfAttributeOutput::WriteExpand( const SwField* pFld ) } } -void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const String& /*rRef*/ ) +void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const OUString& /*rRef*/ ) { SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } @@ -3164,7 +3164,7 @@ void RtfAttributeOutput::HiddenField( const SwField& /*rFld*/ ) SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } -void RtfAttributeOutput::SetField( const SwField& /*rFld*/, ww::eField /*eType*/, const String& /*rCmd*/ ) +void RtfAttributeOutput::SetField( const SwField& /*rFld*/, ww::eField /*eType*/, const OUString& /*rCmd*/ ) { SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); } @@ -3259,11 +3259,11 @@ MSWordExportBase& RtfAttributeOutput::GetExport() // These are used by wwFont::WriteRtf() /// Start the font. -void RtfAttributeOutput::StartFont( const String& rFamilyName ) const +void RtfAttributeOutput::StartFont( const OUString& rFamilyName ) const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OUStringToOString( OUString( rFamilyName ), m_rExport.eCurrentEncoding ).getStr(); + m_rExport.Strm() << OUStringToOString( rFamilyName, m_rExport.eCurrentEncoding ).getStr(); } /// End the font. @@ -3275,12 +3275,12 @@ void RtfAttributeOutput::EndFont() const } /// Alternate name for the font. -void RtfAttributeOutput::FontAlternateName( const String& rName ) const +void RtfAttributeOutput::FontAlternateName( const OUString& rName ) const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FALT << ' '; - m_rExport.Strm() << OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ).getStr() << '}'; + m_rExport.Strm() << OUStringToOString( rName, m_rExport.eCurrentEncoding ).getStr() << '}'; } /// Font charset. diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 91bfd726c07b..708a40606837 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -83,7 +83,7 @@ public: OStringBuffer& Styles(); /// Output text (without markup). - virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); + virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); @@ -92,12 +92,12 @@ public: virtual void EndRuby(); /// Output URL start. - virtual bool StartURL( const String& rUrl, const String& rTarget ); + virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ); /// Output URL end. virtual bool EndURL(); - virtual void FieldVanish( const String& rTxt, ww::eField eType ); + virtual void FieldVanish( const OUString& rTxt, ww::eField eType ); /// Output redlining. /// @@ -134,7 +134,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ); /// Start of a style in the styles table. - virtual void StartStyle( const String& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ); @@ -208,10 +208,10 @@ public: sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush = 0);//For i120928,to export graphic of bullet - void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode ); + void WriteField_Impl( const SwField* pFld, ww::eField eType, const OUString& rFldCmd, sal_uInt8 nMode ); void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds ); void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg ); @@ -426,9 +426,9 @@ protected: /// Write the expanded field virtual void WriteExpand( const SwField* pFld ); - virtual void RefField( const SwField& rFld, const String& rRef ); + virtual void RefField( const SwField& rFld, const OUString& rRef ); virtual void HiddenField( const SwField& rFld ); - virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); + virtual void SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); virtual bool PlaceholderField( const SwField* pFld ); @@ -465,7 +465,7 @@ private: /* * Current style name and its ID. */ - String m_rStyleName; + OUString m_rStyleName; sal_uInt16 m_nStyleId; /* * Current list ID. @@ -598,13 +598,13 @@ public: // These are used by wwFont::WriteRtf() /// Start the font. - void StartFont( const String& rFamilyName ) const; + void StartFont( const OUString& rFamilyName ) const; /// End the font. void EndFont() const; /// Alternate name for the font. - void FontAlternateName( const String& rName ) const; + void FontAlternateName( const OUString& rName ) const; /// Font charset. void FontCharset( sal_uInt8 nCharSet ) const; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 87dd8d3034f6..76a762978a8e 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -274,7 +274,7 @@ void RtfExport::WriteRevTab() Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' '; for(sal_uInt16 i = 0; i < m_aRedlineTbl.size(); ++i) { - const String* pAuthor = GetRedline(i); + const OUString* pAuthor = GetRedline(i); Strm() << '{'; if (pAuthor) Strm() << msfilter::rtfutil::OutString(*pAuthor, eDefaultEncoding).getStr(); @@ -309,7 +309,7 @@ void RtfExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags, WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF, true ); } -void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, sal_uInt8 nMode ) +void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const OUString& rFldCmd, sal_uInt8 nMode ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); @@ -832,9 +832,9 @@ SvStream& RtfExport::OutLong( long nVal ) return m_pWriter->OutLong( Strm(), nVal ); } -void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent, bool bUpr) +void RtfExport::OutUnicode(const sal_Char *pToken, const OUString &rContent, bool bUpr) { - if (rContent.Len()) + if (!rContent.isEmpty()) { if (!bUpr) { @@ -1048,22 +1048,22 @@ OString* RtfExport::GetStyle( sal_uInt16 nId ) return NULL; } -sal_uInt16 RtfExport::GetRedline( const String& rAuthor ) +sal_uInt16 RtfExport::GetRedline( const OUString& rAuthor ) { - std::map<String,sal_uInt16>::iterator i = m_aRedlineTbl.find(rAuthor); + std::map<OUString,sal_uInt16>::iterator i = m_aRedlineTbl.find(rAuthor); if (i != m_aRedlineTbl.end()) return i->second; else { int nId = m_aRedlineTbl.size(); - m_aRedlineTbl.insert(std::pair<String,sal_uInt16>(rAuthor,nId)); + m_aRedlineTbl.insert(std::pair<OUString,sal_uInt16>(rAuthor,nId)); return nId; } } -const String* RtfExport::GetRedline( sal_uInt16 nId ) +const OUString* RtfExport::GetRedline( sal_uInt16 nId ) { - for(std::map<String,sal_uInt16>::iterator aIter = m_aRedlineTbl.begin(); aIter != m_aRedlineTbl.end(); ++aIter) + for(std::map<OUString,sal_uInt16>::iterator aIter = m_aRedlineTbl.begin(); aIter != m_aRedlineTbl.end(); ++aIter) if ((*aIter).second == nId) return &(*aIter).first; return NULL; diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index f4cbd4311e51..fb08b9d59263 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -27,7 +27,7 @@ class RtfExportFilter; class RtfSdrExport; typedef std::map<sal_uInt16,Color> RtfColorTbl; typedef std::map<sal_uInt16,OString> RtfStyleTbl; -typedef std::map<String,sal_uInt16> RtfRedlineTbl; +typedef std::map<OUString,sal_uInt16> RtfRedlineTbl; class SwNode; class SwTxtNode; class SwGrfNode; @@ -91,7 +91,7 @@ public: /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, - const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); + const OUString& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); @@ -158,7 +158,7 @@ public: SvStream& Strm(); SvStream& OutULong( sal_uLong nVal ); SvStream& OutLong( long nVal ); - void OutUnicode(const sal_Char *pToken, const String &rContent, bool bUpr = false); + void OutUnicode(const sal_Char *pToken, const OUString &rContent, bool bUpr = false); void OutDateTime(const sal_Char* pStr, const css::util::DateTime& rDT ); void OutPageDescription( const SwPageDesc& rPgDsc, bool bWriteReset, bool bCheckForFirstPage ); @@ -166,8 +166,8 @@ public: void InsColor( const Color& rCol ); void InsColorLine( const SvxBoxItem& rBox ); void OutColorTable(); - sal_uInt16 GetRedline( const String& rAuthor ); - const String* GetRedline( sal_uInt16 nId ); + sal_uInt16 GetRedline( const OUString& rAuthor ); + const OUString* GetRedline( sal_uInt16 nId ); void InsStyle( sal_uInt16 nId, const OString& rStyle ); OString* GetStyle( sal_uInt16 nId ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index a7d97a1ec497..4b56a712abd6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -840,7 +840,7 @@ bool WW8AttributeOutput::AnalyzeURL( const OUString& rUrl, const OUString& rTarg return bBookMarkOnly; } -bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget ) +bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget ) { // hyperlinks only in WW8 if ( !m_rWW8Export.bWrtWW8 ) @@ -882,7 +882,7 @@ bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget ) // Compare the URL written by AnalyzeURL with the original one to see if // the output URL is absolute or relative. String sRelativeURL; - if ( rUrl.Len() ) + if ( !rUrl.isEmpty() ) sRelativeURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), rUrl ); bool bAbsolute = sRelativeURL.Equals( rUrl ); @@ -1008,7 +1008,7 @@ bool WW8AttributeOutput::EndURL() return true; } -String BookmarkToWord(const String &rBookmark) +OUString BookmarkToWord(const OUString &rBookmark) { String sRet(INetURLObject::encode(rBookmark, INetURLObject::PART_REL_SEGMENT_EXTRA, '%', @@ -1016,7 +1016,7 @@ String BookmarkToWord(const String &rBookmark) return TruncateBookmark(sRet); } -String BookmarkToWriter(const String &rBookmark) +OUString BookmarkToWriter(const OUString &rBookmark) { return INetURLObject::decode(rBookmark, '%', INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_ASCII_US); @@ -1029,7 +1029,7 @@ void SwWW8AttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool) &rAttr.GetRefName(), 0 )); } -void WW8AttributeOutput::FieldVanish( const String& rTxt, ww::eField /*eType*/ ) +void WW8AttributeOutput::FieldVanish( const OUString& rTxt, ww::eField /*eType*/ ) { ww::bytes aItems; m_rWW8Export.GetCurrentItems( aItems ); @@ -1053,7 +1053,7 @@ void WW8AttributeOutput::FieldVanish( const String& rTxt, ww::eField /*eType*/ ) m_rWW8Export.WriteChar( '\x13' ); m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.size(), aItems.data() ); - m_rWW8Export.OutSwString( rTxt, 0, rTxt.Len(), m_rWW8Export.IsUnicode(), + m_rWW8Export.OutSwString( rTxt, 0, rTxt.getLength(), m_rWW8Export.IsUnicode(), RTL_TEXTENCODING_MS_1252 ); m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), nStt_sprmCFSpec, aItems.data() ); @@ -1394,13 +1394,13 @@ Convert characters that need to be converted, the basic replacements and the ridicously complicated title case attribute mapping to hardcoded upper case because word doesn't have the feature */ -String SwWW8AttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos, +OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, xub_StrLen nAktPos, xub_StrLen nLen) const { if (!nLen) return OUString(); - OUString aSnippet(rStr.Copy(nAktPos, nLen)); + OUString aSnippet(rStr.copy(nAktPos, nLen)); // 0x0a ( Hard Line Break ) -> 0x0b // 0xad ( soft hyphen ) -> 0x1f // 0x2011 ( hard hyphen ) -> 0x1e @@ -1444,7 +1444,7 @@ String SwWW8AttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos, rStr, nAktPos, g_pBreakIt->GetLocale(nLanguage), i18n::WordType::ANYWORD_IGNOREWHITESPACES ) ) { - aSnippet = OUString(rStr.GetChar(nAktPos)) + aSnippet.copy(1); + aSnippet = OUString(rStr[nAktPos]) + aSnippet.copy(1); } } m_rExport.m_aCurrentCharPropStarts.pop(); diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index f0caf1917a58..f095cf1dd6f8 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -196,7 +196,7 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush //For i120928,to transfer graphic of bullet ) { @@ -298,7 +298,7 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/, m_rWW8Export.pTableStrm->Write( aCharAtrs.data(), aCharAtrs.size() ); // write the num string - SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, rNumberingString.Len() ); + SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, rNumberingString.getLength() ); SwWW8Writer::WriteString16( *m_rWW8Export.pTableStrm, rNumberingString, false ); } @@ -363,8 +363,8 @@ void MSWordExportBase::AbstractNumberingDefinitions() } // Build the NumString for this Level - String sNumStr; - String sFontName; + OUString sNumStr; + OUString sFontName; bool bWriteBullet = false; const Font* pBulletFont=0; rtl_TextEncoding eChrSet=0; @@ -372,7 +372,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() || SVX_NUM_BITMAP == rFmt.GetNumberingType() ) { - sNumStr = rFmt.GetBulletChar(); + sNumStr = OUString(rFmt.GetBulletChar()); bWriteBullet = true; pBulletFont = rFmt.GetBulletFont(); @@ -412,12 +412,12 @@ void MSWordExportBase::AbstractNumberingDefinitions() for( sal_uInt8 i = 0; i <= nLvl; ++i ) { String sSrch( OUString::number( i )); - xub_StrLen nFnd = sNumStr.Search( sSrch ); - if( STRING_NOTFOUND != nFnd ) + sal_Int32 nFnd = sNumStr.indexOf( sSrch ); + if( -1 != nFnd ) { *pLvlPos = (sal_uInt8)(nFnd + rFmt.GetPrefix().getLength() + 1 ); ++pLvlPos; - sNumStr.SetChar( nFnd, (char)i ); + sNumStr = sNumStr.replaceAt( nFnd, 1, OUString((char)i) ); } } // #i86652# @@ -433,7 +433,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() } if( !rFmt.GetPrefix().isEmpty() ) - sNumStr.Insert( rFmt.GetPrefix(), 0 ); + sNumStr = rFmt.GetPrefix() + sNumStr; sNumStr += rFmt.GetSuffix(); } @@ -455,7 +455,7 @@ void MSWordExportBase::AbstractNumberingDefinitions() aSet.ClearItem( RES_CHRATR_CJK_FONT ); aSet.ClearItem( RES_CHRATR_FONT ); - if ( !sFontName.Len() ) + if ( sFontName.isEmpty() ) sFontName = pBulletFont->GetName(); pPseudoFont = new wwFont( sFontName, pBulletFont->GetPitch(), @@ -637,9 +637,9 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, const Font& rFont = rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : numfunc::GetDefBulletFont(); - String sNumStr = OUString(rFmt.GetBulletChar()); + OUString sNumStr = OUString(rFmt.GetBulletChar()); rtl_TextEncoding eChrSet = rFont.GetCharSet(); - String sFontName = rFont.GetName(); + OUString sFontName = rFont.GetName(); sal_uInt16 nFontId; if ( IsStarSymbol(sFontName) ) @@ -653,7 +653,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, wwFont aPseudoFont(sFontName, rFont.GetPitch(), rFont.GetFamily(), eChrSet, bWrtWW8); nFontId = maFontHelper.GetId(aPseudoFont); - *rpCh = static_cast<sal_uInt8>(sNumStr.GetChar(0)); + *rpCh = static_cast<sal_uInt8>(sNumStr[0]); } else { @@ -666,7 +666,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, true unicode to an 8bit charset */ nFontId = maFontHelper.GetId(rFont); - sal_Unicode cChar = sNumStr.GetChar(0); + sal_Unicode cChar = sNumStr[0]; if ( (eChrSet == RTL_TEXTENCODING_SYMBOL) && (cChar >= 0xF000) && ( cChar <= 0xF0FF) ) { @@ -693,17 +693,17 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, } } -void MSWordExportBase::SubstituteBullet( String& rNumStr, - rtl_TextEncoding& rChrSet, String& rFontName ) const +void MSWordExportBase::SubstituteBullet( OUString& rNumStr, + rtl_TextEncoding& rChrSet, OUString& rFontName ) const { if (!bSubstituteBullets) return; OUString sFontName = rFontName; // If Bullet char is "", don't change - if (rNumStr.GetChar(0) != sal_Unicode(0x0)) + if (rNumStr[0] != sal_Unicode(0x0)) { - rNumStr.SetChar(0, msfilter::util::bestFitOpenSymbolToMSFont(rNumStr.GetChar(0), rChrSet, sFontName, !SupportsUnicode())); + rNumStr = rNumStr.replaceAt(0, 1, OUString( msfilter::util::bestFitOpenSymbolToMSFont(rNumStr[0], rChrSet, sFontName, !SupportsUnicode()) )); } rFontName = sFontName; diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index cf954bff5a3d..0b3d60fc583c 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -372,7 +372,7 @@ void WW8AttributeOutput::EndStyle() m_rWW8Export.pO->clear(); } -void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, sal_uInt16 nWwBase, +void WW8AttributeOutput::StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nWwBase, sal_uInt16 nWwNext, sal_uInt16 nWwId, sal_uInt16 /*nId*/, bool bAutoUpdate ) { sal_uInt8 aWW8_STD[ sizeof( WW8_STD ) ]; @@ -405,7 +405,7 @@ void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, sal_uInt sal_uInt16 nLen = static_cast< sal_uInt16 >( ( pData - aWW8_STD ) + 1 + - ((m_rWW8Export.bWrtWW8 ? 2 : 1 ) * (rName.Len() + 1)) ); // temporary + ((m_rWW8Export.bWrtWW8 ? 2 : 1 ) * (rName.getLength() + 1)) ); // temporary nPOPosStdLen1 = m_rWW8Export.pO->size(); // Adr1 zum nachtragen der Laenge @@ -417,12 +417,12 @@ void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, sal_uInt // write names if( m_rWW8Export.bWrtWW8 ) { - SwWW8Writer::InsUInt16( *m_rWW8Export.pO, rName.Len() ); // length + SwWW8Writer::InsUInt16( *m_rWW8Export.pO, rName.getLength() ); // length SwWW8Writer::InsAsString16( *m_rWW8Export.pO, rName ); } else { - m_rWW8Export.pO->push_back( (sal_uInt8)rName.Len() ); // length + m_rWW8Export.pO->push_back( (sal_uInt8)rName.getLength() ); // length SwWW8Writer::InsAsString8( *m_rWW8Export.pO, rName, RTL_TEXTENCODING_MS_1252 ); } m_rWW8Export.pO->push_back( (sal_uInt8)0 ); // Trotz P-String 0 am Ende! @@ -687,14 +687,14 @@ void MSWordStyles::OutputStylesTable() //--------------------------------------------------------------------------- // Fonts //--------------------------------------------------------------------------- -wwFont::wwFont(const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, +wwFont::wwFont(const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily, rtl_TextEncoding eChrSet, bool bWrtWW8) : mbAlt(false), mbWrtWW8(bWrtWW8), mePitch(ePitch), meFamily(eFamily), meChrSet(eChrSet) { FontMapExport aResult(rFamilyName); msFamilyNm = aResult.msPrimary; msAltNm = aResult.msSecondary; - if (msAltNm.Len() && msAltNm != msFamilyNm && - (msFamilyNm.Len() + msAltNm.Len() + 2 <= 65) ) + if (!msAltNm.isEmpty() && msAltNm != msFamilyNm && + (msFamilyNm.getLength() + msAltNm.getLength() + 2 <= 65) ) { //max size of szFfn in 65 chars mbAlt = true; @@ -704,15 +704,15 @@ wwFont::wwFont(const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, if (bWrtWW8) { - maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 0x22 + ( 2 * ( 1 + msFamilyNm.Len() ) )); + maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 0x22 + ( 2 * ( 1 + msFamilyNm.getLength() ) )); if (mbAlt) - maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 2 * ( 1 + msAltNm.Len())); + maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 2 * ( 1 + msAltNm.getLength())); } else { - maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 1 + msFamilyNm.Len() ); + maWW8_FFN[0] = (sal_uInt8)( 6 - 1 + 1 + msFamilyNm.getLength() ); if (mbAlt) - maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 1 + msAltNm.Len()); + maWW8_FFN[0] = static_cast< sal_uInt8 >(maWW8_FFN[0] + 1 + msAltNm.getLength()); } sal_uInt8 aB = 0; @@ -763,7 +763,7 @@ wwFont::wwFont(const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, rtl_getBestWindowsCharsetFromTextEncoding(eChrSet); if (mbAlt) - maWW8_FFN[5] = static_cast< sal_uInt8 >(msFamilyNm.Len() + 1); + maWW8_FFN[5] = static_cast< sal_uInt8 >(msFamilyNm.getLength() + 1); } bool wwFont::Write(SvStream *pTableStrm) const @@ -825,10 +825,9 @@ bool operator<(const wwFont &r1, const wwFont &r2) int nRet = memcmp(r1.maWW8_FFN, r2.maWW8_FFN, sizeof(r1.maWW8_FFN)); if (nRet == 0) { - StringCompare eRet = r1.msFamilyNm.CompareTo(r2.msFamilyNm); - if (eRet == COMPARE_EQUAL) - eRet = r1.msAltNm.CompareTo(r2.msAltNm); - nRet = eRet; + nRet = r1.msFamilyNm.compareTo(r2.msFamilyNm); + if (nRet == 0) + nRet = r1.msAltNm.compareTo(r2.msAltNm); } return nRet < 0; } @@ -2202,7 +2201,7 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp, void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, WW8_FC& rTxtStart, sal_Int32& rTxtCount, WW8_FC& rRefStart, sal_Int32& rRefCount ) const { - typedef ::std::vector<String>::iterator myiter; + typedef ::std::vector<OUString>::iterator myiter; sal_uLong nFcStart = rWrt.pTableStrm->Tell(); sal_uInt16 nLen = aCps.size(); @@ -2211,7 +2210,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, OSL_ENSURE( aCps.size() + 2 == pTxtPos->Count(), "WritePlc: DeSync" ); - ::std::vector<String> aStrArr; + ::std::vector<OUString> aStrArr; WW8Fib& rFib = *rWrt.pFib; // n+1-te CP-Pos nach Handbuch sal_uInt16 i; bool bWriteCP = true; @@ -2236,8 +2235,8 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, { for ( i = 0; i < aStrArr.size(); ++i ) { - const String& rStr = aStrArr[i]; - SwWW8Writer::WriteShort(*rWrt.pTableStrm, rStr.Len()); + const OUString& rStr = aStrArr[i]; + SwWW8Writer::WriteShort(*rWrt.pTableStrm, rStr.getLength()); SwWW8Writer::WriteString16(*rWrt.pTableStrm, rStr, false); } @@ -2246,8 +2245,8 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, { for ( i = 0; i < aStrArr.size(); ++i ) { - const String& rStr = aStrArr[i]; - *rWrt.pTableStrm << (sal_uInt8)rStr.Len(); + const OUString& rStr = aStrArr[i]; + *rWrt.pTableStrm << (sal_uInt8)rStr.getLength(); SwWW8Writer::WriteString8(*rWrt.pTableStrm, rStr, false, RTL_TEXTENCODING_MS_1252); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index bdd05e920bdb..27bb820c4fba 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1543,7 +1543,7 @@ int MSWordExportBase::GetGrfIndex(const SvxBrushItem& rBrush) return nIndex; } -void MSWordExportBase::AppendWordBookmark( const String& rName ) +void MSWordExportBase::AppendWordBookmark( const OUString& rName ) { AppendBookmark( BookmarkToWord( rName ) ); } @@ -1704,10 +1704,10 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr, rStrm.Write(&aBytes[0], aBytes.size()); } -void WW8Export::WriteStringAsPara( const String& rTxt, sal_uInt16 nStyleId ) +void WW8Export::WriteStringAsPara( const OUString& rTxt, sal_uInt16 nStyleId ) { - if( rTxt.Len() ) - OutSwString( rTxt, 0, rTxt.Len(), IsUnicode(), RTL_TEXTENCODING_MS_1252 ); + if( !rTxt.isEmpty() ) + OutSwString( rTxt, 0, rTxt.getLength(), IsUnicode(), RTL_TEXTENCODING_MS_1252 ); WriteCR(); // CR thereafter ww::bytes aArr; @@ -1757,7 +1757,7 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u nTxtTyp = nOldTyp; } -void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, +void WW8Export::OutSwString(const OUString& rStr, xub_StrLen nStt, xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet) { @@ -1768,9 +1768,9 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, if ( bUnicode != pPiece->IsUnicode() ) pPiece->AppendPc ( Strm().Tell(), bUnicode ); - if( nStt || nLen != rStr.Len() ) + if( nStt || nLen != rStr.getLength() ) { - String sOut( rStr.Copy( nStt, nLen ) ); + String sOut( rStr.copy( nStt, nLen ) ); SAL_INFO( "sw.ww8.level2", sOut ); @@ -2849,12 +2849,12 @@ void WW8Export::StoreDoc1() WriteFkpPlcUsw(); // FKP, PLC, ..... } -void MSWordExportBase::AddLinkTarget(const String& rURL) +void MSWordExportBase::AddLinkTarget(const OUString& rURL) { - if( !rURL.Len() || rURL.GetChar(0) != INET_MARK_TOKEN ) + if( rURL.isEmpty() || rURL[0] != INET_MARK_TOKEN ) return; - OUString aURL( BookmarkToWriter( rURL.Copy( 1 ) ) ); + OUString aURL( BookmarkToWriter( rURL.copy( 1 ) ) ); sal_Int32 nPos = aURL.lastIndexOf( cMarkSeparator ); if( nPos < 2 ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 72735c3e243c..95e498347e15 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -281,15 +281,15 @@ class wwFont //and we could have harmony private: sal_uInt8 maWW8_FFN[6]; - String msFamilyNm; - String msAltNm; + OUString msFamilyNm; + OUString msAltNm; bool mbAlt; bool mbWrtWW8; FontPitch mePitch; FontFamily meFamily; rtl_TextEncoding meChrSet; public: - wwFont( const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, + wwFont( const OUString &rFamilyName, FontPitch ePitch, FontFamily eFamily, rtl_TextEncoding eChrSet, bool bWrtWW8 ); bool Write( SvStream *pTableStram ) const; void WriteDocx( DocxAttributeOutput* rAttrOutput ) const; @@ -447,7 +447,7 @@ public: wwFontHelper maFontHelper; std::vector<sal_uLong> maChapterFieldLocs; typedef std::vector<sal_uLong>::const_iterator mycCFIter; - String aMainStg; + OUString aMainStg; std::vector<const SwTOXType*> aTOXArr; const SfxItemSet* pISet; // fuer Doppel-Attribute WW8_WrPct* pPiece; // Pointer auf Piece-Table @@ -596,10 +596,10 @@ public: bool HasRefToObject( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ); /// Find the bookmark name. - String GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ); + OUString GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ); /// Add a bookmark converted to a Word name. - void AppendWordBookmark( const String& rName ); + void AppendWordBookmark( const OUString& rName ); /// Use OutputItem() on an item set according to the parameters. void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, sal_uInt16 nScript, bool bExportParentItemSet ); @@ -702,8 +702,8 @@ public: void AbstractNumberingDefinitions(); // Convert the bullet according to the font. - void SubstituteBullet( String& rNumStr, rtl_TextEncoding& rChrSet, - String& rFontName ) const; + void SubstituteBullet( OUString& rNumStr, rtl_TextEncoding& rChrSet, + OUString& rFontName ) const; /// No-op for the newer WW versions. virtual void OutputOlst( const SwNumRule& /*rRule*/ ) {} @@ -724,7 +724,7 @@ public: /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, - const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ) = 0; + const OUString& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ) = 0; /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) = 0; @@ -769,7 +769,7 @@ protected: /// Setup the chapter fields (maChapterFieldLocs). void GatherChapterFields(); - void AddLinkTarget( const String& rURL ); + void AddLinkTarget( const OUString& rURL ); void CollectOutlineBookmarks( const SwDoc &rDoc ); bool SetAktPageDescFromNode(const SwNode &rNd); @@ -1003,13 +1003,13 @@ public: /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, - const String& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); + const OUString& rFldCmd, sal_uInt8 nMode = nsFieldFlags::WRITEFIELD_ALL ); - void StartCommentOutput( const String& rName ); - void EndCommentOutput( const String& rName ); + void StartCommentOutput( const OUString& rName ); + void EndCommentOutput( const OUString& rName ); void OutGrf(const sw::Frame &rFrame); bool TestOleNeedsGraphic(const SwAttrSet& rSet, SvStorageRef xOleStg, - SvStorageRef xObjStg, String &rStorageName, SwOLENode *pOLENd); + SvStorageRef xObjStg, OUString &rStorageName, SwOLENode *pOLENd); virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen ); virtual void AppendBookmark( const OUString& rName, bool bSkip = false ); @@ -1027,7 +1027,7 @@ public: virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t() ); void WriteChar( sal_Unicode c ); - void OutSwString(const String&, xub_StrLen nStt, xub_StrLen nLen, + void OutSwString(const OUString&, xub_StrLen nStt, xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet); WW8_CP Fc2Cp( sal_uLong nFc ) const { return pPiece->Fc2Cp( nFc ); } @@ -1083,11 +1083,11 @@ public: void InsUInt16( sal_uInt16 n ) { SwWW8Writer::InsUInt16( *pO, n ); } void InsUInt32( sal_uInt32 n ) { SwWW8Writer::InsUInt32( *pO, n ); } - void InsAsString16( const String& rStr ) + void InsAsString16( const OUString& rStr ) { SwWW8Writer::InsAsString16( *pO, rStr ); } - void InsAsString8( const String& rStr, rtl_TextEncoding eCodeSet ) + void InsAsString8( const OUString& rStr, rtl_TextEncoding eCodeSet ) { SwWW8Writer::InsAsString8( *pO, rStr, eCodeSet ); } - void WriteStringAsPara( const String& rTxt, sal_uInt16 nStyleId = 0 ); + void WriteStringAsPara( const OUString& rTxt, sal_uInt16 nStyleId = 0 ); /// Setup the exporter. WW8Export( SwWW8Writer *pWriter, @@ -1187,8 +1187,8 @@ public: struct WW8_Annotation { const OutlinerParaObject* mpRichText; - String msSimpleText; - String msOwner; + OUString msSimpleText; + OUString msOwner; DateTime maDateTime; WW8_Annotation(const SwPostItField* pPostIt); WW8_Annotation(const SwRedlineData* pRedline); @@ -1466,7 +1466,7 @@ private: sw::FrameIter maFlyIter; xub_StrLen SearchNext( xub_StrLen nStartPos ); - void FieldVanish( const String& rTxt ); + void FieldVanish( const OUString& rTxt ); void OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool bStart); @@ -1497,7 +1497,7 @@ public: bool IsCharRTL() const { return mbCharIsRTL; } bool IsParaRTL() const { return mbParaIsRTL; } rtl_TextEncoding GetCharSet() const { return meChrSet; } - String GetSnippet(const String &rStr, xub_StrLen nAktPos, + OUString GetSnippet(const OUString &rStr, xub_StrLen nAktPos, xub_StrLen nLen) const; const SwFmtDrop& GetSwFmtDrop() const { return mrSwFmtDrop; } }; @@ -1557,7 +1557,7 @@ public: sal_Int16 GetWordFirstLineOffset(const SwNumFmt &rFmt); // A bit of a bag on the side for now OUString FieldString(ww::eField eIndex); -String BookmarkToWord(const String &rBookmark); +OUString BookmarkToWord(const OUString &rBookmark); class WW8SHDLong { diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index baac689f3025..5d703fe9f83b 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -94,7 +94,7 @@ void WW8Export::OutputGrfNode( const SwGrfNode& /*rNode*/ ) } bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, - SvStorageRef xOleStg, SvStorageRef xObjStg, String &rStorageName, + SvStorageRef xOleStg, SvStorageRef xObjStg, OUString &rStorageName, SwOLENode *pOLENd) { bool bGraphicNeeded = false; @@ -248,7 +248,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) bool bIsNotDuplicate = aRes.second; //.second is false when element already existed nPictureId = aRes.first->second; Set_UInt32(pDataAdr, nPictureId); - String sStorageName = OUString('_'); + OUString sStorageName('_'); sStorageName += OUString::number( nPictureId ); SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName, STREAM_READWRITE| STREAM_SHARE_DENYALL ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index f7ffc5598be8..85a0aa14de3e 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -870,7 +870,7 @@ bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, const OUString* pName, s return false; } -String MSWordExportBase::GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ) +OUString MSWordExportBase::GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ) { String sRet; switch ( nTyp ) @@ -994,9 +994,9 @@ void WW8AttributeOutput::RunText( const OUString& rText, rtl_TextEncoding eCharS RawText( rText, m_rWW8Export.bWrtWW8, eCharSet ); } -void WW8AttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) +void WW8AttributeOutput::RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) { - m_rWW8Export.OutSwString( rText, 0, rText.Len(), bForceUnicode, eCharSet ); + m_rWW8Export.OutSwString( rText, 0, rText.getLength(), bForceUnicode, eCharSet ); } void WW8AttributeOutput::OutputFKP() @@ -1773,7 +1773,7 @@ WW8_WrPlcFld* WW8Export::CurrentFieldPlc() const } void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType, - const String& rFldCmd, sal_uInt8 nMode ) + const OUString& rFldCmd, sal_uInt8 nMode ) { bool bUnicode = IsUnicode(); WW8_WrPlcFld* pFldP = CurrentFieldPlc(); @@ -1913,7 +1913,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType, } } -void WW8Export::StartCommentOutput(const String& rName) +void WW8Export::StartCommentOutput(const OUString& rName) { String sStr(FieldString(ww::eQUOTE)); sStr.AppendAscii("["); @@ -1922,7 +1922,7 @@ void WW8Export::StartCommentOutput(const String& rName) OutputField(0, ww::eQUOTE, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START); } -void WW8Export::EndCommentOutput(const String& rName) +void WW8Export::EndCommentOutput(const OUString& rName) { String sStr(OUString(" [")); sStr += rName; @@ -2429,7 +2429,7 @@ void WW8AttributeOutput::HiddenField( const SwField& rFld ) } } -void WW8AttributeOutput::SetField( const SwField& rFld, ww::eField eType, const String& rCmd ) +void WW8AttributeOutput::SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ) { const SwSetExpField* pSet=(const SwSetExpField*)(&rFld); const String &rVar = pSet->GetPar2(); @@ -2491,7 +2491,7 @@ bool WW8AttributeOutput::PlaceholderField( const SwField* ) return true; // expand to text? } -void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) +void WW8AttributeOutput::RefField( const SwField &rFld, const OUString &rRef) { String sStr( FieldString( ww::eREF ) ); sStr.AppendAscii( "\"" ); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index ac6341e9c1ca..537db8977562 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -66,7 +66,7 @@ public: virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet ); /// Output text (without markup). - virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); + virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); @@ -75,12 +75,12 @@ public: virtual void EndRuby(); /// Output URL start. - virtual bool StartURL( const String &rUrl, const String &rTarget ); + virtual bool StartURL( const OUString &rUrl, const OUString &rTarget ); /// Output URL end. virtual bool EndURL(); - virtual void FieldVanish( const String& rTxt, ww::eField eType ); + virtual void FieldVanish( const OUString& rTxt, ww::eField eType ); /// Output redlining. virtual void Redline( const SwRedlineData* pRedline ); @@ -120,7 +120,7 @@ public: virtual void DefaultStyle( sal_uInt16 nStyle ); /// Start of a style in the styles table. - virtual void StartStyle( const String& rName, bool bPapFmt, + virtual void StartStyle( const OUString& rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwIdi, sal_uInt16 nId, bool bAutoUpdate ); @@ -193,7 +193,7 @@ public: sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString, + const OUString &rNumberingString, const SvxBrushItem* pBrush = 0); //For i120928,transfer graphic of bullet protected: @@ -407,9 +407,9 @@ protected: /// Write the expanded field virtual void WriteExpand( const SwField* pFld ); - virtual void RefField ( const SwField& rFld, const String& rRef ); + virtual void RefField ( const SwField& rFld, const OUString& rRef ); virtual void HiddenField( const SwField& rFld ); - virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); + virtual void SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); virtual bool PlaceholderField( const SwField* pFld ); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index d98543b9b647..529f744cb138 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -349,7 +349,7 @@ void SwWW8ImplReader::ReplaceObj(const SdrObject &rReplaceObj, // MakeGrafNotInCntnt setzt eine nicht-Zeichengebundene Grafik // ( bGrafApo == true) SwFlyFrmFmt* SwWW8ImplReader::MakeGrafNotInCntnt(const WW8PicDesc& rPD, - const Graphic* pGraph, const String& rFileName, const SfxItemSet& rGrfSet) + const Graphic* pGraph, const OUString& rFileName, const SfxItemSet& rGrfSet) { sal_uInt32 nWidth = rPD.nWidth; @@ -384,14 +384,14 @@ SwFlyFrmFmt* SwWW8ImplReader::MakeGrafNotInCntnt(const WW8PicDesc& rPD, // MakeGrafInCntnt fuegt zeichengebundene Grafiken ein SwFrmFmt* SwWW8ImplReader::MakeGrafInCntnt(const WW8_PIC& rPic, - const WW8PicDesc& rPD, const Graphic* pGraph, const String& rFileName, + const WW8PicDesc& rPD, const Graphic* pGraph, const OUString& rFileName, const SfxItemSet& rGrfSet) { WW8FlySet aFlySet(*this, pPaM, rPic, rPD.nWidth, rPD.nHeight); SwFrmFmt* pFlyFmt = 0; - if (!rFileName.Len() && nObjLocFc) // dann sollte ists ein OLE-Object + if (rFileName.isEmpty() && nObjLocFc) // dann sollte ists ein OLE-Object pFlyFmt = ImportOle(pGraph, &aFlySet, &rGrfSet); if( !pFlyFmt ) // dann eben als Graphic diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 6a58d2ffb06a..046e1b44f658 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2978,9 +2978,9 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString } } -void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString) +void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString) { - if (!rAddString.Len()) + if (rAddString.isEmpty()) return; #if OSL_DEBUG_LEVEL > 1 @@ -2998,7 +2998,7 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString) if (!pNd) return; - if ((pNd->GetTxt().getLength() + rAddString.Len()) < STRING_MAXLEN-1) + if ((pNd->GetTxt().getLength() + rAddString.getLength()) < STRING_MAXLEN-1) { rDoc.InsertString(*pPaM, rAddString); } @@ -3010,8 +3010,8 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString) String sTempStr (rAddString,0, STRING_MAXLEN - pNd->GetTxt().getLength() -1); rDoc.InsertString(*pPaM, sTempStr); - sTempStr = rAddString.Copy(sTempStr.Len(), - rAddString.Len() - sTempStr.Len()); + sTempStr = rAddString.copy(sTempStr.Len(), + rAddString.getLength() - sTempStr.Len()); AppendTxtNode(*pPaM->GetPoint()); rDoc.InsertString(*pPaM, sTempStr); } @@ -3714,7 +3714,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType) * class SwWW8ImplReader */ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage, - SvStream* pSt, SwDoc& rD, const String& rBaseURL, bool bNewDoc) : + SvStream* pSt, SwDoc& rD, const OUString& rBaseURL, bool bNewDoc) : mpDocShell(rD.GetDocShell()), pStg(pStorage), pStrm(pSt), diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 7d970e6348ec..38d8d5377442 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -224,7 +224,7 @@ struct WW8FlyPara class SwWW8StyInf { - String sWWStyleName; + OUString sWWStyleName; sal_uInt16 nWWStyleId; public: rtl_TextEncoding eLTRFontSrcCharSet; // rtl_TextEncoding fuer den Font @@ -291,13 +291,13 @@ public: delete pWWFly; } - void SetOrgWWIdent( const String& rName, const sal_uInt16 nId ) + void SetOrgWWIdent( const OUString& rName, const sal_uInt16 nId ) { sWWStyleName = rName; nWWStyleId = nId; } sal_uInt16 GetWWStyleId() const { return nWWStyleId; } - const String& GetOrgWWName() const + const OUString& GetOrgWWName() const { return sWWStyleName; } @@ -858,14 +858,14 @@ class wwSectionNamer { private: const SwDoc &mrDoc; - String msFileLinkSeed; + OUString msFileLinkSeed; int mnFileSectionNo; //No copying wwSectionNamer(const wwSectionNamer&); wwSectionNamer& operator=(const wwSectionNamer&); public: - String UniqueName(); - wwSectionNamer(const SwDoc &rDoc, const String &rSeed) + OUString UniqueName(); + wwSectionNamer(const SwDoc &rDoc, const OUString &rSeed) : mrDoc(rDoc), msFileLinkSeed(rSeed), mnFileSectionNo(0) { } }; @@ -1130,7 +1130,7 @@ private: WW8ListManager* pLstManager; WW8ScannerBase* pSBase; WW8PLCFMan* pPlcxMan; - std::map<short, String> aLinkStringMap; + std::map<short, OUString> aLinkStringMap; std::set<const SwNode*> maTxtNodesHavingFirstLineOfstSet; // #i103711# std::set<const SwNode*> maTxtNodesHavingLeftIndentSet; // #i105414# @@ -1173,7 +1173,7 @@ private: boost::shared_ptr<WW8PLCFspecial> mpAtnEnds; sw::util::AuthorInfos m_aAuthorInfos; - String sBaseURL; + OUString sBaseURL; // Ini-Flags: sal_uLong nIniFlags; // Flags aus der writer.ini @@ -1315,7 +1315,7 @@ private: } void DeleteAnchorStk() { DeleteStk( pAnchorStck ); pAnchorStck = 0; } void emulateMSWordAddTextToParagraph(const OUString& rAddString); - void simpleAddTextToParagraph(const String& rAddString); + void simpleAddTextToParagraph(const OUString& rAddString); bool HandlePageBreakChar(); bool ReadChar(long nPosCp, long nCpOfs); bool ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs); @@ -1338,7 +1338,7 @@ private: void Read_HdFtFtnText( const SwNodeIndex* pSttIdx, long nStartCp, long nLen, ManTypes nType ); - void ImportTox( int nFldId, String aStr ); + void ImportTox( int nFldId, OUString aStr ); void EndSprm( sal_uInt16 nId ); // #i103711# @@ -1413,11 +1413,11 @@ private: SdrObject &rSubObj); SwFlyFrmFmt* MakeGrafNotInCntnt(const WW8PicDesc& rPD, - const Graphic* pGraph, const String& rFileName, + const Graphic* pGraph, const OUString& rFileName, const SfxItemSet& rGrfSet); SwFrmFmt* MakeGrafInCntnt(const WW8_PIC& rPic, const WW8PicDesc& rPD, - const Graphic* pGraph, const String& rFileName, + const Graphic* pGraph, const OUString& rFileName, const SfxItemSet& rGrfSet); SwFrmFmt *AddAutoAnchor(SwFrmFmt *pFmt); @@ -1535,12 +1535,12 @@ private: void GrafikDtor(); // anderes - String GetFieldResult( WW8FieldDesc* pF ); - void MakeTagString( String& rStr, const String& rOrg ); + OUString GetFieldResult( WW8FieldDesc* pF ); + void MakeTagString( OUString& rStr, const OUString& rOrg ); void UpdateFields(); OUString ConvertFFileName(const OUString& rRaw); long Read_F_Tag( WW8FieldDesc* pF ); - void InsertTagField( const sal_uInt16 nId, const String& rTagText ); + void InsertTagField( const sal_uInt16 nId, const OUString& rTagText ); long ImportExtSprm(WW8PLCFManResult* pRes); void EndExtSprm(sal_uInt16 nSprmId); void ReadDocInfo(); @@ -1734,7 +1734,7 @@ public: // eigentlich private, geht aber leider nur public void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen); long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName, const OUString &rData); - String GetMappedBookmark(const String &rOrigName); + OUString GetMappedBookmark(const OUString &rOrigName); // Felder eF_ResT Read_F_Input(WW8FieldDesc*, OUString& rStr); @@ -1763,7 +1763,7 @@ public: // eigentlich private, geht aber leider nur public eF_ResT Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr); eF_ResT Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr ); eF_ResT Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr); - com::sun::star::awt::Size MiserableDropDownFormHack(const String &rString, + com::sun::star::awt::Size MiserableDropDownFormHack(const OUString &rString, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& rPropSet); @@ -1804,9 +1804,9 @@ public: // eigentlich private, geht aber leider nur public static ColorData GetCol(sal_uInt8 nIco); SwWW8ImplReader( sal_uInt8 nVersionPara, SvStorage* pStorage, SvStream* pSt, - SwDoc& rD, const String& rBaseURL, bool bNewDoc ); + SwDoc& rD, const OUString& rBaseURL, bool bNewDoc ); - const String& GetBaseURL() const { return sBaseURL; } + const OUString& GetBaseURL() const { return sBaseURL; } // Laden eines kompletten DocFiles sal_uLong LoadDoc( SwPaM&,WW8Glossary *pGloss=0); CharSet GetCurrentCharSet(); @@ -1815,7 +1815,7 @@ public: // eigentlich private, geht aber leider nur public void PostProcessAttrs(); }; -bool CanUseRemoteLink(const String &rGrfName); +bool CanUseRemoteLink(const OUString &rGrfName); void UseListIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt); void SetStyleIndent(SwWW8StyInf &rStyleInfo, const SwNumFmt &rFmt); // #i103711# @@ -1825,7 +1825,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR, const bool bFirstLineOfStSet, const bool bLeftIndentSet ); long GetListFirstLineIndent(const SwNumFmt &rFmt); -String BookmarkToWriter(const String &rBookmark); +OUString BookmarkToWriter(const OUString &rBookmark); bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index bf87dd09a47f..cdd8ce3aba8e 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2283,7 +2283,7 @@ WW8FormulaListBox::WW8FormulaListBox(SwWW8ImplReader &rR) //Miserable hack to get a hardcoded guesstimate of the size of a list dropdown //box's first entry to set as the lists default size -awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const String &rString, +awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, uno::Reference<beans::XPropertySet>& rPropSet) { awt::Size aRet; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index bc60d6ed4b01..c73834210d07 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -937,7 +937,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) // MakeTagString() gibt als Returnwert die Position des ersten // CR / Zeilenende / Seitenumbruch in pText und wandelt auch nur bis dort // Wenn keins dieser Sonderzeichen enthalten ist, wird 0 zurueckgeliefert. -void SwWW8ImplReader::MakeTagString( String& rStr, const String& rOrg ) +void SwWW8ImplReader::MakeTagString( OUString& rStr, const OUString& rOrg ) { OUString sHex("\\x"); bool bAllowCr = SwFltGetFlag( nFieldFlags, SwFltControlStack::TAGS_IN_TEXT ) @@ -946,37 +946,37 @@ void SwWW8ImplReader::MakeTagString( String& rStr, const String& rOrg ) rStr = rOrg; for( xub_StrLen nI = 0; - nI < rStr.Len() && rStr.Len() < (MAX_FIELDLEN - 4); ++nI ) + nI < rStr.getLength() && rStr.getLength() < (MAX_FIELDLEN - 4); ++nI ) { bool bSetAsHex = false; - switch( cChar = rStr.GetChar( nI ) ) + switch( cChar = rStr[ nI ] ) { case 132: // Typographische Anfuehrungszeichen case 148: // gegen normale tauschen case 147: - rStr.SetChar( nI, '"' ); + rStr = rStr.replaceAt( nI, 1, "\"" ); break; case 19: - rStr.SetChar( nI, '{' ); + rStr = rStr.replaceAt( nI, 1, "{" ); break; // 19..21 zu {|} case 20: - rStr.SetChar( nI, '|' ); + rStr = rStr.replaceAt( nI, 1, "|" ); break; case 21: - rStr.SetChar( nI, '}' ); + rStr = rStr.replaceAt( nI, 1, "}" ); break; case '\\': // \{|} per \ Taggen case '{': case '|': case '}': - rStr.Insert( nI, '\\' ); + rStr = rStr.replaceAt( nI, 0, "\\" ); ++nI; break; case 0x0b: case 0x0c: case 0x0d: if( bAllowCr ) - rStr.SetChar( nI, '\n' ); + rStr = rStr.replaceAt( nI, 1, "\n" ); else bSetAsHex = true; break; @@ -996,16 +996,16 @@ void SwWW8ImplReader::MakeTagString( String& rStr, const String& rOrg ) if( cChar < 0x10 ) sTmp += '0'; sTmp += OUString::number( cChar, 16 ); - rStr.Replace( nI, 1 , sTmp ); + rStr = rStr.replaceAt( nI, 1 , sTmp ); nI += sTmp.Len() - 1; } } - if( rStr.Len() > (MAX_FIELDLEN - 4)) - rStr.Erase( MAX_FIELDLEN - 4 ); + if( rStr.getLength() > (MAX_FIELDLEN - 4)) + rStr = rStr.copy( 0, MAX_FIELDLEN - 4 ); } -void SwWW8ImplReader::InsertTagField( const sal_uInt16 nId, const String& rTagText ) +void SwWW8ImplReader::InsertTagField( const sal_uInt16 nId, const OUString& rTagText ) { String aName(OUString("WwFieldTag")); if( SwFltGetFlag( nFieldFlags, SwFltControlStack::TAGS_DO_ID ) ) // Nummer? @@ -1044,7 +1044,7 @@ long SwWW8ImplReader::Read_F_Tag( WW8FieldDesc* pF ) pPlcxMan->GetCpOfs() + nStart, nL, eStructCharSet); - String aTagText; + OUString aTagText; MakeTagString( aTagText, sFTxt ); InsertTagField( pF->nId, aTagText ); @@ -1093,7 +1093,7 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, OUString& rStr ) } // GetFieldResult alloziert einen String und liest das Feld-Resultat ein -String SwWW8ImplReader::GetFieldResult( WW8FieldDesc* pF ) +OUString SwWW8ImplReader::GetFieldResult( WW8FieldDesc* pF ) { long nOldPos = pStrm->Tell(); @@ -1219,7 +1219,7 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pFld, return pRet; } -String SwWW8ImplReader::GetMappedBookmark(const String &rOrigName) +OUString SwWW8ImplReader::GetMappedBookmark(const OUString &rOrigName) { OUString sName(BookmarkToWriter(rOrigName)); OSL_ENSURE(pPlcxMan,"no pPlcxMan"); @@ -2178,7 +2178,7 @@ WW8PostProcessAttrsInfo::WW8PostProcessAttrsInfo(WW8_CP nCpStart, WW8_CP nCpEnd, { } -bool CanUseRemoteLink(const String &rGrfName) +bool CanUseRemoteLink(const OUString &rGrfName) { bool bUseRemote = false; try @@ -2260,7 +2260,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr ) return FLD_READ_FSPA; } -String wwSectionNamer::UniqueName() +OUString wwSectionNamer::UniqueName() { const OUString aName(msFileLinkSeed + OUString::number(++mnFileSectionNo)); return mrDoc.GetUniqueSectionName(&aName); @@ -3454,7 +3454,7 @@ void sw::ms::ImportXE(SwDoc &rDoc, SwPaM &rPaM, const String &rStr) lcl_ImportTox(rDoc, rPaM, rStr, true); } -void SwWW8ImplReader::ImportTox( int nFldId, String aStr ) +void SwWW8ImplReader::ImportTox( int nFldId, OUString aStr ) { bool bIdx = (nFldId != 9); lcl_ImportTox(rDoc, *pPaM, aStr, bIdx); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index d339e9320a7b..b28ed8e22be9 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -4080,7 +4080,7 @@ long WW8PLCFx_Book::GetHandle() const } } -String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex) +OUString WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex) { bool bFound = false; sal_uInt16 i = 0; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 6d08eececfd4..007e6a5aeb88 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -121,12 +121,12 @@ public: //Read a Pascal-style, i.e. single byte string length followed //by string contents -inline String read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc) +inline OUString read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc) { return read_lenPrefixed_uInt8s_ToOUString<sal_uInt8>(rStrm, eEnc); } -inline String read_uInt16_PascalString(SvStream& rStrm) +inline OUString read_uInt16_PascalString(SvStream& rStrm) { return read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rStrm); } @@ -748,7 +748,7 @@ public: long GetHandle() const; void SetStatus( sal_uInt16 nIndex, eBookStatus eStat ); bool MapName(OUString& rName); - String GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex); + OUString GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex); eBookStatus GetStatus() const; OUString GetUniqueBookmarkName(const OUString &rSuggestedName); }; |