[PATCH] fdo#38838 Some removal/replacement of the String/UniString w...

Jean-Noël Rouvignac (via_Code_Review) gerrit at gerrit.libreoffice.org
Wed Jan 9 17:27:42 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1624

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/1624/1

fdo#38838 Some removal/replacement of the String/UniString with OUString

Change-Id: Ibce0f8542aa398147d74f7acf53b2898dc3e4eff
---
M svl/source/items/custritm.cxx
M svl/source/items/stritem.cxx
M svtools/source/control/calendar.cxx
M svtools/source/control/ruler.cxx
M svtools/source/dialogs/filedlg2.cxx
M svx/source/gallery2/galexpl.cxx
M svx/source/svdraw/svdattr.cxx
M svx/source/svdraw/svdibrow.cxx
M svx/source/svdraw/svdmark.cxx
M svx/source/svdraw/svdmodel.cxx
M svx/source/svdraw/svdmrkv.cxx
M svx/source/svdraw/svdtrans.cxx
M svx/source/svdraw/svdview.cxx
M ucb/workben/ucb/ucbdemo.cxx
14 files changed, 194 insertions(+), 381 deletions(-)



diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx
index f8c4f89..a4a6d66 100644
--- a/svl/source/items/custritm.cxx
+++ b/svl/source/items/custritm.cxx
@@ -111,7 +111,7 @@
     rtl::OUString aTheValue;
     if (rVal >>= aTheValue)
     {
-        m_aValue = UniString(aTheValue);
+        m_aValue = OUString(aTheValue);
         return true;
     }
     OSL_FAIL("CntUnencodedStringItem::PutValue(): Wrong type");
diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx
index 30074d8..0cf7994 100644
--- a/svl/source/items/stritem.cxx
+++ b/svl/source/items/stritem.cxx
@@ -32,8 +32,7 @@
 SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream):
     CntUnencodedStringItem(which)
 {
-    UniString aValue = readByteString(rStream);
-    SetValue(aValue);
+    SetValue(readByteString(rStream));
 }
 
 
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 2712871..b93959d 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -218,7 +218,7 @@
 
     // Tagestexte anlegen
     for (sal_Int32 i = 0; i < 31; ++i)
-        mpDayText[i] = new UniString(rtl::OUString::valueOf(i+1));
+        mpDayText[i] = new String(OUString::valueOf(i+1));
 
     maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) );
     maDragScrollTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
@@ -1289,7 +1289,7 @@
             pYearPopupMenus[i]->InsertItem( nYearIdCount+j,
                     maCalendarWrapper.getDisplayName(
                         i18n::CalendarDisplayIndex::MONTH, j-1, 1));
-        aPopupMenu.InsertItem( 10+i, UniString::CreateFromInt32( nYear+i ) );
+        aPopupMenu.InsertItem( 10+i, OUString::valueOf( nYear+i ) );
         aPopupMenu.SetPopupMenu( 10+i, pYearPopupMenus[i] );
         nYearIdCount += 1000;
     }
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 153e915..44b9e51 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -497,7 +497,7 @@
         nMaxWidth /= nTickUnit;
     else
         nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
-    UniString aNumStr(rtl::OUString::valueOf(static_cast<sal_Int32>(nMaxWidth)));
+    OUString aNumStr = OUString::valueOf(static_cast<sal_Int32>(nMaxWidth));
     long nTxtWidth = GetTextWidth( aNumStr );
     const long nTextOff   = 4;
     if ( nTickWidth < nTxtWidth+nTextOff )
@@ -552,7 +552,7 @@
                     // 0 is only painted when Margin1 is not equal to zero
                     if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) )
                     {
-                        aNumStr = (sal_Unicode)'0';
+                        aNumStr = "0";
                         ImplVDrawText( nStart, nCenter, aNumStr );
                     }
                 }
@@ -570,9 +570,9 @@
                 if ( !(nTick % nTick3) )
                 {
                     if ( ( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ) )
-                        aNumStr = UniString::CreateFromInt32( nTick / nTickUnit );
+                        aNumStr = OUString::valueOf( nTick / nTickUnit );
                     else
-                        aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
+                        aNumStr = OUString::valueOf( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
 
                     ImplVDrawText( nStart + n, nCenter, aNumStr, nMin, nMax );
                     ImplVDrawText( nStart - n, nCenter, aNumStr, nMin, nMax );
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index bc197bb..ce9367e 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -67,21 +67,18 @@
 
             for ( sal_uInt16 i = 1; i < nEntries; i++ )
             {
-                UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries );
-                aEntry = comphelper::string::stripStart(aEntry, ' ');
-                aEntry.ToUpperAscii();
-                UniString aCompare = rtl::OUString(cCharCode);
-                aCompare.ToUpperAscii();
+                OUString aEntry = GetEntry ( (i + nCurrentPos) % nEntries );
+                aEntry = comphelper::string::stripStart(aEntry, ' ').toAsciiUpperCase();
+                OUString aCompare = OUString(cCharCode).toAsciiUpperCase();
 
-                if ( aEntry.CompareTo( aCompare, 1 ) == COMPARE_EQUAL )
+                if ( aEntry.compareTo( aCompare, 1 ) == COMPARE_EQUAL )
                 {
                     SelectEntryPos ( (i + nCurrentPos) % nEntries );
                     break;
                 }
             }
         }
