diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-30 11:31:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-30 13:18:38 +0000 |
commit | bbc94edb9a91b27910d43610db9994df10dd99e1 (patch) | |
tree | 99f81b7bc96dd93ae6c6e6a4f7a57cfda72cdfa4 /sw | |
parent | 47e1e8494dde85414d28efafa99b33a62b59116d (diff) |
refactor ConvertLineEnd
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlbas.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfldw.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/envelp/envlop1.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/textfld.cxx | 18 |
11 files changed, 28 insertions, 38 deletions
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx index b3a664f04fd7..665da0339f82 100644 --- a/sw/source/filter/html/htmlbas.cxx +++ b/sw/source/filter/html/htmlbas.cxx @@ -95,7 +95,7 @@ void SwHTMLParser::EndScript() } bIgnoreRawData = sal_False; - aScriptSource.ConvertLineEnd(); + aScriptSource = convertLineEnd(aScriptSource, GetSystemLineEnd()); // Ausser StarBasic und unbenutzem JavaScript jedes Script oder den // Modulnamen in einem Feld merken merken @@ -254,8 +254,7 @@ void SwHTMLParser::InsertBasicDocEvent( rtl::OUString aEvent, const String& rNam if( !pDocSh ) return; - String sEvent( rName ); - sEvent.ConvertLineEnd(); + String sEvent(convertLineEnd(rName, GetSystemLineEnd())); String sScriptType; if( EXTENDED_STYPE == eScrType ) sScriptType = rScrType; diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 3cdc270f2797..fca7370f4b9f 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -475,8 +475,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt ) rComment.Copy( rComment.Len()-3, 3 ).EqualsAscii( "-->" )) ) { // META-Tags direkt ausgeben - String sComment( rComment ); - sComment.ConvertLineEnd( GetSystemLineEnd() ); + String sComment(convertLineEnd(rComment, GetSystemLineEnd())); // TODO: HTML-Tags are written without entitities, that for, // characters not contained in the destination encoding are lost! rtl::OString sTmp(rtl::OUStringToOString(sComment, @@ -492,7 +491,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt ) sComment.EraseLeadingChars(); if( '<' == sComment.GetChar(0) ) { - sComment.ConvertLineEnd( GetSystemLineEnd() ); + sComment = convertLineEnd(sComment, GetSystemLineEnd()); // TODO: HTML-Tags are written without entitities, that for, // characters not contained in the destination encoding are // lost! @@ -506,8 +505,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt ) if( !bWritten ) { - String sComment( rComment ); - sComment.ConvertLineEnd( GetSystemLineEnd() ); + String sComment(convertLineEnd(rComment, GetSystemLineEnd())); rtl::OStringBuffer sOut; // TODO: ??? sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_comment) diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index d12ee914743c..d0afc811e096 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1389,7 +1389,7 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) String sEvent( rOption.GetString() ); if( sEvent.Len() ) { - sEvent.ConvertLineEnd(); + sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); String aScriptType2; if( EXTENDED_STYPE==eScriptType2 ) aScriptType2 = rDfltScriptType; @@ -1621,7 +1621,7 @@ void SwHTMLParser::InsertInput() String sEvent( rOption.GetString() ); if( sEvent.Len() ) { - sEvent.ConvertLineEnd(); + sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); String aScriptType2; if( EXTENDED_STYPE==eScriptType2 ) aScriptType2 = rDfltScriptType; @@ -2088,7 +2088,7 @@ void SwHTMLParser::NewTextArea() String sEvent( rOption.GetString() ); if( sEvent.Len() ) { - sEvent.ConvertLineEnd(); + sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); if( EXTENDED_STYPE==eScriptType2 ) aScriptType = rDfltScriptType; aMacroTbl.Insert( nEvent, new SvxMacro( sEvent, aScriptType, @@ -2368,7 +2368,7 @@ void SwHTMLParser::NewSelect() String sEvent( rOption.GetString() ); if( sEvent.Len() ) { - sEvent.ConvertLineEnd(); + sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); if( EXTENDED_STYPE==eScriptType2 ) aScriptType = rDfltScriptType; aMacroTbl.Insert( nEvent, new SvxMacro( sEvent, aScriptType, diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index f2638dc09ba2..46c69f0361e5 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1336,7 +1336,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, } if( sVal.Len() ) { - sVal.ConvertLineEnd( LINEEND_LF ); + sVal = convertLineEnd(sVal, LINEEND_LF); xub_StrLen nPos = 0; while ( nPos != STRING_NOTFOUND ) { diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 8e302e31a40e..88fc7058ea03 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -424,7 +424,7 @@ IMAGE_SETEVENT: String sTmp( rOption.GetString() ); if( sTmp.Len() ) { - sTmp.ConvertLineEnd(); + sTmp = convertLineEnd(sTmp, GetSystemLineEnd()); String sScriptType; if( EXTENDED_STYPE == eScriptType2 ) sScriptType = sDfltScriptType; @@ -1110,7 +1110,7 @@ ANCHOR_SETEVENT: String sTmp( rOption.GetString() ); if( sTmp.Len() ) { - sTmp.ConvertLineEnd(); + sTmp = convertLineEnd(sTmp, GetSystemLineEnd()); String sScriptType; if( EXTENDED_STYPE == eScriptType2 ) sScriptType = sDfltScriptType; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 887db2500490..d30066ee00b9 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1079,7 +1079,7 @@ void SwHTMLParser::NextToken( int nToken ) switch( nToken ) { case HTML_NOEMBED_OFF: - aContents.ConvertLineEnd(); + aContents = convertLineEnd(aContents, GetSystemLineEnd()); InsertComment( aContents, OOO_STRING_SVTOOLS_HTML_noembed ); aContents.Erase(); bCallNextToken = sal_False; diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index b7e1e5181801..34c5c0f735ad 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -356,8 +356,8 @@ sal_Bool SwEnvPage::FillItemSet(SfxItemSet& rSet) void SwEnvPage::Reset(const SfxItemSet& rSet) { SwEnvItem aItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); - aAddrEdit .SetText(String(aItem.aAddrText).ConvertLineEnd()); - aSenderEdit.SetText(String(aItem.aSendText).ConvertLineEnd()); + aAddrEdit .SetText(convertLineEnd(aItem.aAddrText, GetSystemLineEnd())); + aSenderEdit.SetText(convertLineEnd(aItem.aSendText, GetSystemLineEnd())); aSenderBox .Check (aItem.bSend); aSenderBox.GetClickHdl().Call(&aSenderBox); } diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index e49f36755804..e4c3210b9898 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -356,9 +356,9 @@ IMPL_LINK( SwLabPage, AddrHdl, Button *, EMPTYARG ) String aWriting; if ( aAddrBox.IsChecked() ) - aWriting = MakeSender(); + aWriting = convertLineEnd(MakeSender(), GetSystemLineEnd()); - aWritingEdit.SetText( aWriting.ConvertLineEnd() ); + aWritingEdit.SetText( aWriting ); aWritingEdit.GrabFocus(); return 0; } @@ -570,10 +570,10 @@ void SwLabPage::Reset(const SfxItemSet& rSet) aItem = (const SwLabItem&) rSet.Get(FN_LABEL); String sDBName = aItem.sDBName; - String aWriting( aItem.aWriting ); + String aWriting(convertLineEnd(aItem.aWriting, GetSystemLineEnd())); aAddrBox .Check ( aItem.bAddr ); - aWritingEdit.SetText ( aWriting.ConvertLineEnd() ); + aWritingEdit.SetText ( aWriting ); for(std::vector<rtl::OUString>::const_iterator i = GetParent()->Makes().begin(); i != GetParent()->Makes().end(); ++i) { diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 365d90c94f10..af01ff5cdf30 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -134,7 +134,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS, aEditED.SetReadOnly( !bEnable ); if( aStr.Len() ) - aEditED.SetText( aStr.ConvertLineEnd() ); + aEditED.SetText(convertLineEnd(aStr, GetSystemLineEnd())); FreeResource(); } diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index 80380a206aa4..4dc4cba01619 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -1084,7 +1084,6 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) { case MN_EDIT_COMMENT: { - String sComment; if (pEntry) { if (pTable->GetParent(pEntry)) @@ -1101,14 +1100,14 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) const_cast<SwRedline&>(rRedline).Broadcast(SwRedlineHint(&rRedline,SWREDLINE_FOCUS)); */ - sComment = rRedline.GetComment(); + rtl::OUString sComment = convertLineEnd(rRedline.GetComment(), GetSystemLineEnd()); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT ); OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()"); SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() ); - aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT)); + aSet.Put(SvxPostItTextItem(sComment, SID_ATTR_POSTIT_TEXT)); aSet.Put(SvxPostItAuthorItem(rRedline.GetAuthorString(), SID_ATTR_POSTIT_AUTHOR)); aSet.Put(SvxPostItDateItem( GetAppLangDateTimeString( diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 228d8dd62ca2..984a77b9b308 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -402,13 +402,11 @@ void SwTextShell::ExecField(SfxRequest &rReq) } */ - String sComment; const SwRedline *pRedline = rSh.GetCurrRedline(); if (pRedline) { - sComment = pRedline->GetComment(); - + rtl::OUString sComment = convertLineEnd(pRedline->GetComment(), GetSystemLineEnd()); sal_Bool bTravel = sal_False; @@ -417,7 +415,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT ); OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()"); SfxItemSet aSet(GetPool(), fnGetRange()); - aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT)); + aSet.Put(SvxPostItTextItem(sComment, SID_ATTR_POSTIT_TEXT)); aSet.Put(SvxPostItAuthorItem(pRedline->GetAuthorString(), SID_ATTR_POSTIT_AUTHOR)); aSet.Put( SvxPostItDateItem( GetAppLangDateTimeString( @@ -780,8 +778,6 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn ) const SwRedline *pRedline = pSh->GetCurrRedline(); - String sComment; - if (pRedline) { // Traveling nur bei mehr als einem Feld @@ -809,9 +805,9 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn ) pSh->SwapPam(); pRedline = pSh->GetCurrRedline(); - sComment = pRedline->GetComment(); + rtl::OUString sComment = convertLineEnd(pRedline->GetComment(), GetSystemLineEnd()); - pDlg->SetNote( sComment.ConvertLineEnd() ); + pDlg->SetNote(sComment); pDlg->ShowLastAuthor( pRedline->GetAuthorString(), GetAppLangDateTimeString( pRedline->GetRedlineData().GetTimeStamp() )); @@ -835,8 +831,6 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn ) const SwRedline *pRedline = pSh->GetCurrRedline(); - String sComment; - if (pRedline) { // Traveling nur bei mehr als einem Feld @@ -858,9 +852,9 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn ) pDlg->EnableTravel(sal_True, bEnable); pRedline = pSh->GetCurrRedline(); - sComment = pRedline->GetComment(); + rtl::OUString sComment = convertLineEnd(pRedline->GetComment(), GetSystemLineEnd()); - pDlg->SetNote(sComment.ConvertLineEnd()); + pDlg->SetNote(sComment); pDlg->ShowLastAuthor(pRedline->GetAuthorString(), GetAppLangDateTimeString( pRedline->GetRedlineData().GetTimeStamp() )); |