diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-08-14 23:17:08 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-15 16:38:26 +0200 |
commit | 6e0d836ff120ba292ba52f3623a3dd9be04aefc2 (patch) | |
tree | a8deb1dd85481c0d09d5cdc29d5440722548889b /sw/source/filter/ascii | |
parent | 6b9d91c924a5b2f41c4cab5f1e86291b5997a681 (diff) |
String to OUString, some formatting
Conflicts:
sw/source/filter/basflt/fltini.cxx
sw/source/ui/dialog/ascfldlg.cxx
Change-Id: Ifa12105aa6f747e2797891b6c71128bd96f78bf3
Diffstat (limited to 'sw/source/filter/ascii')
-rw-r--r-- | sw/source/filter/ascii/parasc.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ascii/wrtasc.cxx | 27 | ||||
-rw-r--r-- | sw/source/filter/ascii/wrtasc.hxx | 10 |
3 files changed, 18 insertions, 23 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index a6800fdc8e36..c5e8387a26fa 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -69,7 +69,7 @@ public: // Call for the general reader interface -sal_uLong AsciiReader::Read( SwDoc &rDoc, const String&, SwPaM &rPam, const String & ) +sal_uLong AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OUString & ) { if( !pStrm ) { @@ -110,7 +110,7 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn, pItemSet->Put( aLang, RES_CHRATR_CJK_LANGUAGE ); pItemSet->Put( aLang, RES_CHRATR_CTL_LANGUAGE ); } - if( rOpt.GetFontName().Len() ) + if( !rOpt.GetFontName().isEmpty() ) { Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) ); if( pDoc->getPrinter( false ) ) diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index 42a0b21f8620..87d1002d7586 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -33,17 +33,17 @@ //----------------------------------------------------------------- -SwASCWriter::SwASCWriter( const String& rFltNm ) +SwASCWriter::SwASCWriter( const OUString& rFltNm ) { SwAsciiOptions aNewOpts; - switch( 5 <= rFltNm.Len() ? rFltNm.GetChar( 4 ) : 0 ) + switch( 5 <= rFltNm.getLength() ? rFltNm[4] : 0 ) { case 'D': aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 ); aNewOpts.SetParaFlags( LINEEND_CRLF ); - if( 5 < rFltNm.Len() ) - switch( rFltNm.Copy( 5 ).ToInt32() ) + if( 5 < rFltNm.getLength() ) + switch( rFltNm.copy( 5 ).toInt32() ) { case 437: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_437 ); break; case 850: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 ); break; @@ -74,7 +74,7 @@ SwASCWriter::SwASCWriter( const String& rFltNm ) break; default: - if( rFltNm.Copy( 4 ).EqualsAscii( "_DLG" )) + if( rFltNm.copy( 4 )=="_DLG" ) { // use the options aNewOpts = GetAsciiOptions(); @@ -87,22 +87,17 @@ SwASCWriter::~SwASCWriter() {} sal_uLong SwASCWriter::WriteStream() { - sal_Char cLineEnd[ 3 ]; - sal_Char* pCEnd = cLineEnd; if( bASCII_ParaAsCR ) // If predefined - *pCEnd++ = '\015'; + m_sLineEnd = "\015"; else if( bASCII_ParaAsBlanc ) - *pCEnd++ = ' '; + m_sLineEnd = " "; else switch( GetAsciiOptions().GetParaFlags() ) { - case LINEEND_CR: *pCEnd++ = '\015'; break; - case LINEEND_LF: *pCEnd++ = '\012'; break; - case LINEEND_CRLF: *pCEnd++ = '\015', *pCEnd++ = '\012'; break; + case LINEEND_CR: m_sLineEnd = "\015"; break; + case LINEEND_LF: m_sLineEnd = "\012"; break; + case LINEEND_CRLF: m_sLineEnd = "\015\012"; break; } - *pCEnd = 0; - - sLineEnd.AssignAscii( cLineEnd ); long nMaxNode = pDoc->GetNodes().Count(); @@ -200,7 +195,7 @@ sal_uLong SwASCWriter::WriteStream() } -void GetASCWriter( const String& rFltNm, const String& /*rBaseURL*/, WriterRef& xRet ) +void GetASCWriter( const OUString& rFltNm, const OUString& /*rBaseURL*/, WriterRef& xRet ) { xRet = new SwASCWriter( rFltNm ); } diff --git a/sw/source/filter/ascii/wrtasc.hxx b/sw/source/filter/ascii/wrtasc.hxx index 99b97fca5e91..cd8af84dd38b 100644 --- a/sw/source/filter/ascii/wrtasc.hxx +++ b/sw/source/filter/ascii/wrtasc.hxx @@ -16,8 +16,8 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _WRTASC_HXX -#define _WRTASC_HXX +#ifndef WRTASC_HXX +#define WRTASC_HXX #include <shellio.hxx> #include <wrt_fn.hxx> @@ -29,15 +29,15 @@ extern SwNodeFnTab aASCNodeFnTab; class SwASCWriter : public Writer { - String sLineEnd; + OUString m_sLineEnd; virtual sal_uLong WriteStream(); public: - SwASCWriter( const String& rFilterName ); + SwASCWriter( const OUString& rFilterName ); virtual ~SwASCWriter(); - const String& GetLineEnd() const { return sLineEnd; } + OUString GetLineEnd() const { return m_sLineEnd; } }; |