[Libreoffice-commits] core.git: 2 commits - avmedia/source basegfx/source basic/source bridges/source chart2/source connectivity/source cppuhelper/test crashrep/source dbaccess/source

Thomas Arnhold thomas at arnhold.org
Sat Mar 9 12:49:53 PST 2013


 avmedia/source/viewer/mediawindowbase_impl.cxx                  |    4 
 basegfx/source/polygon/b2dsvgpolypolygon.cxx                    |    2 
 basic/source/runtime/step2.cxx                                  |    6 
 basic/source/sbx/sbxvalue.cxx                                   |    2 
 bridges/source/cpp_uno/cc50_solaris_intel/except.cxx            |    4 
 bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx            |    4 
 chart2/source/tools/ObjectIdentifier.cxx                        |    4 
 chart2/source/view/charttypes/VSeriesPlotter.cxx                |    6 
 chart2/source/view/main/ChartView.cxx                           |  100 ----------
 connectivity/source/commontools/dbtools2.cxx                    |    2 
 connectivity/source/commontools/parameters.cxx                  |    2 
 connectivity/source/drivers/ado/ADatabaseMetaData.cxx           |    2 
 connectivity/source/drivers/hsqldb/HDriver.cxx                  |    2 
 connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx      |    8 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx |    2 
 connectivity/source/drivers/postgresql/pq_xtables.cxx           |    6 
 connectivity/source/parse/sqlbison.y                            |   10 -
 connectivity/source/parse/sqlnode.cxx                           |   18 -
 cppuhelper/test/testdefaultbootstrapping.cxx                    |    2 
 crashrep/source/win32/soreport.cxx                              |    2 
 dbaccess/source/core/api/CacheSet.cxx                           |    2 
 dbaccess/source/core/api/KeySet.cxx                             |    8 
 dbaccess/source/core/api/OptimisticSet.cxx                      |   18 -
 dbaccess/source/core/dataaccess/datasource.cxx                  |    2 
 dbaccess/source/ui/app/AppController.cxx                        |    8 
 dbaccess/source/ui/dlg/ConnectionPage.cxx                       |    2 
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx               |    2 
 dbaccess/source/ui/dlg/DbAdminImpl.cxx                          |   14 -
 dbaccess/source/ui/dlg/adodatalinks.cxx                         |    2 
 29 files changed, 73 insertions(+), 173 deletions(-)

New commits:
commit 6dddefc6e7ff6dc5cde46dde069ba1d7db4ac34b
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Mar 9 21:47:17 2013 +0100

    fdo#43460: use isEmpty()
    
    Change-Id: Ia768e684d3cf255239c04d024b35488830cc9fe6

diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index cc54a18..325e6d4 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -107,7 +107,7 @@ void MediaWindowBaseImpl::setURL( const OUString& rURL,
         mxPlayer.clear();
         mTempFileURL = OUString();
 
-        if (rTempURL.getLength())
+        if (!rTempURL.isEmpty())
         {
             maFileURL = rURL;
             mTempFileURL = rTempURL;
@@ -123,7 +123,7 @@ void MediaWindowBaseImpl::setURL( const OUString& rURL,
         }
 
         mxPlayer = createPlayer(
-                (mTempFileURL.getLength()) ? mTempFileURL : maFileURL );
+                (!mTempFileURL.isEmpty()) ? mTempFileURL : maFileURL );
         onURLChanged();
     }
 }
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 553f02c..ffb0491 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -109,7 +109,7 @@ namespace basegfx
                     }
                 }
 
