diff options
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 212 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 162 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 |
4 files changed, 191 insertions, 193 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 834c642a5128..beeb4db626b0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -338,7 +338,7 @@ void RtfAttributeOutput::EmptyParagraph() { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << SAL_NEWLINE_STRING << OOO_STRING_SVTOOLS_RTF_PAR << ' '; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAR ).WriteChar( ' ' ); } void RtfAttributeOutput::SectionBreaks(const SwTxtNode& rNode) @@ -348,12 +348,12 @@ void RtfAttributeOutput::SectionBreaks(const SwTxtNode& rNode) // output page/section breaks SwNodeIndex aNextIndex( rNode, 1 ); - m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); m_bBufferSectionBreaks = true; // output section headers / footers if (!m_bBufferSectionHeaders) - m_rExport.Strm() << m_aSectionHeaders.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aSectionHeaders.makeStringAndClear().getStr() ); if ( aNextIndex.GetNode().IsTxtNode() ) { @@ -383,7 +383,7 @@ void RtfAttributeOutput::StartParagraphProperties() aPar.append(' '); } if (!m_bBufferSectionHeaders) - m_rExport.Strm() << aPar.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( aPar.makeStringAndClear().getStr() ); else m_aSectionHeaders.append(aPar.makeStringAndClear()); } @@ -392,7 +392,7 @@ void RtfAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxItem { SAL_INFO("sw.rtf", OSL_THIS_FUNC); m_aStyles.append(m_aStylesEnd.makeStringAndClear()); - m_rExport.Strm() << m_aStyles.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() ); } void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun ) @@ -554,7 +554,7 @@ void RtfAttributeOutput::ParagraphStyle( sal_uInt16 nStyle ) if (pStyle) aStyle.append(pStyle->getStr()); if (!m_bBufferSectionHeaders) - m_rExport.Strm() << aStyle.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( aStyle.makeStringAndClear().getStr() ); else m_aSectionHeaders.append(aStyle.makeStringAndClear()); } @@ -928,8 +928,8 @@ void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pT return; // Empty the previous row closing buffer before starting the new one, // necessary for subtables. - m_rExport.Strm() << m_aAfterRuns.makeStringAndClear().getStr(); - m_rExport.Strm() << m_aRowDefs.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aAfterRuns.makeStringAndClear().getStr() ); + m_rExport.Strm().WriteCharPtr( m_aRowDefs.makeStringAndClear().getStr() ); } void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) @@ -1048,7 +1048,7 @@ void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer void RtfAttributeOutput::StartStyles() { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << SAL_NEWLINE_STRING << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLORTBL ); m_rExport.OutColorTable(); OSL_ENSURE(m_aStylesheet.getLength() == 0, "m_aStylesheet is not empty"); m_aStylesheet.append(SAL_NEWLINE_STRING); @@ -1059,9 +1059,9 @@ void RtfAttributeOutput::StartStyles() void RtfAttributeOutput::EndStyles( sal_uInt16 /*nNumberOfStyles*/ ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << '}'; - m_rExport.Strm() << m_aStylesheet.makeStringAndClear().getStr(); - m_rExport.Strm() << '}'; + m_rExport.Strm().WriteChar( '}' ); + m_rExport.Strm().WriteCharPtr( m_aStylesheet.makeStringAndClear().getStr() ); + m_rExport.Strm().WriteChar( '}' ); } void RtfAttributeOutput::DefaultStyle( sal_uInt16 /*nStyle*/ ) @@ -1141,7 +1141,7 @@ void RtfAttributeOutput::PageBreakBefore( bool bBreak ) if (bBreak) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PAGEBB; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAGEBB ); } } @@ -1167,7 +1167,7 @@ void RtfAttributeOutput::StartSection() m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECT OOO_STRING_SVTOOLS_RTF_SECTD); if (!m_bBufferSectionBreaks) - m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); } void RtfAttributeOutput::EndSection() @@ -1192,12 +1192,12 @@ void RtfAttributeOutput::SectionLineNumbering( sal_uLong /*nRestartNo*/, const S { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEMOD; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINEMOD ); m_rExport.OutLong(rLnNumInfo.GetCountBy()); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEX; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINEX ); m_rExport.OutLong(rLnNumInfo.GetPosFromLeft()); if (!rLnNumInfo.IsRestartEachPage()) - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINECONT; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINECONT ); } void RtfAttributeOutput::SectionTitlePage() @@ -1240,7 +1240,7 @@ void RtfAttributeOutput::SectionBiDi( bool bBiDi ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT); + m_rExport.Strm().WriteCharPtr( (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT) ); } void RtfAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber ) @@ -1289,26 +1289,26 @@ void RtfAttributeOutput::SectionType( sal_uInt8 nBreakCode ) } m_aSectionBreaks.append(sType); if (!m_bBufferSectionBreaks) - m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); } void RtfAttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &/*rRule*/ ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE; - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE ); + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTID ); m_rExport.OutULong(nId); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT << '0'; - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LS; - m_rExport.OutULong(nId) << '}'; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT ).WriteChar( '0' ); + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LS ); + m_rExport.OutULong(nId).WriteChar( '}' ); } void RtfAttributeOutput::StartAbstractNumbering( sal_uInt16 nId ) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LIST ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID ); m_rExport.OutULong( nId ); m_nListId = nId; } @@ -1317,8 +1317,8 @@ void RtfAttributeOutput::EndAbstractNumbering() { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; - m_rExport.OutULong( m_nListId ) << '}' << SAL_NEWLINE_STRING; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTID ); + m_rExport.OutULong( m_nListId ).WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING ); } void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, @@ -1337,11 +1337,11 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << SAL_NEWLINE_STRING; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ); if( nLevel > 8 ) // RTF knows only 9 levels - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SOUTLVL ); - m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTLEVEL ); sal_uInt16 nVal = 0; switch( nNumberingType ) @@ -1357,7 +1357,7 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, case SVX_NUM_CHAR_SPECIAL: nVal = 23; break; case SVX_NUM_NUMBER_NONE: nVal = 255; break; } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELNFC; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELNFC ); m_rExport.OutULong( nVal ); switch( eAdjust ) @@ -1366,7 +1366,7 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, case SVX_ADJUST_RIGHT: nVal = 2; break; default: nVal = 0; break; } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELJC; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELJC ); m_rExport.OutULong( nVal ); // bullet @@ -1375,63 +1375,63 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel, int nIndex = m_rExport.GetGrfIndex(*pBrush); if (nIndex != -1) { - m_rExport.Strm() << LO_STRING_SVTOOLS_RTF_LEVELPICTURE; + m_rExport.Strm().WriteCharPtr( LO_STRING_SVTOOLS_RTF_LEVELPICTURE ); m_rExport.OutULong(nIndex); } } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT ); m_rExport.OutULong( nStart ); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW ); m_rExport.OutULong( nFollow ); // leveltext group - m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' '; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELTEXT ).WriteChar( ' ' ); if( SVX_NUM_CHAR_SPECIAL == nNumberingType || SVX_NUM_BITMAP == nNumberingType ) { - m_rExport.Strm() << "\\'01"; + m_rExport.Strm().WriteCharPtr( "\\'01" ); sal_Unicode cChar = rNumberingString[0]; - m_rExport.Strm() << "\\u"; + m_rExport.Strm().WriteCharPtr( "\\u" ); m_rExport.OutULong(cChar); - m_rExport.Strm() << " ?"; + m_rExport.Strm().WriteCharPtr( " ?" ); } else { - m_rExport.Strm() << "\\'" << msfilter::rtfutil::OutHex( rNumberingString.getLength(), 2 ).getStr(); - m_rExport.Strm() << msfilter::rtfutil::OutString( rNumberingString, m_rExport.eDefaultEncoding, /*bUnicode =*/ false ).getStr(); + m_rExport.Strm().WriteCharPtr( "\\'" ).WriteCharPtr( msfilter::rtfutil::OutHex( rNumberingString.getLength(), 2 ).getStr() ); + m_rExport.Strm().WriteCharPtr( msfilter::rtfutil::OutString( rNumberingString, m_rExport.eDefaultEncoding, /*bUnicode =*/ false ).getStr() ); } - m_rExport.Strm() << ";}"; + m_rExport.Strm().WriteCharPtr( ";}" ); // write the levelnumbers - m_rExport.Strm() << "{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS; + m_rExport.Strm().WriteCharPtr( "{" ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS ); for( sal_uInt8 i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i ) { - m_rExport.Strm() << "\\'" << msfilter::rtfutil::OutHex(pNumLvlPos[ i ], 2).getStr(); + m_rExport.Strm().WriteCharPtr( "\\'" ).WriteCharPtr( msfilter::rtfutil::OutHex(pNumLvlPos[ i ], 2).getStr() ); } - m_rExport.Strm() << ";}"; + m_rExport.Strm().WriteCharPtr( ";}" ); if( pOutSet ) { if (pFont) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_F; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_F ); m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont)); } m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF ); - m_rExport.Strm() << m_aStyles.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() ); } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FI; - m_rExport.OutLong( nFirstLineIndex ) << OOO_STRING_SVTOOLS_RTF_LI; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FI ); + m_rExport.OutLong( nFirstLineIndex ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LI ); m_rExport.OutLong( nIndentAt ); - m_rExport.Strm() << '}'; + m_rExport.Strm().WriteChar( '}' ); if( nLevel > 8 ) - m_rExport.Strm() << '}'; + m_rExport.Strm().WriteChar( '}' ); } void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const OUString& rFldCmd, sal_uInt8 /*nMode*/ ) @@ -1582,8 +1582,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty"); m_rExport.mpParentFrame = &rFrame; - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SHP; - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST; + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SHP ); + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST ); // Shape properties. m_aFlyProperties.push_back(std::make_pair<OString, OString>("shapeType", OString::number(ESCHER_ShpInst_TextBox))); @@ -1595,8 +1595,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true; m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); - m_rExport.Strm() << m_aRunText.makeStringAndClear().getStr(); - m_rExport.Strm() << m_aStyles.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aRunText.makeStringAndClear().getStr() ); + m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() ); m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false; m_pFlyFrameSize = 0; @@ -1605,16 +1605,16 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi for (size_t i = 0; i < m_aFlyProperties.size(); ++i) { - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SP "{"; - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SN " "; - m_rExport.Strm() << m_aFlyProperties[i].first.getStr(); - m_rExport.Strm() << "}{" OOO_STRING_SVTOOLS_RTF_SV " "; - m_rExport.Strm() << m_aFlyProperties[i].second.getStr(); - m_rExport.Strm() << "}}"; + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SP "{" ); + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SN " " ); + m_rExport.Strm().WriteCharPtr( m_aFlyProperties[i].first.getStr() ); + m_rExport.Strm().WriteCharPtr( "}{" OOO_STRING_SVTOOLS_RTF_SV " " ); + m_rExport.Strm().WriteCharPtr( m_aFlyProperties[i].second.getStr() ); + m_rExport.Strm().WriteCharPtr( "}}" ); } m_aFlyProperties.clear(); - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SHPTXT; + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SHPTXT ); { /* @@ -1638,7 +1638,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_rExport.WriteText( ); m_rExport.RestoreData(); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PARD; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD ); m_rExport.bRTFFlySyntax = false; m_aRun->append(aSave); m_aRunText.clear(); @@ -1648,11 +1648,11 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_rExport.mpParentFrame = NULL; - m_rExport.Strm() << '}'; // shptxt - m_rExport.Strm() << '}'; // shpinst - m_rExport.Strm() << '}'; // shp + m_rExport.Strm().WriteChar( '}' ); // shptxt + m_rExport.Strm().WriteChar( '}' ); // shpinst + m_rExport.Strm().WriteChar( '}' ); // shp - m_rExport.Strm() << SAL_NEWLINE_STRING; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ); } break; case sw::Frame::eGraphic: @@ -2749,7 +2749,7 @@ void RtfAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize ) m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGHSXN); m_aSectionBreaks.append((sal_Int32)rSize.GetHeight()); if (!m_bBufferSectionBreaks) - m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); } } @@ -2777,8 +2777,7 @@ void RtfAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) m_aSectionBreaks.append((sal_Int32)rLRSpace.GetRight()); } if (!m_bBufferSectionBreaks) - m_rExport.Strm() << - m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm(). WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); } else { @@ -2838,8 +2837,7 @@ void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom); } if (!m_bBufferSectionBreaks) - m_rExport.Strm() << - m_aSectionBreaks.makeStringAndClear().getStr(); + m_rExport.Strm(). WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() ); } else { @@ -2888,7 +2886,7 @@ void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert break; default: m_aFlyProperties.push_back(std::make_pair<OString, OString>("posrelv", OString::number(2))); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPBYPARA << OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPBYPARA ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE ); break; } @@ -2910,11 +2908,11 @@ void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert break; } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPTOP; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPTOP ); m_rExport.OutLong(rFlyVert.GetPos()); if (m_pFlyFrameSize) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPBOTTOM; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPBOTTOM ); m_rExport.OutLong(rFlyVert.GetPos() + m_pFlyFrameSize->Height()); } } @@ -2933,7 +2931,7 @@ void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori break; default: m_aFlyProperties.push_back(std::make_pair<OString, OString>("posrelh", OString::number(2))); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN << OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE ); break; } @@ -2952,11 +2950,11 @@ void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori break; } - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPLEFT; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPLEFT ); m_rExport.OutLong(rFlyHori.GetPos()); if (m_pFlyFrameSize) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SHPRIGHT; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHPRIGHT ); m_rExport.OutLong(rFlyHori.GetPos() + m_pFlyFrameSize->Width()); } } @@ -3110,12 +3108,12 @@ void RtfAttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol& r { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLS; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLS ); m_rExport.OutLong( nCols ); if( bEven ) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLSX ); m_rExport.OutLong( rCol.GetGutterWidth( sal_True ) ); } else @@ -3123,15 +3121,15 @@ void RtfAttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol& r const SwColumns & rColumns = rCol.GetColumns( ); for( sal_uInt16 n = 0; n < nCols; ) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLNO ); m_rExport.OutLong( n+1 ); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLW; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLW ); m_rExport.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) ); if( ++n != nCols ) { - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLSR ); m_rExport.OutLong( rColumns[ n-1 ].GetRight() + rColumns[ n ].GetLeft() ); } @@ -3315,7 +3313,7 @@ void RtfAttributeOutput::StartFont( const OUString& rFamilyName ) const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OUStringToOString( rFamilyName, m_rExport.eCurrentEncoding ).getStr(); + m_rExport.Strm().WriteCharPtr( OUStringToOString( rFamilyName, m_rExport.eCurrentEncoding ).getStr() ); } /// End the font. @@ -3323,7 +3321,7 @@ void RtfAttributeOutput::EndFont() const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << ";}"; + m_rExport.Strm().WriteCharPtr( ";}" ); } /// Alternate name for the font. @@ -3331,8 +3329,8 @@ 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( rName, m_rExport.eCurrentEncoding ).getStr() << '}'; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FALT ).WriteChar( ' ' ); + m_rExport.Strm().WriteCharPtr( OUStringToOString( rName, m_rExport.eCurrentEncoding ).getStr() ).WriteChar( '}' ); } /// Font charset. @@ -3340,9 +3338,9 @@ void RtfAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FCHARSET ); m_rExport.OutULong( nCharSet ); - m_rExport.Strm() << ' '; + m_rExport.Strm().WriteChar( ' ' ); } /// Font family. @@ -3350,7 +3348,7 @@ void RtfAttributeOutput::FontFamilyType( FontFamily eFamily, const wwFont &rFont { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F; + m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_F ); const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL; switch (eFamily) @@ -3373,7 +3371,7 @@ void RtfAttributeOutput::FontFamilyType( FontFamily eFamily, const wwFont &rFont default: break; } - m_rExport.OutULong(m_rExport.maFontHelper.GetId(rFont)) << pStr; + m_rExport.OutULong(m_rExport.maFontHelper.GetId(rFont)).WriteCharPtr( pStr ); } /// Font pitch. @@ -3381,7 +3379,7 @@ void RtfAttributeOutput::FontPitchType( FontPitch ePitch ) const { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FPRQ; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FPRQ ); sal_uInt16 nVal = 0; switch (ePitch) @@ -3443,18 +3441,18 @@ OString RtfAttributeOutput::WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, S if (sNo.getLength() < 2) { if (pStream) - (*pStream) << '0'; + pStream->WriteChar( '0' ); else aRet.append('0'); } if (pStream) - (*pStream) << sNo.getStr(); + pStream->WriteCharPtr( sNo.getStr() ); else aRet.append(sNo); if (++nBreak == nLimit) { if (pStream) - (*pStream) << SAL_NEWLINE_STRING; + pStream->WriteCharPtr( SAL_NEWLINE_STRING ); else aRet.append(SAL_NEWLINE_STRING); nBreak = 0; @@ -3543,14 +3541,14 @@ static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, const Size &rOrig, con } aRet.append(SAL_NEWLINE_STRING); if (pStream) - (*pStream) << aRet.makeStringAndClear().getStr(); + pStream->WriteCharPtr( aRet.makeStringAndClear().getStr() ); if (pStream) RtfAttributeOutput::WriteHex(pGraphicAry, nSize, pStream); else aRet.append(RtfAttributeOutput::WriteHex(pGraphicAry, nSize)); aRet.append('}'); if (pStream) - (*pStream) << aRet.makeStringAndClear().getStr(); + pStream->WriteCharPtr( aRet.makeStringAndClear().getStr() ); } return aRet.makeStringAndClear(); } @@ -3704,7 +3702,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S */ bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; if (!bIsWMF) - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT; + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT ); if (pBLIPType) ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm() ); @@ -3722,7 +3720,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S if (!bIsWMF) { - m_rExport.Strm() << "}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT; + m_rExport.Strm().WriteCharPtr( "}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT ); aStream.Seek(0); GraphicConverter::Export(aStream, aGraphic, CVT_WMF); @@ -3733,23 +3731,23 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm() ); - m_rExport.Strm() << '}'; + m_rExport.Strm().WriteChar( '}' ); } - m_rExport.Strm() << SAL_NEWLINE_STRING; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ); } void RtfAttributeOutput::BulletDefinition(int /*nId*/, const Graphic& rGraphic, Size aSize) { - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT; - m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_PICT OOO_STRING_SVTOOLS_RTF_PNGBLIP; + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT ); + m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_PICT OOO_STRING_SVTOOLS_RTF_PNGBLIP ); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PICWGOAL; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PICWGOAL ); m_rExport.OutULong(aSize.Width()); - m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PICHGOAL; + m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PICHGOAL ); m_rExport.OutULong(aSize.Height()); - m_rExport.Strm() << SAL_NEWLINE_STRING; + m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ); const sal_uInt8* pGraphicAry = 0; SvMemoryStream aStream; if (GraphicConverter::Export(aStream, rGraphic, CVT_PNG) != ERRCODE_NONE) @@ -3758,7 +3756,7 @@ void RtfAttributeOutput::BulletDefinition(int /*nId*/, const Graphic& rGraphic, sal_uInt32 nSize = aStream.Tell(); pGraphicAry = (sal_uInt8*)aStream.GetData(); RtfAttributeOutput::WriteHex(pGraphicAry, nSize, &m_rExport.Strm()); - m_rExport.Strm() << "}}"; // pict, shppict + m_rExport.Strm().WriteCharPtr( "}}" ); // pict, shppict } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 220442ea0ae7..af06f82c0569 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -254,21 +254,21 @@ void RtfExport::WriteNumbering() if ( !pUsedNumTbl ) return; // no numbering is used - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_LISTTABLE; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTTABLE ); CollectGrfsOfBullets(); if (!m_vecBulletPic.empty()) - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << LO_STRING_SVTOOLS_RTF_LISTPICTURE; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( LO_STRING_SVTOOLS_RTF_LISTPICTURE ); BulletDefinitions(); if (!m_vecBulletPic.empty()) - Strm() << '}'; + Strm().WriteChar( '}' ); AbstractNumberingDefinitions(); - Strm() << '}'; + Strm().WriteChar( '}' ); - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE ); NumberingDefinitions(); - Strm() << '}'; + Strm().WriteChar( '}' ); SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); } @@ -293,16 +293,16 @@ void RtfExport::WriteRevTab() } // Now write the table - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' '; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_REVTBL ).WriteChar( ' ' ); for(sal_uInt16 i = 0; i < m_aRedlineTbl.size(); ++i) { const OUString* pAuthor = GetRedline(i); - Strm() << '{'; + Strm().WriteChar( '{' ); if (pAuthor) - Strm() << msfilter::rtfutil::OutString(*pAuthor, eDefaultEncoding).getStr(); - Strm() << ";}"; + Strm().WriteCharPtr( msfilter::rtfutil::OutString(*pAuthor, eDefaultEncoding).getStr() ); + Strm().WriteCharPtr( ";}" ); } - Strm() << '}' << SAL_NEWLINE_STRING; + Strm().WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING ); } void RtfExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags, @@ -398,9 +398,9 @@ sal_uLong RtfExport::ReplaceCr( sal_uInt8 ) void RtfExport::WriteFonts() { - Strm() << SAL_NEWLINE_STRING << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL; + Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FONTTBL ); maFontHelper.WriteFontTable( *m_pAttrOutput ); - Strm() << '}'; + Strm().WriteChar( '}' ); } void RtfExport::WriteStyles() @@ -416,10 +416,10 @@ void RtfExport::WriteFootnoteSettings() // Request a separator only in case the width is larger than zero. bool bSeparator = double(rFtnInfo.GetWidth()) > 0; - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FTNSEP; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FTNSEP ); if (bSeparator) - Strm() << OOO_STRING_SVTOOLS_RTF_CHFTNSEP; - Strm() << '}'; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CHFTNSEP ); + Strm().WriteChar( '}' ); } void RtfExport::WriteMainText() @@ -446,7 +446,7 @@ void RtfExport::WriteMainText() void RtfExport::WriteInfo() { SAL_INFO("sw.rtf", OSL_THIS_FUNC); - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_INFO ); SwDocShell *pDocShell(pDoc->GetDocShell()); uno::Reference<document::XDocumentProperties> xDocProps; @@ -474,8 +474,8 @@ void RtfExport::WriteInfo() OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate()); } - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " "; - Strm() << OUStringToOString( utl::ConfigManager::getProductName(), eCurrentEncoding).getStr() << "}{" << OOO_STRING_SVTOOLS_RTF_VERN; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COMMENT ).WriteCharPtr( " " ); + Strm().WriteCharPtr( OUStringToOString( utl::ConfigManager::getProductName(), eCurrentEncoding).getStr() ).WriteCharPtr( "}{" ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_VERN ); // The convention that we follow is that the version number // should be a non-negative 32-bit int @@ -485,8 +485,8 @@ void RtfExport::WriteInfo() #error Minor, micro and patchlevel version numbers must be less than 256 #endif - Strm().WriteNumber((sal_Int32) LIBO_VERSION_ENCODED_IN_32BITS) << '}'; - Strm() << '}'; + Strm().WriteNumber((sal_Int32) LIBO_VERSION_ENCODED_IN_32BITS).WriteChar( '}' ); + Strm().WriteChar( '}' ); } void RtfExport::WritePageDescTable() @@ -498,15 +498,15 @@ void RtfExport::WritePageDescTable() if( !nSize ) return; - Strm() << SAL_NEWLINE_STRING; + Strm().WriteCharPtr( SAL_NEWLINE_STRING ); bOutPageDescs = sal_True; - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCTBL; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PGDSCTBL ); for( sal_uInt16 n = 0; n < nSize; ++n ) { const SwPageDesc& rPageDesc = pDoc->GetPageDesc( n ); - Strm() << SAL_NEWLINE_STRING << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC; - OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE; + Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PGDSC ); + OutULong( n ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PGDSCUSE ); OutULong( rPageDesc.ReadUseOn() ); OutPageDescription( rPageDesc, false, false ); @@ -516,11 +516,11 @@ void RtfExport::WritePageDescTable() while( i ) if( rPageDesc.GetFollow() == &pDoc->GetPageDesc( --i ) ) break; - Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT; - OutULong( i ) << ' '; - Strm() << msfilter::rtfutil::OutString( rPageDesc.GetName(), eDefaultEncoding).getStr() << ";}"; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PGDSCNXT ); + OutULong( i ).WriteChar( ' ' ); + Strm().WriteCharPtr( msfilter::rtfutil::OutString( rPageDesc.GetName(), eDefaultEncoding).getStr() ).WriteCharPtr( ";}" ); } - Strm() << '}' << SAL_NEWLINE_STRING; + Strm().WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING ); bOutPageDescs = sal_False; // reset table infos, otherwise the depth of the cells will be incorrect, @@ -531,13 +531,13 @@ void RtfExport::WritePageDescTable() void RtfExport::ExportDocument_Impl() { // Make the header - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' - << OOO_STRING_SVTOOLS_RTF_ANSI; - Strm() << OOO_STRING_SVTOOLS_RTF_DEFF; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF ).WriteChar( '1' ) + .WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ANSI ); + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_DEFF ); OutULong( maFontHelper.GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem( RES_CHRATR_FONT ) )); // If this not exist, MS don't understand our ansi characters (0x80-0xff). - Strm() << "\\adeflang1025"; + Strm().WriteCharPtr( "\\adeflang1025" ); // Font table WriteFonts(); @@ -554,17 +554,17 @@ void RtfExport::ExportDocument_Impl() WriteInfo(); // Default TabSize - Strm() << m_pAttrOutput->m_aTabStop.makeStringAndClear().getStr() << SAL_NEWLINE_STRING; + Strm().WriteCharPtr( m_pAttrOutput->m_aTabStop.makeStringAndClear().getStr() ).WriteCharPtr( SAL_NEWLINE_STRING ); // Zoom SwViewShell *pViewShell(pDoc->GetCurrentViewShell()); if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SVX_ZOOM_PERCENT) { - Strm() << OOO_STRING_SVTOOLS_RTF_VIEWSCALE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_VIEWSCALE ); OutULong(pViewShell->GetViewOptions()->GetZoom()); } // Record changes? if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode) - Strm() << OOO_STRING_SVTOOLS_RTF_REVISIONS; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_REVISIONS ); // Init sections m_pSections = new MSWordSections( *this ); @@ -583,14 +583,14 @@ void RtfExport::ExportDocument_Impl() const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n); if (pProtect && pProtect->IsCntntProtected()) { - Strm() << OOO_STRING_SVTOOLS_RTF_FORMPROT; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FORMPROT ); break; } } } // enable form field shading - Strm() << OOO_STRING_SVTOOLS_RTF_FORMSHADE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FORMSHADE ); // size and empty margins of the page if( pDoc->GetPageDescCnt() ) @@ -620,8 +620,8 @@ void RtfExport::ExportDocument_Impl() else if( pDoc->FindPageDescByName( pSttPgDsc-> GetPageDesc()->GetName(), &nPosInDoc )) { - Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCNO; - OutULong( nPosInDoc ) << '}'; + Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PGDSCNO ); + OutULong( nPosInDoc ).WriteChar( '}' ); } } } @@ -631,43 +631,43 @@ void RtfExport::ExportDocument_Impl() { if( rPageDesc.GetLandscape() ) - Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LANDSCAPE ); const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize(); // Clipboard document is always created without a printer, then // the size will be always LONG_MAX! Solution then is to use A4 if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() ) { - Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAPERH ); Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4); - OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + OutULong( a4.Height() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAPERW ); OutULong( a4.Width() ); } else { - Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; - OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAPERH ); + OutULong( rSz.GetHeight() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAPERW ); OutULong( rSz.GetWidth() ); } } { const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace(); - Strm() << OOO_STRING_SVTOOLS_RTF_MARGL; - OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MARGL ); + OutLong( rLR.GetLeft() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MARGR ); OutLong( rLR.GetRight() ); } { const SvxULSpaceItem& rUL = rFmtPage.GetULSpace(); - Strm() << OOO_STRING_SVTOOLS_RTF_MARGT; - OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MARGT ); + OutLong( rUL.GetUpper() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MARGB ); OutLong( rUL.GetLower() ); } - Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SECTD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SBKNONE ); // All sections are unlocked by default - Strm() << OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED ); OutLong(1); OutPageDescription( rPageDesc, false, true ); // Changed bCheckForFirstPage to sal_True so headers // following title page are correctly added - i13107 @@ -689,7 +689,7 @@ void RtfExport::ExportDocument_Impl() const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos ? OOO_STRING_SVTOOLS_RTF_ENDDOC : OOO_STRING_SVTOOLS_RTF_FTNBJ; - Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART; + Strm().WriteCharPtr( pOut ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FTNSTART ); OutLong( rFtnInfo.nFtnOffset + 1 ); switch( rFtnInfo.eNum ) @@ -698,7 +698,7 @@ void RtfExport::ExportDocument_Impl() case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break; default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break; } - Strm() << pOut; + Strm().WriteCharPtr( pOut ); switch( rFtnInfo.aFmt.GetNumberingType() ) { @@ -711,13 +711,13 @@ void RtfExport::ExportDocument_Impl() case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break; default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break; } - Strm() << pOut; + Strm().WriteCharPtr( pOut ); const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo(); - Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT - << OOO_STRING_SVTOOLS_RTF_AFTNSTART; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_AENDDOC ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT ) + .WriteCharPtr( OOO_STRING_SVTOOLS_RTF_AFTNSTART ); OutLong( rEndNoteInfo.nFtnOffset + 1 ); switch( rEndNoteInfo.aFmt.GetNumberingType() ) @@ -731,16 +731,16 @@ void RtfExport::ExportDocument_Impl() case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break; default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break; } - Strm() << pOut; + Strm().WriteCharPtr( pOut ); } - Strm() << SAL_NEWLINE_STRING; + Strm().WriteCharPtr( SAL_NEWLINE_STRING ); WriteFootnoteSettings(); WriteMainText(); - Strm() << '}'; + Strm().WriteChar( '}' ); } void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet, @@ -776,7 +776,7 @@ bool RtfExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt ) if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle()) { // Level 9 disables the outline - Strm() << OOO_STRING_SVTOOLS_RTF_LEVEL << sal_Int32(9); + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVEL ).WriteInt32( sal_Int32(9) ); bRet = true; } @@ -877,23 +877,23 @@ void RtfExport::OutUnicode(const sal_Char *pToken, const OUString &rContent, boo { if (!bUpr) { - Strm() << '{' << pToken << ' '; - Strm() << msfilter::rtfutil::OutString( rContent, eCurrentEncoding ).getStr(); - Strm() << '}'; + Strm().WriteChar( '{' ).WriteCharPtr( pToken ).WriteChar( ' ' ); + Strm().WriteCharPtr( msfilter::rtfutil::OutString( rContent, eCurrentEncoding ).getStr() ); + Strm().WriteChar( '}' ); } else - Strm() << msfilter::rtfutil::OutStringUpr(pToken, rContent, eCurrentEncoding).getStr(); + Strm().WriteCharPtr( msfilter::rtfutil::OutStringUpr(pToken, rContent, eCurrentEncoding).getStr() ); } } void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT ) { - Strm() << '{' << pStr << OOO_STRING_SVTOOLS_RTF_YR; - OutULong( rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO; - OutULong( rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY; - OutULong( rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR; - OutULong( rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN; - OutULong( rDT.Minutes ) << '}'; + Strm().WriteChar( '{' ).WriteCharPtr( pStr ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_YR ); + OutULong( rDT.Year ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MO ); + OutULong( rDT.Month ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_DY ); + OutULong( rDT.Day ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_HR ); + OutULong( rDT.Hours ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_MIN ); + OutULong( rDT.Minutes ).WriteChar( '}' ); } sal_uInt16 RtfExport::GetColor( const Color& rColor ) const @@ -1065,12 +1065,12 @@ void RtfExport::OutColorTable() const Color& rCol = m_aColTbl[ n ]; if( n || COL_AUTO != rCol.GetColor() ) { - Strm() << OOO_STRING_SVTOOLS_RTF_RED; - OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN; - OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RED ); + OutULong( rCol.GetRed() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_GREEN ); + OutULong( rCol.GetGreen() ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_BLUE ); OutULong( rCol.GetBlue() ); } - Strm() << ';'; + Strm().WriteChar( ';' ); } } @@ -1121,13 +1121,13 @@ void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, bool bWriteReset, if( bWriteReset ) { if( pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode ) - Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SECTD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SBKNONE ); else - Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SECT ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SECTD ); } if( pAktPageDesc->GetLandscape() ) - Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LNDSCPSXN ); const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft(); bOutPageDescs = true; @@ -1146,7 +1146,7 @@ void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, bool bWriteReset, // title page if( pAktPageDesc != &rPgDsc ) { - Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TITLEPG ); pAktPageDesc = &rPgDsc; if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem ) == SFX_ITEM_SET ) @@ -1184,12 +1184,12 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) /* is this a title page? */ if( pAktPageDesc->GetFollow() && pAktPageDesc->GetFollow() != pAktPageDesc ) { - Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; + Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TITLEPG ); pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERF : OOO_STRING_SVTOOLS_RTF_FOOTERF); } - Strm() << '{' << pStr; + Strm().WriteChar( '{' ).WriteCharPtr( pStr ); WriteHeaderFooterText(pAktPageDesc->GetMaster(), bHeader); - Strm() << '}'; + Strm().WriteChar( '}' ); SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index fbf7bf0c65c9..07f43f937710 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1478,7 +1478,7 @@ void SwEscherEx::WritePictures() mxGlobal->SetNewBlipStreamOffset( nEndPos ); pPicStrm->Seek( 0 ); - rWrt.Strm() << *pPicStrm; + rWrt.Strm().WriteStream( *pPicStrm ); } Flush(); } @@ -2244,7 +2244,7 @@ void SwBasicEscherEx::WritePictures() mxGlobal->WriteBlibStoreEntry(*pEscherStrm, 1, sal_True, nEndPos); pPicStrm->Seek(0); - *pEscherStrm << *pPicStrm; + pEscherStrm->WriteStream( *pPicStrm ); } } @@ -2407,7 +2407,7 @@ SwEscherEx::~SwEscherEx() void SwEscherEx::FinishEscher() { pEscherStrm->Seek(0); - *rWrt.pTableStrm << *pEscherStrm; + rWrt.pTableStrm->WriteStream( *pEscherStrm ); delete pEscherStrm, pEscherStrm = 0; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 9ccd4d7eea86..20fa739b7f05 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -280,7 +280,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt) rWrt.WriteAsStringTable(aNames, rWrt.pFib->fcSttbfbkmk,rWrt.pFib->lcbSttbfbkmk); SvStream& rStrm = rWrt.bWrtWW8 ? *rWrt.pTableStrm : rWrt.Strm(); rWrt.pFib->fcPlcfbkf = rStrm.Tell(); - rStrm<<aTempStrm1; + rStrm.WriteStream( aTempStrm1 ); SwWW8Writer::WriteLong(rStrm, rWrt.pFib->ccpText + rWrt.pFib->ccpTxbx); for (aItr = aSttCps.begin();aItr!=aSttCps.end();++aItr) { @@ -291,7 +291,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt) } rWrt.pFib->lcbPlcfbkf = rStrm.Tell() - rWrt.pFib->fcPlcfbkf; rWrt.pFib->fcPlcfbkl = rStrm.Tell(); - rStrm<<aTempStrm2; + rStrm.WriteStream( aTempStrm2 ); SwWW8Writer::WriteLong(rStrm, rWrt.pFib->ccpText + rWrt.pFib->ccpTxbx); rWrt.pFib->lcbPlcfbkl = rStrm.Tell() - rWrt.pFib->fcPlcfbkl; } |