[Libreoffice-commits] .: 11 commits - basic/source cui/source dbaccess/source editeng/source forms/source l10ntools/inc l10ntools/source rsc/inc sc/source sfx2/source starmath/source svl/source svl/unx svtools/source sw/source toolkit/source tools/inc tools/Package_inc.mk tools/source unusedcode.easy vcl/source xmloff/inc xmloff/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jan 30 05:19:15 PST 2012


 basic/source/inc/iosys.hxx                             |   32 ++--
 basic/source/runtime/inputbox.cxx                      |    3 
 basic/source/runtime/iosys.cxx                         |  112 ++++++--------
 basic/source/runtime/methods1.cxx                      |    4 
 basic/source/runtime/step0.cxx                         |    4 
 cui/source/dialogs/pastedlg.cxx                        |    2 
 cui/source/dialogs/postdlg.cxx                         |    8 -
 dbaccess/source/ext/macromigration/migrationengine.cxx |    9 -
 editeng/source/editeng/impedit.cxx                     |    3 
 editeng/source/editeng/impedit2.cxx                    |    6 
 editeng/source/outliner/outliner.cxx                   |    3 
 editeng/source/rtf/rtfgrf.cxx                          |    2 
 editeng/source/uno/unofored.cxx                        |    4 
 editeng/source/uno/unotext.cxx                         |    3 
 forms/source/component/DatabaseForm.cxx                |    5 
 l10ntools/inc/export.hxx                               |   23 +-
 l10ntools/source/export2.cxx                           |   13 -
 l10ntools/source/merge.cxx                             |   85 +++++-----
 rsc/inc/rsctools.hxx                                   |    6 
 sc/source/core/tool/ddelink.cxx                        |    2 
 sc/source/filter/xml/XMLStylesExportHelper.cxx         |    3 
 sc/source/ui/app/inputhdl.cxx                          |    2 
 sc/source/ui/docshell/docfunc.cxx                      |    3 
 sc/source/ui/docshell/impex.cxx                        |    4 
 sc/source/ui/optdlg/tpusrlst.cxx                       |   13 -
 sc/source/ui/view/hintwin.cxx                          |    4 
 sc/source/ui/view/tabvwshe.cxx                         |    4 
 sc/source/ui/view/viewfun5.cxx                         |    2 
 sfx2/source/bastyp/sfxhtml.cxx                         |    2 
 starmath/source/accessibility.cxx                      |    3 
 starmath/source/parse.cxx                              |    6 
 svl/source/items/slstitm.cxx                           |    6 
 svl/source/numbers/zformat.cxx                         |   12 -
 svl/source/svdde/ddecli.cxx                            |    2 
 svl/unx/inc/convert.hxx                                |   13 -
 svtools/source/edit/texteng.cxx                        |    3 
 svtools/source/edit/textview.cxx                       |    3 
 svtools/source/filter/sgfbram.cxx                      |  116 +++++++-------
 svtools/source/filter/sgvmain.cxx                      |  100 ++++++------
 svtools/source/svhtml/parhtml.cxx                      |    2 
 sw/source/filter/html/htmlbas.cxx                      |    5 
 sw/source/filter/html/htmlfldw.cxx                     |    8 -
 sw/source/filter/html/htmlform.cxx                     |    8 -
 sw/source/filter/html/htmlforw.cxx                     |    2 
 sw/source/filter/html/htmlgrin.cxx                     |    4 
 sw/source/filter/html/swhtml.cxx                       |    2 
 sw/source/filter/ww8/ww8graf.cxx                       |    2 
 sw/source/filter/ww8/ww8par4.cxx                       |    6 
 sw/source/filter/ww8/ww8scan.cxx                       |    2 
 sw/source/ui/envelp/envlop1.cxx                        |    4 
 sw/source/ui/envelp/label1.cxx                         |    8 -
 sw/source/ui/fldui/inpdlg.cxx                          |    2 
 sw/source/ui/misc/redlndlg.cxx                         |    5 
 sw/source/ui/shells/textfld.cxx                        |   18 --
 toolkit/source/helper/formpdfexport.cxx                |    3 
 toolkit/source/helper/tkresmgr.cxx                     |    6 
 tools/Package_inc.mk                                   |    1 
 tools/inc/tools/lineend.hxx                            |   53 ++++++
 tools/inc/tools/solar.h                                |    4 
 tools/inc/tools/string.hxx                             |   24 ---
 tools/source/stream/stream.cxx                         |  121 +++++++++++++--
 tools/source/string/strimp.cxx                         |   95 ------------
 unusedcode.easy                                        |    4 
 vcl/source/app/dbggui.cxx                              |  134 ++++++++---------
 vcl/source/gdi/bmpacc.cxx                              |    2 
 vcl/source/gdi/impgraph.cxx                            |   22 +-
 vcl/source/gdi/outdev3.cxx                             |    3 
 vcl/source/gdi/pdfwriter_impl.cxx                      |    3 
 vcl/source/gdi/pngread.cxx                             |    2 
 vcl/source/gdi/pngwrite.cxx                            |    2 
 xmloff/inc/xmloff/xmlimp.hxx                           |    4 
 xmloff/source/core/RDFaImportHelper.cxx                |    2 
 xmloff/source/core/xmlimp.cxx                          |    5 
 xmloff/source/draw/sdxmlexp.cxx                        |    3 
 xmloff/source/draw/shapeexport.cxx                     |    1 
 xmloff/source/draw/shapeexport4.cxx                    |    5 
 xmloff/source/draw/xexptran.cxx                        |   43 ++---
 xmloff/source/draw/ximpbody.cxx                        |    3 
 xmloff/source/draw/ximpshap.cxx                        |    1 
 xmloff/source/style/fonthdl.cxx                        |   15 -
 xmloff/source/text/txtparae.cxx                        |    9 -
 81 files changed, 614 insertions(+), 664 deletions(-)

New commits:
commit 61451fec9b4ece2d2ef9d1d337dfc9e78c422d93
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jan 30 13:17:45 2012 +0000

    fdo#44981 - remove obsolete SWAPLONG macros

diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index 0434bf7..f22a0a4 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -173,7 +173,7 @@ inline long SwapLong( long n )
 inline short SwapShort( short n )
 {
 #ifndef OSL_LITENDIAN
-    return SWAPSHORT( n );
+    return OSL_SWAPWORD( n );
 #else
     return n;
 #endif
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx
index ba266de..c969ad4 100644
--- a/rsc/inc/rsctools.hxx
+++ b/rsc/inc/rsctools.hxx
@@ -114,7 +114,7 @@ public:
                     char* pTo = (char*)&nVal;
                     *pTo++ = *pFrom++;
                     *pTo++ = *pFrom++;
-                    return bSwap ? SWAPSHORT( nVal ) : nVal;
+                    return bSwap ? OSL_SWAPWORD( nVal ) : nVal;
                 }
     sal_uInt32  GetLong( sal_uInt32 nPos )
                 {
@@ -125,7 +125,7 @@ public:
                     *pTo++ = *pFrom++;
                     *pTo++ = *pFrom++;
                     *pTo++ = *pFrom++;
-                    return bSwap ? SWAPLONG( nVal ) : nVal;
+                    return bSwap ? OSL_SWAPDWORD( nVal ) : nVal;
                 }
     char *      GetUTF8( sal_uInt32 nPos )
                 {
@@ -212,7 +212,7 @@ public:
     void        PutAt( sal_uInt32 nPos, sal_uInt16 nVal )
                 {
                     if( bSwap )
-                        nVal = SWAPSHORT( nVal );
+                        nVal = OSL_SWAPWORD( nVal );
                     char* pTo = GetPointer( nPos );
                     char* pFrom = (char*)&nVal;
                     *pTo++ = *pFrom++;
diff --git a/svl/unx/inc/convert.hxx b/svl/unx/inc/convert.hxx
index 751d25d..45251e4 100644
--- a/svl/unx/inc/convert.hxx
+++ b/svl/unx/inc/convert.hxx
@@ -28,22 +28,17 @@
 #ifndef _CONVERT_HXX
 #define _CONVERT_HXX
 
-/*
-#define _SWAPSHORT(x) ((((x) & 0xFF00)>>8) | (((x) & 0x00FF)<<8))
-#define _SWAPLONG(x)  ((((x) & 0xFF000000)>>24) | (((x) & 0x00FF0000)>>8) |  \
-                      (((x) & 0x0000FF00)<<8) | (((x) & 0x000000FF)<<24))
-*/
 class Convert
 {
 public:
     static void     Swap( long & nValue )
-                    { nValue = SWAPLONG( nValue ); }
+                    { nValue = OSL_SWAPDWORD( nValue ); }
     static void     Swap( ULONG & nValue )
-                    { nValue = SWAPLONG( nValue ); }
+                    { nValue = OSL_SWAPDWORD( nValue ); }
     static void     Swap( short & nValue )
-                    { nValue = SWAPSHORT( nValue ); }
+                    { nValue = OSL_SWAPWORD( nValue ); }
     static void     Swap( USHORT & nValue )
-                    { nValue = SWAPSHORT( nValue ); }
+                    { nValue = OSL_SWAPWORD( nValue ); }
     static void     Swap( Point & aPtr )
                     { Swap( aPtr.X() ); Swap( aPtr.Y() ); }
     static void     Swap( Size & aSize )
diff --git a/svtools/source/filter/sgfbram.cxx b/svtools/source/filter/sgfbram.cxx
index ea51f85..cdd2582 100644
--- a/svtools/source/filter/sgfbram.cxx
+++ b/svtools/source/filter/sgfbram.cxx
@@ -45,17 +45,17 @@ SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead)
 {
     rIStream.Read((char*)&rHead.Magic,SgfHeaderSize);
 #if defined OSL_BIGENDIAN
-    rHead.Magic  =SWAPSHORT(rHead.Magic  );
-    rHead.Version=SWAPSHORT(rHead.Version);
-    rHead.Typ    =SWAPSHORT(rHead.Typ    );
-    rHead.Xsize  =SWAPSHORT(rHead.Xsize  );
-    rHead.Ysize  =SWAPSHORT(rHead.Ysize  );
-    rHead.Xoffs  =SWAPSHORT(rHead.Xoffs  );
-    rHead.Yoffs  =SWAPSHORT(rHead.Yoffs  );
-    rHead.Planes =SWAPSHORT(rHead.Planes );
-    rHead.SwGrCol=SWAPSHORT(rHead.SwGrCol);
-    rHead.OfsLo  =SWAPSHORT(rHead.OfsLo  );
-    rHead.OfsHi  =SWAPSHORT(rHead.OfsHi  );
+    rHead.Magic  =OSL_SWAPWORD(rHead.Magic  );
+    rHead.Version=OSL_SWAPWORD(rHead.Version);
+    rHead.Typ    =OSL_SWAPWORD(rHead.Typ    );
+    rHead.Xsize  =OSL_SWAPWORD(rHead.Xsize  );
+    rHead.Ysize  =OSL_SWAPWORD(rHead.Ysize  );
+    rHead.Xoffs  =OSL_SWAPWORD(rHead.Xoffs  );
+    rHead.Yoffs  =OSL_SWAPWORD(rHead.Yoffs  );
+    rHead.Planes =OSL_SWAPWORD(rHead.Planes );
+    rHead.SwGrCol=OSL_SWAPWORD(rHead.SwGrCol);
+    rHead.OfsLo  =OSL_SWAPWORD(rHead.OfsLo  );
+    rHead.OfsHi  =OSL_SWAPWORD(rHead.OfsHi  );
 #endif
     return rIStream;
 }
@@ -82,12 +82,12 @@ SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr)
 {
     rIStream.Read((char*)&rEntr.Typ,SgfEntrySize);
 #if defined OSL_BIGENDIAN
-    rEntr.Typ  =SWAPSHORT(rEntr.Typ  );
-    rEntr.iFrei=SWAPSHORT(rEntr.iFrei);
-    rEntr.lFreiLo=SWAPSHORT (rEntr.lFreiLo);
-    rEntr.lFreiHi=SWAPSHORT (rEntr.lFreiHi);
-    rEntr.OfsLo=SWAPSHORT(rEntr.OfsLo);
-    rEntr.OfsHi=SWAPSHORT(rEntr.OfsHi);
+    rEntr.Typ  =OSL_SWAPWORD(rEntr.Typ  );
+    rEntr.iFrei=OSL_SWAPWORD(rEntr.iFrei);
+    rEntr.lFreiLo=OSL_SWAPWORD (rEntr.lFreiLo);
+    rEntr.lFreiHi=OSL_SWAPWORD (rEntr.lFreiHi);
+    rEntr.OfsLo=OSL_SWAPWORD(rEntr.OfsLo);
+    rEntr.OfsHi=OSL_SWAPWORD(rEntr.OfsHi);
 #endif
     return rIStream;
 }
@@ -105,11 +105,11 @@ SvStream& operator>>(SvStream& rIStream, SgfVector& rVect)
 {
     rIStream.Read((char*)&rVect,sizeof(rVect));
 #if defined OSL_BIGENDIAN
-    rVect.Flag =SWAPSHORT(rVect.Flag );
-    rVect.x    =SWAPSHORT(rVect.x    );
-    rVect.y    =SWAPSHORT(rVect.y    );
-    rVect.OfsLo=SWAPLONG (rVect.OfsLo);
-    rVect.OfsHi=SWAPLONG (rVect.OfsHi);
+    rVect.Flag =OSL_SWAPWORD(rVect.Flag );
+    rVect.x    =OSL_SWAPWORD(rVect.x    );
+    rVect.y    =OSL_SWAPWORD(rVect.y    );
+    rVect.OfsLo=OSL_SWAPDWORD (rVect.OfsLo);
+    rVect.OfsHi=OSL_SWAPDWORD (rVect.OfsHi);
 #endif
     return rIStream;
 }
@@ -123,23 +123,23 @@ SvStream& operator>>(SvStream& rIStream, SgfVector& rVect)
 SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead)
 {
 #if defined OSL_BIGENDIAN
-    rHead.Typ     =SWAPSHORT(rHead.Typ     );
-    rHead.SizeLo  =SWAPSHORT(rHead.SizeLo  );
-    rHead.SizeHi  =SWAPSHORT(rHead.SizeHi  );
-    rHead.Reserve1=SWAPSHORT(rHead.Reserve1);
-    rHead.Reserve2=SWAPSHORT(rHead.Reserve2);
-    rHead.OfsLo   =SWAPSHORT(rHead.OfsLo   );
-    rHead.OfsHi   =SWAPSHORT(rHead.OfsHi   );
+    rHead.Typ     =OSL_SWAPWORD(rHead.Typ     );
+    rHead.SizeLo  =OSL_SWAPWORD(rHead.SizeLo  );
+    rHead.SizeHi  =OSL_SWAPWORD(rHead.SizeHi  );
+    rHead.Reserve1=OSL_SWAPWORD(rHead.Reserve1);
+    rHead.Reserve2=OSL_SWAPWORD(rHead.Reserve2);
+    rHead.OfsLo   =OSL_SWAPWORD(rHead.OfsLo   );
+    rHead.OfsHi   =OSL_SWAPWORD(rHead.OfsHi   );
 #endif
     rOStream.Write((char*)&rHead,sizeof(rHead));
 #if defined OSL_BIGENDIAN
-    rHead.Typ     =SWAPSHORT(rHead.Typ     );
-    rHead.SizeLo  =SWAPSHORT(rHead.SizeLo  );
-    rHead.SizeHi  =SWAPSHORT(rHead.SizeHi  );
-    rHead.Reserve1=SWAPSHORT(rHead.Reserve1);
-    rHead.Reserve2=SWAPSHORT(rHead.Reserve2);
-    rHead.OfsLo   =SWAPSHORT(rHead.OfsLo   );
-    rHead.OfsHi   =SWAPSHORT(rHead.OfsHi   );
+    rHead.Typ     =OSL_SWAPWORD(rHead.Typ     );
+    rHead.SizeLo  =OSL_SWAPWORD(rHead.SizeLo  );
+    rHead.SizeHi  =OSL_SWAPWORD(rHead.SizeHi  );
+    rHead.Reserve1=OSL_SWAPWORD(rHead.Reserve1);
+    rHead.Reserve2=OSL_SWAPWORD(rHead.Reserve2);
+    rHead.OfsLo   =OSL_SWAPWORD(rHead.OfsLo   );
+    rHead.OfsHi   =OSL_SWAPWORD(rHead.OfsHi   );
 #endif
     return rOStream;
 }