-                if(sNumberString.getLength())
+                if(!sNumberString.isEmpty())
                 {
                     rtl_math_ConversionStatus eStatus;
                     o_fRetval = ::rtl::math::stringToDouble( sNumberString.makeStringAndClear(),
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index d7f2a8d..f6fa096 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -299,7 +299,7 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName )
     // in the RunInit yet
 
     SbxVariable* pElem = NULL;
-    if( !pMod || !rName.getLength() )
+    if( !pMod || rName.isEmpty() )
     {
         return NULL;
     }
@@ -406,7 +406,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
                             {
                                 SbxVariable* pVar = refArgv->Get( i );
                                 const OUString& rName = refArgv->GetAlias( i );
-                                if( rName.getLength() )
+                                if( !rName.isEmpty() )
                                 {
                                     pNames[i] = rName;
                                 }
@@ -463,7 +463,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
                 {
                     SbxVariable* pVar = refArgv->Get( i );
                     const OUString& rName = refArgv->GetAlias( i );
-                    if( rName.getLength() )
+                    if( !rName.isEmpty() )
                     {
                         // nCurPar is set to the found parameter
                         sal_uInt16 j = 1;
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 7356f89..1e31916 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1469,7 +1469,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
         {
             OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r,
                 RTL_TEXTENCODING_ASCII_US);
-            if( aVal.getLength() )
+            if( !aVal.isEmpty() )
                     aData.pOUString = new OUString( aVal );
                 else
                     aData.pOUString = NULL; // JSM 1995-09-22
diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
index 36bd7a6..7c9d61d 100644
--- a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
+++ b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
@@ -68,7 +68,7 @@ static OString toUNOname( const OString & rRTTIname )
     {
         if( *pRTTI == ':' || ! *pRTTI )
         {
-            if( aRet.getLength() )
+            if( !aRet.isEmpty() )
                 aRet += ".";
             aRet += rRTTIname.copy( pLast - pOrg, pRTTI - pLast );
             while( *pRTTI == ':' )
@@ -102,7 +102,7 @@ static OString toRTTIname( const OString & rUNOname )
 
 static OString toRTTImangledname( const OString & rRTTIname )
 {
-    if( ! rRTTIname.getLength() )
+    if( rRTTIname.isEmpty() )
         return OString();
 
     OStringBuffer aRet( rRTTIname.getLength()*2 );
diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
index ebb0918..9beb24c 100644
--- a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
+++ b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
@@ -70,7 +70,7 @@ static OString toUNOname( const OString & rRTTIname )
     {
         if( *pRTTI == ':' || ! *pRTTI )
         {
-            if( aRet.getLength() )
+            if( !aRet.isEmpty() )
                 aRet += ".";
             aRet += rRTTIname.copy( pLast - pOrg, pRTTI - pLast );
             while( *pRTTI == ':' )
@@ -104,7 +104,7 @@ static OString toRTTIname( const OString & rUNOname )
 
 static OString toRTTImangledname( const OString & rRTTIname )
 {
-    if( ! rRTTIname.getLength() )
+    if( rRTTIname.isEmpty() )
         return OString();
 
     OStringBuffer aRet( rRTTIname.getLength()*2 );
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 358385f..8779f1d 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -82,14 +82,14 @@ OUString lcl_createClassificationStringForType( ObjectType eObjectType
     }
     if( !rDragMethodServiceName.isEmpty() )
     {
-        if( aRet.getLength() )
+        if( !aRet.isEmpty() )
             aRet.appendAscii(":");
         aRet.append( m_aDragMethodEquals );
         aRet.append( rDragMethodServiceName );
 
         if( !rDragParameterString.isEmpty() )
         {
-            if( aRet.getLength() )
+            if( !aRet.isEmpty() )
                 aRet.appendAscii(":");
             aRet.append( m_aDragParameterEquals );
             aRet.append( rDragParameterString );
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index d32638c..6e114dd 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -515,7 +515,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
                     , nPointIndex, fValue, false /*bAsPercentage*/ ) );
                 if( !aNumber.isEmpty() )
                 {
-                    if(aText.getLength())
+                    if(!aText.isEmpty())
                         aText.append(aSeparator);
                     aText.append(aNumber);
                     ++nLineCountForSymbolsize;
@@ -534,7 +534,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
                     , nPointIndex, fValue, true /*bAsPercentage*/ ) );
                 if( !aPercentage.isEmpty() )
                 {
-                    if(aText.getLength())
+                    if(!aText.isEmpty())
                         aText.append(aSeparator);
                     aText.append(aPercentage);
                     ++nLineCountForSymbolsize;
@@ -1144,7 +1144,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
         else
             aScreenPosition2D = aDefaultPos;
 
-        if( aFormula.getLength())
+        if( !aFormula.isEmpty())
         {
             // set fill and line properties on creation
             tNameSequence aNames;
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index f671e6b..bcd6a8e 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -340,7 +340,7 @@ namespace
         }
     }
 
-    if ( aSql.getLength() )
+    if ( !aSql.isEmpty() )
     {
         if ( aSql[aSql.getLength() - 1] == ',' )
             aSql[aSql.getLength() - 1] = ')';
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 3d6fa6c4..bd3c5f2 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -388,7 +388,7 @@ namespace dbtools
                         ++aComponent
                     )
                 {
-                    if ( sAdditionalFilter.getLength() )
+                    if ( !sAdditionalFilter.isEmpty() )
                         sAdditionalFilter.append(s_sAnd);
 
                     sAdditionalFilter.appendAscii("( ",((sal_Int32)(sizeof("( ")-1)));
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
index cf8821f..634660f 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
@@ -920,7 +920,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeExc
             aRecordset.MoveNext();
         }
         aRecordset.Close();
-        if ( aRet.getLength() )
+        if ( !aRet.isEmpty() )
             return aRet.copy(0,aRet.lastIndexOf(','));
     }
     return ::rtl::OUString();
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 0a07e1d..3f2a96b 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -161,7 +161,7 @@ namespace connectivity
                 ::rtl::OUString sPermittedMethod;
                 OSL_VERIFY( aConfig.getNodeValue( *pNodeNames ) >>= sPermittedMethod );
 
-                if ( aPermittedMethods.getLength() )
+                if ( !aPermittedMethods.isEmpty() )
                     aPermittedMethods.append( (sal_Unicode)';' );
                 aPermittedMethods.append( sPermittedMethod );
             }
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
index 45d891f..9b88aea 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
@@ -1333,7 +1333,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeExc
         aValue.appendAscii("UCASE,");
 
 
-    if ( aValue.getLength() )
+    if ( !aValue.isEmpty() )
         aValue.setLength(aValue.getLength()-1);
 
     return aValue.makeStringAndClear();
@@ -1388,7 +1388,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeExc
     if(nValue & SQL_FN_TD_YEAR)
         aValue.appendAscii("YEAR,");
 
-    if ( aValue.getLength() )
+    if ( !aValue.isEmpty() )
         aValue.setLength(aValue.getLength()-1);
 
     return aValue.makeStringAndClear();
@@ -1407,7 +1407,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeExc
     if(nValue & SQL_FN_SYS_USERNAME)
         aValue.appendAscii("USERNAME,");
 
-    if ( aValue.getLength() )
+    if ( !aValue.isEmpty() )
         aValue.setLength(aValue.getLength()-1);
 
     return aValue.makeStringAndClear();
@@ -1468,7 +1468,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeExc
     if(nValue & SQL_FN_NUM_TRUNCATE)
         aValue.appendAscii("TRUNCATE,");
 
-    if ( aValue.getLength() )
+    if ( !aValue.isEmpty() )
         aValue.setLength(aValue.getLength()-1);
 
     return aValue.makeStringAndClear();
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 3cc6665..b2aa683 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -697,7 +697,7 @@ void PreparedStatement::setObjectWithInfo(
         {
             x >>= myString;
         }
-        if( myString.getLength() )
+        if( !myString.isEmpty() )
         {
 //              printf( "setObjectWithInfo %s\n", OUStringToOString(myString,RTL_TEXTENCODING_ASCII_US).getStr());
             setString( parameterIndex, myString );
diff --git a/connectivity/source/drivers/postgresql/pq_xtables.cxx b/connectivity/source/drivers/postgresql/pq_xtables.cxx
index 92c0f12..844ae3a 100644
--- a/connectivity/source/drivers/postgresql/pq_xtables.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xtables.cxx
@@ -234,7 +234,7 @@ static void appendColumnList(
                 {
                     buf.append( type );
                 }
-                if( defaultValue.getLength() )
+                if( !defaultValue.isEmpty() )
                 {
                     bufferQuoteConstant( buf, defaultValue, settings );
                 }
@@ -300,7 +300,7 @@ void Tables::appendByDescriptor(
 
     // description ....
     OUString description = extractStringProperty( descriptor, st.DESCRIPTION );
-    if( description.getLength() )
+    if( !description.isEmpty() )
     {
         buf = OUStringBuffer( 128 );
         buf.append( "COMMENT ON TABLE" );
@@ -322,7 +322,7 @@ void Tables::appendByDescriptor(
             {
                 Reference< XPropertySet > column( xEnum->nextElement(), UNO_QUERY );
                 description = extractStringProperty( column,st.DESCRIPTION );
-                if( description.getLength() )
+                if( !description.isEmpty() )
                 {
                     buf = OUStringBuffer( 128 );
                     buf.append( "COMMENT ON COLUMN " );
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 338d738..0bb7c31 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4680,9 +4680,9 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
 	if (SQLyyparse() != 0)
 	{
 		// only set the error message, if it's not already set
-		if (!m_sErrorMessage.getLength())
+		if (m_sErrorMessage.isEmpty())
 			m_sErrorMessage = s_pScanner->getErrorMessage();
-		if (!m_sErrorMessage.getLength())
+		if (m_sErrorMessage.isEmpty())
 			m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_GENERAL);
 
 		rErrorMessage = m_sErrorMessage;
@@ -4736,7 +4736,7 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
 		    aStr = pContext->getIntlKeywordAscii(eKeyCode);
 	}
 
-	if (!aStr.getLength())
+	if (aStr.isEmpty())
 	{
 		aStr = yytname[YYTRANSLATE(nTokenID)];
 		if(aStr.startsWith("SQL_TOKEN_"))
@@ -4875,7 +4875,7 @@ void OSQLParser::reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank)
 // -------------------------------------------------------------------------
 void OSQLParser::error(const sal_Char *fmt)
 {
-	if(!m_sErrorMessage.getLength())
+	if(m_sErrorMessage.isEmpty())
 	{
 		::rtl::OUString sStr(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
 		::rtl::OUString sSQL_TOKEN("SQL_TOKEN_");
@@ -4900,7 +4900,7 @@ void OSQLParser::error(const sal_Char *fmt)
 			m_sErrorMessage = sStr;
 
 		::rtl::OUString aError = s_pScanner->getErrorMessage();
-		if(aError.getLength())
+		if(!aError.isEmpty())
 		{
 			m_sErrorMessage += ::rtl::OUString(", ");
 			m_sErrorMessage += aError;
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 7acb62c..779b638 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -359,7 +359,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString,
     // special handling for parameters
     case parameter:
     {
-        if(rString.getLength())
+        if(!rString.isEmpty())
             rString.appendAscii(" ");
         if (nCount == 1)    // ?
             m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
@@ -608,7 +608,7 @@ bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUStringBuffer
                 // parse the sub-select to SDBC level, too
                 ::rtl::OUStringBuffer sSubSelect;
                 pSubQueryNode->impl_parseNodeToString_throw( sSubSelect, rParam );
-                if ( sSubSelect.getLength() )
+                if ( !sSubSelect.isEmpty() )
                     sCommand = sSubSelect.makeStringAndClear();
             }
         }
@@ -1709,7 +1709,7 @@ sal_Bool OSQLParseNode::addDateValue(::rtl::OUStringBuffer& rString, const SQLPa
                  }
             }
 
-            if (rString.getLength())
+            if (!rString.isEmpty())
                 rString.appendAscii(" ");
             rString.append(suQuote);
             const ::rtl::OUString sTokenValue = pODBCNode->m_aChildren[1]->getTokenValue();
@@ -2400,19 +2400,19 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
     {
         case SQL_NODE_KEYWORD:
         {
-            if (rString.getLength())
+            if (!rString.isEmpty())
                 rString.appendAscii(" ");
 
             const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext :  NULL);
             rString.append(::rtl::OStringToOUString(sT,RTL_TEXTENCODING_UTF8));
         }   break;
         case SQL_NODE_STRING:
-            if (rString.getLength())
+            if (!rString.isEmpty())
                 rString.appendAscii(" ");
             rString.append(SetQuotation(m_aNodeValue,::rtl::OUString("\'"),::rtl::OUString("\'\'")));
             break;
         case SQL_NODE_NAME:
-            if (rString.getLength() > 0)
+            if (!rString.isEmpty())
             {
                 switch(rString[rString.getLength()-1])
                 {
@@ -2441,7 +2441,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
                 rString.append(m_aNodeValue);
             break;
         case SQL_NODE_ACCESS_DATE:
-            if (rString.getLength())
+            if (!rString.isEmpty())
                 rString.appendAscii(" ");
             rString.appendAscii("#");
             rString.append(m_aNodeValue);
@@ -2455,7 +2455,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
                 if (rParam.bInternational && rParam.bPredicate && rParam.cDecSep != '.')
                     aTmp = aTmp.replace('.', rParam.cDecSep);
 
-                if (rString.getLength())
+                if (!rString.isEmpty())
                     rString.appendAscii(" ");
                 rString.append(aTmp);
 
@@ -2468,7 +2468,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
             }
             // fall through
         default:
-            if (rString.getLength() > 0 && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' )
+            if (!rString.isEmpty() && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' )
             {
                 switch( rString[rString.getLength() - 1] )
                 {
diff --git a/cppuhelper/test/testdefaultbootstrapping.cxx b/cppuhelper/test/testdefaultbootstrapping.cxx
index ba822ff..a61c5d9 100644
--- a/cppuhelper/test/testdefaultbootstrapping.cxx
+++ b/cppuhelper/test/testdefaultbootstrapping.cxx
@@ -49,7 +49,7 @@ SAL_IMPLEMENT_MAIN()
             OUString arg;
 
             rtl_getAppCommandArg(i, &arg.pData);
-            if (arg.getLength())
+            if (!arg.isEmpty())
             {
                 Reference<XInterface> xInterface = smgr->createInstance(arg);
                 OString tmp = OUStringToOString(arg, RTL_TEXTENCODING_ASCII_US);
diff --git a/crashrep/source/win32/soreport.cxx b/crashrep/source/win32/soreport.cxx
index fc8886c..e862dd3 100644
--- a/crashrep/source/win32/soreport.cxx
+++ b/crashrep/source/win32/soreport.cxx
@@ -162,7 +162,7 @@ static BOOL GetCrashDataPath( LPTSTR szBuffer )
     ::rtl::OUString ustrValue(RTL_CONSTASCII_USTRINGPARAM("${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}"));
     ::rtl::Bootstrap::expandMacros( ustrValue );
 
-    if ( ustrValue.getLength() )
+    if ( !ustrValue.isEmpty() )
     {
         ustrValue += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/user/crashdata"));
 
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index 734989b..1efe897 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -296,7 +296,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR
     ::std::list< sal_Int32> aOrgValues;
     fillParameters(_rInsertRow,_xTable,aCondition,aSql,aOrgValues);
     aSql[aSql.getLength() - 1] = ' ';
-    if ( aCondition.getLength() )
+    if ( !aCondition.isEmpty() )
     {
         aCondition.setLength(aCondition.getLength()-5);
 
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 4df0230..f1538b9 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -634,18 +634,18 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow
     else
         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_VALUE_CHANGED ), SQL_GENERAL_ERROR, m_xConnection );
 
-    if(sKeyCondition.getLength() || sIndexCondition.getLength())
+    if(!sKeyCondition.isEmpty() || !sIndexCondition.isEmpty())
     {
         aSql.append(" WHERE ");
-        if(sKeyCondition.getLength() && sIndexCondition.getLength())
+        if(!sKeyCondition.isEmpty() && !sIndexCondition.isEmpty())
         {
             aSql.append(sKeyCondition.makeStringAndClear() + sIndexCondition.makeStringAndClear());
         }
-        else if(sKeyCondition.getLength())
+        else if(!sKeyCondition.isEmpty())
         {
             aSql.append(sKeyCondition.makeStringAndClear());
         }
-        else if(sIndexCondition.getLength())
+        else if(!sIndexCondition.isEmpty())
         {
             aSql.append(sIndexCondition.makeStringAndClear());
         }
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index cbfcb62..816b9d8 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -72,7 +72,7 @@ namespace
     void lcl_fillKeyCondition(const ::rtl::OUString& i_sTableName,const ::rtl::OUString& i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions)
     {
         ::rtl::OUStringBuffer& rKeyCondition = io_aKeyConditions[i_sTableName];
-        if ( rKeyCondition.getLength() )
+        if ( !rKeyCondition.isEmpty() )
             rKeyCondition.append(" AND ");
         rKeyCondition.append(i_sQuotedColumnName);
         if ( i_aValue.isNull() )
@@ -216,7 +216,7 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow
                 (_rInsertRow->get())[aJoinIter->second] = (_rInsertRow->get())[aIter->second.nPosition];
             }
             ::rtl::OUStringBuffer& rPart = aSql[aIter->second.sTableName];
-            if ( rPart.getLength() )
+            if ( !rPart.isEmpty() )
                 rPart.append(", ");
             rPart.append(sQuotedColumnName + s_sPara);
         }
@@ -245,7 +245,7 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow
             ::rtl::OUStringBuffer sSql(s_sUPDATE + ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ) +
                                        s_sSET + aSqlIter->second.toString());
             ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first];
-            if ( rCondition.getLength() )
+            if ( !rCondition.isEmpty() )
                 sSql.append(" WHERE " + rCondition.toString() );
 
             executeUpdate(_rInsertRow ,_rOrginalRow,sSql.makeStringAndClear(),aSqlIter->first);
@@ -284,11 +284,11 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn
                 (_rInsertRow->get())[aJoinIter->second] = (_rInsertRow->get())[aIter->second.nPosition];
             }
             ::rtl::OUStringBuffer& rPart = aSql[aIter->second.sTableName];
-            if ( rPart.getLength() )
+            if ( !rPart.isEmpty() )
                 rPart.append(", ");
             rPart.append(sQuotedColumnName);
             ::rtl::OUStringBuffer& rParam = aParameter[aIter->second.sTableName];
-            if ( rParam.getLength() )
+            if ( !rParam.isEmpty() )
                 rParam.append(", ");
             rParam.append("?");
         }
@@ -313,7 +313,7 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn
                                  s_sVALUES + aParameter[aSqlIter->first].toString() + " )");
 
             ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first];
-            if ( rCondition.getLength() )
+            if ( !rCondition.isEmpty() )
             {
                 ::rtl::OUString sQuery("SELECT " + aSqlIter->second.toString() + " FROM " + sComposedTableName +
                                        " WHERE " + rCondition.toString());
@@ -376,7 +376,7 @@ void SAL_CALL OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const conne
     for(;aSqlIter != aSqlEnd ; ++aSqlIter)
     {
         ::rtl::OUStringBuffer& rCondition = aSqlIter->second;
-        if ( rCondition.getLength() )
+        if ( !rCondition.isEmpty() )
         {
             ::rtl::OUString sCatalog,sSchema,sTable;
             ::dbtools::qualifiedNameComponents(xMetaData,aSqlIter->first,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
@@ -621,7 +621,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const
             lcl_fillKeyCondition(aColIter->second.sTableName,sQuotedColumnName,io_aRow[aColIter->second.nPosition],aKeyConditions);
         }
         ::rtl::OUStringBuffer& rPart = aSql[aColIter->second.sTableName];
-        if ( rPart.getLength() )
+        if ( !rPart.isEmpty() )
             rPart.append(", ");
         rPart.append(sQuotedColumnName);
     }
@@ -633,7 +633,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const
         if ( aSqlIter->second.getLength() )
         {
             ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first];
-            if ( rCondition.getLength() )
+            if ( !rCondition.isEmpty() )
             {
                 ::rtl::OUString sCatalog,sSchema,sTable;
                 ::dbtools::qualifiedNameComponents(xMetaData,aSqlIter->first,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 42cc640..866e907 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -669,7 +669,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
 
         Sequence< PropertyValue > aUserPwd(nAdditionalArgs);
         sal_Int32 nArgPos = 0;
-        if (sUser.getLength())
+        if (!sUser.isEmpty())
         {
             aUserPwd[ nArgPos ].Name = "user";
             aUserPwd[ nArgPos ].Value <<= sUser;
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index ef62c6a..0880194 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -924,12 +924,12 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
 
                     m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber );
 
-                    if ( !sDatabaseName.getLength() )
+                    if ( sDatabaseName.isEmpty() )
                         sDatabaseName = m_aTypeCollection.cutPrefix( sURL );
                     if ( m_aTypeCollection.isFileSystemBased(sURL) )
                     {
                         sDatabaseName = SvtPathOptions().SubstituteVariable( sDatabaseName );
-                        if ( sDatabaseName.getLength() )
+                        if ( !sDatabaseName.isEmpty() )
                         {
                             ::svt::OFileNotation aFileNotation(sDatabaseName);
                             // set this decoded URL as text
@@ -937,7 +937,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
                         }
                     }
 
-                    if ( sDatabaseName.getLength() == 0 )
+                    if ( sDatabaseName.isEmpty() )
                         sDatabaseName = m_aTypeCollection.getTypeDisplayName( sURL );
 
                     aReturn.sTitle = sDatabaseName;
@@ -1729,7 +1729,7 @@ sal_Bool OApplicationController::onContainerSelect(ElementType _eType)
 
             xLayoutManager->lock();
             xLayoutManager->destroyElement( sDestroyToolbar );
-            if ( sToolbar.getLength() )
+            if ( !sToolbar.isEmpty() )
             {
                 xLayoutManager->createElement( sToolbar );
                 xLayoutManager->requestElement( sToolbar );
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 2437f74..8b982d9 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -240,7 +240,7 @@ namespace dbaui
             if ( !pJdbcDrvItem->GetValue().getLength() )
             {
                 OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType);
-                if ( sDefaultJdbcDriverName.getLength() )
+                if ( !sDefaultJdbcDriverName.isEmpty() )
                 {
                     m_aJavaDriver.SetText(sDefaultJdbcDriverName);
                     m_aJavaDriver.SetModifyFlag();
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 60fa166..06584cf 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -638,7 +638,7 @@ DBG_NAME(OMySQLIntroPageSetup)
             if ( !pDrvItem->GetValue().getLength() )
             {
                 OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType);
-                if ( sDefaultJdbcDriverName.getLength() )
+                if ( !sDefaultJdbcDriverName.isEmpty() )
                 {
                     m_aETDriverClass.SetText(sDefaultJdbcDriverName);
                     m_aETDriverClass.SetModifyFlag();
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index e1896c3..405ec96 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -258,7 +258,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert
             OUString sLoginRequest(ModuleRes(STR_ENTER_CONNECTION_PASSWORD));
             OUString sTemp = sName;
             sName = ::dbaui::getStrippedDatabaseName(NULL,sTemp);
-            if ( sName.getLength() )
+            if ( !sName.isEmpty() )
                 sLoginRequest = sLoginRequest.replaceAll("$name$", sName);
             else
             {
@@ -313,7 +313,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert
                 m_pItemSetHelper->getWriteOutputSet()->Put(SfxStringItem(DSID_PASSWORD, sPassword));
         }
 
-        if (sPassword.getLength())
+        if (!sPassword.isEmpty())
             aReturn.push_back(
                 PropertyValue(  OUString("password"), 0,
                                 makeAny(OUString(sPassword)), PropertyState_DIRECT_VALUE));
@@ -514,7 +514,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
                     // Huh? Anybody there?
                     // OJ: It is needed when the connection properties are changed. There the URL is used for every type.
 
-                if ( sDatabaseName.getLength() )
+                if ( !sDatabaseName.isEmpty() )
                 {
                     sNewUrl += OUString::createFromAscii("/") + sDatabaseName;
                 }
@@ -529,9 +529,9 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
                 {
                     sNewUrl = "@" + lcl_createHostWithPort(pHostName,pPortNumber);
                     OUString sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : OUString();
-                    if ( !sDatabaseName.getLength() && pUrlItem )
+                    if ( sDatabaseName.isEmpty() && pUrlItem )
                         sDatabaseName = pCollection->cutPrefix( pUrlItem->GetValue() );
-                    if ( sDatabaseName.getLength() )
+                    if ( !sDatabaseName.isEmpty() )
                     {
                         sNewUrl += OUString::createFromAscii(":") + sDatabaseName;
                     }
@@ -1080,7 +1080,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
             break;
     }
 
-    if ( sUrlPart.getLength() )
+    if ( !sUrlPart.isEmpty() )
     {
         if ( eTy == ::dbaccess::DST_MYSQL_NATIVE )
         {
@@ -1094,7 +1094,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
         }
     }
 
-    if ( sNewHostName.getLength() )
+    if ( !sNewHostName.isEmpty() )
         _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName));
 
     if ( nPortNumber != -1 && nPortNumberId != 0 )
diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx
index f56b2cd..dcbd89c 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.cxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.cxx
@@ -51,7 +51,7 @@ BSTR PromptNew(long hWnd);
 ::rtl::OUString getAdoDatalink(long hWnd,::rtl::OUString& oldLink)
 {
     ::rtl::OUString dataLink;
-    if (oldLink.getLength())
+    if (!oldLink.isEmpty())
     {
         dataLink=reinterpret_cast<sal_Unicode *>(PromptEdit(hWnd,(BSTR)oldLink.getStr()));
     }
commit d9a3752143027bbf0d9383074fd378631309a3b0
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Mar 9 21:06:39 2013 +0100

    remove commented out code
    
    This has moved to XShapeDumper.cxx as the comment says...
    
    Change-Id: I0060101a45c359cdf438ae399ec43e39270f9bff

diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 250021c..feeb6e6 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2996,106 +2996,6 @@ uno::Sequence< ::rtl::OUString > ChartView::getAvailableServiceNames() throw (un
     return aServiceNames;
 }
 
-/* ----------------------
-    goes to drawinglayer/XShapeDumper.cxx
-    ----------------------
-namespace {
-
-#define DEBUG_DUMPER 0
-
-int writeCallback(void* pContext, const char* sBuffer, int nLen)
-{
-    rtl::OStringBuffer* pBuffer = static_cast<rtl::OStringBuffer*>(pContext);
-    pBuffer->append(sBuffer);
-    return nLen;
-}
-
-int closeCallback(void* )
-{
-    return 0;
-}
-
-void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
-{
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X);
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y);
-}
-
-void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter)
-{
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width);
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height);
-}
-
-void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter )
-{
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s", rtl::OUStringToOString(xDescr->getShapeType(), RTL_TEXTENCODING_UTF8).getStr());
-}
-
-void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter );
-
-void dumpXShape( uno::Reference< drawing::XShape > xShape, xmlTextWriterPtr xmlWriter  )
-{
-    xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) );
-
-    dumpPositionAsAttribute(xShape->getPosition(), xmlWriter);
-    dumpSizeAsAttribute(xShape->getSize(), xmlWriter);
-    uno::Reference< drawing::XShapeDescriptor > xDescr(xShape, uno::UNO_QUERY_THROW);
-    dumpShapeDescriptorAsAttribute(xDescr, xmlWriter);
-
-    uno::Reference< lang::XServiceInfo > xServiceInfo( xShape, uno::UNO_QUERY_THROW );
-    uno::Sequence< rtl::OUString > aServiceNames = xServiceInfo->getSupportedServiceNames();
-
-    uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW);
-    uno::Any aAny = xPropSet->getPropertyValue("Name");
-    rtl::OUString aName;
-    if (aAny >>= aName)
-    {
-        if (!aName.isEmpty())
-            xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
-    }
-    if (xServiceInfo->supportsService("com.sun.star.drawing.Text"))
-    {
-        uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY_THROW);
-        rtl::OUString aText = xText->getString();
-        if(!aText.isEmpty())
-            xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("text"), "%s", rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
-    }
-    else if(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
-    {
-        uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY_THROW);
-        dumpXShapes(xShapes, xmlWriter);
-    }
-#if DEBUG_DUMPER
-    sal_Int32 nServices = aServiceNames.getLength();
-    for (sal_Int32 i = 0; i < nServices; ++i)
-    {
-        xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ServiceName" ));
-        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( "name" ), "%s", rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
-        xmlTextWriterEndElement( xmlWriter );
-    }
-#endif
-
-    xmlTextWriterEndElement( xmlWriter );
-}
-
-void dumpXShapes( uno::Reference< drawing::XShapes > xShapes, xmlTextWriterPtr xmlWriter )
-{
-    xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShapes" ) );
-    uno::Reference< container::XIndexAccess > xIA( xShapes, uno::UNO_QUERY_THROW);
-    sal_Int32 nLength = xIA->getCount();
-    for (sal_Int32 i = 0; i < nLength; ++i)
-    {
-        uno::Reference< drawing::XShape > xShape( xIA->getByIndex( i ), uno::UNO_QUERY_THROW );
-        dumpXShape( xShape, xmlWriter );
-    }
-
-    xmlTextWriterEndElement( xmlWriter );
-}
-
-}
-*/
-
 rtl::OUString ChartView::dump() throw (uno::RuntimeException)
 {
     impl_updateView();


More information about the Libreoffice-commits mailing list