framework/source/services/substitutepathvars.cxx | 12 ++++------- sal/qa/osl/file/osl_old_test_file.cxx | 3 -- sal/qa/osl/module/osl_Module_Const.h | 9 -------- sal/qa/rtl/cipher/rtl_cipher.cxx | 2 - vcl/inc/vcl/builder.hxx | 25 ++--------------------- 5 files changed, 8 insertions(+), 43 deletions(-)
New commits: commit 19d37e5c4bd43d2477d21fbaeccef923a60eb9ec Author: Caolán McNamara <[email protected]> Date: Wed Oct 10 09:28:34 2012 +0100 loplugin: unused O[U]Strings Change-Id: I020149a3073d8479887d108465cf5d3b727588d7 diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 9ac3c21..fbab8a4 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -375,11 +375,9 @@ const rtl::OUString& SubstitutePathVariables_Impl::GetNTDomainName() const rtl::OUString& SubstitutePathVariables_Impl::GetHostName() { - if ( !m_bHostRetrieved ) + if (!m_bHostRetrieved) { - rtl::OUString aHostName; oslSocketResult aSocketResult; - m_aHost = osl::SocketAddr::getLocalHostname( &aSocketResult ).toAsciiLowerCase(); } @@ -1133,8 +1131,8 @@ throw ( NoSuchElementException, RuntimeException ) aVariable = rVariable.copy( 2, rVariable.getLength() - 3 ); else { - rtl::OUString aExceptionText( RTL_CONSTASCII_USTRINGPARAM( "Unknown variable!" )); - throw NoSuchElementException(); + OUString aExceptionText("Unknown variable!"); + throw NoSuchElementException(aExceptionText, (cppu::OWeakObject *)this); } } else @@ -1148,8 +1146,8 @@ throw ( NoSuchElementException, RuntimeException ) return pIter->second.aSubstValue; } - rtl::OUString aExceptionText( RTL_CONSTASCII_USTRINGPARAM( "Unknown variable!" )); - throw NoSuchElementException( aExceptionText, (cppu::OWeakObject *)this ); + OUString aExceptionText("Unknown variable!"); + throw NoSuchElementException(aExceptionText, (cppu::OWeakObject *)this); } } diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx index 1cdb283..0d2379e 100644 --- a/sal/qa/osl/file/osl_old_test_file.cxx +++ b/sal/qa/osl/file/osl_old_test_file.cxx @@ -173,9 +173,6 @@ void oldtestfile::test_file_004() { CPPUNIT_ASSERT_MESSAGE("failure #10.1", target.equalsAscii( aSource1[i+1] ) ); } - OString o = OUStringToOString( target , RTL_TEXTENCODING_ASCII_US ); - OString obase = OUStringToOString( base4 , RTL_TEXTENCODING_ASCII_US ); - //fprintf( stderr, "%d %s + %s = %s\n" ,e, obase.getStr(), aSource1[i], o.pData->buffer ); } #endif } diff --git a/sal/qa/osl/module/osl_Module_Const.h b/sal/qa/osl/module/osl_Module_Const.h index 00de78d..544c525 100644 --- a/sal/qa/osl/module/osl_Module_Const.h +++ b/sal/qa/osl/module/osl_Module_Const.h @@ -47,15 +47,6 @@ # define FILE_PREFIX "file:///" -//Korea charactors -::rtl::OUString aKname( - RTL_CONSTASCII_STRINGPARAM( - "/\xEC\x95\x88\xEB\x85\x95\xED\x95\x98\xEC\x84\xB8\xEC\x9A\x94"), - RTL_TEXTENCODING_ISO_8859_1); - // zero-extend the individual byte-sized characters one-to-one to individual - // sal_Unicode-sized characters; not sure whether this is what was - // intended... - //------------------------------------------------------------------------ // function pointer type. //------------------------------------------------------------------------ diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx index 2b982e5..9514bd5 100644 --- a/sal/qa/rtl/cipher/rtl_cipher.cxx +++ b/sal/qa/rtl/cipher/rtl_cipher.cxx @@ -258,8 +258,6 @@ public: /* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len); CPPUNIT_ASSERT_MESSAGE("wrong decode", aError == rtl_Cipher_E_None); - rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len); - sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16); CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0); commit c14bd74f268d4883a73f46a7ceac2d2e98ac96a3 Author: Caolán McNamara <[email protected]> Date: Wed Oct 10 00:06:09 2012 +0100 don't do things differently on higher debug levels Change-Id: Ib1fd8c4a5ab4db8d5889ea489b74569639994714 diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index aae959a..83b1139 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -144,36 +144,17 @@ public: template <typename T> T* get(T*& ret, OString sID) { Window *w = get_by_name(sID); - assert(w); + assert(w && dynamic_cast<T*>(w)); ret = static_cast<T*>(w); - -#if OSL_DEBUG_LEVEL > 0 - if (w) - { - ret = dynamic_cast<T*>(w); - assert(ret); - } -#endif - return ret; } //sID may not exist, but must be of type T if it does template <typename T /*=Window if we had c++11*/> T* get(OString sID) { Window *w = get_by_name(sID); - T* ret = static_cast<T*>(w); - -#if OSL_DEBUG_LEVEL > 0 - if (w) - { - ret = dynamic_cast<T*>(w); - assert(ret); - } -#endif - - return ret; + assert(!w || dynamic_cast<T*>(w)); + return static_cast<T*>(w); } - OString get_by_window(const Window *pWindow) const; //for the purposes of retrofitting this to the existing code //look up sID, clone its properties into replacement and
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
