[Libreoffice-commits] core.git: 2 commits - cui/source editeng/source include/tools sc/source sw/source tools/source

Caolán McNamara caolanm at redhat.com
Fri Sep 13 07:25:07 PDT 2013


 cui/source/dialogs/cuigaldlg.cxx         |    4 ++--
 cui/source/inc/cuigaldlg.hxx             |    2 +-
 editeng/source/misc/svxacorr.cxx         |   12 ++++++------
 include/tools/string.hxx                 |    2 --
 sc/source/ui/inc/anyrefdg.hxx            |    4 ++--
 sc/source/ui/miscdlgs/anyrefdg.cxx       |    8 ++++----
 sw/source/core/doc/SwStyleNameMapper.cxx |    4 ++--
 tools/source/string/strimp.cxx           |   24 ------------------------
 8 files changed, 17 insertions(+), 43 deletions(-)

New commits:
commit 8b3cbc71151cf91a97e4c4340430876c8d02d030
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 13 12:45:15 2013 +0100

    Related: fdo#38838 remove UniString::ToLowerAscii
    
    Change-Id: Iecb8104ea2891d5229e3ecace54e12287d9b0ac6

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 6392801..11c3d0a 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -106,7 +106,7 @@ void SearchThread::execute()
             nBeginFormat = nEndFormat = nFileNumber;
 
         for( sal_uInt16 i = nBeginFormat; i <= nEndFormat; ++i )
-            aFormats.push_back( mpBrowser->aFilterEntryList[ i ]->aFilterName.ToLowerAscii() );
+            aFormats.push_back( mpBrowser->aFilterEntryList[ i ]->aFilterName.toAsciiLowerCase() );
 
         ImplSearch( maStartURL, aFormats, mpBrowser->bSearchRecursive );
     }
@@ -970,7 +970,7 @@ void TPGalleryThemeProperties::FillFilterList()
 #endif
 
     pFilterEntry = new FilterEntry;
-    pFilterEntry->aFilterName = String( CUI_RES( RID_SVXSTR_GALLERY_ALLFILES ) );
+    pFilterEntry->aFilterName = CUI_RESSTR(RID_SVXSTR_GALLERY_ALLFILES);
     pFilterEntry->aFilterName = addExtension( pFilterEntry->aFilterName, aExtensions );
     size_t pos = aCbbFileType.InsertEntry( pFilterEntry->aFilterName, 0 );
     if ( pos < aFilterEntryList.size() ) {
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index 3157e98..1591dab 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -52,7 +52,7 @@ typedef ::std::vector< sal_uLong > TokenList_impl;
 
 struct FilterEntry
 {
-    String  aFilterName;
+    OUString  aFilterName;
 };
 
 class SearchThread: public salhelper::Thread
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 71f70f4..eee5bfe 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1782,14 +1782,14 @@ sal_Bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
     return sal_False;
 }
 
