Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please find attached a partial fix for Easy Hack FDO43460

Part IV
Module
basic (small cosmetic fix per demand of Ivan Timofeev)
binaryurp
bridges

- -- 
Olivier Hallot
Founder, Board of Directors Member - The Document Foundation
LibreOffice translation leader for Brazilian Portuguese
+55-21-8822-8812
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO47UrAAoJEJp3R7nH3vLxExQH/0aSskWwVdhFGzBrcerpF4yB
R8w/UaH0GpHydBh9uIlUJKvJ42NQLNIxxOmhP2W7HirPO0QOhGGy1AipJUUrTotA
xFs3PilC2Wo2uQDSmnmyG/dhLEHVGXMWcYoCa4L7bzlq8GP6/VaZHBARc65erjc2
qsaQ3Tbv8rL+OkCuDhuMFX/fY0a0vKD5IPh8MwQm7EiejqPyuvN12NHcfnZ8ZlH/
gbxDblZO69ChKb5PZpty5kwJzKPjjaIMnmCQdI5CWbcXp0efZVqgewZf3G2UCQgA
mwJ5MxJrzU7nVcZAfpDHVQUEZIJ3eDpLsJBgvqJe8ysqyhqz8NZuzUrYdVrIpw4=
=aALZ
-----END PGP SIGNATURE-----
From 68c4ac7291664b6e9a6162b31bc7d8ea4213745c Mon Sep 17 00:00:00 2001
From: Olivier Hallot <olivier.hallot@alta.org.br>
Date: Sat, 10 Dec 2011 17:29:21 -0200
Subject: [PATCH] Fix for fdo43460 Part IV getLength to isEmpty

Part IV
Module
basic (small fix per demand from Ivan Timofeev)
binaryurp
bridges
---
 basic/source/uno/scriptcont.cxx                 |    4 ++--
 binaryurp/source/bridge.cxx                     |    8 ++++----
 binaryurp/source/bridgefactory.cxx              |    4 ++--
 binaryurp/source/reader.cxx                     |    4 ++--
 binaryurp/source/unmarshal.cxx                  |    4 ++--
 binaryurp/source/writer.cxx                     |    2 +-
 bridges/source/cpp_uno/shared/vtablefactory.cxx |    4 ++--
 bridges/source/jni_uno/jni_data.cxx             |    2 +-
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index c6fbc5d..9dd01a1 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -473,8 +473,8 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
     if( OldPassword == NewPassword )
         return;
 