-        else
-        if ( aKeyEvt.GetKeyCode().GetCode() == KEY_RETURN )
+        else if ( aKeyEvt.GetKeyCode().GetCode() == KEY_RETURN )
         {
             DoubleClick();
         }
@@ -136,7 +133,7 @@
     Point aPnt( a6Siz.Width(), a6Siz.Height() );
     long nLbH1 = pDlg->LogicToPixel( Size( 0, 93 ), MAP_APPFONT ).Height();
     long nH = 0;
-    UniString aEmptyStr;
+    OUString aEmptyStr;
 
     INITCONTROL( pDirTitel, FixedText, 0,
                  aPnt, aFTSiz, SVT_RESSTR( STR_FILEDLG_DIR ), HID_FILEDLG_DIR );
@@ -243,8 +240,7 @@
 {
     if( p == pDriveList )
     {
-        UniString aDrive( pDriveList->GetSelectEntry(), 0, 2);
-        aDrive += '\\';
+        OUString aDrive = OUString( pDriveList->GetSelectEntry().Copy(0, 2) ) + "\\";
         SetPath( aDrive );
     }
     else
@@ -252,11 +248,11 @@
     {
         // isolate the pure name of the entry
         // removing trainling stuff and leading spaces
-        UniString aEntry( pDirList->GetSelectEntry() );
+        OUString aEntry( pDirList->GetSelectEntry() );
         aEntry = comphelper::string::stripStart(aEntry, ' ');
 
-        sal_uInt16 nPos = aEntry.Search( '/' );
-        aEntry.Erase( nPos );
+        sal_uInt16 nPos = aEntry.indexOf( '/' );
+        aEntry.replaceAt( nPos, aEntry.getLength(), "" );
 
         // build the absolute path to the selected item
         DirEntry aNewPath;
@@ -268,7 +264,7 @@
         if( nCurPos < nDirCount )
             aNewPath = aNewPath[nDirCount-nCurPos-1];
         else
-            aNewPath += aEntry;
+            aNewPath += String(aEntry);
 
         pEdit->SetText( aNewPath.GetFull() );
     }
@@ -342,11 +338,11 @@
 {
     // isolate the pure name of the entry
     // removing trainling stuff and leading spaces
-    UniString aEntry( pBox->GetSelectEntry() );
+    OUString aEntry( pBox->GetSelectEntry() );
 
     aEntry = comphelper::string::stripStart(aEntry, ' ');
-    sal_uInt16 nPos = aEntry.Search( '/' );
-    aEntry.Erase( nPos );
+    sal_uInt16 nPos = aEntry.indexOf( '/' );
+    aEntry.replaceAt( nPos, aEntry.getLength(), "" );
 
     // build the absolute path to the selected item
     DirEntry aNewPath;
@@ -363,10 +359,10 @@
         if( nCurPos < nDirCount )
             aNewPath = aNewPath[nDirCount-nCurPos-1];
         else
-            aNewPath += aEntry;
+            aNewPath += String(aEntry);
     }
     else
-        aNewPath += aEntry;
+        aNewPath += String(aEntry);
 
     pSvPathDialog->EnterWait();
 
@@ -391,7 +387,7 @@
 
 void ImpPathDialog::UpdateEntries( const sal_Bool )
 {
-    UniString aTabString;
+    OUString aTabString;
     DirEntry aTmpPath;
     aTmpPath.ToAbs();
 
@@ -402,10 +398,9 @@
 
     for( sal_uInt16 i = nDirCount; i > 0; i-- )
     {
-        UniString aName( aTabString );
-        aName += aTmpPath[i-1].GetName();
+        OUString aName = aTabString + aTmpPath[i-1].GetName();
         pDirList->InsertEntry( aName );
-        aTabString.AppendAscii( "  ", 2 );
+        aTabString += "  ";
     }
 
     // scan the directory
@@ -465,7 +460,7 @@
     pDirList->Invalidate();
     pDirList->Update();
 
-    UniString aDirName = rTmpPath.GetFull();
+    OUString aDirName = rTmpPath.GetFull();
     if( pDirPath )
         pDirPath->SetText( aDirName );
     else
@@ -481,8 +476,8 @@
         // Datei vorhanden ?
         if( ! rDirEntry.Exists() )
         {
-            UniString aQueryTxt( SVT_RESSTR( STR_FILEDLG_ASKNEWDIR ) );
-            aQueryTxt.SearchAndReplaceAscii( "%s", rDirEntry.GetFull() );
+            OUString aQueryTxt( SVT_RESSTR( STR_FILEDLG_ASKNEWDIR ) );
+            aQueryTxt = aQueryTxt.replaceFirst( "%s", rDirEntry.GetFull() );
             QueryBox aQuery( GetPathDialog(),
                              WB_YES_NO | WB_DEF_YES,
                              aQueryTxt  );
@@ -493,10 +488,7 @@
         }
         if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) )
         {
-            UniString aBoxText( SVT_RESSTR( STR_FILEDLG_CANTOPENDIR ) );
-            aBoxText.AppendAscii( "\n[" );
-            aBoxText += rDirEntry.GetFull();
-            aBoxText.AppendAscii( "]" );
+            OUString aBoxText = SVT_RESSTR( STR_FILEDLG_CANTOPENDIR ) + "\n[" + rDirEntry.GetFull() + "]" ;
             InfoBox aBox( GetPathDialog(), aBoxText );
             aBox.Execute();
             return sal_False;
@@ -598,26 +590,25 @@
         for( i = 0; i < nCount; ++i )
         {
             DirEntry& rEntry = aDir[i];
-            UniString aStr    = rEntry.GetFull( FSYS_STYLE_HOST, sal_False );
+            OUString aStr    = rEntry.GetFull( FSYS_STYLE_HOST, sal_False );
 
-            UniString aVolume = rEntry.GetVolume() ;
-            aStr.ToUpperAscii();
-            if ( aVolume.Len() )
+            OUString aVolume = rEntry.GetVolume() ;
+            aStr = aStr.toAsciiUpperCase();
+            if ( aVolume.getLength() )
             {
-                aStr += ' ';
-                aStr += aVolume;
+                aStr = aStr + " " + aVolume;
             }
-            pDriveList->InsertEntry( aStr );
+            pDriveList->InsertEntry( String(aStr) );
 
         }
-        UniString aPathStr = aPath.GetFull();
+        OUString aPathStr = aPath.GetFull();
 
         for ( i = 0; i < pDriveList->GetEntryCount(); ++i )
         {
-            UniString aEntry = pDriveList->GetEntry(i);
-            xub_StrLen nLen   = aEntry.Len();
+            OUString aEntry = pDriveList->GetEntry(i);
+            xub_StrLen nLen   = aEntry.getLength();
             nLen = nLen > 2 ? 2 : nLen;
-            if ( aEntry.CompareIgnoreCaseToAscii( aPathStr, nLen ) == COMPARE_EQUAL )
+            if ( aEntry.compareTo( aPathStr, nLen ) == COMPARE_EQUAL )
             {
                 pDriveList->SelectEntryPos(i);
                 break;
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index 3a185aa..12981a0 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -150,7 +150,6 @@
     if (!FillObjList(nThemeId, aObjList))
         return false;
 
-    // Convert UniString to rtl::OUString.
     std::vector<rtl::OUString> aList;
     aList.reserve(aObjList.size());
     std::vector<String>::const_iterator it = aObjList.begin(), itEnd = aObjList.end();
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 45042dd..fa47a5f 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -648,8 +648,7 @@
     }
     else
     {
-        rText = UniString();
-        rText += sal_Unicode('?');
+        rText = OUString("?");
     }
 
     if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
@@ -701,8 +700,7 @@
     }
     else
     {
-        rText = UniString();
-        rText += sal_Unicode('?');
+        rText = OUString("?");
     }
 
     if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
@@ -1351,8 +1349,7 @@
 
     if(nValue < 0)
     {
-        rText = OUString::valueOf(-nValue);
-        rText += UniString(RTL_CONSTASCII_USTRINGPARAM("pixel"));
+        rText = OUString::valueOf(-nValue) + "pixel";
     }
     else
     {
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 9e724aa..1317dea 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -321,7 +321,7 @@
                 switch (_nColId)
                 {
                     case ITEMBROWSER_WHICHCOL_ID:
-                        sRet = UniString::CreateFromInt32(pEntry->nWhichId); break;
+                        sRet = OUString::valueOf(pEntry->nWhichId); break;
                     case ITEMBROWSER_STATECOL_ID:
                     {
                         switch (pEntry->eState)
@@ -518,9 +518,9 @@
         aNeuNam += pEntry->GetItemTypeStr();
         if (pEntry->bCanNum) {
             aNeuNam.AppendAscii(": ");
-            aNeuNam += UniString::CreateFromInt32(pEntry->nMin);
+            aNeuNam += OUString::valueOf(pEntry->nMin);
             aNeuNam.AppendAscii("..");
-            aNeuNam += UniString::CreateFromInt32(pEntry->nMax);
+            aNeuNam += OUString::valueOf(pEntry->nMax);
         }
         aNeuNam.AppendAscii(" - Type 'del' to reset to default.");
         pParent->SetText(aNeuNam);
@@ -1019,7 +1019,7 @@
                         if (aEntry.bCanNum)
                         {
                             aEntry.aValue.InsertAscii(": ",0);
-                            aEntry.aValue.Insert(UniString::CreateFromInt32(aEntry.nVal),0);
+                            aEntry.aValue.Insert(OUString::valueOf(aEntry.nVal),0);
                         }
                     }
                     else
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 8a30230..0fe31f9 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -594,7 +594,7 @@
             }
 
             aNam.Insert(sal_Unicode(' '), 0);
-            aNam.Insert(UniString::CreateFromInt32(nAnz), 0);
+            aNam.Insert(OUString::valueOf( static_cast<sal_Int32>(nAnz) ), 0);
         }
 
         ((SdrMarkList*)(this))->maMarkName = aNam;
@@ -694,7 +694,7 @@
             }
 
             aNam.Insert(sal_Unicode(' '), 0);
