From b575f4b1a2a2217282cddc995951b350936b47b1 Mon Sep 17 00:00:00 2001 From: Gustavo Buzzatti Pacheco Date: Fri, 23 Dec 2011 10:25:18 -0200 Subject: Fix for fdo43460 Part XIV getLength() to isEmpty() Part XIV Modules drawinglayer, dtrans, editeng --- editeng/source/editeng/editview.cxx | 4 ++-- editeng/source/editeng/impedit2.cxx | 2 +- editeng/source/editeng/impedit4.cxx | 2 +- editeng/source/editeng/textconv.cxx | 2 +- editeng/source/items/frmitems.cxx | 4 ++-- editeng/source/items/textitem.cxx | 6 +++--- editeng/source/items/xmlcnitm.cxx | 2 +- editeng/source/misc/hangulhanja.cxx | 8 ++++---- editeng/source/misc/unolingu.cxx | 8 ++++---- editeng/source/rtf/rtfgrf.cxx | 2 +- editeng/source/uno/unofield.cxx | 4 ++-- editeng/source/uno/unonrule.cxx | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) (limited to 'editeng') diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index ada459eb5697..ee9f749bcbad 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -105,7 +105,7 @@ LanguageType lcl_CheckLanguage( // if the result from language guessing does not provide a 'Country' part // try to get it by looking up the locale setting of the office. - if (aLocale.Country.getLength() == 0) + if ( aLocale.Country.isEmpty( ) ) { lang::Locale aTmpLocale = SvxCreateLocale( nTmpLang ); if (aTmpLocale.Language == aLocale.Language) @@ -1056,7 +1056,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage( xSvcInfo->getImplementationName()) ); - if (aDictionaryImageUrl.getLength() > 0) + if (!aDictionaryImageUrl.isEmpty() ) { Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) ); pInsertMenu->SetItemImage( nPos, aImage ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index eb36306909cf..b344b3a8157c 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1689,7 +1689,7 @@ void ImpEditEngine::InitScriptTypes( sal_uInt16 nPara ) while ( pField ) { ::rtl::OUString aFldText( ((EditCharAttribField*)pField)->GetFieldValue() ); - if ( aFldText.getLength() ) + if ( !aFldText.isEmpty() ) { aText.SetChar( pField->GetStart(), aFldText.getStr()[0] ); short nFldScriptType = _xBI->getScriptType( aFldText, 0 ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index ff441f17e844..6bdbba6a0471 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1796,7 +1796,7 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL pEditView->ShowCursor( sal_True, sal_False ); rConvTxt = aRes; - if (rConvTxt.getLength()) + if ( !rConvTxt.isEmpty() ) rConvTxtLang = nResLang; } diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 81f85a5207b8..a8f46c04cfbf 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -252,7 +252,7 @@ sal_Bool TextConvWrapper::ConvContinue_impl() pEditView->GetImpEditEngine()->ImpConvert( aConvText, nConvTextLang, pEditView, GetSourceLanguage(), aConvSel, bAllowChange, GetTargetLanguage(), GetTargetFont() ); - return aConvText.getLength() != 0; + return !aConvText.isEmpty(); } diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 18af4a61ec7b..ee8b297d6f76 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3649,9 +3649,9 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { SetGraphicLink(sLink); } - if ( sLink.getLength() && eGraphicPos == GPOS_NONE ) + if ( !sLink.isEmpty() && eGraphicPos == GPOS_NONE ) eGraphicPos = GPOS_MM; - else if( !sLink.getLength() ) + else if( sLink.isEmpty() ) eGraphicPos = GPOS_NONE; } } diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index db0edf2c9ffd..8b1e477308c8 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2654,7 +2654,7 @@ bool SvxLanguageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(!(rVal >>= aLocale)) return sal_False; - if (aLocale.Language.getLength() || aLocale.Country.getLength()) + if (!aLocale.Language.isEmpty() || !aLocale.Country.isEmpty()) SetValue(MsLangId::convertLocaleToLanguage( aLocale )); else SetValue(LANGUAGE_NONE); @@ -3079,14 +3079,14 @@ bool SvxTwoLinesItem::PutValue( const com::sun::star::uno::Any& rVal, case MID_START_BRACKET: if( rVal >>= s ) { - cStartBracket = s.getLength() ? s[ 0 ] : 0; + cStartBracket = s.isEmpty() ? 0 : s[ 0 ]; bRet = sal_True; } break; case MID_END_BRACKET: if( rVal >>= s ) { - cEndBracket = s.getLength() ? s[ 0 ] : 0; + cEndBracket = s.isEmpty() ? 0 : s[ 0 ]; bRet = sal_True; } break; diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index b7c91f9ea09b..15b4dffd1e52 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -147,7 +147,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal const ::rtl::OUString aPrefix( aName.copy( 0, pos )); const ::rtl::OUString aLName( aName.copy( pos+1 )); - if( pData->Namespace.getLength() == 0 ) + if( pData->Namespace.isEmpty() ) { if( !pNewImpl->AddAttr( aPrefix, aLName, pData->Value ) ) break; diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx index 1c7a809e216b..6e0eb21d1f14 100644 --- a/editeng/source/misc/hangulhanja.cxx +++ b/editeng/source/misc/hangulhanja.cxx @@ -496,7 +496,7 @@ namespace editeng m_nReplacementBaseIndex = 0; m_nCurrentStartIndex = m_nCurrentEndIndex = 0; - bool bRet = 0 != m_sCurrentPortion.getLength(); + bool bRet = !m_sCurrentPortion.isEmpty(); if (m_eConvType == HHC::eConvHangulHanja && m_bTryBothDirections) implGetConversionDirectionForCurrentPortion( m_eCurrentConversionDirection ); @@ -528,7 +528,7 @@ namespace editeng return sal_True; } } - while ( m_sCurrentPortion.getLength() ); + while ( !m_sCurrentPortion.isEmpty() ); // no more portions return sal_False; @@ -730,7 +730,7 @@ namespace editeng void HangulHanjaConversion_Impl::implChange( const ::rtl::OUString& _rChangeInto ) { - if( !_rChangeInto.getLength() ) + if( _rChangeInto.isEmpty() ) return; // translate the conversion format into a replacement action @@ -900,7 +900,7 @@ namespace editeng ::rtl::OUString sCurrentUnit( m_pConversionDialog->GetCurrentString() ); ::rtl::OUString sChangeInto( m_pConversionDialog->GetCurrentSuggestion( ) ); - if( sChangeInto.getLength() ) + if( !sChangeInto.isEmpty() ) { // change the current occurrence implChange( sChangeInto ); diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index ba14ec5f1297..d95a54b7840a 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -116,7 +116,7 @@ Sequence< OUString > lcl_RemoveMissingEntries( const OUString *pEntry = rCfgSvcs.getConstArray(); for (sal_Int32 i = 0; i < nEntries; ++i) { - if (pEntry[i].getLength() && lcl_FindEntry( pEntry[i], rAvailSvcs )) + if (!pEntry[i].isEmpty() && lcl_FindEntry( pEntry[i], rAvailSvcs )) pRes[ nCnt++ ] = pEntry[i]; } @@ -175,7 +175,7 @@ Sequence< OUString > lcl_GetNewEntries( const OUString *pEntry = rAvailSvcs.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - if (pEntry[i].getLength() && !lcl_FindEntry( pEntry[i], rLastFoundSvcs )) + if (!pEntry[i].isEmpty() && !lcl_FindEntry( pEntry[i], rLastFoundSvcs )) pRes[ nCnt++ ] = pEntry[i]; } @@ -202,7 +202,7 @@ Sequence< OUString > lcl_MergeSeq( const OUString *pEntry = rSeq.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - if (pEntry[i].getLength() && !lcl_FindEntry( pEntry[i], aRes )) + if (!pEntry[i].isEmpty() && !lcl_FindEntry( pEntry[i], aRes )) pRes[ nCnt++ ] = pEntry[i]; } } @@ -1272,7 +1272,7 @@ short SvxDicError( Window *pParent, sal_Int16 nError ) LanguageType SvxLocaleToLanguage( const Locale& rLocale ) { - if ( rLocale.Language.getLength() == 0 ) + if ( rLocale.Language.isEmpty() ) return LANGUAGE_NONE; return MsLangId::convertLocaleToLanguage( rLocale ); diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx index b4d5c8753832..0434bf76a588 100644 --- a/editeng/source/rtf/rtfgrf.cxx +++ b/editeng/source/rtf/rtfgrf.cxx @@ -297,7 +297,7 @@ sal_Bool SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) if( nShapePropertyBracket > 0 && nShapePropertyBracket > _nOpenBrakets ) { nShapePropertyBracket = -1; - if( sShapePropertyName.getLength() ) + if( !sShapePropertyName.isEmpty() ) { rPicType.aPropertyPairs.push_back( ::std::pair< OUString, OUString >( sShapePropertyName, sShapePropertyValue ) ); sShapePropertyName = sShapePropertyValue = ::rtl::OUString(); diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 1f3cee796ac6..1798b07240e9 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -434,7 +434,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() break; case ID_URLFIELD: - pData = new SvxURLField( mpImpl->msString3, mpImpl->msString1, mpImpl->msString1.getLength() ? SVXURLFORMAT_REPR : SVXURLFORMAT_URL ); + pData = new SvxURLField( mpImpl->msString3, mpImpl->msString1, !mpImpl->msString1.isEmpty() ? SVXURLFORMAT_REPR : SVXURLFORMAT_URL ); ((SvxURLField*)pData)->SetTargetFrame( mpImpl->msString2 ); if( mpImpl->mnInt16 >= SVXURLFORMAT_APPDEFAULT && mpImpl->mnInt16 <= SVXURLFORMAT_REPR ) ((SvxURLField*)pData)->SetFormat( (SvxURLFormat)mpImpl->mnInt16 ); @@ -476,7 +476,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() // mimic behaviour of writer, which means: // prefer CurrentPresentation over Content // if both are given. - if( mpImpl->msString1.getLength() ) + if( !mpImpl->msString1.isEmpty() ) aContent = mpImpl->msString1; else aContent = mpImpl->msString2; diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index a0f977157e83..fa5275f158e9 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -350,7 +350,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope OUString aStr; if( aVal >>= aStr ) { - if(aStr.getLength()) + if(!aStr.isEmpty()) { aFmt.SetBulletChar(aStr[0]); } -- cgit