[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Jun 1 20:16:33 PDT 2011


 sc/source/core/tool/userlist.cxx |   54 +++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 24 deletions(-)

New commits:
commit 25e1b2a6a2475c3c40f0d664367edd17addc34d1
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Jun 1 23:15:59 2011 -0400

    String to OUString.

diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index 68ed9fa..364a561 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -44,6 +44,7 @@
 #include <boost/bind.hpp>
 
 using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
 
 namespace {
 
@@ -228,53 +229,58 @@ ScUserList::ScUserList()
         xCal = xCalendars[j].Days;
         if ( xCal.getLength() )
         {
-            String sDayShort, sDayLong;
+            OUStringBuffer aDayShortBuf, aDayLongBuf;
             sal_Int32 i;
             sal_Int32 nLen = xCal.getLength();
-            rtl::OUString sStart = xCalendars[j].StartOfWeek;
             sal_Int16 nStart = sal::static_int_cast<sal_Int16>(nLen);
             while (nStart > 0)
             {
-                if (xCal[--nStart].ID == sStart)
+                if (xCal[--nStart].ID == xCalendars[j].StartOfWeek)
                     break;
             }
             sal_Int16 nLast = sal::static_int_cast<sal_Int16>( (nStart + nLen - 1) % nLen );
             for (i = nStart; i != nLast; i = (i+1) % nLen)
             {
-                sDayShort += String( xCal[i].AbbrevName );
-                sDayShort += cDelimiter;
-                sDayLong  += String( xCal[i].FullName );
-                sDayLong  += cDelimiter;
+                aDayShortBuf.append(xCal[i].AbbrevName);
+                aDayShortBuf.append(cDelimiter);
+                aDayLongBuf.append(xCal[i].FullName);
+                aDayLongBuf.append(cDelimiter);
             }
-            sDayShort += String( xCal[i].AbbrevName );
-            sDayLong  += String( xCal[i].FullName );
+            aDayShortBuf.append(xCal[i].AbbrevName);
+            aDayLongBuf.append(xCal[i].FullName);
 
-            if ( !HasEntry( sDayShort ) )
-                maData.push_back( new ScUserListData( sDayShort ));
-            if ( !HasEntry( sDayLong ) )
-                maData.push_back( new ScUserListData( sDayLong ));
+            OUString aDayShort = aDayShortBuf.makeStringAndClear();
+            OUString aDayLong = aDayLongBuf.makeStringAndClear();
+
+            if ( !HasEntry( aDayShort ) )
+                maData.push_back( new ScUserListData( aDayShort ));
+            if ( !HasEntry( aDayLong ) )
+                maData.push_back( new ScUserListData( aDayLong ));
         }
 
         xCal = xCalendars[j].Months;
         if ( xCal.getLength() )
         {
-            String sMonthShort, sMonthLong;
+            OUStringBuffer aMonthShortBuf, aMonthLongBuf;
             sal_Int32 i;
             sal_Int32 nLen = xCal.getLength() - 1;
             for (i = 0; i < nLen; i++)
             {
-                sMonthShort += String( xCal[i].AbbrevName );
-                sMonthShort += cDelimiter;
-                sMonthLong  += String( xCal[i].FullName );
-                sMonthLong  += cDelimiter;
+                aMonthShortBuf.append(xCal[i].AbbrevName);
+                aMonthShortBuf.append(cDelimiter);
+                aMonthLongBuf.append(xCal[i].FullName);
+                aMonthLongBuf.append(cDelimiter);
             }
-            sMonthShort += String( xCal[i].AbbrevName );
-            sMonthLong  += String( xCal[i].FullName );
+            aMonthShortBuf.append(xCal[i].AbbrevName);
+            aMonthLongBuf.append(xCal[i].FullName);
+
+            OUString aMonthShort = aMonthShortBuf.makeStringAndClear();
+            OUString aMonthLong = aMonthLongBuf.makeStringAndClear();
 
-            if ( !HasEntry( sMonthShort ) )
-                maData.push_back( new ScUserListData( sMonthShort ));
-            if ( !HasEntry( sMonthLong ) )
-                maData.push_back( new ScUserListData( sMonthLong ));
+            if ( !HasEntry( aMonthShort ) )
+                maData.push_back( new ScUserListData( aMonthShort ));
+            if ( !HasEntry( aMonthLong ) )
+                maData.push_back( new ScUserListData( aMonthLong ));
         }
     }
 }


More information about the Libreoffice-commits mailing list