-            aNam.Insert(UniString::CreateFromInt32(nMarkPtObjAnz), 0);
+            aNam.Insert(OUString::valueOf( static_cast<sal_Int32>(nMarkPtObjAnz) ), 0);
         }
 
         XubString aStr1;
@@ -706,7 +706,7 @@
         else
         {
             aStr1 = (ImpGetResStr(bGlue ? STR_ViewMarkedGluePoints : STR_ViewMarkedPoints));
-            aStr1.SearchAndReplaceAscii("%2", UniString::CreateFromInt32(nMarkPtAnz));
+            aStr1.SearchAndReplaceAscii("%2", OUString::valueOf( static_cast<sal_Int32>(nMarkPtAnz) ));
         }
 
         aStr1.SearchAndReplaceAscii("%1", aNam);
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 4e9c6e4..aae7534 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1177,17 +1177,17 @@
         }
         case FUNIT_100TH_MM:
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
+            rStr = OUString("/100mm");
             break;
         }
         case FUNIT_MM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
+            rStr = OUString("mm");
             break;
         }
         case FUNIT_CM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
+            rStr = OUString("cm");
             break;
         }
         case FUNIT_M      :
@@ -1198,22 +1198,22 @@
         }
         case FUNIT_KM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("km"));
+            rStr = OUString("km");
             break;
         }
         case FUNIT_TWIP   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