@@ -169,31 +169,31 @@ sal_uInt32 BmpFileHeader::GetOfs()
 SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rInfo)
 {
 #if defined OSL_BIGENDIAN
-    rInfo.Size    =SWAPLONG (rInfo.Size    );
-    rInfo.Width   =SWAPLONG (rInfo.Width   );
-    rInfo.Hight   =SWAPLONG (rInfo.Hight   );
-    rInfo.Planes  =SWAPSHORT(rInfo.Planes  );
-    rInfo.PixBits =SWAPSHORT(rInfo.PixBits );
-    rInfo.Compress=SWAPLONG (rInfo.Compress);
-    rInfo.ImgSize =SWAPLONG (rInfo.ImgSize );
-    rInfo.xDpmm   =SWAPLONG (rInfo.xDpmm   );
-    rInfo.yDpmm   =SWAPLONG (rInfo.yDpmm   );
-    rInfo.ColUsed =SWAPLONG (rInfo.ColUsed );
-    rInfo.ColMust =SWAPLONG (rInfo.ColMust );
+    rInfo.Size    =OSL_SWAPDWORD (rInfo.Size    );
+    rInfo.Width   =OSL_SWAPDWORD (rInfo.Width   );
+    rInfo.Hight   =OSL_SWAPDWORD (rInfo.Hight   );
+    rInfo.Planes  =OSL_SWAPWORD(rInfo.Planes  );
+    rInfo.PixBits =OSL_SWAPWORD(rInfo.PixBits );
+    rInfo.Compress=OSL_SWAPDWORD (rInfo.Compress);
+    rInfo.ImgSize =OSL_SWAPDWORD (rInfo.ImgSize );
+    rInfo.xDpmm   =OSL_SWAPDWORD (rInfo.xDpmm   );
+    rInfo.yDpmm   =OSL_SWAPDWORD (rInfo.yDpmm   );
+    rInfo.ColUsed =OSL_SWAPDWORD (rInfo.ColUsed );
+    rInfo.ColMust =OSL_SWAPDWORD (rInfo.ColMust );
 #endif
     rOStream.Write((char*)&rInfo,sizeof(rInfo));
 #if defined OSL_BIGENDIAN
-    rInfo.Size    =SWAPLONG (rInfo.Size    );
-    rInfo.Width   =SWAPLONG (rInfo.Width   );
-    rInfo.Hight   =SWAPLONG (rInfo.Hight   );
-    rInfo.Planes  =SWAPSHORT(rInfo.Planes  );
-    rInfo.PixBits =SWAPSHORT(rInfo.PixBits );
-    rInfo.Compress=SWAPLONG (rInfo.Compress);
-    rInfo.ImgSize =SWAPLONG (rInfo.ImgSize );
-    rInfo.xDpmm   =SWAPLONG (rInfo.xDpmm   );
-    rInfo.yDpmm   =SWAPLONG (rInfo.yDpmm   );
-    rInfo.ColUsed =SWAPLONG (rInfo.ColUsed );
-    rInfo.ColMust =SWAPLONG (rInfo.ColMust );
+    rInfo.Size    =OSL_SWAPDWORD (rInfo.Size    );
+    rInfo.Width   =OSL_SWAPDWORD (rInfo.Width   );
+    rInfo.Hight   =OSL_SWAPDWORD (rInfo.Hight   );
+    rInfo.Planes  =OSL_SWAPWORD(rInfo.Planes  );
+    rInfo.PixBits =OSL_SWAPWORD(rInfo.PixBits );
+    rInfo.Compress=OSL_SWAPDWORD (rInfo.Compress);
+    rInfo.ImgSize =OSL_SWAPDWORD (rInfo.ImgSize );
+    rInfo.xDpmm   =OSL_SWAPDWORD (rInfo.xDpmm   );
+    rInfo.yDpmm   =OSL_SWAPDWORD (rInfo.yDpmm   );
+    rInfo.ColUsed =OSL_SWAPDWORD (rInfo.ColUsed );
+    rInfo.ColMust =OSL_SWAPDWORD (rInfo.ColMust );
 #endif
     return rOStream;
 }
