[Libreoffice-commits] .: 2 commits - extensions/source framework/source sc/source sd/source svl/source sw/source writerperfect/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 23:32:47 PST 2012


 extensions/source/plugin/win/winmgr.cxx                 |    3 --
 framework/source/helper/titlebarupdate.cxx              |    3 --
 sc/source/core/data/funcdesc.cxx                        |    3 --
 sd/source/ui/unoidl/unosrch.cxx                         |    4 +--
 svl/source/misc/inettype.cxx                            |   13 ++++--------
 sw/source/ui/dbui/createaddresslistdialog.cxx           |    3 --
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   17 ++++++----------
 7 files changed, 18 insertions(+), 28 deletions(-)

New commits:
commit 9865cc0aee96b6b19bf673df3efb0d9d1755744a
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Wed Nov 28 01:31:58 2012 -0600

    fix misuse of toAscii(Lower|Upper)Case
    
    OUString are immutable so these api, contrary to what happen
    with String, do not change the object but create a new copy
    
    Change-Id: Ib48a8d11e485d4b8556f4427880aaaca32d4e82c

diff --git a/extensions/source/plugin/win/winmgr.cxx b/extensions/source/plugin/win/winmgr.cxx
index b954b6a..3abf3f9 100644
--- a/extensions/source/plugin/win/winmgr.cxx
+++ b/extensions/source/plugin/win/winmgr.cxx
@@ -96,8 +96,7 @@ static void addPluginsFromPath( const TCHAR * pPluginsPath, PluginLocationMap &
 
     while (hFind != INVALID_HANDLE_VALUE)
     {
-        OString aName( aFindData.cFileName );
-        aName.toAsciiLowerCase();
+        OString aName = OUString( aFindData.cFileName ).toAsciiLowerCase();
 
         // no netscape default plugin anymore...
         // and no double plugin dlls
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index f13fdc7..4c20605 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -195,8 +195,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
             sDesktopName = ::rtl::OUString("base");
         else
             sDesktopName = ::rtl::OUString("startcenter");
-        sApplicationID = utl::ConfigManager::getProductName().
-            toAsciiLowerCase();
+        sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase();
         sApplicationID += ::rtl::OUString(sal_Unicode('-'));
         sApplicationID += sDesktopName;
     }
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 8a02172..d5681b0 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -450,8 +450,7 @@ ScFunctionList::ScFunctionList() :
         pAddInFuncData->getParamDesc( aArgName, aArgDesc, 0 );
         pDesc->nFIndex     = nNextId++; //  ??? OpCode vergeben
         pDesc->nCategory   = ID_FUNCTION_GRP_ADDINS;
-        pDesc->pFuncName   = new ::rtl::OUString(pAddInFuncData->GetInternalName());
-        pDesc->pFuncName->toAsciiUpperCase();
+        pDesc->pFuncName   = new OUString(pAddInFuncData->GetInternalName().toAsciiUpperCase());
 
         ::rtl::OUStringBuffer aBuf(aArgDesc);
         aBuf.append(sal_Unicode('\n'));
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index 0dd1219..2d543f1 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -644,8 +644,8 @@ sal_Bool SdUnoSearchReplaceShape::Search( const OUString& rText, sal_Int32& nSta
 
     if( !pDescr->IsCaseSensitive() )
     {
-        aText.toAsciiLowerCase();
-        aSearchStr.toAsciiLowerCase();
+        aText = aText.toAsciiLowerCase();
+        aSearchStr = aSearchStr.toAsciiLowerCase();
     }
 
     sal_Int32 nFound = aText.indexOf( aSearchStr, nStartPos );
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index b9f8bf3..143a11a 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -521,8 +521,7 @@ Registration::~Registration()
 // static
 TypeNameMapEntry * Registration::getExtensionEntry(OUString const & rTypeName)
 {
-    OUString aTheTypeName = rTypeName;
-    aTheTypeName.toAsciiLowerCase();
+    OUString aTheTypeName = rTypeName.toAsciiLowerCase();;
     Registration &rRegistration = theRegistration::get();
     TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName);
     if (it != rRegistration.m_aTypeNameMap.end())
@@ -543,8 +542,7 @@ INetContentType Registration::RegisterContentType(OUString const & rTypeName,
                "Registration::RegisterContentType(): Already registered");
 
     INetContentType eTypeID = INetContentType(rRegistration.m_nNextDynamicID++);
-    OUString aTheTypeName = rTypeName;
-    aTheTypeName.toAsciiLowerCase();
+    OUString aTheTypeName = rTypeName.toAsciiLowerCase();
 
     TypeIDMapEntry * pTypeIDMapEntry = new TypeIDMapEntry;
     pTypeIDMapEntry->m_aTypeName = aTheTypeName;
@@ -575,8 +573,7 @@ INetContentType Registration::GetContentType(OUString const & rTypeName)
 {
     Registration &rRegistration = theRegistration::get();
 
-    OUString aTheTypeName = rTypeName;
-    aTheTypeName.toAsciiLowerCase();
+    OUString aTheTypeName = rTypeName.toAsciiLowerCase();
     TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName);
     return it != rRegistration.m_aTypeNameMap.end()
         ? it->second->m_eTypeID
@@ -932,7 +929,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
         return false;
     rType = OUString(pToken, p - pToken);
     if (bDowncase)
-        rType.toAsciiLowerCase();
+        rType= rType.toAsciiLowerCase();
 
     p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
     if (p == pEnd || *p++ != '/')
@@ -950,7 +947,7 @@ bool INetContentTypes::parse(OUString const & rMediaType,
         return false;
     rSubType = OUString(pToken, p - pToken);
     if (bDowncase)
-        rSubType.toAsciiLowerCase();
+        rSubType = rSubType.toAsciiLowerCase();
 
     return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
 }
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 4205ea6..880b829 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -672,8 +672,7 @@ void SwCreateAddressListDialog::UpdateButtons()
 
 void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn)
 {
-    OUString sSearch = rSearch;
-    sSearch.toAsciiLowerCase();
+    OUString sSearch = OUString(rSearch).toAsciiLowerCase();
     sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet();
     //search forward
     bool bFound = false;
commit fd773e669a0958f5f989e17a87ef815ecfd02476
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Wed Nov 28 00:30:59 2012 -0600

    clean-up a lone lost 'String' in writerperfect
    
    Change-Id: I848ac4d934ffde0ae9c4b8b674fcb46c7bd17769

diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index 45372e3..cf1c61f 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -35,8 +35,6 @@
 #include "stream/WPXSvStream.h"
 #include "WordPerfectImportFilter.hxx"
 
-using ::rtl::OString;
-using ::rtl::OUString;
 using ::ucbhelper::Content;
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
@@ -126,9 +124,8 @@ throw (RuntimeException)
             aPasswdDlg.SetMinLen(0);
             if(!aPasswdDlg.Execute())
                 return sal_False;
-            String aPasswd = aPasswdDlg.GetPassword();
-            OUString aUniPasswd(aPasswd.GetBuffer() /*, aPasswd.Len(), RTL_TEXTENCODING_UCS2 */);
-            aUtf8Passwd = OUStringToOString(aUniPasswd, RTL_TEXTENCODING_UTF8);
+            OUString aPasswd = aPasswdDlg.GetPassword();
+            aUtf8Passwd = OUStringToOString(aPasswd, RTL_TEXTENCODING_UTF8);
             if (WPD_PASSWORD_MATCH_OK == WPDocument::verifyPassword(&input, aUtf8Passwd.getStr()))
                 break;
             else
@@ -211,17 +208,17 @@ throw( RuntimeException )
         }
         catch ( ... )
         {
-            return ::rtl::OUString();
+            return OUString();
         }
 
         if (!xInputStream.is())
-            return ::rtl::OUString();
+            return OUString();
     }
 
     WPXSvInputStream input( xInputStream );
 
     if (input.atEOS())
-        return ::rtl::OUString();
+        return OUString();
 
     confidence = WPDocument::isFileFormatSupported(&input);
 
@@ -320,7 +317,7 @@ WordPerfectImportFilterDialog::~WordPerfectImportFilterDialog()
 {
 }
 
-void SAL_CALL WordPerfectImportFilterDialog::setTitle( const ::rtl::OUString & )
+void SAL_CALL WordPerfectImportFilterDialog::setTitle( const OUString & )
 throw (RuntimeException)
 {
 }
@@ -376,7 +373,7 @@ throw(com::sun::star::beans::UnknownPropertyException, com::sun::star::beans::Pr
     for (long i = 0; i < nPropCount; i++)
     {
         const PropertyValue &rProp = pPropArray[i];
-        ::rtl::OUString aPropName = rProp.Name;
+        OUString aPropName = rProp.Name;
 
         if ( aPropName == "Password" )
             rProp.Value >>= msPassword;


More information about the Libreoffice-commits mailing list