summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/inputbox.cxx3
-rw-r--r--basic/source/runtime/iosys.cxx5
-rw-r--r--cui/source/dialogs/pastedlg.cxx2
-rw-r--r--cui/source/dialogs/postdlg.cxx8
-rw-r--r--editeng/source/editeng/impedit.cxx3
-rw-r--r--editeng/source/editeng/impedit2.cxx6
-rw-r--r--editeng/source/outliner/outliner.cxx3
-rw-r--r--editeng/source/uno/unofored.cxx4
-rw-r--r--editeng/source/uno/unotext.cxx3
-rw-r--r--forms/source/component/DatabaseForm.cxx5
-rw-r--r--sc/source/core/tool/ddelink.cxx2
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx3
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx3
-rw-r--r--sc/source/ui/docshell/impex.cxx4
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx3
-rw-r--r--sc/source/ui/view/hintwin.cxx4
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
-rw-r--r--sc/source/ui/view/viewfun5.cxx2
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx2
-rw-r--r--starmath/source/accessibility.cxx3
-rw-r--r--starmath/source/parse.cxx6
-rw-r--r--svtools/source/edit/texteng.cxx3
-rw-r--r--svtools/source/edit/textview.cxx3
-rw-r--r--svtools/source/svhtml/parhtml.cxx2
-rw-r--r--sw/source/filter/html/htmlbas.cxx5
-rw-r--r--sw/source/filter/html/htmlfldw.cxx8
-rw-r--r--sw/source/filter/html/htmlform.cxx8
-rw-r--r--sw/source/filter/html/htmlforw.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx4
-rw-r--r--sw/source/filter/html/swhtml.cxx2
-rw-r--r--sw/source/ui/envelp/envlop1.cxx4
-rw-r--r--sw/source/ui/envelp/label1.cxx8
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx2
-rw-r--r--sw/source/ui/misc/redlndlg.cxx5
-rw-r--r--sw/source/ui/shells/textfld.cxx18
-rw-r--r--toolkit/source/helper/formpdfexport.cxx3
-rw-r--r--tools/Package_inc.mk1
-rw-r--r--tools/inc/tools/lineend.hxx53
-rw-r--r--tools/inc/tools/string.hxx24
-rw-r--r--tools/source/stream/stream.cxx92
-rw-r--r--tools/source/string/strimp.cxx95
-rwxr-xr-xvcl/source/app/dbggui.cxx134
-rwxr-xr-xvcl/source/gdi/outdev3.cxx3
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx3
45 files changed, 278 insertions, 284 deletions
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index d59eae1d34e9..e3bc61770591 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -116,8 +116,7 @@ void SvRTLInputBox::PositionPrompt(const String& rPrompt,const Size& rDlgSize)
{
if ( rPrompt.Len() == 0 )
return;
- String aText_( rPrompt );
- aText_.ConvertLineEnd( LINEEND_CR );
+ String aText_(convertLineEnd(rPrompt, LINEEND_CR));
aPromptText.SetPosPixel( LogicToPixel(Point(5,5)));
aPromptText.SetText( aText_ );
Size aSize( rDlgSize );
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 07a696db8d5f..fb33fcd18930 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -705,9 +705,8 @@ namespace
{
void WriteLines(SvStream &rStream, const rtl::OString& rStr)
{
- ByteString aStr( rStr );
- aStr.ConvertLineEnd( rStream.GetLineDelimiter() );
- rStream.Write( aStr.GetBuffer(), aStr.Len() );
+ rtl::OString aStr(convertLineEnd(rStr, rStream.GetLineDelimiter()) );
+ write_uInt8s_FromOString(rStream, rStr);
endl( rStream );
}
}
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index 99cb18709094..105178240e19 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -226,7 +226,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
aTypeName += '\n';
aTypeName += aSourceName;
- aTypeName.ConvertLineEnd();
+ aTypeName = convertLineEnd(aTypeName, GetSystemLineEnd());
}
ObjectSource().SetText( aTypeName );
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index ab5ed760d79f..0bb2a3e91743 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -112,7 +112,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent,
}
nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR );
- String aAuthorStr, aDateStr, aTextStr;
+ String aAuthorStr, aDateStr;
if ( rSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE )
{
@@ -140,6 +140,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent,
nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT );
+ rtl::OUString aTextStr;
if ( rSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE )
{
const SvxPostItTextItem& rText =
@@ -148,7 +149,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent,
}
ShowLastAuthor(aAuthorStr, aDateStr);
- aEditED.SetText( aTextStr.ConvertLineEnd() );
+ aEditED.SetText(convertLineEnd(aTextStr, GetSystemLineEnd()));
if ( !bNew )
SetText( CUI_RESSTR( STR_NOTIZ_EDIT ) );
@@ -235,8 +236,9 @@ IMPL_LINK( SvxPostItDialog, Stamp, Button *, EMPTYARG )
aStr += aLocaleWrapper.getTime(aTime, sal_False, sal_False);
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " ----\n" ) );
+ aStr = convertLineEnd(aStr, GetSystemLineEnd());
- aEditED.SetText( aStr.ConvertLineEnd() );
+ aEditED.SetText(aStr);
xub_StrLen nLen = aStr.Len();
aEditED.GrabFocus();
aEditED.SetSelection( Selection( nLen, nLen ) );
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 9be866971669..c5a3f5d4bbd6 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1310,8 +1310,7 @@ void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::dat
uno::Any aData = xDataObj->getTransferData( aFlavor );
::rtl::OUString aTmpText;
aData >>= aTmpText;
- String aText( aTmpText );
- aText.ConvertLineEnd( LINEEND_LF );
+ String aText(convertLineEnd(aTmpText, LINEEND_LF));
aText.SearchAndReplaceAll( LINE_SEP, ' ' );
aSel = pEditEngine->pImpEditEngine->ImpInsertText( aSel, aText );
}
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index a53c670fa85a..313f54c03694 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2700,8 +2700,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS
if ( GetStatus().DoOnlineSpelling() )
aCurWord = SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD );
- XubString aText( rStr );
- aText.ConvertLineEnd( LINEEND_LF );
+ XubString aText(convertLineEnd(rStr, LINEEND_LF));
SfxVoidItem aTabItem( EE_FEATURE_TAB );
// Converts to linesep = \n
@@ -3485,8 +3484,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable(
uno::Reference< datatransfer::XTransferable > xDataObj;
xDataObj = pDataObj;
- XubString aText( GetSelected( aSelection ) );
- aText.ConvertLineEnd(); // System specific
+ XubString aText(convertLineEnd(GetSelected(aSelection), GetSystemLineEnd())); // System specific
pDataObj->GetString() = aText;
SvxFontItem::EnableStoreUnicodeNames( sal_True );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index f62cec68311b..8b86352811f4 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -405,8 +405,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara )
}
else
{
- XubString aText( rText );
- aText.ConvertLineEnd( LINEEND_LF );
+ XubString aText(convertLineEnd(rText, LINEEND_LF));
if( aText.GetChar( aText.Len()-1 ) == '\x0A' )
aText.Erase( aText.Len()-1, 1 ); // Delete the last break
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index 6761127d7115..fbc93db4e0d5 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -67,9 +67,7 @@ sal_uInt16 SvxEditEngineForwarder::GetTextLen( sal_uInt16 nParagraph ) const
String SvxEditEngineForwarder::GetText( const ESelection& rSel ) const
{
- String aRet = rEditEngine.GetText( rSel, LINEEND_LF );
- aRet.ConvertLineEnd();
- return aRet;
+ return convertLineEnd(rEditEngine.GetText(rSel, LINEEND_LF), GetSystemLineEnd());
}
SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) const
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 655928202fe1..947a93e9de99 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -371,8 +371,7 @@ void SAL_CALL SvxUnoTextRangeBase::setString(const OUString& aString)
{
CheckSelection( maSelection, pForwarder );
- String aConverted( aString );
- aConverted.ConvertLineEnd( LINEEND_LF ); // Simply count the number of line endings
+ String aConverted(convertLineEnd(aString, LINEEND_LF)); // Simply count the number of line endings
pForwarder->QuickInsertText( aConverted, maSelection );
mpEditSource->UpdateData();
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 5caf83a9f56b..d678f5146532 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -969,10 +969,7 @@ void ODatabaseForm::Encode( ::rtl::OUString& rString ) const
::rtl::OUString aResult;
// Zeilenendezeichen werden als CR dargestellt
- UniString sConverter = rString;
- sConverter.ConvertLineEnd( LINEEND_CR );
- rString = sConverter;
-
+ rString = convertLineEnd(rString, LINEEND_CR);
// Jeden einzelnen Character ueberpruefen
sal_Int32 nStrLen = rString.getLength();
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index c53e739821e2..3bd75aebb350 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -140,7 +140,7 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
String aLinkStr;
ScByteSequenceToString::GetString( aLinkStr, rValue, DDE_TXT_ENCODING );
- aLinkStr.ConvertLineEnd(LINEEND_LF);
+ aLinkStr = convertLineEnd(aLinkStr, LINEEND_LF);
// wenn String mit Zeilenende aufhoert, streichen:
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index cd086044b052..a04c75bb10cb 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -328,8 +328,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport,
{
sal_Int32 i(0);
rtl::OUStringBuffer sTemp;
- String sMessage(sOUMessage);
- rtl::OUString sText (sMessage.ConvertLineEnd(LINEEND_LF));
+ rtl::OUString sText(convertLineEnd(sOUMessage, LINEEND_LF));
bool bPrevCharWasSpace(true);
while(i < sText.getLength())
{
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 34959e15a127..b80b6142f01d 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -321,7 +321,7 @@ void lcl_RemoveTabs(String& rStr)
void lcl_RemoveLineEnd(String& rStr)
{
- rStr.ConvertLineEnd(LINEEND_LF);
+ rStr = convertLineEnd(rStr, LINEEND_LF);
xub_StrLen nPos;
while ( (nPos=rStr.Search('\n')) != STRING_NOTFOUND )
rStr.SetChar( nPos, ' ' );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 8ed622667ad4..94dd497dfd65 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1139,8 +1139,7 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, sal_Boo
return false;
}
- String aNewText = rText;
- aNewText.ConvertLineEnd(); //! ist das noetig ???
+ String aNewText = convertLineEnd(rText, GetSystemLineEnd()); //! ist das noetig ???
if( ScPostIt* pNote = (aNewText.Len() > 0) ? pDoc->GetOrCreateNote( rPos ) : pDoc->GetNote( rPos ) )
pNote->SetText( rPos, aNewText );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 2c99ac995b2a..ede56ebb183e 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1471,7 +1471,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace )
aCell.SearchAndReplaceAll( _LF, ' ' );
else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF )
- aCell.ConvertLineEnd();
+ aCell = convertLineEnd(aCell, GetSystemLineEnd());
}
if( mExportTextOptions.mcSeparatorConvertTo && cSep )
@@ -1503,7 +1503,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace )
aCell.SearchAndReplaceAll( _LF, ' ' );
else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF )
- aCell.ConvertLineEnd();
+ aCell = convertLineEnd(aCell, GetSystemLineEnd());
}
if( mExportTextOptions.mcSeparatorConvertTo && cSep )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 4aa0e9caba52..3eee0085bb0e 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -306,8 +306,7 @@ void ScTpUserLists::UpdateEntries( size_t nList )
aEntryListStr += String(pList->GetSubStr(i));
}
- aEntryListStr.ConvertLineEnd();
- aEdEntries.SetText( aEntryListStr );
+ aEdEntries.SetText(convertLineEnd(aEntryListStr, GetSystemLineEnd()));
}
else
{
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 0b9cb21cda93..3496ef6b86f4 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -45,10 +45,8 @@
ScHintWindow::ScHintWindow( Window* pParent, const String& rTit, const String& rMsg ) :
Window( pParent, WinBits( WB_BORDER ) ),
aTitle( rTit ),
- aMessage( rMsg )
+ aMessage( convertLineEnd(rMsg, LINEEND_CR) )
{
- aMessage.ConvertLineEnd( LINEEND_CR );
-
// Hellgelb, wie Notizen in detfunc.cxx
Color aYellow( 255,255,192 ); // hellgelb
SetBackground( aYellow );
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index 997a233ba87a..fb20104cb8a6 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -111,9 +111,7 @@ String ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
aObj.SetFormulas( GetViewData()->GetOptions().GetOption( VOPT_FORMULAS ) );
rtl::OUString aExportOUString;
aObj.ExportString( aExportOUString );
- aStrSelection = aExportOUString;
-
- aStrSelection.ConvertLineEnd( LINEEND_CR );
+ aStrSelection = convertLineEnd(aExportOUString, LINEEND_CR);
// Tab/CR durch Space ersetzen, wenn fuer Dialog oder per Basic/SelectionTextExt,
// oder wenn es eine einzelne Zeile ist.
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 1b18f51bf270..08dc06228a2e 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -650,7 +650,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r
{
// get size from string the same way as in ScDdeLink::DataChanged
- aDataStr.ConvertLineEnd(LINEEND_LF);
+ aDataStr = convertLineEnd(aDataStr, LINEEND_LF);
xub_StrLen nLen = aDataStr.Len();
if (nLen && aDataStr.GetChar(nLen-1) == '\n')
aDataStr.Erase(nLen-1);
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 40758e224de9..2f3a7ad6089e 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -176,7 +176,7 @@ IMAPOBJ_SETEVENT:
String sTmp( rOption.GetString() );
if( sTmp.Len() )
{
- sTmp.ConvertLineEnd();
+ sTmp = convertLineEnd(sTmp, GetSystemLineEnd());
aMacroTbl.Insert( nEvent,
new SvxMacro( sTmp, sEmpty, eScrpType ));
}
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index e70301dbcaa2..c2d81f3b3b44 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1009,8 +1009,7 @@ String SmTextForwarder::GetText( const ESelection& rSel ) const
String aRet;
if (pEditEngine)
aRet = pEditEngine->GetText( rSel, LINEEND_LF );
- aRet.ConvertLineEnd();
- return aRet;
+ return convertLineEnd(aRet, GetSystemLineEnd());
}
SfxItemSet SmTextForwarder::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) const
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 34425ab6acc7..787695685f58 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2443,8 +2443,7 @@ SmNode *SmParser::Parse(const String &rBuffer)
{
ClearUsedSymbols();
- m_aBufferString = rBuffer;
- m_aBufferString.ConvertLineEnd( LINEEND_LF );
+ m_aBufferString = convertLineEnd(rBuffer, LINEEND_LF);
m_nBufferIndex = 0;
m_nTokenIndex = 0;
m_Row = 1;
@@ -2468,8 +2467,7 @@ SmNode *SmParser::Parse(const String &rBuffer)
SmNode *SmParser::ParseExpression(const String &rBuffer)
{
- m_aBufferString = rBuffer;
- m_aBufferString.ConvertLineEnd( LINEEND_LF );
+ m_aBufferString = convertLineEnd(rBuffer, LINEEND_LF);
m_nBufferIndex = 0;
m_nTokenIndex = 0;
m_Row = 1;
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 5a6f7b81af57..74c41198dc62 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -826,8 +826,7 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
else
aPaM = rCurSel.GetEnd();
- XubString aText( rStr );
- aText.ConvertLineEnd( LINEEND_LF );
+ XubString aText(convertLineEnd(rStr, LINEEND_LF));
sal_uInt16 nStart = 0;
while ( nStart < aText.Len() )
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
index fae3fe87f473..d049f3028c6e 100644
--- a/svtools/source/edit/textview.cxx
+++ b/svtools/source/edit/textview.cxx
@@ -2140,8 +2140,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
uno::Any aData = xDataObj->getTransferData( aFlavor );
::rtl::OUString aOUString;
aData >>= aOUString;
- aText = aOUString;
- aText.ConvertLineEnd( LINEEND_LF );
+ aText = convertLineEnd(aOUString, LINEEND_LF);
}
}
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index c8e8ab253757..3df6ab9f3f16 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2126,7 +2126,7 @@ bool HTMLParser::ParseMetaOptionsImpl(
else
{
// convert line endings for Description
- aContent.ConvertLineEnd();
+ aContent = convertLineEnd(aContent, GetSystemLineEnd());
}
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() ));
diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx
index 957c0186620b..0dd668d049ea 100644
--- a/toolkit/source/helper/formpdfexport.cxx
+++ b/toolkit/source/helper/formpdfexport.cxx
@@ -610,8 +610,7 @@ namespace toolkitform
// --------------------------------
// text line ends
// some controls may (always or dependent on other settings) return UNIX line ends
- String aConverter( _rpDescriptor->Text );
- _rpDescriptor->Text = aConverter.ConvertLineEnd( LINEEND_CRLF );
+ _rpDescriptor->Text = convertLineEnd(_rpDescriptor->Text, LINEEND_CRLF);
}
catch( const Exception& )
{
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index 91642c41344f..b4765f95cd6c 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -54,6 +54,7 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmime.hxx,tools/inetmim
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmsg.hxx,tools/inetmsg.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetstrm.hxx,tools/inetstrm.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/line.hxx,tools/line.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/lineend.hxx,tools/lineend.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/link.hxx,tools/link.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/list.hxx,tools/list.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/mapunit.hxx,tools/mapunit.hxx))
diff --git a/tools/inc/tools/lineend.hxx b/tools/inc/tools/lineend.hxx
new file mode 100644
index 000000000000..b9ee807ffa30
--- /dev/null
+++ b/tools/inc/tools/lineend.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
+ * (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _LINEEND_HXX
+#define _LINEEND_HXX
+
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include "tools/toolsdllapi.h"
+
+enum LineEnd { LINEEND_CR, LINEEND_LF, LINEEND_CRLF };
+
+inline LineEnd GetSystemLineEnd()
+{
+#if defined WNT
+ return LINEEND_CRLF;
+#else
+ return LINEEND_LF;
+#endif
+}
+
+TOOLS_DLLPUBLIC rtl::OString convertLineEnd(const rtl::OString &rIn, LineEnd eLineEnd);
+TOOLS_DLLPUBLIC rtl::OUString convertLineEnd(const rtl::OUString &rIn, LineEnd eLineEnd);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 8f3be409d9b9..22aecff2038e 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -36,6 +36,7 @@
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include "tools/toolsdllapi.h"
+#include "tools/lineend.hxx"
/*******************************************************************************
*
@@ -80,21 +81,6 @@ typedef rtl_TextEncoding CharSet;
#endif // ENUM_CHARSET_DECLARED
-// -----------
-// - LineEnd -
-// -----------
-
-enum LineEnd { LINEEND_CR, LINEEND_LF, LINEEND_CRLF };
-
-inline LineEnd GetSystemLineEnd()
-{
-#if defined UNX
- return LINEEND_LF;
-#else
- return LINEEND_CRLF;
-#endif
-}
-
// -----------------------------------------------------------------------
// ----------------
@@ -227,10 +213,6 @@ public:
ByteString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
ByteString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
- ByteString& ConvertLineEnd( LineEnd eLineEnd );
- ByteString& ConvertLineEnd()
- { return ConvertLineEnd( GetSystemLineEnd() ); }
-
ByteString& ToLowerAscii();
ByteString& ToUpperAscii();
@@ -480,10 +462,6 @@ public:
UniString& EraseTrailingChars( sal_Unicode c = ' ' );
UniString& Reverse();
- UniString& ConvertLineEnd( LineEnd eLineEnd );
- UniString& ConvertLineEnd()
- { return ConvertLineEnd( GetSystemLineEnd() ); }
-
UniString& ToLowerAscii();
UniString& ToUpperAscii();
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index fd5a579a8bde..902f17876d3a 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -2388,4 +2388,96 @@ rtl::OUString read_uInt16s_ToOUString(SvStream& rStrm, sal_Size nLen)
return pStr ? rtl::OUString(pStr, SAL_NO_ACQUIRE) : rtl::OUString();
}
+namespace
+{
+ template <typename T, typename O> T tmpl_convertLineEnd(const T &rIn, LineEnd eLineEnd)
+ {
+ // Zeilenumbrueche ermitteln und neue Laenge berechnen
+ bool bConvert = false; // Muss konvertiert werden
+ sal_Int32 nStrLen = rIn.getLength();
+ sal_Int32 nLineEndLen = (eLineEnd == LINEEND_CRLF) ? 2 : 1;
+ sal_Int32 nLen = 0; // Ziel-Laenge
+ sal_Int32 i = 0; // Source-Zaehler
+
+ while (i < nStrLen)
+ {
+ // Bei \r oder \n gibt es neuen Zeilenumbruch
+ if ( (rIn[i] == _CR) || (rIn[i] == _LF) )
+ {
+ nLen = nLen + nLineEndLen;
+
+ // Wenn schon gesetzt, dann brauchen wir keine aufwendige Abfrage
+ if ( !bConvert )
+ {
+ // Muessen wir Konvertieren
+ if ( ((eLineEnd != LINEEND_LF) && (rIn[i] == _LF)) ||
+ ((eLineEnd == LINEEND_CRLF) && (rIn[i+1] != _LF)) ||
+ ((eLineEnd == LINEEND_LF) &&
+ ((rIn[i] == _CR) || (rIn[i+1] == _CR))) ||
+ ((eLineEnd == LINEEND_CR) &&
+ ((rIn[i] == _LF) || (rIn[i+1] == _LF))) )
+ bConvert = true;
+ }
+
+ // \r\n oder \n\r, dann Zeichen ueberspringen
+ if ( ((rIn[i+1] == _CR) || (rIn[i+1] == _LF)) &&
+ (rIn[i] != rIn[i+1]) )
+ ++i;
+ }
+ else
+ ++nLen;
+ ++i;
+ }
+
+ if (!bConvert)
+ return rIn;
+
+ // Zeilenumbrueche konvertieren
+ // Neuen String anlegen
+ O aNewData(nLen);
+ i = 0;
+ while (i < nStrLen)
+ {
+ // Bei \r oder \n gibt es neuen Zeilenumbruch
+ if ( (rIn[i] == _CR) || (rIn[i] == _LF) )
+ {
+ if ( eLineEnd == LINEEND_CRLF )
+ {
+ aNewData.append(_CR);
+ aNewData.append(_LF);
+ }
+ else
+ {
+ if ( eLineEnd == LINEEND_CR )
+ aNewData.append(_CR);
+ else
+ aNewData.append(_LF);
+ }
+
+ if ( ((rIn[i+1] == _CR) || (rIn[i+1] == _LF)) &&
+ (rIn[i] != rIn[i+1]) )
+ ++i;
+ }
+ else
+ {
+ aNewData.append(rIn[i]);
+ }
+
+ ++i;
+ }
+
+ return aNewData.makeStringAndClear();
+ }
+}
+
+rtl::OString convertLineEnd(const rtl::OString &rIn, LineEnd eLineEnd)
+{
+ return tmpl_convertLineEnd<rtl::OString, rtl::OStringBuffer>(rIn, eLineEnd);
+}
+
+rtl::OUString convertLineEnd(const rtl::OUString &rIn, LineEnd eLineEnd)
+{
+ return tmpl_convertLineEnd<rtl::OUString, rtl::OUStringBuffer>(rIn, eLineEnd);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index 41966383d3dc..32913e0d2331 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -808,101 +808,6 @@ STRING& STRING::ToUpperAscii()
// -----------------------------------------------------------------------
-STRING& STRING::ConvertLineEnd( LineEnd eLineEnd )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- // Zeilenumbrueche ermitteln und neue Laenge berechnen
- sal_Bool bConvert = sal_False; // Muss konvertiert werden
- const STRCODE* pStr = mpData->maStr; // damit es schneller geht
- xub_StrLen nLineEndLen = (eLineEnd == LINEEND_CRLF) ? 2 : 1;
- xub_StrLen nLen = 0; // Ziel-Laenge
- xub_StrLen i = 0; // Source-Zaehler
-
- while ( i < mpData->mnLen )
- {
- // Bei \r oder \n gibt es neuen Zeilenumbruch
- if ( (pStr[i] == _CR) || (pStr[i] == _LF) )
- {
- nLen = nLen + nLineEndLen;
-
- // Wenn schon gesetzt, dann brauchen wir keine aufwendige Abfrage
- if ( !bConvert )
- {
- // Muessen wir Konvertieren
- if ( ((eLineEnd != LINEEND_LF) && (pStr[i] == _LF)) ||
- ((eLineEnd == LINEEND_CRLF) && (pStr[i+1] != _LF)) ||
- ((eLineEnd == LINEEND_LF) &&
- ((pStr[i] == _CR) || (pStr[i+1] == _CR))) ||
- ((eLineEnd == LINEEND_CR) &&
- ((pStr[i] == _LF) || (pStr[i+1] == _LF))) )
- bConvert = sal_True;
- }
-
- // \r\n oder \n\r, dann Zeichen ueberspringen
- if ( ((pStr[i+1] == _CR) || (pStr[i+1] == _LF)) &&
- (pStr[i] != pStr[i+1]) )
- ++i;
- }
- else
- ++nLen;
- ++i;
-
- // Wenn String zu lang, dann konvertieren wir nicht
- if ( nLen >= STRING_MAXLEN )
- return *this;
- }
-
- // Zeilenumbrueche konvertieren
- if ( bConvert )
- {
- // Neuen String anlegen
- STRINGDATA* pNewData = ImplAllocData( nLen );
- xub_StrLen j = 0;
- i = 0;
- while ( i < mpData->mnLen )
- {
- // Bei \r oder \n gibt es neuen Zeilenumbruch
- if ( (pStr[i] == _CR) || (pStr[i] == _LF) )
- {
- if ( eLineEnd == LINEEND_CRLF )
- {
- pNewData->maStr[j] = _CR;
- pNewData->maStr[j+1] = _LF;
- j += 2;
- }
- else
- {
- if ( eLineEnd == LINEEND_CR )
- pNewData->maStr[j] = _CR;
- else
- pNewData->maStr[j] = _LF;
- ++j;
- }
-
- if ( ((pStr[i+1] == _CR) || (pStr[i+1] == _LF)) &&
- (pStr[i] != pStr[i+1]) )
- ++i;
- }
- else
- {
- pNewData->maStr[j] = mpData->maStr[i];
- ++j;
- }
-
- ++i;
- }
-
- // Alte Daten loeschen und Neue zuweisen
- STRING_RELEASE((STRING_TYPE *)mpData);
- mpData = pNewData;
- }
-
- return *this;
-}
-
-// -----------------------------------------------------------------------
-
StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index d8cc7763c141..7137de34e071 100755
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -520,7 +520,7 @@ DbgWindow::DbgWindow() :
SetWindowState( aState );
}
- SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "StarView Debug Window" ) ) );
+ SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarView Debug Window")));
Show();
Update();
}
@@ -603,16 +603,18 @@ long DbgWindow::PreNotify( NotifyEvent& rNEvt )
GetAssertionEntryRange( maLstBox.GetSelectEntryPos(), nAssertionFirst, nAssertionLast );
// build the string to copy to the clipboard
- String sAssertion;
- String sLineFeed = String::CreateFromAscii( "\n" );
- sLineFeed.ConvertLineEnd( GetSystemLineEnd() );
+ rtl::OUStringBuffer sAssertion;
+ rtl::OUString sLineFeed = convertLineEnd(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")),
+ GetSystemLineEnd());
while ( nAssertionFirst < nAssertionLast )
{
- sAssertion += maLstBox.GetEntry( nAssertionFirst++ );
- sAssertion += sLineFeed;
+ sAssertion.append(maLstBox.GetEntry( nAssertionFirst++ ));
+ sAssertion.append(sLineFeed);
}
- ::vcl::unohelper::TextDataObject::CopyStringTo( sAssertion, GetClipboard() );
+ ::vcl::unohelper::TextDataObject::CopyStringTo(
+ sAssertion.makeStringAndClear(), GetClipboard());
}
}
return 1; // handled
@@ -625,8 +627,7 @@ long DbgWindow::PreNotify( NotifyEvent& rNEvt )
void DbgWindow::InsertLine( const XubString& rLine )
{
- XubString aStr = rLine;
- aStr.ConvertLineEnd( LINEEND_LF );
+ XubString aStr = convertLineEnd(rLine, LINEEND_LF);
xub_StrLen nPos = aStr.Search( _LF );
sal_Bool bFirstEntry = sal_True;
while ( nPos != STRING_NOTFOUND )
@@ -695,7 +696,7 @@ DbgDialog::DbgDialog() :
{
maXtorThis.Show();
- maXtorThis.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "T~his" ) ) );
+ maXtorThis.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("T~his" )));
if ( pData->nTestFlags & DBG_TEST_XTOR_THIS )
maXtorThis.Check( sal_True );
maXtorThis.SetPosSizePixel( LogicToPixel( Point( 10, 15 ), aAppMap ),
@@ -704,7 +705,7 @@ DbgDialog::DbgDialog() :
{
maXtorFunc.Show();
- maXtorFunc.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Function" ) ) );
+ maXtorFunc.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Function")));
if ( pData->nTestFlags & DBG_TEST_XTOR_FUNC )
maXtorFunc.Check( sal_True );
maXtorFunc.SetPosSizePixel( LogicToPixel( Point( 75, 15 ), aAppMap ),
@@ -713,7 +714,7 @@ DbgDialog::DbgDialog() :
{
maXtorExit.Show();
- maXtorExit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "E~xit" ) ) );
+ maXtorExit.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("E~xit")));
if ( pData->nTestFlags & DBG_TEST_XTOR_EXIT )
maXtorExit.Check( sal_True );
maXtorExit.SetPosSizePixel( LogicToPixel( Point( 140, 15 ), aAppMap ),
@@ -722,7 +723,7 @@ DbgDialog::DbgDialog() :
{
maXtorReport.Show();
- maXtorReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
+ maXtorReport.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Report")));
if ( pData->nTestFlags & DBG_TEST_XTOR_REPORT )
maXtorReport.Check( sal_True );
maXtorReport.SetPosSizePixel( LogicToPixel( Point( 205, 15 ), aAppMap ),
@@ -731,7 +732,7 @@ DbgDialog::DbgDialog() :
{
maXtorTrace.Show();
- maXtorTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
+ maXtorTrace.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Trace")));
if ( pData->nTestFlags & DBG_TEST_XTOR_TRACE )
maXtorTrace.Check( sal_True );
maXtorTrace.SetPosSizePixel( LogicToPixel( Point( 270, 15 ), aAppMap ),
@@ -740,14 +741,14 @@ DbgDialog::DbgDialog() :
{
maBox1.Show();
- maBox1.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Object Tests" ) ) );
+ maBox1.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Object Tests")));
maBox1.SetPosSizePixel( LogicToPixel( Point( 5, 5 ), aAppMap ),
LogicToPixel( Size( 330, 30 ), aAppMap ) );
}
{
maProf.Show();
- maProf.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Profiling" ) ) );
+ maProf.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Profiling")));
if ( pData->nTestFlags & DBG_TEST_PROFILING )
maProf.Check( sal_True );
maProf.SetPosSizePixel( LogicToPixel( Point( 10, 95 ), aAppMap ),
@@ -756,7 +757,7 @@ DbgDialog::DbgDialog() :
{
maRes.Show();
- maRes.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Resourcen" ) ) );
+ maRes.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Resourcen")));
if ( pData->nTestFlags & DBG_TEST_RESOURCE )
maRes.Check( sal_True );
maRes.SetPosSizePixel( LogicToPixel( Point( 75, 95 ), aAppMap ),
@@ -765,7 +766,7 @@ DbgDialog::DbgDialog() :
{
maDialog.Show();
- maDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Dialog" ) ) );
+ maDialog.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Dialog")));
if ( pData->nTestFlags & DBG_TEST_DIALOG )
maDialog.Check( sal_True );
maDialog.SetPosSizePixel( LogicToPixel( Point( 140, 95 ), aAppMap ),
@@ -774,7 +775,7 @@ DbgDialog::DbgDialog() :
{
maBoldAppFont.Show();
- maBoldAppFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Bold AppFont" ) ) );
+ maBoldAppFont.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Bold AppFont")));
if ( pData->nTestFlags & DBG_TEST_BOLDAPPFONT )
maBoldAppFont.Check( sal_True );
maBoldAppFont.SetPosSizePixel( LogicToPixel( Point( 205, 95 ), aAppMap ),
@@ -784,14 +785,14 @@ DbgDialog::DbgDialog() :
{
maBox3.Show();
- maBox3.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Test Options" ) ) );
+ maBox3.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test Options")));
maBox3.SetPosSizePixel( LogicToPixel( Point( 5, 85 ), aAppMap ),
LogicToPixel( Size( 330, 30 ), aAppMap ) );
}
{
maDebugName.Show();
- maDebugName.SetText( XubString( pData->aDebugName, RTL_TEXTENCODING_UTF8 ) );
+ maDebugName.SetText(rtl::OStringToOUString(pData->aDebugName, RTL_TEXTENCODING_UTF8));
maDebugName.SetMaxTextLen( sizeof( pData->aDebugName ) );
maDebugName.SetPosSizePixel( LogicToPixel( Point( 10, 130 ), aAppMap ),
LogicToPixel( Size( 185, 14 ), aAppMap ) );
@@ -799,7 +800,7 @@ DbgDialog::DbgDialog() :
{
maOverwrite.Show();
- maOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Overwrite ~File" ) ) );
+ maOverwrite.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Overwrite ~File")));
if ( pData->bOverwrite )
maOverwrite.Check( sal_True );
maOverwrite.SetPosSizePixel( LogicToPixel( Point( 205, 130 ), aAppMap ),
@@ -808,7 +809,7 @@ DbgDialog::DbgDialog() :
{
maHookOSLBox.Show();
- maHookOSLBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Reroute osl debug ~messages" ) ) );
+ maHookOSLBox.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Reroute osl debug ~messages")));
if ( pData->bHookOSLAssert )
maHookOSLBox.Check( sal_True );
maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
@@ -817,14 +818,14 @@ DbgDialog::DbgDialog() :
{
maInclClassText.Show();
- maInclClassText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Include-ObjectTest-Filter" ) ) );
+ maInclClassText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Include-ObjectTest-Filter")));
maInclClassText.SetPosSizePixel( LogicToPixel( Point( 10, 150 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
maInclClassFilter.Show();
- maInclClassFilter.SetText( XubString( pData->aInclClassFilter, RTL_TEXTENCODING_UTF8 ) );
+ maInclClassFilter.SetText(rtl::OStringToOUString(pData->aInclClassFilter, RTL_TEXTENCODING_UTF8));
maInclClassFilter.SetMaxTextLen( sizeof( pData->aInclClassFilter ) );
maInclClassFilter.SetPosSizePixel( LogicToPixel( Point( 10, 160 ), aAppMap ),
LogicToPixel( Size( 95, 14 ), aAppMap ) );
@@ -832,14 +833,14 @@ DbgDialog::DbgDialog() :
{
maExclClassText.Show();
- maExclClassText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Exclude-ObjectTest-Filter" ) ) );
+ maExclClassText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Exclude-ObjectTest-Filter")));
maExclClassText.SetPosSizePixel( LogicToPixel( Point( 115, 150 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
maExclClassFilter.Show();
- maExclClassFilter.SetText( XubString( pData->aExclClassFilter, RTL_TEXTENCODING_UTF8 ) );
+ maExclClassFilter.SetText(rtl::OStringToOUString(pData->aExclClassFilter, RTL_TEXTENCODING_UTF8));
maExclClassFilter.SetMaxTextLen( sizeof( pData->aExclClassFilter ) );
maExclClassFilter.SetPosSizePixel( LogicToPixel( Point( 115, 160 ), aAppMap ),
LogicToPixel( Size( 95, 14 ), aAppMap ) );
@@ -847,14 +848,14 @@ DbgDialog::DbgDialog() :
{
maInclText.Show();
- maInclText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Include-Filter" ) ) );
+ maInclText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Include-Filter")));
maInclText.SetPosSizePixel( LogicToPixel( Point( 10, 180 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
maInclFilter.Show();
- maInclFilter.SetText( XubString( pData->aInclFilter, RTL_TEXTENCODING_UTF8 ) );
+ maInclFilter.SetText(rtl::OStringToOUString(pData->aInclFilter, RTL_TEXTENCODING_UTF8));
maInclFilter.SetMaxTextLen( sizeof( pData->aInclFilter ) );
maInclFilter.SetPosSizePixel( LogicToPixel( Point( 10, 190 ), aAppMap ),
LogicToPixel( Size( 95, 14 ), aAppMap ) );
@@ -862,14 +863,14 @@ DbgDialog::DbgDialog() :
{
maExclText.Show();
- maExclText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Exclude-Filter" ) ) );
+ maExclText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Exclude-Filter")));
maExclText.SetPosSizePixel( LogicToPixel( Point( 115, 180 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
maExclFilter.Show();
- maExclFilter.SetText( XubString( pData->aExclFilter, RTL_TEXTENCODING_UTF8 ) );
+ maExclFilter.SetText(rtl::OStringToOUString(pData->aExclFilter, RTL_TEXTENCODING_UTF8));
maExclFilter.SetMaxTextLen( sizeof( pData->aExclFilter ) );
maExclFilter.SetPosSizePixel( LogicToPixel( Point( 115, 190 ), aAppMap ),
LogicToPixel( Size( 95, 14 ), aAppMap ) );
@@ -877,20 +878,20 @@ DbgDialog::DbgDialog() :
{
maTraceText.Show();
- maTraceText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
+ maTraceText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Trace" )));
maTraceText.SetPosSizePixel( LogicToPixel( Point( 10, 210 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Window" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Shell" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("None" )));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("File")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Window")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Shell")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MessageBox")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TestTool")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Debugger")));
+ maTraceBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Abort")));
ImplAppendUserDefinedChannels( maTraceBox );
ImplSelectChannel( maTraceBox, pData->nTraceOut, 0 );
maTraceBox.Show();
@@ -900,20 +901,20 @@ DbgDialog::DbgDialog() :
{
maWarningText.Show();
- maWarningText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Warning" ) ) );
+ maWarningText.SetText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("~Warning")));
maWarningText.SetPosSizePixel( LogicToPixel( Point( 115, 210 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
{
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Window" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Shell" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("None")));
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Window" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Shell" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
+ maWarningBox.InsertEntry(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
ImplAppendUserDefinedChannels( maWarningBox );
ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 );
maWarningBox.Show();
@@ -923,7 +924,7 @@ DbgDialog::DbgDialog() :
{
maErrorText.Show();
- maErrorText.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Error" ) ) );
+ maErrorText.SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "~Error" ) ) );
maErrorText.SetPosSizePixel( LogicToPixel( Point( 220, 210 ), aAppMap ),
LogicToPixel( Size( 95, 9 ), aAppMap ) );
}
@@ -931,18 +932,18 @@ DbgDialog::DbgDialog() :
{
if ( DbgIsAllErrorOut() )
{
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Window" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Shell" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Window" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Shell" ) ) );
mnErrorOff = 0;
}
else
mnErrorOff = 4;
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
+ maErrorBox.InsertEntry( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
ImplAppendUserDefinedChannels( maErrorBox );
ImplSelectChannel( maErrorBox, pData->nErrorOut, mnErrorOff );
maErrorBox.Show();
@@ -952,7 +953,7 @@ DbgDialog::DbgDialog() :
{
maBox4.Show();
- maBox4.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Output" ) ) );
+ maBox4.SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Output" ) ) );
maBox4.SetPosSizePixel( LogicToPixel( Point( 5, 120 ), aAppMap ),
LogicToPixel( Size( 330, 135 ), aAppMap ) );
}
@@ -971,7 +972,7 @@ DbgDialog::DbgDialog() :
{
maInfoButton.Show();
maInfoButton.SetClickHdl( LINK( this, DbgDialog, ClickHdl ) );
- maInfoButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Info..." ) ) );
+ maInfoButton.SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "~Info..." ) ) );
maInfoButton.SetPosSizePixel( LogicToPixel( Point( 130, 260 ), aAppMap ),
LogicToPixel( Size( 50, 15 ), aAppMap ) );
}
@@ -982,7 +983,7 @@ DbgDialog::DbgDialog() :
}
{
- SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL Debug Options" ) ) );
+ SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL Debug Options" ) ) );
SetOutputSizePixel( LogicToPixel( Size( 340, 280 ), aAppMap ) );
}
}
@@ -1089,7 +1090,7 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aDbgInfoBuf[0] = '\0';
DbgXtorInfo( aDbgInfoBuf );
XubString aInfoText( aDbgInfoBuf, RTL_TEXTENCODING_UTF8 );
- aInfoDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debug InfoReport" ) ) );
+ aInfoDialog.SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Debug InfoReport" ) ) );
aInfoDialog.SetInfoText( aInfoText );
aInfoDialog.Execute();
}
@@ -1111,7 +1112,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
aHelpText.AppendAscii( *pHelpStrs );
pHelpStrs++;
}
- aInfoDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debug Hilfe" ) ) );
+ aInfoDialog.SetText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Debug Hilfe" ) ) );
aInfoDialog.SetInfoText( aHelpText );
aInfoDialog.Execute();
}
@@ -1148,8 +1149,7 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
{
maListBox.SetUpdateMode( sal_False );
maListBox.Clear();
- XubString aStr = rStr;
- aStr.ConvertLineEnd( LINEEND_LF );
+ XubString aStr = convertLineEnd(rStr, LINEEND_LF);
sal_uInt16 nStrIndex = 0;
sal_uInt16 nFoundIndex;
do
@@ -1684,7 +1684,7 @@ void DbgPrintMsgBox( const char* pLine )
if ( aMessageBox.didTimeout() )
DbgPrintShell( pLine );
else if ( nResult == RET_YES )
- GetpApp()->Abort( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debug-Utilities-Error" ) ) );
+ GetpApp()->Abort( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Debug-Utilities-Error" ) ) );
else if ( nResult == RET_CANCEL )
DbgCoreDump();
}
@@ -1799,7 +1799,7 @@ void DbgGUIStart()
else
{
ErrorBox( 0, WB_OK,
- XubString( RTL_CONSTASCII_USTRINGPARAM( "TOOLS Library has no Debug-Routines" ) ) ).Execute();
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TOOLS Library has no Debug-Routines" ) ) ).Execute();
}
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index bf2628cfba3a..4c0123f13959 100755
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6428,8 +6428,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
nFormatLines = nLines-1;
pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
- aLastLine = aStr.Copy( pLineInfo->GetIndex() );
- aLastLine.ConvertLineEnd( LINEEND_LF );
+ aLastLine = convertLineEnd(aStr.Copy(pLineInfo->GetIndex()), LINEEND_LF);
// Alle LineFeed's durch Spaces ersetzen
xub_StrLen nLastLineLen = aLastLine.Len();
for ( i = 0; i < nLastLineLen; i++ )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 703b6f4f53a3..508510f08c41 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7794,8 +7794,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
nFormatLines = nLines-1;
pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
- aLastLine = aStr.Copy( pLineInfo->GetIndex() );
- aLastLine.ConvertLineEnd( LINEEND_LF );
+ aLastLine = convertLineEnd(aStr.Copy(pLineInfo->GetIndex()), LINEEND_LF);
// replace line feed by space
xub_StrLen nLastLineLen = aLastLine.Len();
for ( i = 0; i < nLastLineLen; i++ )