diff --git a/svtools/source/filter/sgvmain.cxx b/svtools/source/filter/sgvmain.cxx
index a220a22..bbfda53 100644
--- a/svtools/source/filter/sgvmain.cxx
+++ b/svtools/source/filter/sgvmain.cxx
@@ -39,50 +39,50 @@
 #include <unotools/ucbstreamhelper.hxx>
 
 #define SWAPPOINT(p) {  \
-    p.x=SWAPSHORT(p.x); \
-    p.y=SWAPSHORT(p.y); }
+    p.x=OSL_SWAPWORD(p.x); \
+    p.y=OSL_SWAPWORD(p.y); }
 
 #define SWAPPAGE(p) {                         \
-    p.Next   =SWAPLONG (p.Next   );           \
-    p.nList  =SWAPLONG (p.nList  );           \
-    p.ListEnd=SWAPLONG (p.ListEnd);           \
-    p.Paper.Size.x=SWAPSHORT(p.Paper.Size.x); \
-    p.Paper.Size.y=SWAPSHORT(p.Paper.Size.y); \
-    p.Paper.RandL =SWAPSHORT(p.Paper.RandL ); \
-    p.Paper.RandR =SWAPSHORT(p.Paper.RandR ); \
-    p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \
-    p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \
+    p.Next   =OSL_SWAPDWORD (p.Next   );           \
+    p.nList  =OSL_SWAPDWORD (p.nList  );           \
+    p.ListEnd=OSL_SWAPDWORD (p.ListEnd);           \
+    p.Paper.Size.x=OSL_SWAPWORD(p.Paper.Size.x); \
+    p.Paper.Size.y=OSL_SWAPWORD(p.Paper.Size.y); \
+    p.Paper.RandL =OSL_SWAPWORD(p.Paper.RandL ); \
+    p.Paper.RandR =OSL_SWAPWORD(p.Paper.RandR ); \
+    p.Paper.RandO =OSL_SWAPWORD(p.Paper.RandO ); \
+    p.Paper.RandU =OSL_SWAPWORD(p.Paper.RandU ); \
     SWAPPOINT(p.U);                           \
     sal_uInt16 iTemp;                             \
     for (iTemp=0;iTemp<20;iTemp++) {          \
-        rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]);       \
-        rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]);      }}
+        rPage.HlpLnH[iTemp]=OSL_SWAPWORD(rPage.HlpLnH[iTemp]);       \
+        rPage.HlpLnV[iTemp]=OSL_SWAPWORD(rPage.HlpLnV[iTemp]);      }}
 
 #define SWAPOBJK(o) {                 \
-    o.Last    =SWAPLONG (o.Last    ); \
-    o.Next    =SWAPLONG (o.Next    ); \
-    o.MemSize =SWAPSHORT(o.MemSize ); \
+    o.Last    =OSL_SWAPDWORD (o.Last    ); \
+    o.Next    =OSL_SWAPDWORD (o.Next    ); \
+    o.MemSize =OSL_SWAPWORD(o.MemSize ); \
     SWAPPOINT(o.ObjMin);              \
     SWAPPOINT(o.ObjMax);              }
 
 #define SWAPLINE(l) {             \
-    l.LMSize=SWAPSHORT(l.LMSize); \
-    l.LDicke=SWAPSHORT(l.LDicke); }
+    l.LMSize=OSL_SWAPWORD(l.LMSize); \
+    l.LDicke=OSL_SWAPWORD(l.LDicke); }
 
 #define SWAPAREA(a) {               \
-    a.FDummy2=SWAPSHORT(a.FDummy2); \
-    a.FMuster=SWAPSHORT(a.FMuster); }
+    a.FDummy2=OSL_SWAPWORD(a.FDummy2); \
+    a.FMuster=OSL_SWAPWORD(a.FMuster); }
 
 #define SWAPTEXT(t) {               \
     SWAPLINE(t.L);                  \
     SWAPAREA(t.F);                  \
-    t.FontLo =SWAPSHORT(t.FontLo ); \
-    t.FontHi =SWAPSHORT(t.FontHi ); \
-    t.Grad   =SWAPSHORT(t.Grad   ); \
-    t.Breite =SWAPSHORT(t.Breite ); \
-    t.Schnitt=SWAPSHORT(t.Schnitt); \
-    t.LnFeed =SWAPSHORT(t.LnFeed ); \
-    t.Slant  =SWAPSHORT(t.Slant  ); \
+    t.FontLo =OSL_SWAPWORD(t.FontLo ); \
+    t.FontHi =OSL_SWAPWORD(t.FontHi ); \
+    t.Grad   =OSL_SWAPWORD(t.Grad   ); \
+    t.Breite =OSL_SWAPWORD(t.Breite ); \
+    t.Schnitt=OSL_SWAPWORD(t.Schnitt); \
+    t.LnFeed =OSL_SWAPWORD(t.LnFeed ); \
+    t.Slant  =OSL_SWAPWORD(t.Slant  ); \
     SWAPLINE(t.ShdL);               \
     SWAPAREA(t.ShdF);               \
     SWAPPOINT(t.ShdVers);           \