-    sal_Bool bOldPassword = ( !OldPassword.isEmpty() );
-    sal_Bool bNewPassword = ( !NewPassword.isEmpty() );
+    sal_Bool bOldPassword = !OldPassword.isEmpty();
+    sal_Bool bNewPassword = !NewPassword.isEmpty();
     sal_Bool bStorage = mxStorage.is() && !pImplLib->mbLink;
 
     if( pImplLib->mbReadOnly || (bOldPassword && !pImplLib->mbPasswordProtected) )
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index b491a2a..389284d 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -345,7 +345,7 @@ css::uno::UnoInterfaceReference Bridge::registerIncomingInterface(
     rtl::OUString const & oid, css::uno::TypeDescription const & type)
 {
     assert(type.is());
-    if (oid.getLength() == 0) {
+    if (oid.isEmpty()) {
         return css::uno::UnoInterfaceReference();
     }
     css::uno::UnoInterfaceReference obj(findStub(oid, type));
@@ -427,7 +427,7 @@ rtl::OUString Bridge::registerOutgoingInterface(
 css::uno::UnoInterfaceReference Bridge::findStub(
     rtl::OUString const & oid, css::uno::TypeDescription const & type)
 {
-    assert(oid.getLength() != 0 && type.is());
+    assert(!oid.isEmpty() && type.is());
     osl::MutexGuard g(mutex_);
     Stubs::iterator i(stubs_.find(oid));
     if (i != stubs_.end()) {
@@ -449,7 +449,7 @@ css::uno::UnoInterfaceReference Bridge::findStub(
 void Bridge::releaseStub(
     rtl::OUString const & oid, css::uno::TypeDescription const & type)
 {
-    assert(oid.getLength() != 0 && type.is());
+    assert(!oid.isEmpty() && type.is());
     css::uno::UnoInterfaceReference obj;
     bool unused;
     {
@@ -814,7 +814,7 @@ Bridge::~Bridge() {
 css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
     rtl::OUString const & sInstanceName) throw (css::uno::RuntimeException)
 {
-    if (sInstanceName.getLength() == 0) {
+    if (sInstanceName.isEmpty()) {
         throw css::uno::RuntimeException(
             rtl::OUString(
                 RTL_CONSTASCII_USTRINGPARAM(
diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx
index 5c91055..0edbaa0 100644
--- a/binaryurp/source/bridgefactory.cxx
+++ b/binaryurp/source/bridgefactory.cxx
@@ -80,7 +80,7 @@ void BridgeFactory::removeBridge(
     assert(bridge.is());
     rtl::OUString n(bridge->getName());
     osl::MutexGuard g(*this);
-    if (n.getLength() == 0) {
+    if (n.isEmpty()) {
         BridgeList::iterator i(
             std::find(unnamed_.begin(), unnamed_.end(), bridge));
         if (i != unnamed_.end()) {
@@ -154,7 +154,7 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
                 static_cast< cppu::OWeakObject * >(this), -1);
         }
         b.set(new Bridge(this, sName, aConnection, anInstanceProvider));
-        if (sName.getLength() == 0) {
+        if (sName.isEmpty()) {
             unnamed_.push_back(
                 css::uno::Reference< css::bridge::XBridge >(b.get()));
         } else {
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index c052fad..e6b6f06 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -215,7 +215,7 @@ void Reader::readMessage(Unmarshal & unmarshal) {
     rtl::OUString oid;
     if (newOid) {
         oid = unmarshal.readOid();
-        if (oid.getLength() == 0) {
+        if (oid.isEmpty()) {
             throw css::io::IOException(
                 rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM(
@@ -224,7 +224,7 @@ void Reader::readMessage(Unmarshal & unmarshal) {
         }
         lastOid_ = oid;
     } else {
-        if (lastOid_.getLength() == 0) {
+        if (lastOid_.isEmpty()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM(
diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx
index df91fa8..a2ac6c3 100644
--- a/binaryurp/source/unmarshal.cxx
+++ b/binaryurp/source/unmarshal.cxx
@@ -249,8 +249,8 @@ rtl::OUString Unmarshal::readOid() {
         }
     }
     sal_uInt16 idx = readCacheIndex();
-    if (oid.getLength() == 0 && idx != cache::ignore) {
-        if (state_.oidCache[idx].getLength() == 0) {
+    if (oid.isEmpty() && idx != cache::ignore) {
+        if (state_.oidCache[idx].isEmpty()) {
             throw css::io::IOException(
                 rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM(
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index 5aca57b..843f667 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -210,7 +210,7 @@ void Writer::sendRequest(
     std::vector< BinaryAny > const & inArguments, bool currentContextMode,
     css::uno::UnoInterfaceReference const & currentContext)
 {
-    OSL_ASSERT(tid.getLength() != 0 && oid.getLength() != 0 && member.is());
+    OSL_ASSERT(tid.getLength() != 0 && !oid.isEmpty() && member.is());
     css::uno::TypeDescription t(type);
     sal_Int32 functionId = 0;
     bool forceSynchronous = false;
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index fd84a73..2703ac0 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -241,9 +241,9 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
     if (aSecurity.getHomeDir(strURLDirectory))
         osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
 
-    for (int i = strDirectory.getLength() == 0 ? 1 : 0; i < 2; ++i)
+    for (int i = strDirectory.isEmpty() ? 1 : 0; i < 2; ++i)
     {
-        if (!strDirectory.getLength())
+        if (strDirectory.isEmpty())
             strDirectory = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/tmp" ));
 
         strDirectory += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/.execoooXXXXXX" ));
diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx
index c6ea28a..9d77812 100644
--- a/bridges/source/jni_uno/jni_data.cxx
+++ b/bridges/source/jni_uno/jni_data.cxx
@@ -1817,7 +1817,7 @@ void Bridge::map_to_java(
                 // polymorphic struct types:
                 rtl::OUString const & name = rtl::OUString::unacquired(
                     &pAny->pType->pTypeName);
-                OSL_ASSERT(name.getLength() > 0);
+                OSL_ASSERT(!name.isEmpty());
                 if (name[name.getLength() - 1] == '>')
                 {
                     // Box up in com.sun.star.uno.Any:
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.