+            rStr = OUString("twip");
             break;
         }
         case FUNIT_POINT  :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
+            rStr = OUString("pt");
             break;
         }
         case FUNIT_PICA   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pica"));
+            rStr = OUString("pica");
             break;
         }
         case FUNIT_INCH   :
@@ -1224,12 +1224,12 @@
         }
         case FUNIT_FOOT   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("ft"));
+            rStr = OUString("ft");
             break;
         }
         case FUNIT_MILE   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mile(s)"));
+            rStr = OUString("mile(s)");
             break;
         }
         case FUNIT_PERCENT:
@@ -1407,7 +1407,7 @@
     nMul += nDiv/2;
     nMul /= nDiv;
 
-    rStr = UniString::CreateFromInt32(nMul);
+    rStr = OUString::valueOf(nMul);
 
     if(bNeg)
         rStr.Insert(sal_Unicode('-'), 0);
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index afeb453..11c9008 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1954,7 +1954,7 @@
     if(nPos != STRING_NOTFOUND)
     {
         rStr.Erase(nPos, 2);
-        rStr.Insert(UniString::CreateFromInt32(nVal), nPos);
+        rStr.Insert(OUString::valueOf(nVal), nPos);
     }
 }
 
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 536e599..cd64052 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -831,7 +831,7 @@
 
     if(!nVal)
     {
-        rStr = UniString();
+        rStr = String();
         rStr += aNullCode;
         return;
     }
@@ -864,7 +864,7 @@
     if(nMul_ != nDiv_)
         nVal = BigMulDiv(nVal, nMul_, nDiv_);
 
-    aStr = UniString::CreateFromInt32(nVal);
+    aStr = OUString::valueOf(nVal);
 
     if(nK > 0 && aStr.Len() <= nK )
     {
@@ -945,78 +945,76 @@
         // metrically
         case MAP_100TH_MM   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
+            rStr = OUString("/100mm");
             break;
         }
         case MAP_10TH_MM    :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/10mm"));
+            rStr = OUString("/10mm");
             break;
         }
         case MAP_MM         :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
+            rStr = OUString("mm");
             break;
         }
         case MAP_CM         :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
+            rStr = OUString("cm");
             break;
         }
 
         // Inch
         case MAP_1000TH_INCH:
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/1000\""));
+            rStr = OUString("/1000\"");
             break;
         }
         case MAP_100TH_INCH :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100\""));
+            rStr = OUString("/100\"");
             break;
         }
         case MAP_10TH_INCH  :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/10\""));
+            rStr = OUString("/10\"");
             break;
         }
         case MAP_INCH       :
         {
-            rStr = UniString();
-            rStr += sal_Unicode('"');
+            rStr = OUString("\"");
             break;
         }
         case MAP_POINT      :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
+            rStr = OUString("pt");
             break;
         }
         case MAP_TWIP       :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
+            rStr = OUString("twip");
             break;
         }
 
         // others
         case MAP_PIXEL      :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pixel"));
+            rStr = OUString("pixel");
             break;
         }
         case MAP_SYSFONT    :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("sysfont"));
+            rStr = OUString("sysfont");
             break;
         }
         case MAP_APPFONT    :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("appfont"));
+            rStr = OUString("appfont");
             break;
         }
         case MAP_RELATIVE   :
         {
-            rStr = UniString();
-            rStr += sal_Unicode('%');
+            rStr = OUString("%");
             break;
         }
         default: break;
@@ -1031,76 +1029,73 @@
         case FUNIT_NONE     :
         case FUNIT_CUSTOM   :
         {
-            rStr = UniString();
+            rStr = OUString();
             break;
         }
 
         // metrically
         case FUNIT_100TH_MM:
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
+            rStr = OUString("/100mm");
             break;
         }
         case FUNIT_MM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
+            rStr = OUString("mm");
             break;
         }
         case FUNIT_CM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
+            rStr = OUString("cm");
             break;
         }
         case FUNIT_M      :
         {
-            rStr = UniString();
-            rStr += sal_Unicode('m');
+            rStr = OUString("m");
             break;
         }
         case FUNIT_KM     :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("km"));
+            rStr = OUString("km");
             break;
         }
 
         // Inch
         case FUNIT_TWIP   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
+            rStr = OUString("twip");
             break;
         }
         case FUNIT_POINT  :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
+            rStr = OUString("pt");
             break;
         }
         case FUNIT_PICA   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pica"));
+            rStr = OUString("pica");
             break;
         }
         case FUNIT_INCH   :
         {
-            rStr = UniString();
-            rStr += sal_Unicode('"');
+            rStr = OUString("\"");
             break;
         }
         case FUNIT_FOOT   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("ft"));