@@ -223,9 +223,9 @@ SvStream& operator>>(SvStream& rInp, RectType& rRect)
     SWAPAREA (rRect.F);
     SWAPPOINT(rRect.Pos1);
     SWAPPOINT(rRect.Pos2);
-    rRect.Radius  =SWAPSHORT(rRect.Radius  );
-    rRect.DrehWink=SWAPSHORT(rRect.DrehWink);
-    rRect.Slant   =SWAPSHORT(rRect.Slant   );
+    rRect.Radius  =OSL_SWAPWORD(rRect.Radius  );
+    rRect.DrehWink=OSL_SWAPWORD(rRect.DrehWink);
+    rRect.Slant   =OSL_SWAPWORD(rRect.Slant   );
 #endif
     return rInp;
 }
@@ -236,7 +236,7 @@ SvStream& operator>>(SvStream& rInp, PolyType& rPoly)
     SWAPOBJK (rPoly);
     SWAPLINE (rPoly.L);
     SWAPAREA (rPoly.F);
-    // rPoly.EckP=SWAPLONG(rPoly.EckP);
+    // rPoly.EckP=OSL_SWAPDWORD(rPoly.EckP);
 #endif
     return rInp;
 }
@@ -247,7 +247,7 @@ SvStream& operator>>(SvStream& rInp, SplnType& rSpln)
     SWAPOBJK (rSpln);
     SWAPLINE (rSpln.L);
     SWAPAREA (rSpln.F);
-    // rSpln.EckP=SWAPLONG(rSpln.EckP);
+    // rSpln.EckP=OSL_SWAPDWORD(rSpln.EckP);
 #endif
     return rInp;
 }
@@ -260,9 +260,9 @@ SvStream& operator>>(SvStream& rInp, CircType& rCirc)
     SWAPAREA (rCirc.F);
     SWAPPOINT(rCirc.Radius);
     SWAPPOINT(rCirc.Center);
-    rCirc.DrehWink =SWAPSHORT(rCirc.DrehWink );
-    rCirc.StartWink=SWAPSHORT(rCirc.StartWink);
-    rCirc.RelWink  =SWAPSHORT(rCirc.RelWink  );
+    rCirc.DrehWink =OSL_SWAPWORD(rCirc.DrehWink );
+    rCirc.StartWink=OSL_SWAPWORD(rCirc.StartWink);
+    rCirc.RelWink  =OSL_SWAPWORD(rCirc.RelWink  );
 #endif
     return rInp;
 }
@@ -274,14 +274,14 @@ SvStream& operator>>(SvStream& rInp, TextType& rText)
     SWAPTEXT (rText.T);
     SWAPPOINT(rText.Pos1);
     SWAPPOINT(rText.Pos2);
-    rText.TopOfs  =SWAPSHORT(rText.TopOfs  );
-    rText.DrehWink=SWAPSHORT(rText.DrehWink);
-    rText.BoxSlant=SWAPSHORT(rText.BoxSlant);
-    rText.BufSize =SWAPSHORT(rText.BufSize );
-    //rText.Buf     =SWAPLONG (rText.Buf     );
-    //rText.Ext     =SWAPLONG (rText.Ext     );
+    rText.TopOfs  =OSL_SWAPWORD(rText.TopOfs  );
+    rText.DrehWink=OSL_SWAPWORD(rText.DrehWink);
+    rText.BoxSlant=OSL_SWAPWORD(rText.BoxSlant);
+    rText.BufSize =OSL_SWAPWORD(rText.BufSize );
+    //rText.Buf     =OSL_SWAPDWORD (rText.Buf     );
+    //rText.Ext     =OSL_SWAPDWORD (rText.Ext     );
     SWAPPOINT(rText.FitSize);
-    rText.FitBreit=SWAPSHORT(rText.FitBreit);
+    rText.FitBreit=OSL_SWAPWORD(rText.FitBreit);
 #endif
     rText.Buffer=NULL;
     return rInp;
@@ -294,8 +294,8 @@ SvStream& operator>>(SvStream& rInp, BmapType& rBmap)
     SWAPAREA (rBmap.F);
     SWAPPOINT(rBmap.Pos1);
     SWAPPOINT(rBmap.Pos2);
-    rBmap.DrehWink=SWAPSHORT(rBmap.DrehWink);
-    rBmap.Slant   =SWAPSHORT(rBmap.Slant   );
+    rBmap.DrehWink=OSL_SWAPWORD(rBmap.DrehWink);
+    rBmap.Slant   =OSL_SWAPWORD(rBmap.Slant   );
     SWAPPOINT(rBmap.PixSize);
 #endif
     return rInp;
@@ -305,12 +305,12 @@ SvStream& operator>>(SvStream& rInp, GrupType& rGrup)
     rInp.Read((char*)&rGrup.Last,GrupSize);
 #if defined OSL_BIGENDIAN
     SWAPOBJK (rGrup);
