diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-27 15:39:50 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-27 19:14:06 -0200 |
commit | 983de9808159036bd5de008d895ba6e5566c99f6 (patch) | |
tree | 171a9a802c0acace68e33e1db5593ede8ca5e9ae /xmloff | |
parent | 87842e4aa43ed66edfc400053ffac751f2e56bf7 (diff) |
Fix for fdo43460 Part LII getLength() to isEmpty()
Part LII
Modules
xmloff (part 5)
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtimppr.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtlists.cxx | 21 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 80 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 39 | ||||
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/text/txtvfldi.cxx | 4 |
7 files changed, 85 insertions, 85 deletions
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 84b7a6beb4d4..8c6d0aa635b1 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -173,7 +173,7 @@ void XMLTextImportPropertyMapper::FontFinished( { OUString sName; pFontFamilyNameState->maValue >>= sName; - if( !sName.getLength() ) + if( sName.isEmpty() ) pFontFamilyNameState->mnIndex = -1; } if( !pFontFamilyNameState || pFontFamilyNameState->mnIndex == -1 ) diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index b615933e22a1..0d414296700f 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -167,7 +167,7 @@ void XMLTextListsHelper::KeepListAsProcessed( ::rtl::OUString sListId, msListStyleOfLastProcessedList = sListStyleName; // Inconsistent behavior regarding lists (#i92811#) - if ( sListStyleDefaultListId.getLength() != 0 ) + if ( !sListStyleDefaultListId.isEmpty()) { if ( mpMapListIdToListStyleDefaultListId == 0 ) { @@ -264,14 +264,14 @@ const ::rtl::OUString& XMLTextListsHelper::GetListStyleOfLastProcessedList() con ::rtl::OUString XMLTextListsHelper::GetListIdForListBlock( XMLTextListBlockContext& rListBlock ) { ::rtl::OUString sListBlockListId( rListBlock.GetContinueListId() ); - if ( sListBlockListId.getLength() == 0 ) + if ( sListBlockListId.isEmpty() ) { sListBlockListId = rListBlock.GetListId(); } if ( mpMapListIdToListStyleDefaultListId != 0 ) { - if ( sListBlockListId.getLength() != 0 ) + if ( !sListBlockListId.isEmpty() ) { const ::rtl::OUString sListStyleName = GetListStyleOfProcessedList( sListBlockListId ); @@ -350,14 +350,14 @@ XMLTextListsHelper::GetNumberedParagraphListId( const sal_uInt16 i_Level, const ::rtl::OUString i_StyleName) { - if (!i_StyleName.getLength()) { + if (i_StyleName.isEmpty()) { OSL_FAIL("invalid numbered-paragraph: no style-name"); } - if (i_StyleName.getLength() + if (!i_StyleName.isEmpty() && (i_Level < mLastNumberedParagraphs.size()) && (mLastNumberedParagraphs[i_Level].first == i_StyleName) ) { - OSL_ENSURE(mLastNumberedParagraphs[i_Level].second.getLength(), + OSL_ENSURE(!mLastNumberedParagraphs[i_Level].second.isEmpty(), "internal error: numbered-paragraph style-name but no list-id?"); return mLastNumberedParagraphs[i_Level].second; } else { @@ -384,8 +384,8 @@ XMLTextListsHelper::EnsureNumberedParagraph( const ::rtl::OUString i_ListId, sal_Int16 & io_rLevel, const ::rtl::OUString i_StyleName) { - OSL_ENSURE(i_ListId.getLength(), "inavlid ListId"); - OSL_ENSURE(io_rLevel >= 0, "inavlid Level"); + OSL_ENSURE(!i_ListId.isEmpty(), "invalid ListId"); + OSL_ENSURE(io_rLevel >= 0, "invalid Level"); NumParaList_t & rNPList( mNPLists[i_ListId] ); const ::rtl::OUString none; // default if ( rNPList.empty() && (0 != io_rLevel)) { @@ -396,7 +396,7 @@ XMLTextListsHelper::EnsureNumberedParagraph( } // create num rule first because this might clamp the level... uno::Reference<container::XIndexReplace> xNumRules; - if ((0 == io_rLevel) || rNPList.empty() || i_StyleName.getLength()) { + if ((0 == io_rLevel) || rNPList.empty() || !i_StyleName.isEmpty()) { // no parent to inherit from, or explicit style given => new numrules! // index of parent: level - 1, but maybe that does not exist const size_t parent( std::min(static_cast<size_t>(io_rLevel), @@ -449,8 +449,7 @@ XMLTextListsHelper::MakeNumRule( static ::rtl::OUString s_NumberingRules( RTL_CONSTASCII_USTRINGPARAM("NumberingRules")); uno::Reference<container::XIndexReplace> xNumRules(i_rNumRule); - if ( i_StyleName.getLength() && - i_StyleName != i_ParentStyleName ) + if ( !i_StyleName.isEmpty() && i_StyleName != i_ParentStyleName ) { const ::rtl::OUString sDisplayStyleName( i_rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST, diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index ca23ab0b115a..5dab1cb232eb 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -526,7 +526,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, OUString sName; if( xNamed.is() ) sName = xNamed->getName(); - sal_Bool bAdd = !sName.getLength(); + sal_Bool bAdd = sName.isEmpty(); if( !bAdd ) { Reference < XPropertySet > xNumPropSet( xNumRule, @@ -598,7 +598,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, if( (xPropStates.size() - nIgnoreProps) > 0 ) { GetAutoStylePool().Add( nFamily, sParent, xPropStates, bDontSeek ); - if( sCondParent.getLength() && sParent != sCondParent ) + if( !sCondParent.isEmpty() && sParent != sCondParent ) GetAutoStylePool().Add( nFamily, sCondParent, xPropStates ); } } @@ -643,7 +643,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, OUString sName; if( xNamed.is() ) sName = xNamed->getName(); - sal_Bool bAdd = !sName.getLength(); + sal_Bool bAdd = sName.isEmpty(); if( !bAdd ) { Reference < XPropertySet > xNumPropSet( xNumRule, @@ -696,7 +696,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, if( find_if( xPropStates.begin(), xPropStates.end(), lcl_validPropState ) != xPropStates.end() ) { GetAutoStylePool().Add( nFamily, sParent, xPropStates ); - if( sCondParent.getLength() && sParent != sCondParent ) + if( !sCondParent.isEmpty() && sParent != sCondParent ) GetAutoStylePool().Add( nFamily, sCondParent, xPropStates ); } } @@ -774,7 +774,7 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink( case CTF_CHAR_STYLE_NAME: i->maValue >>= sName; i->mnIndex = -1; - rbHasCharStyle = sName.getLength() > 0; + rbHasCharStyle = !sName.isEmpty(); if( nIgnoreProps ) aSecondDel = i; else @@ -814,7 +814,7 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink( } OUString sParent; // AutoStyles should not have parents! sName = GetAutoStylePool().Find( XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates ); - DBG_ASSERT( sName.getLength(), "AutoStyle could not be found" ); + DBG_ASSERT( !sName.isEmpty(), "AutoStyle could not be found" ); rbHasAutoStyle = sal_True; } @@ -909,7 +909,7 @@ void XMLTextParagraphExport::exportListChange( { if ( bExportODF && eODFDefaultVersion >= SvtSaveOptions::ODFVER_012 && - sListId.getLength() > 0 ) + !sListId.isEmpty() ) { /* Property text:id at element <text:list> has to be replaced by property xml:id (#i92221#) @@ -928,7 +928,7 @@ void XMLTextParagraphExport::exportListChange( mpTextListsHelper->GenerateNewListId() ); if ( bExportODF && eODFDefaultVersion >= SvtSaveOptions::ODFVER_012 && - sListId.getLength() > 0 ) + !sListId.isEmpty() ) { /* Property text:id at element <text:list> has to be replaced by property xml:id (#i92221#) @@ -959,7 +959,7 @@ void XMLTextParagraphExport::exportListChange( { if ( bExportODF && eODFDefaultVersion >= SvtSaveOptions::ODFVER_012 && - sListId.getLength() > 0 ) + !sListId.isEmpty() ) { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_CONTINUE_LIST, @@ -1066,7 +1066,7 @@ void XMLTextParagraphExport::exportListChange( // export of <text:number> element for last opened <text:list-item>, if requested if ( GetExport().exportTextNumberElement() && eLName == XML_LIST_ITEM && nListLevelsToBeOpened == 1 && // last iteration --> last opened <text:list-item> - rNextInfo.ListLabelString().getLength() > 0 ) + !rNextInfo.ListLabelString().isEmpty() ) { const ::rtl::OUString aTextNumberElem = OUString( GetExport().GetNamespaceMap().GetQNameByKey( @@ -1142,7 +1142,7 @@ void XMLTextParagraphExport::exportListChange( // export of <text:number> element for <text:list-item>, if requested if ( GetExport().exportTextNumberElement() && - rNextInfo.ListLabelString().getLength() > 0 ) + !rNextInfo.ListLabelString().isEmpty() ) { const ::rtl::OUString aTextNumberElem = OUString( GetExport().GetNamespaceMap().GetQNameByKey( @@ -1616,7 +1616,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres OUString sName; if( xNamed.is() ) sName = xNamed->getName(); - sal_Bool bAdd = !sName.getLength(); + sal_Bool bAdd = sName.isEmpty(); if( !bAdd ) { Reference < XPropertySet > xNumPropSet( xNumRule, @@ -1959,7 +1959,7 @@ void XMLTextParagraphExport::exportParagraph( if( xRef.is() ) { const OUString& rIdentifier = GetExport().getInterfaceToIdentifierMapper().getIdentifier( xRef ); - if( rIdentifier.getLength() ) + if( !rIdentifier.isEmpty() ) { // FIXME: this is just temporary until EditEngine // paragraphs implement XMetadatable. @@ -1976,7 +1976,7 @@ void XMLTextParagraphExport::exportParagraph( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, sStyle ); - if( sAutoStyle.getLength() ) + if( !sAutoStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sAutoStyle ) ); @@ -1993,7 +1993,7 @@ void XMLTextParagraphExport::exportParagraph( { sCondStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, sCondStyle ); - if( sCondStyle.getLength() ) + if( !sCondStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_COND_STYLE_NAME, GetExport().EncodeStyleName( sCondStyle ) ); @@ -2477,7 +2477,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( if( xNamed.is() ) { OUString sName( xNamed->getName() ); - if( sName.getLength() ) + if( !sName.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName() ); } @@ -2733,11 +2733,11 @@ void XMLTextParagraphExport::exportAnyTextFrame( *pRangePropSet ), bHasAutoStyle, *pRangePropSet, sCharStyleNames ); - if( sStyle.getLength() ) + if( !sStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sStyle ) ); { - SvXMLElementExport aElem( GetExport(), sStyle.getLength() > 0, + SvXMLElementExport aElem( GetExport(), !sStyle.isEmpty(), XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); { SvXMLElementExport aElement( GetExport(), @@ -2789,7 +2789,7 @@ void XMLTextParagraphExport::_exportTextFrame( OUString sAutoStyle( sStyle ); OUString aMinHeightValue; sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); - if( sAutoStyle.getLength() ) + if( !sAutoStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, GetExport().EncodeStyleName( sAutoStyle ) ); addTextFrameAttributes( rPropSet, sal_False, &aMinHeightValue ); @@ -2797,7 +2797,7 @@ void XMLTextParagraphExport::_exportTextFrame( SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, XML_FRAME, sal_False, sal_True ); - if( aMinHeightValue.getLength() ) + if( !aMinHeightValue.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT, aMinHeightValue ); @@ -2805,7 +2805,7 @@ void XMLTextParagraphExport::_exportTextFrame( if( rPropSetInfo->hasPropertyByName( sChainNextName ) ) { OUString sNext; - if( (rPropSet->getPropertyValue( sChainNextName ) >>= sNext) && sNext.getLength() > 0 ) + if( (rPropSet->getPropertyValue( sChainNextName ) >>= sNext) && !sNext.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_CHAIN_NEXT_NAME, sNext ); @@ -2970,7 +2970,7 @@ void XMLTextParagraphExport::_exportTextGraphic( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); - if( sAutoStyle.getLength() ) + if( !sAutoStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, GetExport().EncodeStyleName( sAutoStyle ) ); addTextFrameAttributes( rPropSet, sal_False ); @@ -3000,7 +3000,7 @@ void XMLTextParagraphExport::_exportTextGraphic( setTextEmbeddedGraphicURL( rPropSet, sURL ); // If there still is no url, then then graphic is empty - if( sURL.getLength() ) + if( !sURL.isEmpty() ) { GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL ); GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); @@ -3012,7 +3012,7 @@ void XMLTextParagraphExport::_exportTextGraphic( // draw:filter-name OUString sGrfFilter; rPropSet->getPropertyValue( sGraphicFilter ) >>= sGrfFilter; - if( sGrfFilter.getLength() ) + if( !sGrfFilter.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_FILTER_NAME, sGrfFilter ); @@ -3072,7 +3072,7 @@ void XMLTextParagraphExport::exportTitleAndDescription( { OUString sObjTitle; rPropSet->getPropertyValue( sTitle ) >>= sObjTitle; - if( sObjTitle.getLength() ) + if( !sObjTitle.isEmpty() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, XML_TITLE, sal_True, sal_False ); @@ -3085,7 +3085,7 @@ void XMLTextParagraphExport::exportTitleAndDescription( { OUString sObjDesc; rPropSet->getPropertyValue( sDescription ) >>= sObjDesc; - if( sObjDesc.getLength() ) + if( !sObjDesc.isEmpty() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, XML_DESC, sal_True, sal_False ); @@ -3115,7 +3115,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( { rPropSet->getPropertyValue( sHyperLinkURL ) >>= sHRef; - if( sHRef.getLength() > 0 ) + if( !sHRef.isEmpty() ) bExport = sal_True; } @@ -3124,7 +3124,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( rPropState->getPropertyState( sHyperLinkName ) ) ) { rPropSet->getPropertyValue( sHyperLinkName ) >>= sName; - if( sName.getLength() > 0 ) + if( !sName.isEmpty() ) bExport = sal_True; } @@ -3133,7 +3133,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( rPropState->getPropertyState( sHyperLinkTarget ) ) ) { rPropSet->getPropertyValue( sHyperLinkTarget ) >>= sTargetFrame; - if( sTargetFrame.getLength() ) + if( !sTargetFrame.isEmpty() ) bExport = sal_True; } @@ -3151,7 +3151,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( rPropState->getPropertyState( sUnvisitedCharStyleName ) ) ) { rPropSet->getPropertyValue( sUnvisitedCharStyleName ) >>= sUStyleName; - if( sUStyleName.getLength() ) + if( !sUStyleName.isEmpty() ) bExport = sal_True; } @@ -3160,7 +3160,7 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( rPropState->getPropertyState( sVisitedCharStyleName ) ) ) { rPropSet->getPropertyValue( sVisitedCharStyleName ) >>= sVStyleName; - if( sVStyleName.getLength() ) + if( !sVStyleName.isEmpty() ) bExport = sal_True; } @@ -3169,10 +3169,10 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference( sHRef ) ); - if( sName.getLength() > 0 ) + if( !sName.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, sName ); - if( sTargetFrame.getLength() ) + if( !sTargetFrame.isEmpty() ) { GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargetFrame ); @@ -3186,11 +3186,11 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_SERVER_MAP, XML_TRUE ); - if( sUStyleName.getLength() ) + if( !sUStyleName.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sUStyleName ) ); - if( sVStyleName.getLength() ) + if( !sVStyleName.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_VISITED_STYLE_NAME, GetExport().EncodeStyleName( sVStyleName ) ); } @@ -3246,12 +3246,12 @@ void XMLTextParagraphExport::exportTextRange( xPropSet, sCharStyleNames ); OUString aText(rTextRange->getString()); - if( sStyle.getLength() ) + if( !sStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sStyle ) ); { // in a block to make sure it is destroyed before the text:a element - SvXMLElementExport aElement( GetExport(), sStyle.getLength() > 0, + SvXMLElementExport aElement( GetExport(), !sStyle.isEmpty(), XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); exportText( aText, rPrevCharIsSpace ); @@ -3414,7 +3414,7 @@ void XMLTextParagraphExport::exportTextDeclarations() sIndexAutoMarkFileURL)) { xPropertySet->getPropertyValue(sIndexAutoMarkFileURL) >>= sUrl; - if (sUrl.getLength() > 0) + if (!sUrl.isEmpty()) { GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(sUrl) ); @@ -3542,7 +3542,7 @@ void XMLTextParagraphExport::exportRuby( OUString sEmpty; OUString sStyleName(Find( XML_STYLE_FAMILY_TEXT_RUBY, rPropSet, sEmpty )); - DBG_ASSERT(sStyleName.getLength() > 0, "I can't find the style!"); + DBG_ASSERT(!sStyleName.isEmpty(), "I can't find the style!"); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, sStyleName); @@ -3568,7 +3568,7 @@ void XMLTextParagraphExport::exportRuby( // write the ruby text (with char style) { - if (sOpenRubyCharStyle.getLength() > 0) + if (!sOpenRubyCharStyle.isEmpty()) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sOpenRubyCharStyle) ); diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 409016e5049c..721e03b14ebb 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -418,7 +418,7 @@ XMLImpHyperlinkContext_Impl::XMLImpHyperlinkContext_Impl( } } - if( sShow.getLength() && !pHint->GetTargetFrameName().getLength() ) + if( !sShow.isEmpty() && pHint->GetTargetFrameName().isEmpty() ) { if( IsXMLToken( sShow, XML_NEW ) ) pHint->SetTargetFrameName( @@ -910,7 +910,7 @@ void XMLMetaImportContext::InsertMeta( { OSL_ENSURE(!m_bHaveAbout == !m_sProperty.getLength(), "XMLMetaImportContext::InsertMeta: invalid RDFa?"); - if (m_XmlId.getLength() || (m_bHaveAbout && m_sProperty.getLength())) + if (!m_XmlId.isEmpty() || (m_bHaveAbout && !m_sProperty.isEmpty())) { // insert mark const uno::Reference<rdf::XMetadatable> xMeta( @@ -989,7 +989,7 @@ void XMLMetaFieldImportContext::ProcessAttribute(sal_uInt16 const i_nPrefix, void XMLMetaFieldImportContext::InsertMeta( const Reference<XTextRange> & i_xInsertionRange) { - if (m_XmlId.getLength()) // valid? + if (!m_XmlId.isEmpty()) // valid? { // insert mark const Reference<XPropertySet> xPropertySet( @@ -1003,7 +1003,7 @@ void XMLMetaFieldImportContext::InsertMeta( OSL_ENSURE(xPropertySet.is(), "cannot insert MetaField?"); if (!xPropertySet.is()) return; - if (m_DataStyleName.getLength()) + if (!m_DataStyleName.isEmpty()) { sal_Bool isDefaultLanguage(sal_True); @@ -1144,7 +1144,7 @@ void XMLIndexMarkImportContext_Impl::StartElement( if (CreateMark(xMark, sService)) { ProcessAttributes(xAttrList, xMark); - if (sID.getLength() > 0) + if (!sID.isEmpty()) { // process only if we find an ID XMLHint_Impl* pHint = @@ -1165,7 +1165,7 @@ void XMLIndexMarkImportContext_Impl::StartElement( // call process attributes with empty XPropertySet: ProcessAttributes(xAttrList, xMark); - if (sID.getLength() > 0) + if (!sID.isEmpty()) { // if we have an ID, find the hint and set the end position sal_uInt16 nCount = rHints.Count(); @@ -1596,7 +1596,7 @@ XMLImpSpanContext_Impl::XMLImpSpanContext_Impl( aStyleName = xAttrList->getValueByIndex( i ); } - if( aStyleName.getLength() ) + if( !aStyleName.isEmpty() ) { pHint = new XMLStyleHint_Impl( aStyleName, GetImport().GetTextImport()->GetCursorAsRange()->getStart() ); @@ -1993,9 +1993,9 @@ XMLParaContext::XMLParaContext( } } - if( aCondStyleName.getLength() ) + if( !aCondStyleName.isEmpty() ) sStyleName = aCondStyleName; - else if( sClassNames.getLength() ) + else if( !sClassNames.isEmpty() ) { sal_Int32 nDummy = 0; sStyleName = sClassNames.getToken( 0, ' ', nDummy ); @@ -2015,7 +2015,7 @@ XMLParaContext::~XMLParaContext() // paragraph and register it with the given identifier // FIXME: this is just temporary, and should be removed when // EditEngine paragraphs implement XMetadatable! - if (m_sXmlId.getLength()) + if (!m_sXmlId.isEmpty()) { Reference < XTextCursor > xIdCursor( xTxtImport->GetText()->createTextCursorByRange( xStart ) ); if( xIdCursor.is() ) @@ -2038,7 +2038,7 @@ XMLParaContext::~XMLParaContext() xAttrCursor->gotoRange( xEnd, sal_True ); // xml:id for RDF metadata - if (m_sXmlId.getLength() || m_bHaveAbout || m_sProperty.getLength()) + if (!m_sXmlId.isEmpty() || m_bHaveAbout || !m_sProperty.isEmpty()) { try { const uno::Reference<container::XEnumerationAccess> xEA @@ -2064,7 +2064,7 @@ XMLParaContext::~XMLParaContext() } OUString const sCellParaStyleName(xTxtImport->GetCellParaStyleDefault()); - if( sCellParaStyleName.getLength() > 0 ) + if( !sCellParaStyleName.isEmpty() ) { /* Suppress handling of outline and list attributes, because of side effects of method <SetStyleAndAttrs(..)> (#i80724#) @@ -2077,7 +2077,7 @@ XMLParaContext::~XMLParaContext() } // #103445# for headings without style name, find the proper style - if( bHeading && (sStyleName.getLength() == 0) ) + if( bHeading && sStyleName.isEmpty() ) xTxtImport->FindOutlineStyleName( sStyleName, nOutlineLevel ); // set style and hard attributes at the previous paragraph @@ -2143,7 +2143,7 @@ XMLParaContext::~XMLParaContext() { const OUString& rStyleName = ((XMLStyleHint_Impl *)pHint)->GetStyleName(); - if( rStyleName.getLength() ) + if( !rStyleName.isEmpty() ) xTxtImport->SetStyleAndAttrs( GetImport(), xAttrCursor, rStyleName, sal_False ); @@ -2153,7 +2153,7 @@ XMLParaContext::~XMLParaContext() { const OUString& rRefName = ((XMLReferenceHint_Impl *)pHint)->GetRefName(); - if( rRefName.getLength() ) + if( !rRefName.isEmpty() ) { if( !pHint->GetEnd().is() ) pHint->SetEnd(xEnd); @@ -2378,14 +2378,15 @@ XMLNumberedParaContext::XMLNumberedParaContext( XMLTextListsHelper& rTextListsHelper( i_rImport.GetTextImport()->GetTextListHelper() ); - if (!m_ListId.getLength()) { + if (m_ListId.isEmpty()) + { OSL_ENSURE( ! i_rImport.GetODFVersion().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("1.2") ), "invalid numbered-paragraph: no list-id (1.2)"); m_ListId = rTextListsHelper.GetNumberedParagraphListId(m_Level, StyleName); - OSL_ENSURE(m_ListId.getLength(), "numbered-paragraph: no ListId"); - if (!m_ListId.getLength()) { + OSL_ENSURE(!m_ListId.isEmpty(), "numbered-paragraph: no ListId"); + if (m_ListId.isEmpty()) { return; } } @@ -2403,7 +2404,7 @@ XMLNumberedParaContext::~XMLNumberedParaContext() void XMLNumberedParaContext::EndElement() { - if (m_ListId.getLength()) { + if (!m_ListId.isEmpty()) { GetImport().GetTextImport()->PopListContext(); } } diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 939536f18741..240afeffeb07 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -584,7 +584,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( { if( *(sal_Bool *)rValue.getValue() ) { - if( !rStrExpValue.getLength() || + if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) { rStrExpValue = sVal; @@ -599,7 +599,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( rStrExpValue = aOut.makeStringAndClear(); } } - else if( !rStrExpValue.getLength() ) + else if( rStrExpValue.isEmpty() ) { rStrExpValue = GetXMLToken( XML_NONE ); } @@ -842,7 +842,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( { if( *(sal_Bool *)rValue.getValue() ) { - if( !rStrExpValue.getLength() || + if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) { rStrExpValue = sVal; @@ -867,7 +867,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( rStrExpValue = aOut.makeStringAndClear(); } } - else if( !rStrExpValue.getLength() ) + else if( rStrExpValue.isEmpty() ) { rStrExpValue = GetXMLToken( XML_NONE ); } @@ -1015,7 +1015,7 @@ sal_Bool XMLTextCombineCharPropHdl_Impl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - if( rStrImpValue.getLength() ) + if( !rStrImpValue.isEmpty() ) rValue <<= rStrImpValue.copy( 0, 1 ); else rValue <<= rStrImpValue; diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 18255c376ad8..61be66650e5f 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -231,7 +231,7 @@ void XMLTextStyleContext::CreateAndInsert( sal_Bool bOverwrite ) sal_uInt16 nCategory = ParagraphStyleCategory::TEXT; if( XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() && - sCategoryVal.getLength() && xStyle->isUserDefined() && + !sCategoryVal.isEmpty() && xStyle->isUserDefined() && xPropSetInfo->hasPropertyByName( sCategory ) && SvXMLUnitConverter::convertEnum( nCategory, sCategoryVal, aCategoryMap ) ) { @@ -283,7 +283,7 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite ) // Consider set empty list style (#i69523#) if ( !( mbListStyleSet || nOutlineLevel >= 0 || - sDropCapTextStyleName.getLength() || + !sDropCapTextStyleName.isEmpty() || bHasMasterPageName ) || !xStyle.is() || !( bOverwrite || IsNew() ) ) @@ -335,7 +335,7 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite ) if ( bApplyListStyle ) { - if ( !sListStyleName.getLength() ) + if ( sListStyleName.isEmpty() ) { Any aAny; aAny <<= sListStyleName /* empty string */; @@ -363,7 +363,7 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite ) } } - if( sDropCapTextStyleName.getLength() ) + if( !sDropCapTextStyleName.isEmpty() ) { // change list style name to display name OUString sDisplayDropCapTextStyleName( @@ -390,7 +390,7 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite ) // The families cointaner must exist const Reference < XNameContainer >& rPageStyles = GetImport().GetTextImport()->GetPageStyles(); - if( ( !sDisplayName.getLength() || + if( ( sDisplayName.isEmpty() || (rPageStyles.is() && rPageStyles->hasByName( sDisplayName )) ) && xPropSetInfo->hasPropertyByName( sPageDescName ) ) @@ -445,7 +445,7 @@ void XMLTextStyleContext::FillPropertySet( ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) { bAutomatic = true; - if( GetAutoName().getLength() ) + if( !GetAutoName().isEmpty() ) { OUString sAutoProp = ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT ) ? OUString( RTL_CONSTASCII_USTRINGPARAM("CharAutoStyleName") ): @@ -526,7 +526,7 @@ void XMLTextStyleContext::FillPropertySet( // if necessary. OUString sFontName; rAny >>= sFontName; - if ( sFontName.getLength() > 0 ) + if ( !sFontName.isEmpty() ) { OUString sStarBats( RTL_CONSTASCII_USTRINGPARAM("StarBats" ) ); OUString sStarMath( RTL_CONSTASCII_USTRINGPARAM("StarMath" ) ); diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 9b2c4e87887e..6ab8937e9a5a 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -330,11 +330,11 @@ void XMLSetVarFieldImportContext::EndElement() // call field or master depending on variable // PrepareMaster() in addition to PrepareField() - DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!"); + DBG_ASSERT(!GetServiceName().isEmpty(), "no service name for element!"); if (bValid) { - DBG_ASSERT(GetName().getLength()>0, "variable name needed!"); + DBG_ASSERT(!GetName().isEmpty(), "variable name needed!"); // find field master Reference<XPropertySet> xMaster; |