+            rStr = OUString("ft");
             break;
         }
         case FUNIT_MILE   :
         {
-            rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mile(s)"));
+            rStr = OUString("mile(s)");
             break;
         }
 
         // others
         case FUNIT_PERCENT:
         {
-            rStr = UniString();
-            rStr += sal_Unicode('%');
+            rStr = OUString("%");
             break;
         }
     }
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index b28c9c1..39b0e99 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1254,7 +1254,7 @@
         aStr.SearchAndReplaceAscii("%3", OUString::valueOf(nCol + 1));
 
 #ifdef DBG_UTIL
-        aStr += UniString( RTL_CONSTASCII_USTRINGPARAM( ", Level " ) );
+        aStr += OUString( ", Level " );
         aStr += OUString::valueOf( sal_Int32( pTextEditOutliner->GetDepth( aSel.nEndPara )) );
 #endif
     }
diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx
index f38447a..83017f7 100644
--- a/ucb/workben/ucb/ucbdemo.cxx
+++ b/ucb/workben/ucb/ucbdemo.cxx
@@ -141,7 +141,7 @@
 //-------------------------------------------------------------------------
 void MessagePrinter::print( const sal_Char* pText )
 {
-    print( UniString::CreateFromAscii( pText ) );
+    print( OUString::valueOf( static_cast<sal_Int32>(pText) ) );
 }
 
 //-------------------------------------------------------------------------
@@ -444,7 +444,7 @@
             for (sal_Int32 i = 0; i < aInfos.getLength(); ++i)
             {
                 String aText("    ");
-                aText += UniString(aInfos[i].Scheme);
+                aText += OUString(aInfos[i].Scheme);
                 print(aText);
             }
         }
@@ -650,10 +650,7 @@
 
         if ( bPrint )
         {
-            UniString aText( UniString::CreateFromAscii(
-                                RTL_CONSTASCII_STRINGPARAM(
-                                    "Executing command: " ) ) );
-            aText += UniString( rName );
+            OUString aText = "Executing command: " + rName;
             print( aText );
         }
 
@@ -1028,9 +1025,9 @@
             if ( bPrint )
             {
                 print( "Folder object opened - iterating:" );
-                print( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(
+                print( OUString(
                     "Content-ID : Title : Size : IsFolder : IsDocument\n"
-                    "-------------------------------------------------" ) ) );
+                    "-------------------------------------------------" ) );
             }
 
             if (nFetchSize > 0)
@@ -1063,31 +1060,24 @@
 
                 while ( xResultSet->next() )
                 {
-                    UniString aText;
+                    OUString aText;
 
                     if ( bPrint )
                     {
-                        rtl::OUString aId( xContentAccess->
+                        OUString aId( xContentAccess->
                                           queryContentIdentifierString() );
-                        aText += UniString::CreateFromInt32( ++n );
-                        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                               ") " ) );
-                        aText += UniString( aId );
-                        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                               " : " ) );
+                        aText = OUString::valueOf( ++n ) + ") " + aId + " : ";
                     }
 
                     // Title:
-                    UniString aTitle( xRow->getString( 1 ) );
+                    OUString aTitle( xRow->getString( 1 ) );
                     if ( bPrint )
                     {
                         if ( aTitle.Len() == 0 && xRow->wasNull() )
-                            aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                                   "<null>" ) );
+                            aText += "<null>";
                         else
                             aText += aTitle;
-                        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                               " : " ) );
+                        aText += " : ";
                     }
 
                     // Size:
@@ -1095,12 +1085,10 @@
                     if ( bPrint )
                     {
                         if ( nSize == 0 && xRow->wasNull() )
-                            aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                                   "<null>" ) );
+                            aText += "<null>";
                         else
-                            aText += UniString::CreateFromInt32( nSize );
-                        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                               " : " ) );
+                            aText += OUString::valueOf( nSize );
+                        aText += " : ";
                     }
 
                     // IsFolder:
@@ -1111,14 +1099,7 @@
                             aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
                                                    "<null>" ) );
                         else
-                            aText
-                                += bFolder ?
-                                       UniString::CreateFromAscii(
-                                           RTL_CONSTASCII_STRINGPARAM(
-                                               "true" ) ) :
-                                       UniString::CreateFromAscii(
-                                           RTL_CONSTASCII_STRINGPARAM(
-                                               "false" ) );
+                            aText += bFolder ? "true" : "false";
                         aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
                                                " : " ) );
                     }
@@ -1132,13 +1113,7 @@
                                 "<null>" ) );
                         else
                             aText
-                                += bDocument ?
-                                       UniString::CreateFromAscii(
-                                           RTL_CONSTASCII_STRINGPARAM(
-                                               "true" ) ) :
-                                       UniString::CreateFromAscii(
-                                           RTL_CONSTASCII_STRINGPARAM(
-                                               "false" ) ); //  IsDocument
+                                += bDocument ? "true" : "false"; //  IsDocument
                     }
 
                     if ( bPrint )
@@ -1175,11 +1150,7 @@
     if ( bTiming )
     {
         nTime = Time::GetSystemTicks() - nTime;
-        UniString
-            aText( UniString::CreateFromAscii(
-                       RTL_CONSTASCII_STRINGPARAM( "Operation took " ) ) );
-        aText += rtl::OUString::valueOf(static_cast<sal_Int64>(nTime));
-        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " ms." ) );
+        OUString aText = "Operation took " + OUString::valueOf(static_cast<sal_Int64>(nTime)) + " ms.";
         print( aText );
     }
 }