-    rGrup.SbLo     =SWAPSHORT(rGrup.SbLo     );
-    rGrup.SbHi     =SWAPSHORT(rGrup.SbHi     );
-    rGrup.UpLo     =SWAPSHORT(rGrup.UpLo     );
-    rGrup.UpHi     =SWAPSHORT(rGrup.UpHi     );
-    rGrup.ChartSize=SWAPSHORT(rGrup.ChartSize);
-    rGrup.ChartPtr =SWAPLONG (rGrup.ChartPtr );
+    rGrup.SbLo     =OSL_SWAPWORD(rGrup.SbLo     );
+    rGrup.SbHi     =OSL_SWAPWORD(rGrup.SbHi     );
+    rGrup.UpLo     =OSL_SWAPWORD(rGrup.UpLo     );
+    rGrup.UpHi     =OSL_SWAPWORD(rGrup.UpHi     );
+    rGrup.ChartSize=OSL_SWAPWORD(rGrup.ChartSize);
+    rGrup.ChartPtr =OSL_SWAPDWORD (rGrup.ChartPtr );
 #endif
     return rInp;
 }
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 96860bd..0e66f64 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1310,7 +1310,7 @@ SdrObject *SwWW8ImplReader::ReadGroup( WW8_DPHEAD* pHd, const WW8_DO* pDo,
         return 0;
 
 #ifdef OSL_BIGENDIAN
-    nGrouped = (sal_Int16)SWAPSHORT( nGrouped );
+    nGrouped = (sal_Int16)OSL_SWAPWORD( nGrouped );
 #endif
 
     nDrawXOfs = nDrawXOfs + (sal_Int16)SVBT16ToShort( pHd->xa );
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 748b515..0447a73 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -144,9 +144,9 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
         return false;
 
 #if defined  OSL_BIGENDIAN
-    pMfp->mm = SWAPSHORT( pMfp->mm );
-    pMfp->xExt = SWAPSHORT( pMfp->xExt );
-    pMfp->yExt = SWAPSHORT( pMfp->yExt );
+    pMfp->mm = OSL_SWAPWORD( pMfp->mm );
+    pMfp->xExt = OSL_SWAPWORD( pMfp->xExt );
+    pMfp->yExt = OSL_SWAPWORD( pMfp->yExt );
 #endif // OSL_BIGENDIAN
 
     if( pMfp->mm == 94 || pMfp->mm == 99 )
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 2c03ff8..a97f383 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -7434,7 +7434,7 @@ bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
 void swapEndian(sal_Unicode *pString)
 {
     for (sal_Unicode *pWork = pString; *pWork; ++pWork)
-        *pWork = SWAPSHORT(*pWork);
+        *pWork = OSL_SWAPWORD(*pWork);
 }
 #endif
 
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 2f33ad1..0f0b123 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -144,10 +144,6 @@ inline void     DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[7
 
 /*** standard macros *****************************************/
 
-#define SWAPSHORT(x) ((((x) >> 8) & 0x00FF) | (((x) & 0x00FF) << 8))
-#define SWAPLONG(x)  ((((x) >> 24) & 0x000000FF) | (((x) & 0x00FF0000) >> 8) | \
-                      (((x) & 0x0000FF00) <<  8) | (((x) & 0x000000FF) << 24))
-
 #ifndef __cplusplus
 #ifndef min
 #define min(a,b)    (((a) < (b)) ? (a) : (b))
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 902f178..ee7803c 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -40,6 +40,7 @@
 #include "boost/static_assert.hpp"
 
 #include <tools/solar.h>
+#include <osl/endian.h>
 
 #include <comphelper/string.hxx>
 
@@ -62,17 +63,17 @@ DBG_NAME( Stream )
 
 // !!! Nicht inline, wenn Operatoren <<,>> inline sind
 inline static void SwapUShort( sal_uInt16& r )
-    {   r = SWAPSHORT(r);   }
+    {   r = OSL_SWAPWORD(r);   }
 inline static void SwapShort( short& r )
-    {   r = SWAPSHORT(r);   }
+    {   r = OSL_SWAPWORD(r);   }
 inline static void SwapLong( long& r )
-    {   r = SWAPLONG(r);   }
+    {   r = OSL_SWAPDWORD(r);   }
 inline static void SwapULong( sal_uInt32& r )
-    {   r = SWAPLONG(r);   }
+    {   r = OSL_SWAPDWORD(r);   }
 inline static void SwapLongInt( sal_Int32& r )
-    {   r = SWAPLONG(r);   }
+    {   r = OSL_SWAPDWORD(r);   }
 inline static void SwapLongUInt( unsigned int& r )
-    {   r = SWAPLONG(r);   }
+    {   r = OSL_SWAPDWORD(r);   }
 
 inline static void SwapUInt64( sal_uInt64& r )
     {
@@ -87,8 +88,8 @@ inline static void SwapUInt64( sal_uInt64& r )
         s.c[1] ^= s.c[0];
         s.c[0] ^= s.c[1];
         // swap the bytes in the words
-        s.c[0] = SWAPLONG(s.c[0]);
-        s.c[1] = SWAPLONG(s.c[1]);
+        s.c[0] = OSL_SWAPDWORD(s.c[0]);
+        s.c[1] = OSL_SWAPDWORD(s.c[1]);
         r = s.n;
     }
 
@@ -105,8 +106,8 @@ inline static void SwapInt64( sal_Int64& r )
         s.c[1] ^= s.c[0];
         s.c[0] ^= s.c[1];
         // swap the bytes in the words
-        s.c[0] = SWAPLONG(s.c[0]);
-        s.c[1] = SWAPLONG(s.c[1]);
+        s.c[0] = OSL_SWAPDWORD(s.c[0]);
+        s.c[1] = OSL_SWAPDWORD(s.c[1]);
         r = s.n;
     }
 
@@ -120,7 +121,7 @@ inline static void SwapFloat( float& r )
         } s;
 
         s.f = r;
-        s.c = SWAPLONG( s.c );
+        s.c = OSL_SWAPDWORD( s.c );
         r = s.f;
     }
 
@@ -142,8 +143,8 @@ inline static void SwapDouble( double& r )
             s.c[0] ^= s.c[1]; // zwei 32-Bit-Werte in situ vertauschen
             s.c[1] ^= s.c[0];
             s.c[0] ^= s.c[1];
-            s.c[0] = SWAPLONG(s.c[0]); // und die beiden 32-Bit-Werte selbst in situ drehen
-            s.c[1] = SWAPLONG(s.c[1]);
+            s.c[0] = OSL_SWAPDWORD(s.c[0]); // und die beiden 32-Bit-Werte selbst in situ drehen
+            s.c[1] = OSL_SWAPDWORD(s.c[1]);
             r = s.d;
         }
     }
@@ -2380,7 +2381,7 @@ rtl::OUString read_uInt16s_ToOUString(SvStream& rStrm, sal_Size nLen)
         if (rStrm.IsEndianSwap())
         {
             for (sal_Int32 i = 0; i < pStr->length; ++i)
-                pStr->buffer[i] = SWAPSHORT(pStr->buffer[i]);
+                pStr->buffer[i] = OSL_SWAPWORD(pStr->buffer[i]);
         }
     }
 
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index a3174e6..c4ce0e3 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -289,7 +289,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
             sal_uInt8*      pLast4Bytes = (sal_uInt8*) GetBuffer() + ( nScanSize - 4 );
 
 #ifdef OSL_LITENDIAN