-static sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord)
+static sal_Bool lcl_FindAbbreviation(const SvStringsISortDtor* pList, const OUString& sWord)
 {
     OUString sAbk('~');
     SvStringsISortDtor::const_iterator it = pList->find( sAbk );
     sal_uInt16 nPos = it - pList->begin();
     if( nPos < pList->size() )
     {
-        String sLowerWord( sWord ); sLowerWord.ToLowerAscii();
+        OUString sLowerWord(sWord.toAsciiLowerCase());
         OUString pAbk;
         for( sal_uInt16 n = nPos;
                 n < pList->size() &&
@@ -1797,15 +1797,15 @@ static sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const Str
             ++n )
         {
             // ~ and ~. are not allowed!
-            if( 2 < pAbk.getLength() && pAbk.getLength() - 1 <= sWord.Len() )
+            if( 2 < pAbk.getLength() && pAbk.getLength() - 1 <= sWord.getLength() )
             {
-                String sLowerAbk( pAbk ); sLowerAbk.ToLowerAscii();
-                for( xub_StrLen i = sLowerAbk.Len(), ii = sLowerWord.Len(); i; )
+                OUString sLowerAbk(pAbk.toAsciiLowerCase());
+                for (sal_Int32 i = sLowerAbk.getLength(), ii = sLowerWord.getLength(); i;)
                 {
                     if( !--i )      // agrees
                         return sal_True;
 
-                    if( sLowerAbk.GetChar( i ) != sLowerWord.GetChar( --ii ))
+                    if( sLowerAbk[i] != sLowerWord[--ii])
                         break;
                 }
             }
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 768192f..5fd64e9 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -225,8 +225,6 @@ public:
     UniString&          Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
     UniString           Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
 
-    UniString&          ToLowerAscii();
-
     StringCompare       CompareTo( const UniString& rStr,
                                    xub_StrLen nLen = STRING_LEN ) const;
     StringCompare       CompareToAscii( const sal_Char* pAsciiStr,
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 336329f..9de494d 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -316,8 +316,8 @@ lcl_NewUINameArray(sal_uInt16 nStt, sal_uInt16 const nEnd)
     pNameArray->reserve(nEnd - nStt);
     while( nStt < nEnd )
     {
-        const ResId rRId( nStt, *pSwResMgr );
-        pNameArray->push_back(OUString(rRId));
+        const ResId aRId( nStt, *pSwResMgr );
+        pNameArray->push_back(OUString(aRId));
         ++nStt;
     }
     return pNameArray;
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index 6fbb280..c6d882b 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -365,30 +365,6 @@ STRING& STRING::Erase( xub_StrLen nIndex, xub_StrLen nCount )
     return *this;
 }
 
-STRING& STRING::ToLowerAscii()
-{
-    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
-    sal_Int32 nIndex = 0;
-    sal_Int32 nLen = mpData->mnLen;
-    STRCODE*    pStr = mpData->maStr;
-    while ( nIndex < nLen )
-    {
-        // Convert if char is between 'A' and 'Z'
-        if ( (*pStr >= 65) && (*pStr <= 90) )
-        {
-            // allocate string of new size
-            pStr = ImplCopyStringData( pStr );
-            *pStr += 32;
-        }
-
-        ++pStr,
-        ++nIndex;
-    }
-
-    return *this;
-}
-
 xub_StrLen STRING::Search( STRCODE c, xub_StrLen nIndex ) const
 {
     DBG_CHKTHIS( STRING, DBGCHECKSTRING );
commit 0a5f063797d39913536a690cda9426ba20300b73
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 13 12:47:38 2013 +0100

    ResId rResId -> ResId& rResId
    
    Change-Id: If2a5ce7d9163c9ef1862850ec3b89a5e600e9636

diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 660de08..e26410f 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -183,7 +183,7 @@ public:
     virtual long        PreNotify( NotifyEvent& rNEvt );
     virtual void        StateChanged( StateChangedType nStateChange );
 protected:
-    ScRefHdlModalImpl( Window* pParent, ResId& rResId );
+    ScRefHdlModalImpl( Window* pParent, const ResId& rResId );
 
 private:
 };
@@ -258,7 +258,7 @@ void ScRefHdlrImplBase<TWindow, bBindRef>::StateChanged( StateChangedType nState
 class ScAnyRefModalDlg : public ScRefHdlModalImpl
 {
 public:
-    ScAnyRefModalDlg(Window* pParent, ResId rResId);
+    ScAnyRefModalDlg(Window* pParent, const ResId& rResId);
 };
 
 //============================================================================
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 1cd114e..834485e 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -1031,8 +1031,8 @@ void ScRefHandler::RefInputDone( sal_Bool bForced )
 
 //-------------------------------------------------------------------------------
 
-ScRefHdlModalImpl::ScRefHdlModalImpl( Window* pParent, ResId& rResId ):
-    ModalDialog( pParent, rResId ),
+ScRefHdlModalImpl::ScRefHdlModalImpl( Window* pParent, const ResId& rResId )
+    : ModalDialog( pParent, rResId ),
     ScRefHandler(dynamic_cast<Window&>(*this), NULL, true) {}
 
 long ScRefHdlModalImpl::PreNotify( NotifyEvent& rNEvt )
@@ -1047,7 +1047,7 @@ void ScRefHdlModalImpl::StateChanged( StateChangedType nStateChange )
     ScRefHandler::stateChanged( nStateChange, true );
 }
 
-ScAnyRefModalDlg::ScAnyRefModalDlg( Window* pParent, ResId aResId ):
-    ScRefHdlModalImpl( pParent, aResId ) {}
+ScAnyRefModalDlg::ScAnyRefModalDlg( Window* pParent, const ResId &rResId ):
+    ScRefHdlModalImpl( pParent, rResId ) {}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list