@@ -1202,11 +1173,10 @@
 
         if ( bPrint )
         {
-            UniString aText;
+            OUString aText;
             for ( sal_uInt32 i = aEntry.m_nLevel; i != 0; --i )
                 aText += '=';
-            aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "LEVEL " ) );
-            aText += rtl::OUString::valueOf(static_cast<sal_Int64>(aEntry.m_nLevel));
+            aText = aText + "LEVEL " + OUString::valueOf(static_cast<sal_Int64>(aEntry.m_nLevel));
 
             uno::Reference< ucb::XContentIdentifier > xID;
             if ( aEntry.m_bUseIdentifier )
@@ -1215,8 +1185,7 @@
                 xID = aEntry.m_xContent->getIdentifier();
             if ( xID.is() )
             {
-                aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-                aText += UniString( xID->getContentIdentifier() );
+                aText = aText + ": " + xID->getContentIdentifier();
             }
 
             print( aText );
@@ -1248,20 +1217,15 @@
         }
 
         UcbContent( m_rUCB, xChild, m_pOutEdit ).
-            open( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(
-                                                  "open" ) ),
-                  UniString(), bPrint, false, bSort, &aStack,
+            open( "open",
+                  OUString(), bPrint, false, bSort, &aStack,
                   aEntry.m_nLevel, nFetchSize );
     }
 
     if ( bTiming )
     {
         nTime = Time::GetSystemTicks() - nTime;
-        UniString
-            aText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(
-                                                   "Operation took " ) ) );
-        aText += rtl::OUString::valueOf(static_cast<sal_Int64>(nTime));
-        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " ms." ) );
+        OUString aText = "Operation took "  + OUString::valueOf(static_cast<sal_Int64>(nTime)) + " ms.";
         print( aText );
     }
 }
@@ -1354,14 +1318,11 @@
             xInfo->getCommands() );
         const ucb::CommandInfo* pCommands = aCommands.getConstArray();
 
-        String aText( UniString::CreateFromAscii(
-                        RTL_CONSTASCII_STRINGPARAM( "Commands:\n" ) ) );
+        String aText("Commands:\n");
         sal_uInt32 nCount = aCommands.getLength();
         for ( sal_uInt32 n = 0; n < nCount; ++n )
         {
-            aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "    " ) );
-            aText += String( pCommands[ n ].Name );
-            aText += '\n';
+            aText = aText + "    " + String( pCommands[ n ].Name ) + "\n";
         }
         print( aText );
 
@@ -1384,14 +1345,11 @@
         uno::Sequence< beans::Property > aProps( xInfo->getProperties() );
         const beans::Property* pProps = aProps.getConstArray();
 
-        String aText( UniString::CreateFromAscii(
-                        RTL_CONSTASCII_STRINGPARAM( "Properties:\n" ) ) );
+        OUString aText("Properties:\n");
         sal_uInt32 nCount = aProps.getLength();
         for ( sal_uInt32 n = 0; n < nCount; ++n )
         {
-            aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "    " ) );
-            aText += UniString( pProps[ n ].Name );
-            aText += '\n';
+            aText = aText + "    " + pProps[ n ].Name + "\n";
         }
         print( aText );
 
@@ -1437,10 +1395,7 @@
         const rtl::OUString aValue(
             * static_cast< const rtl::OUString * >( aAny.getValue() ) );
 
-        UniString aText( rName );
-        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " value: '" ) );
-        aText += UniString( aValue );
-        aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "'" ) );
+        OUString aText = rName + " value: '" + aValue + "'";
         print( aText );
 
         return aValue;
@@ -1479,10 +1434,7 @@
     aAny <<= rValue;
     setPropertyValue( rName, aAny );
 
-    UniString aText( rName );
-    aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " value set to: '" ) );
-    aText += UniString( rValue );
-    aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "'" ) );
+    OUString aText = rName + " value set to: '" + rValue + "'";
     print( aText );
 }
 
@@ -1494,10 +1446,7 @@
                                                             uno::UNO_QUERY );
     if ( xContainer.is() )
     {
-        UniString aText( UniString::CreateFromAscii(
-                            RTL_CONSTASCII_STRINGPARAM(
-                                "Adding property: " ) ) );
-        aText += UniString( rName );
+        OUString aText = "Adding property: " + rName;
         print( aText );
 
         try
@@ -1543,10 +1492,7 @@
                                                             uno::UNO_QUERY );
     if ( xContainer.is() )
     {
-        UniString aText( UniString::CreateFromAscii(
-                            RTL_CONSTASCII_STRINGPARAM(
-                                "Removing property: " ) ) );
-        aText += UniString( rName );
+        OUString aText = "Removing property: " + rName;
         print( aText );
 
         try
@@ -1628,16 +1574,12 @@
     {
         case ucb::ContentAction::INSERTED:
         {
-            UniString aText( UniString::CreateFromAscii(
-                                RTL_CONSTASCII_STRINGPARAM(
-                                    "contentEvent: INSERTED: " ) ) );
+            OUString aText = "contentEvent: INSERTED: ";
             if ( evt.Content.is() )
             {
                 uno::Reference< ucb::XContentIdentifier > xId(
                                            evt.Content->getIdentifier() );
-                aText += UniString( xId->getContentIdentifier() );
-                aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) );
-                aText += UniString( evt.Content->getContentType() );
+                aText = aText + xId->getContentIdentifier() + " - " + evt.Content->getContentType();
             }
 
             print( aText );
@@ -1699,9 +1641,7 @@
         const beans::PropertyChangeEvent* pEvents = evt.getConstArray();
         for ( sal_uInt32 n = 0; n < nCount; ++n )
         {
-            UniString aText( UniString::CreateFromAscii(
-                                RTL_CONSTASCII_STRINGPARAM( "    " ) ) );
-            aText += UniString( pEvents[ n ].PropertyName );
+            OUString aText = "    " + pEvents[ n ].PropertyName;
             print( aText );
         }
     }