-            nMask = SWAPLONG( nMask );
+            nMask = OSL_SWAPDWORD( nMask );
 #endif
             for( sal_uInt32 i = 0; i < nHeight; i++, pLast4Bytes += nScanSize )
                 ( *(sal_uInt32*) pLast4Bytes ) &= nMask;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6aaedd6..38261b9 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -991,17 +991,17 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
         // swapped
         if( nType > 100L )
         {
-            nType = SWAPLONG( nType );
-            nLen = SWAPLONG( nLen );
-            nWidth = SWAPLONG( nWidth );
-            nHeight = SWAPLONG( nHeight );
-            nMapMode = SWAPLONG( nMapMode );
-            nScaleNumX = SWAPLONG( nScaleNumX );
-            nScaleDenomX = SWAPLONG( nScaleDenomX );
-            nScaleNumY = SWAPLONG( nScaleNumY );
-            nScaleDenomY = SWAPLONG( nScaleDenomY );
-            nOffsX = SWAPLONG( nOffsX );
-            nOffsY = SWAPLONG( nOffsY );
+            nType = OSL_SWAPDWORD( nType );
+            nLen = OSL_SWAPDWORD( nLen );
+            nWidth = OSL_SWAPDWORD( nWidth );
+            nHeight = OSL_SWAPDWORD( nHeight );
+            nMapMode = OSL_SWAPDWORD( nMapMode );
+            nScaleNumX = OSL_SWAPDWORD( nScaleNumX );
+            nScaleDenomX = OSL_SWAPDWORD( nScaleDenomX );
+            nScaleNumY = OSL_SWAPDWORD( nScaleNumY );
+            nScaleDenomY = OSL_SWAPDWORD( nScaleDenomY );
+            nOffsX = OSL_SWAPDWORD( nOffsX );
+            nOffsY = OSL_SWAPDWORD( nOffsY );
         }
 
         aSize = Size( nWidth, nHeight );
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index cb4f72e..9837537 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -286,7 +286,7 @@ bool PNGReaderImpl::ReadNextChunk()
         // calculate chunktype CRC (swap it back to original byte order)
         sal_uInt32 nChunkType = mnChunkType;
         #if defined(__LITTLEENDIAN) || defined(OSL_LITENDIAN)
-        nChunkType = SWAPLONG( nChunkType );
+        nChunkType = OSL_SWAPDWORD( nChunkType );
         #endif
         sal_uInt32 nCRC32 = rtl_crc32( 0, &nChunkType, 4 );
 
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 04c4588..bc25105 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -281,7 +281,7 @@ sal_Bool PNGWriterImpl::Write( SvStream& rOStm )
     {
         sal_uInt32 nType = aBeg->nType;
     #if defined(__LITTLEENDIAN) || defined(OSL_LITENDIAN)
-        nType = SWAPLONG( nType );
+        nType = OSL_SWAPDWORD( nType );
     #endif
         sal_uInt32 nCRC = rtl_crc32( 0, &nType, 4 );
         sal_uInt32 nDataSize = aBeg->aData.size();
commit bbc94edb9a91b27910d43610db9994df10dd99e1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 30 11:31:05 2012 +0000

    refactor ConvertLineEnd

diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index d59eae1..e3bc617 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 07a696d..fb33fcd 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 99cb187..1051782 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 ab5ed76..0bb2a3e 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 9be8669..c5a3f5d 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 a53c670..313f54c 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 f62cec6..8b86352 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 6761127..fbc93db 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 6559282..947a93e 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 5caf83a..d678f51 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 c53e739..3bd75ae 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 cd08604..a04c75b 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 34959e1..b80b614 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 8ed6226..94dd497 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 2c99ac9..ede56eb 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 4aa0e9c..3eee008 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 0b9cb21..3496ef6 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 997a233..fb20104 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 1b18f51..08dc062 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 40758e2..2f3a7ad 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 e70301d..c2d81f3 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 34425ab..7876956 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 5a6f7b8..74c4119 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 fae3fe8..d049f30 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 c8e8ab2..3df6ab9 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 b3a664f..665da03 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 3cdc270..fca7370 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 d12ee91..d0afc81 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 f2638dc..46c69f0 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 8e302e3..88fc705 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 887db25..d30066e 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 b7e1e51..34c5c0f 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 e49f367..e4c3210 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 365d90c..af01ff5 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 80380a2..4dc4cba 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 228d8dd..984a77b 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 957c018..0dd668d 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 91642c4..b4765f9 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 0000000..b9ee807
--- /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 at 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 8f3be40..22aecff 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 fd5a579..902f178 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 4196638..32913e0 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 d8cc776..7137de3 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 bf2628c..4c0123f 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 703b6f4..508510f 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++ )
commit 47e1e8494dde85414d28efafa99b33a62b59116d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 29 22:57:02 2012 +0000

    make svl ByteString free

diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index d3e41c8..7b86ab3 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -234,8 +234,7 @@ void SfxStringListItem::SetString( const XubString& rStr )
 
     xub_StrLen nStart = 0;
     xub_StrLen nDelimPos;
-    XubString aStr(rStr);
-    aStr.ConvertLineEnd(LINEEND_CR);
+    XubString aStr(convertLineEnd(rStr, LINEEND_CR));
     do
     {
         nDelimPos = aStr.Search( _CR, nStart );
@@ -277,8 +276,7 @@ XubString SfxStringListItem::GetString()
                 break;
         }
     }
-    aStr.ConvertLineEnd();
-    return aStr;
+    return convertLineEnd(aStr, GetSystemLineEnd());
 }
 
 //------------------------------------------------------------------------
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d2c3e90..0aed979 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1764,18 +1764,18 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
 void SvNumberformat::LoadString( SvStream& rStream, String& rStr )
 {
     CharSet eStream = rStream.GetStreamCharSet();
-    ByteString aStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);
+    rtl::OString aStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);
     sal_Char cStream = NfCurrencyEntry::GetEuroSymbol( eStream );
