summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2012-01-26 17:05:51 -0200
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-01-26 19:19:41 -0200
commit596469d4183ff451833348cb4454ad0d02e0138f (patch)
tree74bdef7370f3d0be408487ebeacab00e7dafa4fe /xmloff/source
parentdfa8287f8bbb6c523266237ff67eb4b3d07b5c8b (diff)
Fix for fdo43460 Part LI getLength() to isEmpty()
Part LI Modules xmloff (part 4)
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/table/XMLTableExport.cxx14
-rw-r--r--xmloff/source/table/XMLTableImport.cxx10
-rw-r--r--xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx8
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx5
-rw-r--r--xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx5
-rw-r--r--xmloff/source/text/XMLIndexMarkExport.cxx4
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTabStopEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexUserSourceContext.cxx2
-rw-r--r--xmloff/source/text/XMLLineNumberingExport.cxx4
-rw-r--r--xmloff/source/text/XMLPropertyBackpatcher.cxx2
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx8
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx34
-rw-r--r--xmloff/source/text/XMLSectionFootnoteConfigExport.cxx4
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionSourceImportContext.cxx4
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx45
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx14
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx8
-rw-r--r--xmloff/source/text/XMLTextMasterPageContext.cxx8
-rw-r--r--xmloff/source/text/XMLTextNumRuleInfo.cxx7
-rw-r--r--xmloff/source/text/txtdrope.cxx4
-rw-r--r--xmloff/source/text/txtexppr.cxx9
-rw-r--r--xmloff/source/text/txtflde.cxx32
-rw-r--r--xmloff/source/text/txtfldi.cxx8
-rw-r--r--xmloff/source/text/txtftne.cxx10
-rw-r--r--xmloff/source/text/txtimp.cxx52
29 files changed, 152 insertions, 159 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 1a0934a0c7ad..992a7c4355b3 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -287,7 +287,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
else
sStyleName = sParentStyleName;
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
Reference< XInterface > xKey( xCellSet, UNO_QUERY );
pTableInfo->maCellStyleMap[xKey] = sStyleName;
@@ -295,7 +295,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
// create auto style for text
Reference< XText > xText(xCellSet, UNO_QUERY);
- if(xText.is() && xText->getString().getLength())
+ if(xText.is() && !xText->getString().isEmpty())
GetExport().GetTextParagraphExport()->collectTextAutoStyles( xText );
aStringStatistic.add( sStyleName );
@@ -354,11 +354,11 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
{
Reference< XInterface > xKey( xCellRange, UNO_QUERY );
const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] );
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName );
sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex];
- if( sDefaultCellStyle.getLength() )
+ if( !sDefaultCellStyle.isEmpty() )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle );
}
@@ -401,7 +401,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
{
Reference< XInterface > xKey( xColumnProperties, UNO_QUERY );
const OUString sStyleName( pTableInfo->maColumnStyleMap[xKey] );
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName );
}
@@ -430,7 +430,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
// table:style-name
Reference< XInterface > xKey( xCell, UNO_QUERY );
const OUString sStyleName( pTableInfo->maCellStyleMap[xKey] );
- if( sStyleName.getLength() && (sStyleName != rDefaultCellStyle) )
+ if( !sStyleName.isEmpty() && (sStyleName != rDefaultCellStyle) )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName );
}
@@ -475,7 +475,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
void XMLTableExport::ImpExportText( const Reference< XCell >& xCell )
{
Reference< XText > xText( xCell, UNO_QUERY );
- if( xText.is() && xText->getString().getLength())
+ if( xText.is() && !xText->getString().isEmpty())
mrExport.GetTextParagraphExport()->exportText( xText );
}
diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx
index c84520c77900..399d2147dd02 100644
--- a/xmloff/source/table/XMLTableImport.cxx
+++ b/xmloff/source/table/XMLTableImport.cxx
@@ -410,7 +410,7 @@ void XMLTableImportContext::InitColumns()
{
boost::shared_ptr< ColumnInfo > xInfo( maColumnInfos[nCol] );
- if( pAutoStyles && xInfo->msStyleName.getLength() )
+ if( pAutoStyles && !xInfo->msStyleName.isEmpty() )
{
const XMLPropStyleContext* pStyle =
dynamic_cast< const XMLPropStyleContext* >(
@@ -492,7 +492,7 @@ SvXMLImportContext * XMLTableImportContext::ImportRow( sal_uInt16 nPrefix, const
}
}
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
SvXMLStylesContext * pAutoStyles = GetImport().GetShapeImport()->GetAutoStylesContext();
if( pAutoStyles )
@@ -608,7 +608,7 @@ OUString XMLTableImportContext::GetDefaultCellStyleName() const
OUString sStyleName( msDefaultCellStyleName );
// if there is still no style name, try default style name from column
- if( (sStyleName.getLength() == 0) && (mnCurrentColumn < sal::static_int_cast<sal_Int32>(maColumnInfos.size())) )
+ if( (sStyleName.isEmpty()) && (mnCurrentColumn < sal::static_int_cast<sal_Int32>(maColumnInfos.size())) )
sStyleName = maColumnInfos[mnCurrentColumn]->msDefaultCellStyleName;
return sStyleName;
@@ -666,10 +666,10 @@ XMLCellImportContext::XMLCellImportContext( SvXMLImport& rImport, const Referenc
}
// if there is no style name at the cell, try default style name from row
- if( sStyleName.getLength() == 0 )
+ if( sStyleName.isEmpty() )
sStyleName = sDefaultCellStyleName;
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
SvXMLStylesContext * pAutoStyles = GetImport().GetShapeImport()->GetAutoStylesContext();
if( pAutoStyles )
diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
index d8f34b3097bb..236ae27e7719 100644
--- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
@@ -375,28 +375,28 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings(
{
Any aAny;
- if (sCitationStyle.getLength() > 0)
+ if (!sCitationStyle.isEmpty())
{
aAny <<= GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, sCitationStyle );
rConfig->setPropertyValue(sPropertyCharStyleName, aAny);
}
- if (sAnchorStyle.getLength() > 0)
+ if (!sAnchorStyle.isEmpty())
{
aAny <<= GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, sAnchorStyle );
rConfig->setPropertyValue(sPropertyAnchorCharStyleName, aAny);
}
- if (sPageStyle.getLength() > 0)
+ if (!sPageStyle.isEmpty())
{
aAny <<= GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_MASTER_PAGE, sPageStyle );
rConfig->setPropertyValue(sPropertyPageStyleName, aAny);
}
- if (sDefaultStyle.getLength() > 0)
+ if (!sDefaultStyle.isEmpty())
{
aAny <<= GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_PARAGRAPH, sDefaultStyle );
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
index 28c799cb41b9..fc7fa4ded6c5 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
@@ -232,14 +232,13 @@ void XMLIndexAlphabeticalSourceContext::EndElement()
rIndexPropertySet->setPropertyValue(sIsCommaSeparated, aAny);
- if (sAlgorithm.getLength() > 0)
+ if (!sAlgorithm.isEmpty())
{
aAny <<= sAlgorithm;
rIndexPropertySet->setPropertyValue(sSortAlgorithm, aAny);
}
- if ( (aLocale.Language.getLength() > 0) &&
- (aLocale.Country.getLength() > 0) )
+ if ( !aLocale.Language.isEmpty() && !aLocale.Country.isEmpty() )
{
aAny <<= aLocale;
rIndexPropertySet->setPropertyValue(sLocale, aAny);
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index e5963f707161..254c00dce3ba 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -267,14 +267,13 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(sal_Bool)
aAny.setValue(&bSortByPosition, ::getBooleanCppuType());
xPropSet->setPropertyValue(sIsSortByPosition, aAny);
- if( (aLocale.Language.getLength() > 0) &&
- (aLocale.Country.getLength() > 0) )
+ if( !aLocale.Language.isEmpty() && !aLocale.Country.isEmpty() )
{
aAny <<= aLocale;
xPropSet->setPropertyValue(sLocale, aAny);
}
- if( sAlgorithm.getLength() > 0 )
+ if( !sAlgorithm.isEmpty() )
{
aAny <<= sAlgorithm;
xPropSet->setPropertyValue(sSortAlgorithm, aAny);
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx
index 71171bb88862..d7bc9321fbf7 100644
--- a/xmloff/source/text/XMLIndexMarkExport.cxx
+++ b/xmloff/source/text/XMLIndexMarkExport.cxx
@@ -113,7 +113,7 @@ void XMLIndexMarkExport::ExportIndexMark(
aAny = xIndexMarkPropSet->getPropertyValue(sAlternativeText);
OUString sTmp;
aAny >>= sTmp;
- DBG_ASSERT(sTmp.getLength() > 0,
+ DBG_ASSERT(!sTmp.isEmpty(),
"collapsed index mark without alternative text");
rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STRING_VALUE, sTmp);
}
@@ -203,7 +203,7 @@ void lcl_ExportPropertyString( SvXMLExport& rExport,
OUString sValue;
if( rAny >>= sValue )
{
- if( sValue.getLength() > 0 )
+ if( !sValue.isEmpty() )
{
rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
}
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index a0e7ba36aa93..4662c87182d1 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -261,7 +261,7 @@ void XMLIndexTOCContext::StartElement(
aAny.setValue( &bProtected, ::getBooleanCppuType() );
xTOCPropertySet->setPropertyValue( sIsProtected, aAny );
- if (sIndexName.getLength() > 0)
+ if (!sIndexName.isEmpty())
{
aAny <<= sIndexName;
xTOCPropertySet->setPropertyValue( sName, aAny );
diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
index 3b11834ec43a..7c5f0350a41b 100644
--- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
@@ -109,7 +109,7 @@ void XMLIndexTabStopEntryContext::StartElement(
{
sLeaderChar = sAttr;
// valid only, if we have a char!
- bLeaderCharOK = (sAttr.getLength() > 0);
+ bLeaderCharOK = !sAttr.isEmpty();
}
// #i21237#
else if ( IsXMLToken( sLocalName, XML_WITH_TAB ) )
diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx
index 0f750eef158f..97e02b541310 100644
--- a/xmloff/source/text/XMLIndexUserSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx
@@ -194,7 +194,7 @@ void XMLIndexUserSourceContext::EndElement()
aAny.setValue(&bUseLevelParagraphStyles, ::getBooleanCppuType());
rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny);
- if( sIndexName.getLength() > 0 )
+ if( !sIndexName.isEmpty() )
{
aAny <<= sIndexName;
rIndexPropertySet->setPropertyValue(sUserIndexName, aAny);
diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx
index aa7f1e9780c4..295ca6b30671 100644
--- a/xmloff/source/text/XMLLineNumberingExport.cxx
+++ b/xmloff/source/text/XMLLineNumberingExport.cxx
@@ -93,7 +93,7 @@ void XMLLineNumberingExport::Export()
aAny = xLineNumbering->getPropertyValue(sCharStyleName);
OUString sTmp;
aAny >>= sTmp;
- if (sTmp.getLength() > 0)
+ if (!sTmp.isEmpty())
{
rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME,
rExport.EncodeStyleName( sTmp ));
@@ -189,7 +189,7 @@ void XMLLineNumberingExport::Export()
aAny = xLineNumbering->getPropertyValue(sSeparatorText);
OUString sSeparator;
aAny >>= sSeparator;
- if (sSeparator.getLength() > 0)
+ if (!sSeparator.isEmpty())
{
// SeparatorInterval
diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx
index fadec64cddb2..0d8beec53194 100644
--- a/xmloff/source/text/XMLPropertyBackpatcher.cxx
+++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx
@@ -61,7 +61,7 @@ XMLPropertyBackpatcher<A>::XMLPropertyBackpatcher(
A aDef)
: sPropertyName(sPropName)
, bDefaultHandling(bDefault)
-, bPreserveProperty(sPreserveName.getLength()>0)
+, bPreserveProperty(!sPreserveName.isEmpty())
, sPreservePropertyName(sPreserveName)
, aDefault(aDef)
{
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 244fd5bbc4c4..007aac138589 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -483,7 +483,7 @@ void XMLRedlineExport::ExportChangeInfo(
Any aAny = rPropSet->getPropertyValue(sRedlineAuthor);
OUString sTmp;
aAny >>= sTmp;
- if (sTmp.getLength() > 0)
+ if (!sTmp.isEmpty())
{
SvXMLElementExport aCreatorElem( rExport, XML_NAMESPACE_DC,
XML_CREATOR, sal_True,
@@ -523,7 +523,7 @@ void XMLRedlineExport::ExportChangeInfo(
{
OUString sTmp;
rVal.Value >>= sTmp;
- if (sTmp.getLength() > 0)
+ if (!sTmp.isEmpty())
{
rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp);
}
@@ -607,7 +607,7 @@ void XMLRedlineExport::ExportStartOrEndRedline(
if( bIdOK )
{
- DBG_ASSERT( sId.getLength() > 0, "Redlines must have IDs" );
+ DBG_ASSERT( !sId.isEmpty(), "Redlines must have IDs" );
// TODO: use GetRedlineID or elimiate that function
OUStringBuffer sBuffer(sChangePrefix);
@@ -658,7 +658,7 @@ void XMLRedlineExport::ExportStartOrEndRedline(
void XMLRedlineExport::WriteComment(const OUString& rComment)
{
- if (rComment.getLength() > 0)
+ if (!rComment.isEmpty())
{
// iterate over all string-pieces separated by return (0x0a) and
// put each inside a paragraph element.
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index 83ea374d8bec..77244e31168c 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -439,7 +439,7 @@ void XMLSectionExport::ExportRegularSectionStart(
OUString sCond;
aAny >>= sCond;
enum XMLTokenEnum eDisplay = XML_TOKEN_INVALID;
- if (sCond.getLength() > 0)
+ if (!sCond.isEmpty())
{
OUString sQValue =
GetExport().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOOW,
@@ -495,23 +495,23 @@ void XMLSectionExport::ExportRegularSectionStart(
OUString sRegionName;
aAny >>= sRegionName;
- if ( (aFileLink.FileURL.getLength() > 0) ||
- (aFileLink.FilterName.getLength() > 0) ||
- (sRegionName.getLength() > 0) )
+ if ( !aFileLink.FileURL.isEmpty() ||
+ !aFileLink.FilterName.isEmpty() ||
+ !sRegionName.isEmpty())
{
- if (aFileLink.FileURL.getLength() > 0)
+ if (!aFileLink.FileURL.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF,
GetExport().GetRelativeReference( aFileLink.FileURL) );
}
- if (aFileLink.FilterName.getLength() > 0)
+ if (!aFileLink.FilterName.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FILTER_NAME,
aFileLink.FilterName);
}
- if (sRegionName.getLength() > 0)
+ if (!sRegionName.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_SECTION_NAME,
sRegionName);
@@ -539,9 +539,9 @@ void XMLSectionExport::ExportRegularSectionStart(
OUString sItem;
aAny >>= sItem;
- if ( (sApplication.getLength() > 0) ||
- (sTopic.getLength() > 0) ||
- (sItem.getLength() > 0 ) )
+ if ( !sApplication.isEmpty() ||
+ !sTopic.isEmpty() ||
+ !sItem.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_OFFICE,
XML_DDE_APPLICATION, sApplication);
@@ -682,7 +682,7 @@ void XMLSectionExport::ExportAlphabeticalIndexStart(
aAny = rPropertySet->getPropertyValue(sMainEntryCharacterStyleName);
OUString sStyleName;
aAny >>= sStyleName;
- if (sStyleName.getLength())
+ if (!sStyleName.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_TEXT,
XML_MAIN_ENTRY_STYLE_NAME,
@@ -711,7 +711,7 @@ void XMLSectionExport::ExportAlphabeticalIndexStart(
aAny = rPropertySet->getPropertyValue(sSortAlgorithm);
OUString sAlgorithm;
aAny >>= sAlgorithm;
- if (sAlgorithm.getLength() > 0)
+ if (!sAlgorithm.isEmpty())
{
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_SORT_ALGORITHM,
sAlgorithm );
@@ -799,7 +799,7 @@ void XMLSectionExport::ExportBaseIndexStart(
// index name
OUString sIndexName;
rPropertySet->getPropertyValue(sName) >>= sIndexName;
- if ( sIndexName.getLength() > 0 )
+ if ( !sIndexName.isEmpty() )
{
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sIndexName);
}
@@ -1304,7 +1304,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
case TOK_TPARAM_CHAR_STYLE:
// only valid, if not empty
rValues[i].Value >>= sCharStyle;
- bCharStyleOK = sCharStyle.getLength() > 0;
+ bCharStyleOK = !sCharStyle.isEmpty();
break;
case TOK_TPARAM_TEXT:
@@ -1496,7 +1496,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
}
// fill char ("leader char")
- if (bFillCharOK && (sFillChar.getLength() > 0))
+ if (bFillCharOK && !sFillChar.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_STYLE,
XML_LEADER_CHAR, sFillChar);
@@ -1705,7 +1705,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
aAny = xPropSet->getPropertyValue(sSortAlgorithm);
OUString sAlgorithm;
aAny >>= sAlgorithm;
- if( sAlgorithm.getLength() > 0 )
+ if( !sAlgorithm.isEmpty() )
{
rExport.AddAttribute( XML_NAMESPACE_TEXT,
XML_SORT_ALGORITHM, sAlgorithm );
@@ -1908,7 +1908,7 @@ void XMLSectionExport::ExportMasterDocHeadingDummies()
break;
}
}
- if( sStyle.getLength() > 0 )
+ if( !sStyle.isEmpty() )
{
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
GetExport().EncodeStyleName( sStyle ) );
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
index 9e806aa07d0f..3c09c161d112 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
@@ -164,12 +164,12 @@ void XMLSectionFootnoteConfigExport::exportXML(
if (bNumOwn)
{
// prefix and suffix
- if (sNumPrefix.getLength() > 0)
+ if (!sNumPrefix.isEmpty())
{
rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_PREFIX,
sNumPrefix);
}
- if (sNumSuffix.getLength() > 0)
+ if (!sNumSuffix.isEmpty())
{
rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_SUFFIX,
sNumSuffix);
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx
index 1ada22a2994a..f5be934b9ef3 100644
--- a/xmloff/source/text/XMLSectionImportContext.cxx
+++ b/xmloff/source/text/XMLSectionImportContext.cxx
@@ -165,7 +165,7 @@ void XMLSectionImportContext::StartElement(
xNamed->setName(sName);
// stylename?
- if (sStyleName.getLength() > 0)
+ if (!sStyleName.isEmpty())
{
XMLPropStyleContext* pStyle = rHelper->
FindSectionStyle(sStyleName);
diff --git a/xmloff/source/text/XMLSectionSourceImportContext.cxx b/xmloff/source/text/XMLSectionSourceImportContext.cxx
index 906b08bf8abc..c2af73c676c2 100644
--- a/xmloff/source/text/XMLSectionSourceImportContext.cxx
+++ b/xmloff/source/text/XMLSectionSourceImportContext.cxx
@@ -123,7 +123,7 @@ void XMLSectionSourceImportContext::StartElement(
const OUString sLinkRegion(RTL_CONSTASCII_USTRINGPARAM("LinkRegion"));
Any aAny;
- if ((sURL.getLength() > 0) || (sFilterName.getLength() > 0))
+ if (!sURL.isEmpty() || !sFilterName.isEmpty())
{
SectionFileLink aFileLink;
aFileLink.FileURL = GetImport().GetAbsoluteReference( sURL );
@@ -133,7 +133,7 @@ void XMLSectionSourceImportContext::StartElement(
rSectionPropertySet->setPropertyValue(sFileLink, aAny);
}
- if (sSectionName.getLength() > 0)
+ if (!sSectionName.isEmpty())
{
aAny <<= sSectionName;
rSectionPropertySet->setPropertyValue(sLinkRegion, aAny);
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index f12f66bf66db..e984b3477c12 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -214,7 +214,7 @@ XMLTextFrameParam_Impl::XMLTextFrameParam_Impl(
}
}
}
- if (sName.getLength() && bFoundValue )
+ if (!sName.isEmpty() && bFoundValue )
rParamMap[sName] = sValue;
}
class XMLTextFrameContourContext_Impl : public SvXMLImportContext
@@ -301,10 +301,9 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
RTL_CONSTASCII_USTRINGPARAM("ContourPolyPolygon") );
Reference < XPropertySetInfo > xPropSetInfo =
rPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName(
- sContourPolyPolygon ) &&
+ if( xPropSetInfo->hasPropertyByName(sContourPolyPolygon ) &&
nWidth > 0 && nHeight > 0 && bPixelWidth == bPixelHeight &&
- (bPath ? sD : sPoints).getLength() )
+ !(bPath ? sD : sPoints).isEmpty() )
{
awt::Point aPoint( 0, 0 );
awt::Size aSize( nWidth, nHeight );
@@ -482,14 +481,14 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
if( xBase64Stream.is() )
{
OUString sURL( GetImport().ResolveEmbeddedObjectURLFromBase64() );
- if( sURL.getLength() )
+ if( !sURL.isEmpty() )
xPropSet = GetImport().GetTextImport()
->createAndInsertOLEObject( GetImport(), sURL,
sStyleName,
sTblName,
nWidth, nHeight );
}
- else if( sHRef.getLength() )
+ else if( !sHRef.isEmpty() )
{
OUString sURL( GetImport().ResolveEmbeddedObjectURL( sHRef,
OUString() ) );
@@ -535,7 +534,7 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
}
case XML_TEXT_FRAME_PLUGIN:
{
- if(sHRef.getLength())
+ if(!sHRef.isEmpty())
GetImport().GetAbsoluteReference(sHRef);
xPropSet = GetImport().GetTextImport()
->createAndInsertPlugin( sMimeType, sHRef,
@@ -584,8 +583,8 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
if( xNamed.is() )
{
OUString sOrigName( xNamed->getName() );
- if( !sOrigName.getLength() ||
- (sName.getLength() && sOrigName != sName) )
+ if( sOrigName.isEmpty() ||
+ (!sName.isEmpty() && sOrigName != sName) )
{
OUString sOldName( sName );
sal_Int32 i = 0;
@@ -603,7 +602,7 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
// frame style
XMLPropStyleContext *pStyle = 0;
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
pStyle = xTextImportHelper->FindAutoFrameStyle( sStyleName );
if( pStyle )
@@ -611,7 +610,7 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
}
Any aAny;
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
OUString sDisplayStyleName( GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_SD_GRAPHICS_ID, sStyleName ) );
@@ -711,11 +710,11 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
if( XML_TEXT_FRAME_GRAPHIC == nType )
{
// URL
- OSL_ENSURE( sHRef.getLength() > 0 || xBase64Stream.is(),
+ OSL_ENSURE( !sHRef.isEmpty() || xBase64Stream.is(),
"neither URL nor base64 image data given" );
UniReference < XMLTextImportHelper > xTxtImport =
GetImport().GetTextImport();
- if( sHRef.getLength() )
+ if( !sHRef.isEmpty() )
{
sal_Bool bForceLoad = xTxtImport->IsInsertMode() ||
xTxtImport->IsBlockMode() ||
@@ -1058,10 +1057,10 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
if( ( (XML_TEXT_FRAME_GRAPHIC == nType ||
XML_TEXT_FRAME_OBJECT == nType ||
XML_TEXT_FRAME_OBJECT_OLE == nType) &&
- !sHRef.getLength() ) ||
- ( XML_TEXT_FRAME_APPLET == nType && !sCode.getLength() ) ||
+ sHRef.isEmpty() ) ||
+ ( XML_TEXT_FRAME_APPLET == nType && sCode.isEmpty() ) ||
( XML_TEXT_FRAME_PLUGIN == nType &&
- sHRef.getLength() == 0 && sMimeType.getLength() == 0 ) )
+ sHRef.isEmpty() && sMimeType.isEmpty() ) )
return; // no URL: no image or OLE object
Create( sal_True );
@@ -1145,7 +1144,7 @@ SvXMLImportContext *XMLTextFrameContext_Impl::CreateChildContext(
new XMLEmbeddedObjectImportContext( GetImport(), nPrefix,
rLocalName, xAttrList );
sFilterService = pEContext->GetFilterServiceName();
- if( sFilterService.getLength() != 0 )
+ if( !sFilterService.isEmpty() )
{
Create( sal_False );
if( xPropSet.is() )
@@ -1179,7 +1178,7 @@ void XMLTextFrameContext_Impl::Characters( const OUString& rChars )
!xPropSet.is() && !bCreateFailed )
{
OUString sTrimmedChars( rChars. trim() );
- if( sTrimmedChars.getLength() )
+ if( !sTrimmedChars.isEmpty() )
{
if( !xBase64Stream.is() )
{
@@ -1199,7 +1198,7 @@ void XMLTextFrameContext_Impl::Characters( const OUString& rChars )
if( bOwnBase64Stream && xBase64Stream.is() )
{
OUString sChars;
- if( sBase64CharsLeft.getLength() )
+ if( !sBase64CharsLeft.isEmpty() )
{
sChars = sBase64CharsLeft;
sChars += sTrimmedChars;
@@ -1350,13 +1349,13 @@ XMLTextFrameContext::XMLTextFrameContext(
IsXMLToken( aLocalName, XML_STYLE_NAME ) )
{
OUString aStyleName = xAttrList->getValueByIndex( i );
- if( aStyleName.getLength() )
+ if( !aStyleName.isEmpty() )
{
UniReference < XMLTextImportHelper > xTxtImport =
GetImport().GetTextImport();
XMLPropStyleContext* pStyle( 0L );
pStyle = xTxtImport->FindAutoFrameStyle( aStyleName );
- if ( pStyle && !pStyle->GetParentName().getLength() )
+ if ( pStyle && pStyle->GetParentName().isEmpty() )
{
m_HasAutomaticStyleWithoutParentStyle = sal_True;
}
@@ -1390,11 +1389,11 @@ void XMLTextFrameContext::EndElement()
{
pImpl->CreateIfNotThere();
- if( m_sTitle.getLength() )
+ if( !m_sTitle.isEmpty() )
{
pImpl->SetTitle( m_sTitle );
}
- if( m_sDesc.getLength() )
+ if( !m_sDesc.isEmpty() )
{
pImpl->SetDesc( m_sDesc );
}
diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
index fa87c92218e1..afe55e88628b 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
@@ -99,7 +99,7 @@ XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext(
}
}
- if( sShow.getLength() && !sTargetFrameName.getLength() )
+ if( !sShow.isEmpty() && sTargetFrameName.isEmpty() )
{
if( IsXMLToken( sShow, XML_NEW ) )
sTargetFrameName =
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index 244b2e27fb78..e97ab6d08e31 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -162,12 +162,12 @@ XMLTextListBlockContext::XMLTextListBlockContext(
{
xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
>>= sListStyleDefaultListId;
- DBG_ASSERT( sListStyleDefaultListId.getLength() != 0,
+ DBG_ASSERT( !sListStyleDefaultListId.isEmpty(),
"no default list id found at numbering rules instance. Serious defect -> please inform OD." );
}
}
}
- if ( msListId.getLength() == 0 ) // no text:id property found
+ if ( msListId.isEmpty() ) // no text:id property found
{
sal_Int32 nUPD( 0 );
sal_Int32 nBuild( 0 );
@@ -179,7 +179,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
use default list id of numbering rules instance, if existing
(#i92811#)
*/
- if ( sListStyleDefaultListId.getLength() != 0 )
+ if ( !sListStyleDefaultListId.isEmpty() )
{
msListId = sListStyleDefaultListId;
if ( !bIsContinueNumberingAttributePresent &&
@@ -190,7 +190,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
}
}
}
- if ( msListId.getLength() == 0 )
+ if ( msListId.isEmpty() )
{
// generate a new list id for the list
msListId = rTextListsHelper.GenerateNewListId();
@@ -198,7 +198,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
}
if ( bIsContinueNumberingAttributePresent && !mbRestartNumbering &&
- msContinueListId.getLength() == 0 )
+ msContinueListId.isEmpty() )
{
::rtl::OUString Last( rTextListsHelper.GetLastProcessedListId() );
if ( rTextListsHelper.GetListStyleOfLastProcessedList() == msListStyleName
@@ -208,7 +208,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
}
}
- if ( msContinueListId.getLength() > 0 )
+ if ( !msContinueListId.isEmpty() )
{
if ( !rTextListsHelper.IsListProcessed( msContinueListId ) )
{
@@ -220,7 +220,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
// continue the master list.
::rtl::OUString sTmpStr =
rTextListsHelper.GetContinueListIdOfProcessedList( msContinueListId );
- while ( sTmpStr.getLength() > 0 )
+ while ( !sTmpStr.isEmpty() )
{
msContinueListId = sTmpStr;
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index 9508bba158af..032ac26664e3 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -84,7 +84,7 @@ XMLTextListItemContext::XMLTextListItemContext(
IsXMLToken( aLocalName, XML_STYLE_OVERRIDE ) )
{
const ::rtl::OUString sListStyleOverrideName = rValue;
- if ( sListStyleOverrideName.getLength() > 0 )
+ if ( !sListStyleOverrideName.isEmpty() )
{
OUString sDisplayStyleName(
GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST,
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 6a3c5e47679e..53c558a55425 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -102,7 +102,7 @@ void XMLFieldParamImportContext::StartElement(const ::com::sun::star::uno::Refer
sValue = xAttrList->getValueByIndex(nAttr);
}
}
- if (rHelper.hasCurrentFieldCtx() && sName.getLength()>0) {
+ if (rHelper.hasCurrentFieldCtx() && !sName.isEmpty()) {
rHelper.addFieldParam(sName, sValue);
}
}
@@ -185,7 +185,7 @@ void XMLTextMarkImportContext::StartElement(
if (IsXMLToken(GetLocalName(), XML_FIELDMARK_START) || IsXMLToken(GetLocalName(), XML_FIELDMARK))
{
- if (m_sBookmarkName.getLength() == 0)
+ if (m_sBookmarkName.isEmpty())
{
m_sBookmarkName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown"));
}
@@ -206,7 +206,7 @@ void XMLTextMarkImportContext::EndElement()
static const OUString sAPI_formfieldmark(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FormFieldmark"));
- if (m_sBookmarkName.getLength() > 0)
+ if (!m_sBookmarkName.isEmpty())
{
sal_uInt16 nTmp;
if (SvXMLUnitConverter::convertEnum(nTmp, GetLocalName(),
@@ -397,7 +397,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark(
}
else
{
- if (sMarkName.getLength())
+ if (!sMarkName.isEmpty())
{
OSL_FAIL("name given, but XNamed not supported?");
return 0;
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index d2f214a9bcce..1075079e1143 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -116,7 +116,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
}
}
- if( sDisplayName.getLength() )
+ if( !sDisplayName.isEmpty() )
{
rImport.AddStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, sName,
sDisplayName );
@@ -126,7 +126,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
sDisplayName = sName;
}
- if( 0 == sDisplayName.getLength() )
+ if( sDisplayName.isEmpty() )
return;
Reference < XNameContainer > xPageStyles =
@@ -252,7 +252,7 @@ void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite )
if( xStyle.is() && (IsNew() || bOverwrite) )
{
Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- if( sPageMasterName.getLength() )
+ if( !sPageMasterName.isEmpty() )
{
XMLPropStyleContext* pStyle =
GetImport().GetTextImport()->FindPageMaster( sPageMasterName );
@@ -274,7 +274,7 @@ void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite )
OUString sDisplayFollow(
GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_MASTER_PAGE, sFollow ) );
- if( !sDisplayFollow.getLength() ||
+ if( sDisplayFollow.isEmpty() ||
!xPageStyles->hasByName( sDisplayFollow ) )
sDisplayFollow = xStyle->getName();
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx
index b086136782bf..d8aebcc25c6f 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.cxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx
@@ -141,7 +141,7 @@ void XMLTextNumRuleInfo::Set(
// First try to find the numbering rules in the list auto style pool.
// If not found, the numbering rules instance has to be named.
msNumRulesName = rListAutoPool.Find( mxNumRules );
- if ( msNumRulesName.getLength() == 0 )
+ if ( msNumRulesName.isEmpty() )
{
Reference < XNamed > xNamed( mxNumRules, UNO_QUERY );
DBG_ASSERT( xNamed.is(),
@@ -151,7 +151,7 @@ void XMLTextNumRuleInfo::Set(
msNumRulesName = xNamed->getName();
}
}
- DBG_ASSERT( msNumRulesName.getLength() > 0,
+ DBG_ASSERT( !msNumRulesName.isEmpty(),
"<XMLTextNumRuleInfo::Set(..)> - no name found for numbering rules instance. Serious defect -> please inform OD." );
if( xPropSetInfo->hasPropertyByName( msPropNameListId ) )
@@ -230,8 +230,7 @@ sal_Bool XMLTextNumRuleInfo::BelongsToSameList( const XMLTextNumRuleInfo& rCmp )
{
sal_Bool bRet( sal_True );
// Currently only the text documents support <ListId>.
- if ( rCmp.msListId.getLength() > 0 ||
- msListId.getLength() > 0 )
+ if ( !rCmp.msListId.isEmpty() || !msListId.isEmpty() )
{
bRet = rCmp.msListId == msListId;
}
diff --git a/xmloff/source/text/txtdrope.cxx b/xmloff/source/text/txtdrope.cxx
index a7324cb604bb..75bd3bbd6638 100644
--- a/xmloff/source/text/txtdrope.cxx
+++ b/xmloff/source/text/txtdrope.cxx
@@ -80,7 +80,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny,
::sax::Converter::convertNumber(sBuffer, (sal_Int32)aFormat.Count);
sValue = sBuffer.makeStringAndClear();
}
- if( sValue.getLength() )
+ if( !sValue.isEmpty() )
rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LENGTH, sValue );
// style:distance
@@ -92,7 +92,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny,
}
// style:style-name
- if( rStyleName.getLength() )
+ if( !rStyleName.isEmpty() )
rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_STYLE_NAME,
rExport.EncodeStyleName( rStyleName ) );
}
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index f7eb9c925487..e2ea77952e73 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -157,8 +157,7 @@ void XMLTextExportPropertySetMapper::handleSpecialItem(
pThis->bDropWholeWord = *(sal_Bool *)rProperty.maValue.getValue();
break;
case CTF_DROPCAPCHARSTYLE:
- DBG_ASSERT( !sDropCharStyle.getLength(),
- "drop char style is set already!" );
+ DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" );
rProperty.maValue >>= pThis->sDropCharStyle;
break;
case CTF_NUMBERINGSTYLENAME:
@@ -236,7 +235,7 @@ void XMLTextExportPropertySetMapper::ContextFontFilter(
OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
- if( sName.getLength() )
+ if( !sName.isEmpty() )
{
pFontNameState->maValue <<= sName;
if( pFontFamilyNameState )
@@ -255,12 +254,12 @@ void XMLTextExportPropertySetMapper::ContextFontFilter(
pFontNameState->mnIndex = -1;
}
- if( pFontFamilyNameState && (0 == sFamilyName.getLength()) )
+ if( pFontFamilyNameState && sFamilyName.isEmpty() )
{
pFontFamilyNameState->mnIndex = -1;
}
- if( pFontStyleNameState && (0 == sStyleName.getLength()) )
+ if( pFontStyleNameState && sStyleName.isEmpty() )
{
pFontStyleNameState->mnIndex = -1;
}
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index fc550cf76bb9..cc8a3991633c 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -400,7 +400,7 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID(
}
// if this is not a normal text field, check if its a presentation text field
- if( sFieldName.getLength() == 0 )
+ if( sFieldName.isEmpty() )
{
const OUString* pNames2 = aServices.getConstArray();
sal_Int32 nCount2 = aServices.getLength();
@@ -417,7 +417,7 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID(
++pNames2;
}
- if( sFieldName.getLength() != 0 )
+ if( !sFieldName.isEmpty() )
{
if( sFieldName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "Header" ) ) == 0 )
{
@@ -435,7 +435,7 @@ enum FieldIdEnum XMLTextFieldExport::GetFieldID(
}
// map postfix of service name to field ID
- DBG_ASSERT(sFieldName.getLength()>0, "no TextField service found!");
+ DBG_ASSERT(!sFieldName.isEmpty(), "no TextField service found!");
return MapFieldName(sFieldName, xPropSet);
}
@@ -452,9 +452,9 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName(
// a) find prelim. FIELD_ID via aFieldServiceMapping
// check for non-empty service name
- DBG_ASSERT(sFieldName.getLength()>0, "no valid service name!");
+ DBG_ASSERT(!sFieldName.isEmpty(), "no valid service name!");
enum FieldIdEnum nToken = FIELD_ID_UNKNOWN;
- if (sFieldName.getLength() > 0)
+ if (!sFieldName.isEmpty())
{
// map name to prelim. ID
sal_uInt16 nTmp;
@@ -792,7 +792,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
// insert this text field master
OUString sFieldMasterName = GetStringProperty(
sPropertyInstanceName, xDepField->getTextFieldMaster());
- if (sFieldMasterName.getLength() > 0)
+ if (!sFieldMasterName.isEmpty())
aMapIter->second.insert( sFieldMasterName );
}
// else: no dependent field -> no master -> ignore
@@ -1009,7 +1009,7 @@ void XMLTextFieldExport::ExportField(
OUString sStyle = GetExport().GetTextParagraphExport()->
FindTextStyleAndHyperlink( xRangePropSet, bHasHyperlink, bIsUICharStyle,
bHasAutoStyle, pStates );
- sal_Bool bHasStyle = (sStyle.getLength() > 0);
+ sal_Bool bHasStyle = !sStyle.isEmpty();
// export hyperlink (if we have one)
Reference < XPropertySetInfo > xRangePropSetInfo;
@@ -1741,7 +1741,7 @@ void XMLTextFieldExport::ExportFieldHelper(
// author
OUString aAuthor( GetStringProperty(sPropertyAuthor, rPropSet) );
- if( aAuthor.getLength() )
+ if( !aAuthor.isEmpty() )
{
SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_DC,
XML_CREATOR, sal_True,
@@ -2268,7 +2268,7 @@ void XMLTextFieldExport::ExportMacro(
// if the ScriptURL property is not empty then this is a Scripting
// Framework URL, otherwise treat it as a Basic Macro
- if (sName.getLength() != 0)
+ if (!sName.isEmpty())
{
aSeq = Sequence<PropertyValue> (2);
PropertyValue* pArr = aSeq.getArray();
@@ -2389,7 +2389,7 @@ void XMLTextFieldExport::ProcessValueAndType(
OUString sDataStyleName =
GetExport().getDataStyleName(nFormatKey, bTimeStyle);
- if( sDataStyleName.getLength() > 0 )
+ if( !sDataStyleName.isEmpty() )
{
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DATA_STYLE_NAME,
@@ -2457,7 +2457,7 @@ void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName,
return;
// check for empty string, if applicable
- if ( bOmitEmpty && (sValue.getLength()==0) )
+ if ( bOmitEmpty && sValue.isEmpty() )
return;
// write attribute
@@ -2750,7 +2750,7 @@ void XMLTextFieldExport::ProcessBibliographyData(
OUString sStr;
aValues[i].Value >>= sStr;
- if (sStr.getLength() > 0)
+ if (!sStr.isEmpty())
{
rExport.AddAttribute(XML_NAMESPACE_TEXT,
MapBibliographyFieldName(aValues[i].Name),
@@ -2827,19 +2827,19 @@ void XMLTextFieldExport::ExportDataBaseElement(
OUString sDataBaseURL;
OUString sStr;
if( ( rPropertySet->getPropertyValue( sPropertyDataBaseName ) >>= sStr )
- && ( sStr.getLength() > 0 ) )
+ && !sStr.isEmpty() )
{
sDataBaseName = sStr;
}
else if( rPropertySetInfo->hasPropertyByName( sPropertyDataBaseURL ) &&
(rPropertySet->getPropertyValue( sPropertyDataBaseURL ) >>= sStr) &&
- (sStr.getLength() > 0) )
+ !sStr.isEmpty() )
{
sDataBaseURL = sStr;
}
// add database name property (if present)
- if( sDataBaseName.getLength() > 0 )
+ if( !sDataBaseName.isEmpty() )
rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_DATABASE_NAME,
sDataBaseName );
SvXMLElementExport aDataBaseElement( GetExport(),
@@ -2847,7 +2847,7 @@ void XMLTextFieldExport::ExportDataBaseElement(
sal_False, sal_False );
// write URL as children
- if( sDataBaseURL.getLength() > 0 )
+ if( !sDataBaseURL.isEmpty() )
{
rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sDataBaseURL );
SvXMLElementExport aDataSourceElement(
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index d09e5e15c65c..cd655bfbdf5f 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -251,7 +251,7 @@ XMLTextFieldImportContext::~XMLTextFieldImportContext() {
OUString XMLTextFieldImportContext::GetContent()
{
- if (sContent.getLength()==0)
+ if (sContent.isEmpty())
{
sContent = sContentBuffer.makeStringAndClear();
}
@@ -261,7 +261,7 @@ OUString XMLTextFieldImportContext::GetContent()
void XMLTextFieldImportContext::EndElement()
{
- DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!");
+ DBG_ASSERT(!GetServiceName().isEmpty(), "no service name for element!");
if (bValid)
{
@@ -2011,7 +2011,7 @@ void XMLUserDocInfoImportContext::PrepareField(
::com::sun::star::beans::XPropertySet> & xPropertySet)
{
uno::Any aAny;
- if ( aName.getLength() )
+ if ( !aName.isEmpty() )
{
aAny <<= aName;
xPropertySet->setPropertyValue(sPropertyName, aAny);
@@ -3707,7 +3707,7 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext(
void XMLAnnotationImportContext::EndElement()
{
- DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!");
+ DBG_ASSERT(!GetServiceName().isEmpty(), "no service name for element!");
if( mxCursor.is() )
{
// delete addition newline
diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx
index b9fa46d8c0f6..2297b5ab0055 100644
--- a/xmloff/source/text/txtftne.cxx
+++ b/xmloff/source/text/txtftne.cxx
@@ -143,7 +143,7 @@ void XMLTextParagraphExport::exportTextFootnote(
aCharStyleNamesPropInfoCache.hasProperty(
rPropSet ), bHasAutoStyle,
rPropSet, sCharStyleNames );
- if( sStyle.getLength() )
+ if( !sStyle.isEmpty() )
{
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
GetExport().EncodeStyleName( sStyle ) );
@@ -195,7 +195,7 @@ void XMLTextParagraphExport::exportTextFootnoteHelper(
{
// handle label vs. automatic numbering
OUString sLabel = rFootnote->getLabel();
- if (sLabel.getLength()>0)
+ if (!sLabel.isEmpty())
{
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_LABEL,
sLabel);
@@ -248,7 +248,7 @@ void lcl_exportString(
Any aAny = rPropSet->getPropertyValue(sProperty);
OUString sTmp;
aAny >>= sTmp;
- if (!bOmitIfEmpty || (sTmp.getLength() > 0))
+ if (!bOmitIfEmpty || !sTmp.isEmpty())
{
if( bEncodeName )
sTmp = rExport.EncodeStyleName( sTmp );
@@ -368,7 +368,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper(
aAny = rFootnoteConfig->getPropertyValue(sEndNotice);
aAny >>= sTmp;
- if (sTmp.getLength() > 0)
+ if (!sTmp.isEmpty())
{
SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT,
XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD,
@@ -380,7 +380,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper(
aAny = rFootnoteConfig->getPropertyValue(sBeginNotice);
aAny >>= sTmp;
- if (sTmp.getLength() > 0)
+ if (!sTmp.isEmpty())
{
SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT,
XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD,
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 61021eb00df5..276baafa982e 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -957,9 +957,9 @@ XMLTextImportHelper::XMLTextImportHelper(
::rtl::OUString sListId;
xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
>>= sListId;
- DBG_ASSERT( sListId.getLength() != 0,
+ DBG_ASSERT( !sListId.isEmpty(),
"no default list id found at chapter numbering rules instance. Serious defect -> please inform OD." );
- if ( sListId.getLength() )
+ if ( !sListId.isEmpty() )
{
Reference< XNamed > const xChapterNumNamed(
m_pImpl->m_xChapterNumbering, UNO_QUERY);
@@ -1262,7 +1262,7 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
XMLTextStyleContext *pStyle = 0;
sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
: XML_STYLE_FAMILY_TEXT_TEXT;
- if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
+ if (!rStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
@@ -1363,7 +1363,7 @@ sal_Bool lcl_HasListStyle( OUString sStyleName,
{
OUString sListStyle;
xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle.getLength() != 0 &&
+ if ( !sListStyle.isEmpty() &&
sListStyle == sOutlineStyleName )
{
bRet = sal_False;
@@ -1382,14 +1382,13 @@ sal_Bool lcl_HasListStyle( OUString sStyleName,
while ( xStyle.is() )
{
OUString aParentStyle( xStyle->getParentStyle() );
- if ( aParentStyle.getLength() > 0 )
+ if ( !aParentStyle.isEmpty() )
{
aParentStyle =
rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
aParentStyle );
}
- if ( aParentStyle.getLength() == 0 ||
- !xParaStyles->hasByName( aParentStyle ) )
+ if ( aParentStyle.isEmpty() || !xParaStyles->hasByName( aParentStyle ) )
{
// no list style found
break;
@@ -1414,7 +1413,7 @@ sal_Bool lcl_HasListStyle( OUString sStyleName,
{
OUString sListStyle;
xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle.getLength() != 0 &&
+ if ( !sListStyle.isEmpty() &&
sListStyle == sOutlineStyleName )
{
bRet = sal_False;
@@ -1423,7 +1422,7 @@ sal_Bool lcl_HasListStyle( OUString sStyleName,
/* Check explicitly on certain versions and on import of
text documents in OpenOffice.org file format (#i86058#)
*/
- else if ( sListStyle.getLength() == 0 &&
+ else if ( sListStyle.isEmpty() &&
( rImport.IsTextDocInOOoFileFormat() ||
( bBuildIdFound &&
( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
@@ -1486,7 +1485,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
: XML_STYLE_FAMILY_TEXT_TEXT;
XMLTextStyleContext *pStyle = 0;
OUString sStyleName( rStyleName );
- if (sStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
+ if (!sStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
@@ -1501,7 +1500,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
xPropSet->getPropertySetInfo());
// style
- if( sStyleName.getLength() )
+ if( !sStyleName.isEmpty() )
{
sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName );
const String& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName;
@@ -1654,7 +1653,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
{
- if (sListId.getLength()) {
+ if (!sListId.isEmpty()) {
xPropSet->setPropertyValue(s_PropNameListId,
makeAny(sListId) );
}
@@ -1678,7 +1677,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
DBG_ASSERT( ( bBuildIdFound && nUPD == 680 ) ||
!pStyle ||
!pStyle->IsListStyleSet() ||
- pStyle->GetListStyle().getLength() == 0,
+ pStyle->GetListStyle().isEmpty(),
"automatic paragraph style with list style name, but paragraph not in list???" );
if ( ( bBuildIdFound && nUPD == 680 ) ||
!pStyle || !pStyle->IsListStyleSet() )
@@ -1716,7 +1715,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_MASTER_PAGE,
pStyle->GetMasterPageName()) );
- if( !sDisplayName.getLength() ||
+ if( sDisplayName.isEmpty() ||
(m_pImpl->m_xPageStyles.is() &&
m_pImpl->m_xPageStyles->hasByName( sDisplayName)))
{
@@ -1724,7 +1723,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
makeAny(sDisplayName));
}
}
- if( bPara && pStyle->GetDropCapStyleName().getLength() &&
+ if( bPara && !pStyle->GetDropCapStyleName().isEmpty() &&
m_pImpl->m_xTextStyles.is())
{
OUString sDisplayName(
@@ -1771,7 +1770,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// the selected text has to be removed afterwards
m_pImpl->m_xText->insertTextContent( xRange->getStart(), xTextContent, sal_True );
- if( xRange->getString().getLength() )
+ if( !xRange->getString().isEmpty() )
{
try
{
@@ -1914,7 +1913,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName"));
// style name empty?
- if( rStyleName.getLength() == 0 )
+ if( rStyleName.isEmpty() )
{
// Empty? Then we need o do stuff. Let's do error checking first.
if (m_pImpl->m_xChapterNumbering.is() &&
@@ -1962,7 +1961,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
const OUString& rStyleName )
{
- if (rStyleName.getLength()
+ if (!rStyleName.isEmpty()
&& m_pImpl->m_xChapterNumbering.is()
&& (nOutlineLevel > 0)
&& (nOutlineLevel <= m_pImpl->m_xChapterNumbering->getCount()))
@@ -2063,8 +2062,7 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
for ( sal_Int32 i = 0; i < nCount; ++i )
{
// Paragraph style assignments in Outline of template lost from second level on (#i107610#)
- if ( bSetEmptyLevels ||
- sChosenStyles[i].getLength() > 0 )
+ if ( bSetEmptyLevels || !sChosenStyles[i].isEmpty() )
{
pProps->Value <<= sChosenStyles[i];
m_pImpl->m_xChapterNumbering->replaceByIndex(i,
@@ -2140,7 +2138,7 @@ void XMLTextImportHelper::SetHyperlink(
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rStyleName ) );
- if( sDisplayName.getLength() &&
+ if( !sDisplayName.isEmpty() &&
xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
m_pImpl->m_xTextStyles->hasByName(sDisplayName))
{
@@ -2151,7 +2149,7 @@ void XMLTextImportHelper::SetHyperlink(
sDisplayName =
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rVisitedStyleName );
- if( sDisplayName.getLength() &&
+ if( !sDisplayName.isEmpty() &&
xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
m_pImpl->m_xTextStyles->hasByName(sDisplayName))
{
@@ -2182,7 +2180,7 @@ void XMLTextImportHelper::SetRuby(
// the ruby style (ruby-adjust)
XMLPropStyleContext *pStyle = 0;
- if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
+ if (!rStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
@@ -2200,7 +2198,7 @@ void XMLTextImportHelper::SetRuby(
OUString sDisplayName(
rImport.GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, rTextStyleName ) );
- if( (sDisplayName.getLength() > 0) &&
+ if( (!sDisplayName.isEmpty()) &&
m_pImpl->m_xTextStyles->hasByName( sDisplayName ))
{
xPropSet->setPropertyValue(sRubyCharStyleName, makeAny(sDisplayName));
@@ -2243,7 +2241,7 @@ sal_Bool XMLTextImportHelper::HasDrawNameAttribute(
if( XML_NAMESPACE_DRAW == nPrefix &&
IsXMLToken( aLocalName, XML_NAME ) )
{
- return xAttrList->getValueByIndex(i).getLength() != 0;
+ return !xAttrList->getValueByIndex(i).isEmpty();
}
}
@@ -2720,10 +2718,10 @@ void XMLTextImportHelper::ConnectFrameChains(
static ::rtl::OUString s_ChainPrevName(
RTL_CONSTASCII_USTRINGPARAM("ChainPrevName"));
- if( !rFrmName.getLength() )
+ if( rFrmName.isEmpty() )
return;
- if( rNextFrmName.getLength() )
+ if( !rNextFrmName.isEmpty() )
{
OUString sNextFrmName(GetRenameMap().Get( XML_TEXT_RENAME_TYPE_FRAME,
rNextFrmName ));