@@ -1786,236 +1726,146 @@
     m_pTool = new ToolBox( this, WB_3DLOOK | WB_BORDER  | WB_SCROLL );
 
     m_pTool->InsertItem ( MYWIN_ITEMID_CLEAR,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                  "Clear" ) ) );
+                          OUString( "Clear" );
     m_pTool->SetHelpText( MYWIN_ITEMID_CLEAR,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                  "Clear the Output Window" ) ) );
+                          OUString( "Clear the Output Window" );
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_CREATE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Create" ) ) );
+                          OUString( "Create" );
     m_pTool->SetHelpText( MYWIN_ITEMID_CREATE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Create a content" ) ) );
+                          OUString( "Create a content" );
     m_pTool->InsertItem ( MYWIN_ITEMID_RELEASE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Release" ) ) );
+                          OUString( "Release" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_RELEASE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Release current content" ) ) );
+                          OUString( "Release current content" );
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_COMMANDS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Commands" ) ) );
+                          OUString( "Commands" );
     m_pTool->SetHelpText( MYWIN_ITEMID_COMMANDS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                  "Get Commands supported by the content" ) ) );
+                          OUString( "Get Commands supported by the content" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_PROPS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Properties" ) ) );
+                          OUString( "Properties" ) ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_PROPS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Get Properties supported by the content" ) ) );
+                          OUString( "Get Properties supported by the content" ) );
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_ADD_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "addProperty" ) ) );
+                          OUString( "addProperty" );
     m_pTool->SetHelpText( MYWIN_ITEMID_ADD_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                   "Add a new string(!) property to the content. "
                                   "Type the property name in the entry field and "
                                   "push this button. The default value for the "
-                                  "property will be set to the string 'DefaultValue'" ) ) );
+                                  "property will be set to the string 'DefaultValue'" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_REMOVE_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "removeProperty" ) ) );
+                          OUString( "removeProperty" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_REMOVE_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                   "Removes a property from the content. "
                                   "Type the property name in the entry field and "
-                                  "push this button." ) ) );
+                                  "push this button." ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_GET_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "getPropertyValue" ) ) );
+                          OUString( "getPropertyValue" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_GET_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                   "Get a string(!) property value from the content. "
                                   "Type the property name in the entry field and "
-                                  "push this button to obtain the value" ) ) );
+                                  "push this button to obtain the value" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_SET_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "setPropertyValue" ) ) );
+                          OUString( "setPropertyValue" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_SET_PROP,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                   "Set a string(!) property value of the content."
                                   "Type the property name in the entry field and "
                                   "push this button to set the value to the string "
-                                  "'NewValue'" ) ) );
+                                  "'NewValue'" ) );
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_OPEN,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Open" ) ) );
+                          OUString( "Open" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_OPEN,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Open the content" ) ) );
+                          OUString( "Open the content" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_OPEN_ALL,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Open All" ) ) );
+                          OUString( "Open All" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_OPEN_ALL,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Open the content and all of its"
-                                    " children" ) ) );
+                                    " children" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_UPDATE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Update" ) ) );
+                          OUString( "Update" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_UPDATE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Update the content" ) ) );
+                          OUString( "Update the content" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_SYNCHRONIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Synchronize" ) ) );
+                          OUString( "Synchronize" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_SYNCHRONIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Synchronize the content" ) ) );
+                          OUString( "Synchronize the content" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_SEARCH,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Search" ) ) );
+                          OUString( "Search" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_SEARCH,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Search the content" ) ) );
+                          OUString( "Search the content" ) );
 
     m_pTool->InsertItem ( MYWIN_ITEMID_REORGANIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Reorganize" ) ) );
+                          OUString( "Reorganize" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_REORGANIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Reorganize the content storage" ) ) );
+                          OUString( "Reorganize the content storage" ) );
 
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_COPY,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Copy" ) ) );
+                          OUString( "Copy" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_COPY,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Copy a content. Type the URL of the source "
-                                "content into the entry field." ) ) );
+                                "content into the entry field." ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_MOVE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Move" ) ) );
+                          OUString( "Move" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_MOVE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Move a content. Type the URL of the source "
-                                "content into the entry field." ) ) );
+                                "content into the entry field." ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_DELETE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Delete" ) ) );
+                          OUString( "Delete" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_DELETE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Delete the content." ) ) );
+                          OUString( "Delete the content." ) );
 
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_TIMING,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Timing" ) ),
+                          OUString( "Timing" ) ),
                           TIB_CHECKABLE | TIB_AUTOCHECK );
     m_pTool->SetHelpText( MYWIN_ITEMID_TIMING,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Display execution times instead of"
-                                    " output" ) ) );
+                                    " output" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_SORT,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Sort" ) ),
+                          OUString( "Sort" ) ),
                           TIB_CHECKABLE | TIB_AUTOCHECK );
     m_pTool->SetHelpText( MYWIN_ITEMID_SORT,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Sort result sets" ) ) );
+                          OUString( "Sort result sets" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_FETCHSIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Fetch Size" ) ) );
+                          OUString( "Fetch Size" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_FETCHSIZE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Set cached cursor fetch size to positive value" ) ) );
+                          OUString( "Set cached cursor fetch size to positive value" ) );
 
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_SYS2URI,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "UNC>URI" ) ) );
+                          OUString( "UNC>URI" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_SYS2URI,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Translate 'System File Path' to URI,"
-                                    " if possible" ) ) );
+                                    " if possible" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_URI2SYS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "URI>UNC" ) ) );
+                          OUString( "URI>UNC" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_URI2SYS,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
+                          OUString(
                                 "Translate URI to 'System File Path',"
-                                    " if possible" ) ) );
+                                    " if possible" ) );
 
     m_pTool->InsertSeparator();
     m_pTool->InsertItem ( MYWIN_ITEMID_OFFLINE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Offline" ) ) );
+                          OUString( "Offline" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_OFFLINE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Go offline" ) ) );
+                          OUString( "Go offline" ) );
     m_pTool->InsertItem ( MYWIN_ITEMID_ONLINE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Online" ) ) );
+                          OUString( "Online" ) );
     m_pTool->SetHelpText( MYWIN_ITEMID_ONLINE,
-                          UniString::CreateFromAscii(
-                              RTL_CONSTASCII_STRINGPARAM(
-                                "Go back online" ) ) );
+                          OUString( "Go back online" ) );
 
     m_pTool->SetSelectHdl( LINK( this, MyWin, ToolBarHandler ) );
     m_pTool->Show();