-    if ( aStr.Search( cStream ) == STRING_NOTFOUND )
+    if (aStr.indexOf(cStream) == -1)
     {   // simple conversion to unicode
-        rStr = UniString( aStr, eStream );
+        rStr = rtl::OStringToOUString(aStr, eStream);
     }
     else
     {
         sal_Unicode cTarget = NfCurrencyEntry::GetEuroSymbol();
-        register const sal_Char* p = aStr.GetBuffer();
-        register const sal_Char* const pEnd = p + aStr.Len();
-        register sal_Unicode* pUni = rStr.AllocBuffer( aStr.Len() );
+        register const sal_Char* p = aStr.getStr();
+        register const sal_Char* const pEnd = p + aStr.getLength();
+        register sal_Unicode* pUni = rStr.AllocBuffer(aStr.getLength());
         while ( p < pEnd )
         {
             if ( *p == cStream )
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index c2462ba..fba0c25 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -436,7 +436,6 @@ DdePoke::DdePoke( DdeConnection& d, const String& i, const String& rData,
                   long n ) :
             DdeTransaction( d, i, n )
 {
-//  ByteString aByteStr( rData, osl_getThreadTextEncoding() );
     aDdeData = DdeData( (void*) rData.GetBuffer(), sizeof(sal_Unicode) * (rData.Len()), CF_TEXT );
     nType = XTYP_POKE;
 }
@@ -456,7 +455,6 @@ DdePoke::DdePoke( DdeConnection& d, const String& i, const DdeData& rData,
 DdeExecute::DdeExecute( DdeConnection& d, const String& rData, long n ) :
                 DdeTransaction( d, String(), n )
 {
-//  ByteString aByteStr( rData, osl_getThreadTextEncoding() );
     aDdeData = DdeData( (void*)rData.GetBuffer(), sizeof(sal_Unicode) * (rData.Len() + 1), CF_TEXT );
     nType = XTYP_EXECUTE;
 }
commit a108260d0f0576f275495921ad36b957e789eadf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 29 22:04:58 2012 +0000

    CreateResMgr just takes a const char*

diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx
index ed29c38..fd2f5cb 100644
--- a/toolkit/source/helper/tkresmgr.cxx
+++ b/toolkit/source/helper/tkresmgr.cxx
@@ -65,10 +65,8 @@ void TkResMgr::ensureImplExists()
 
     ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
 
-    ByteString sResMgrName( "tk" );
-
-    m_pSimpleResMgr = SimpleResMgr::Create( sResMgrName.GetBuffer(), aLocale );
-    m_pResMgr = ResMgr::CreateResMgr( sResMgrName.GetBuffer() );
+    m_pSimpleResMgr = SimpleResMgr::Create( "tk", aLocale );
+    m_pResMgr = ResMgr::CreateResMgr( "tk" );
 
     if (m_pSimpleResMgr)
     {
commit ea6900d405c6022f90b4d30631db75c76dd1e90e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 29 22:00:26 2012 +0000

    ByteString->rtl::OString

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 40ecba8..7e04866 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -329,7 +329,7 @@ public:
 
     static void DumpExportList(const rtl::OString& rListName,
         ExportList& aList);
-    static ByteString DumpMap(const rtl::OString& rMapName,
+    static void DumpMap(const rtl::OString& rMapName,
         ByteStringHashMap& aMap);
 
 private:
@@ -400,7 +400,7 @@ private:
 
 public:
     PFormEntrys( const ByteString &rPForm ) : ByteString( rPForm ) {};
-    ByteString Dump();
+    rtl::OString Dump();
     void InsertEntry(
                     const ByteString &nId ,
                     const ByteString &rText,
@@ -471,15 +471,15 @@ class MergeDataFile
         std::set<rtl::OString> aLanguageSet;
 
         MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false );
-        void InsertEntry( const ByteString &rTYP, const ByteString &rGID, const ByteString &rLID,
-            const ByteString &rPFO,
-            const ByteString &nLang, const ByteString &rTEXT,
-            const ByteString &rQHTEXT, const ByteString &rTITLE,
-            const ByteString &sFilename, bool bCaseSensitive
-            );
-        ByteString Dump();
+        void InsertEntry(const rtl::OString &rTYP, const rtl::OString &rGID,
+            const rtl::OString &rLID, const rtl::OString &rPFO,
+            const rtl::OString &nLang, const rtl::OString &rTEXT,
+            const rtl::OString &rQHTEXT, const rtl::OString &rTITLE,
+            const rtl::OString &sFilename, bool bCaseSensitive);
+        rtl::OString Dump();
     public:
-        explicit MergeDataFile( const ByteString &rFileName, const ByteString& rFile, bool bErrLog, bool bCaseSensitive = false );
+        explicit MergeDataFile(const rtl::OString &rFileName,
+            const rtl::OString& rFile, bool bErrLog, bool bCaseSensitive = false);
         ~MergeDataFile();
 
 
@@ -488,7 +488,8 @@ class MergeDataFile
         PFormEntrys *GetPFormEntrys( ResData *pResData );
         PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData );
 
-        static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false );
+        static rtl::OString CreateKey(const rtl::OString& rTYP, const rtl::OString& rGID,
+            const rtl::OString& rLID, const rtl::OString& rFilename , bool bCaseSensitive = false);
 };
 
 
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 9f9c1de..e88d3fb 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -104,23 +104,22 @@ void Export::DumpExportList(const rtl::OString& rListName, ExportList& aList)
     printf("\n");
 }
 
-ByteString Export::DumpMap(const rtl::OString& rMapName,
+void Export::DumpMap(const rtl::OString& rMapName,
     ByteStringHashMap& aMap)
 {
-    ByteStringHashMap::const_iterator idbg;
-    ByteString sReturn;
-
     if( rMapName.getLength() )
         printf("MapName %s\n", rMapName.getStr());
-    if( aMap.size() < 1 ) return ByteString();
-    for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){
+    if( aMap.size() < 1 )
+        return;
+    for(ByteStringHashMap::const_iterator idbg = aMap.begin(); idbg != aMap.end(); ++idbg)
+    {
         ByteString a( idbg->first );
         ByteString b( idbg->second );
         printf("[%s]= %s",a.GetBuffer(),b.GetBuffer());
         printf("\n");
     }
     printf("\n");
-    return sReturn;
+    return;
 }
 
 /*****************************************************************************/
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 5a3c115..cc4d97d 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -53,13 +53,14 @@ extern void ConvertHalfwitdhToFullwidth( String& rString );
 // class PFormEntrys
 //
 
-ByteString PFormEntrys::Dump()
+rtl::OString PFormEntrys::Dump()
 {
-    ByteString sRet( "PFormEntrys\n" );
-    ByteString a("sText");
     if (sText.size())
+    {
+        rtl::OString a(RTL_CONSTASCII_STRINGPARAM("sText"));
         Export::DumpMap(a , sText);
-    return sRet;
+    }
+    return rtl::OString(RTL_CONSTASCII_STRINGPARAM("PFormEntrys\n"));
 }
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list