fdo#43460 framework,i18npool,accessibility: use isEmpty()

Change-Id: I4cd9841127b1d4a294d7f001b646259c61eb1172
Reviewed-on: https://gerrit.libreoffice.org/4443
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Jelle van der Waa
2013-06-22 12:53:04 +02:00
committed by Michael Stahl
parent 51daa4de4f
commit 126827b0fd
5 changed files with 20 additions and 20 deletions

View File

@@ -120,7 +120,7 @@ namespace accessibility
// TODO: localize this! // TODO: localize this!
OUStringBuffer sName(mpBrowseBox->GetColumnDescription( ::sal::static_int_cast< sal_uInt16 >( getColumnPos() ) )); OUStringBuffer sName(mpBrowseBox->GetColumnDescription( ::sal::static_int_cast< sal_uInt16 >( getColumnPos() ) ));
if ( 0 == sName.getLength() ) if ( sName.isEmpty() )
{ {
sName.appendAscii("Column "); sName.appendAscii("Column ");
sName.append(getColumnPos()); sName.append(getColumnPos());

View File

@@ -521,7 +521,7 @@ void TitleHelper::impl_appendProductName (OUStringBuffer& sTitle)
OUString name(utl::ConfigManager::getProductName()); OUString name(utl::ConfigManager::getProductName());
if (!name.isEmpty()) if (!name.isEmpty())
{ {
if (sTitle.getLength() != 0) if (!sTitle.isEmpty())
sTitle.appendAscii(RTL_CONSTASCII_STRINGPARAM(" - ")); sTitle.appendAscii(RTL_CONSTASCII_STRINGPARAM(" - "));
sTitle.append(name); sTitle.append(name);
} }

View File

@@ -356,7 +356,7 @@ void SAL_CALL DispatchRecorder::implts_recordMacro( const OUString& aURL,
{ {
sValBuffer.setLength(0); sValBuffer.setLength(0);
} }
if (!sValBuffer.getLength()) if (sValBuffer.isEmpty())
continue; continue;
{ {

View File

@@ -411,7 +411,7 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult )
if ((nDigit = nPart % 100) < 20) if ((nDigit = nPart % 100) < 20)
{ {
if (aTemp.getLength()) if (!aTemp.isEmpty())
aTemp.insert( 0, sal_Unicode(0x0020)); aTemp.insert( 0, sal_Unicode(0x0020));
aTemp.insert( 0, table_PersianWord_decade1[nDigit]); aTemp.insert( 0, table_PersianWord_decade1[nDigit]);
} }
@@ -419,13 +419,13 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult )
{ {
if ((nDigit = nPart % 10) != 0) if ((nDigit = nPart % 10) != 0)
{ {
if (aTemp.getLength()) if (!aTemp.isEmpty())
aTemp.insert( 0, asPersianWord_conjunction); aTemp.insert( 0, asPersianWord_conjunction);
aTemp.insert( 0, table_PersianWord_decade1[nDigit]); aTemp.insert( 0, table_PersianWord_decade1[nDigit]);
} }
if ((nDigit = (nPart / 10) % 10) != 0) if ((nDigit = (nPart / 10) % 10) != 0)
{ {
if (aTemp.getLength()) if (!aTemp.isEmpty())
aTemp.insert( 0, asPersianWord_conjunction); aTemp.insert( 0, asPersianWord_conjunction);
aTemp.insert( 0, table_PersianWord_decade2[nDigit-2]); aTemp.insert( 0, table_PersianWord_decade2[nDigit-2]);
} }
@@ -433,7 +433,7 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult )
if ((nDigit = nPart / 100) != 0) if ((nDigit = nPart / 100) != 0)
{ {
if (aTemp.getLength()) if (!aTemp.isEmpty())
aTemp.insert( 0, asPersianWord_conjunction); aTemp.insert( 0, asPersianWord_conjunction);
aTemp.insert( 0, table_PersianWord_decade3[nDigit-1]); aTemp.insert( 0, table_PersianWord_decade3[nDigit-1]);
} }

View File

@@ -1022,7 +1022,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
if (!(nDetected & 4)) if (!(nDetected & 4))
{ {
aPatternBuf.append( 'Y'); aPatternBuf.append( 'Y');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'Y'); aPatternBuf2.append( 'Y');
nDetected |= 4; nDetected |= 4;
} }
@@ -1032,7 +1032,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
if (!(nDetected & 2)) if (!(nDetected & 2))
{ {
aPatternBuf.append( 'M'); aPatternBuf.append( 'M');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'M'); aPatternBuf2.append( 'M');
nDetected |= 2; nDetected |= 2;
} }
@@ -1042,7 +1042,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
if (!(nDetected & 1)) if (!(nDetected & 1))
{ {
aPatternBuf.append( 'D'); aPatternBuf.append( 'D');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'D'); aPatternBuf2.append( 'D');
nDetected |= 1; nDetected |= 1;
} }
@@ -1076,7 +1076,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
aPatternBuf2 = aPatternBuf; aPatternBuf2 = aPatternBuf;
if (cChar == cDateSep || cChar == cDateSep2) if (cChar == cDateSep || cChar == cDateSep2)
aPatternBuf.append( OUString( &cDateSep, 1)); // always the defined separator aPatternBuf.append( OUString( &cDateSep, 1)); // always the defined separator
if (cChar == cDateSep2 && aPatternBuf2.getLength() > 0) if (cChar == cDateSep2 && !aPatternBuf2.isEmpty())
aPatternBuf2.append( OUString( &cDateSep2, 1)); // always the format's separator aPatternBuf2.append( OUString( &cDateSep2, 1)); // always the format's separator
break; break;
// The localized legacy: // The localized legacy:
@@ -1088,7 +1088,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
// it GG/MM/AAAA // it GG/MM/AAAA
// fr_CA AAAA-MM-JJ // fr_CA AAAA-MM-JJ
aPatternBuf.append( 'Y'); aPatternBuf.append( 'Y');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'Y'); aPatternBuf2.append( 'Y');
nDetected |= 4; nDetected |= 4;
} }
@@ -1099,7 +1099,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
// fr JJ.MM.AAAA // fr JJ.MM.AAAA
// fr_CA AAAA-MM-JJ // fr_CA AAAA-MM-JJ
aPatternBuf.append( 'D'); aPatternBuf.append( 'D');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'D'); aPatternBuf2.append( 'D');
nDetected |= 1; nDetected |= 1;
} }
@@ -1108,7 +1108,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
// nl DD-MM-JJJJ // nl DD-MM-JJJJ
// de TT.MM.JJJJ // de TT.MM.JJJJ
aPatternBuf.append( 'Y'); aPatternBuf.append( 'Y');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'Y'); aPatternBuf2.append( 'Y');
nDetected |= 4; nDetected |= 4;
} }
@@ -1118,7 +1118,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{ {
// de TT.MM.JJJJ // de TT.MM.JJJJ
aPatternBuf.append( 'D'); aPatternBuf.append( 'D');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'D'); aPatternBuf2.append( 'D');
nDetected |= 1; nDetected |= 1;
} }
@@ -1128,7 +1128,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{ {
// it GG/MM/AAAA // it GG/MM/AAAA
aPatternBuf.append( 'D'); aPatternBuf.append( 'D');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'D'); aPatternBuf2.append( 'D');
nDetected |= 1; nDetected |= 1;
} }
@@ -1138,7 +1138,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{ {
// fi PP.KK.VVVV // fi PP.KK.VVVV
aPatternBuf.append( 'D'); aPatternBuf.append( 'D');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'D'); aPatternBuf2.append( 'D');
nDetected |= 1; nDetected |= 1;
} }
@@ -1148,7 +1148,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{ {
// fi PP.KK.VVVV // fi PP.KK.VVVV
aPatternBuf.append( 'M'); aPatternBuf.append( 'M');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'M'); aPatternBuf2.append( 'M');
nDetected |= 2; nDetected |= 2;
} }
@@ -1158,7 +1158,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{ {
// fi PP.KK.VVVV // fi PP.KK.VVVV
aPatternBuf.append( 'Y'); aPatternBuf.append( 'Y');
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
aPatternBuf2.append( 'Y'); aPatternBuf2.append( 'Y');
nDetected |= 4; nDetected |= 4;
} }
@@ -1182,7 +1182,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
// Insert at front so full date pattern is first in checks. // Insert at front so full date pattern is first in checks.
theDateAcceptancePatterns.insert( theDateAcceptancePatterns.begin(), aPattern); theDateAcceptancePatterns.insert( theDateAcceptancePatterns.begin(), aPattern);
} }
if (aPatternBuf2.getLength() > 0) if (!aPatternBuf2.isEmpty())
{ {
OUString aPattern2( aPatternBuf2.makeStringAndClear()); OUString aPattern2( aPatternBuf2.makeStringAndClear());
if (aPattern2.getLength() < 5) if (aPattern2.getLength() < 5)