@@ -2023,8 +1873,7 @@
     // Edit.
     m_pCmdEdit = new Edit( this );
     m_pCmdEdit->SetReadOnly( FALSE );
-    m_pCmdEdit->SetText( UniString::CreateFromAscii(
-                            RTL_CONSTASCII_STRINGPARAM( "file:///" ) ) );
+    m_pCmdEdit->SetText( OUString( "file:///" ) );
     m_pCmdEdit->Show();
 
     // MyOutWindow.
@@ -2069,7 +1918,7 @@
 //-------------------------------------------------------------------------
 void MyWin::print( const sal_Char* pText )
 {
-    print( UniString::CreateFromAscii( pText ) );
+    print( OUString( pText ) );
 }
 
 //-------------------------------------------------------------------------
@@ -2088,7 +1937,7 @@
 IMPL_LINK( MyWin, ToolBarHandler, ToolBox*, pToolBox )
 {
     USHORT nItemId   = pToolBox->GetCurItemId();
-    UniString aCmdLine = m_pCmdEdit->GetText();
+    OUString aCmdLine = m_pCmdEdit->GetText();
 
     ULONG n = Application::ReleaseSolarMutex();
 
@@ -2106,10 +1955,7 @@
         case MYWIN_ITEMID_CREATE:
             if ( m_pContent )
             {
-                UniString aText( UniString::CreateFromAscii(
-                                    RTL_CONSTASCII_STRINGPARAM(
-                                        "Content released: " ) ) );
-                aText += m_pContent->getURL();
+                OUString aText = "Content released: " + m_pContent->getURL();
 
                 m_pContent->dispose();
                 m_pContent->release();
@@ -2121,20 +1967,12 @@
             m_pContent = UcbContent::create( m_aUCB, aCmdLine, m_pOutEdit );
             if ( m_pContent )
             {
-                String aText( UniString::CreateFromAscii(
-                                RTL_CONSTASCII_STRINGPARAM(
-                                    "Created content: " ) ) );
-                aText += String( m_pContent->getURL() );
-                aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) );
-                aText += String( m_pContent->getType() );
+                OUString aText = "Created content: " + m_pContent->getURL() + " - " + m_pContent->getType();
                 print( aText );
             }
             else
             {
-                String aText( UniString::CreateFromAscii(
-                                RTL_CONSTASCII_STRINGPARAM(
-                                    "Creation failed for content: " ) ) );
-                aText += String( aCmdLine );
+                OUString aText = "Creation failed for content: " + aCmdLine;
                 print( aText );
             }
             break;
@@ -2142,10 +1980,7 @@
         case MYWIN_ITEMID_RELEASE:
             if ( m_pContent )
             {
-                UniString aText( UniString::CreateFromAscii(
-                                    RTL_CONSTASCII_STRINGPARAM(
-                                        "Content released: " ) ) );
-                aText += m_pContent->getURL();
+                OUString aText = "Content released: " + m_pContent->getURL();
 
                 m_pContent->dispose();
                 m_pContent->release();
@@ -2497,10 +2332,7 @@
     MyWin *pMyWin = new MyWin( NULL, WB_APP | WB_STDWORK, xFac,
                                aConfigurationKey1, aConfigurationKey2 );
 
-    pMyWin->
-        SetText(
-            UniString::CreateFromAscii(
-                RTL_CONSTASCII_STRINGPARAM( "UCB Demo/Test Application" ) ) );
+    pMyWin->SetText( OUString( "UCB Demo/Test Application" ) );
 
     pMyWin->SetPosSizePixel( 0, 0, 1024, 768 );
 

-- 
To view, visit https://gerrit.libreoffice.org/1624
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibce0f8542aa398147d74f7acf53b2898dc3e4eff
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Jean-Noël Rouvignac <jn.rouvignac at gmail.com>



More information about the LibreOffice mailing list