summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-18 13:40:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-18 14:12:39 +0100
commit05575c31e1f962636125ff8c42c3e2409a9edb6c (patch)
tree0fa44d2899f95ae21676ee51a57eb34b38e965e0 /xmloff
parentfb4fec646d20388539c8d294f3e2bc20d0903a2b (diff)
xmloff: Use appropriate OUString functions on string constants
Change-Id: I349e0c2575d9a5154ac7002d129a1851a3df7687
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx2
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx30
-rw-r--r--xmloff/source/core/XMLEmbeddedObjectImportContext.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx2
-rw-r--r--xmloff/source/draw/eventimp.cxx3
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx2
-rw-r--r--xmloff/source/draw/ximpshap.cxx2
-rw-r--r--xmloff/source/forms/elementexport.cxx4
-rw-r--r--xmloff/source/forms/elementimport.cxx4
-rw-r--r--xmloff/source/forms/eventexport.cxx8
-rw-r--r--xmloff/source/forms/eventimport.cxx12
-rw-r--r--xmloff/source/style/impastpl.cxx7
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextNumRuleInfo.hxx6
-rw-r--r--xmloff/source/text/txtfldi.cxx6
-rw-r--r--xmloff/source/text/txtparae.cxx6
-rw-r--r--xmloff/source/text/txtvfldi.cxx2
17 files changed, 49 insertions, 51 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 1ccc56cea869..97687107705b 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2468,7 +2468,7 @@ void SchXMLExportHelper_Impl::exportAxes(
}
}
exportAxis( XML_X, XML_PRIMARY_X, xAxisProps, xNewAxis, aCategoriesRange, bHasXAxisTitle, bHasXAxisMajorGrid, bHasXAxisMinorGrid, bExportContent );
- aCategoriesRange = "";
+ aCategoriesRange.clear();
}
// secondary x axis
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index f49e9383a27a..5e3fc42739e2 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -767,27 +767,27 @@ void XMLConfigItemMapIndexedContext::EndElement()
for ( sal_Int32 j = 0 ; j < XML_FORBIDDEN_CHARACTER_MAX ; j++ )
{
- if (pForChar->Name.equals ( "Language" ) )
+ if (pForChar->Name == "Language")
{
pForChar->Value >>= aLocale.Language;
bHaveLanguage = true;
}
- else if (pForChar->Name.equals ( "Country" ) )
+ else if (pForChar->Name == "Country")
{
pForChar->Value >>= aLocale.Country;
bHaveCountry = true;
}
- else if (pForChar->Name.equals ( "Variant" ) )
+ else if (pForChar->Name == "Variant")
{
pForChar->Value >>= aLocale.Variant;
bHaveVariant = true;
}
- else if (pForChar->Name.equals ( "BeginLine" ) )
+ else if (pForChar->Name == "BeginLine")
{
pForChar->Value >>= aForbid.beginLine;
bHaveBegin = true;
}
- else if (pForChar->Name.equals ( "EndLine" ) )
+ else if (pForChar->Name == "EndLine")
{
pForChar->Value >>= aForbid.endLine;
bHaveEnd = true;
@@ -839,52 +839,52 @@ void XMLConfigItemMapIndexedContext::EndElement()
for ( sal_Int32 j = 0 ; j < XML_SYMBOL_DESCRIPTOR_MAX ; j++ )
{
- if (pSymbol->Name.equals ( "Name" ) )
+ if (pSymbol->Name == "Name")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].sName;
bHaveName = true;
}
- else if (pSymbol->Name.equals ( "ExportName" ) )
+ else if (pSymbol->Name == "ExportName")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].sExportName;
bHaveExportName = true;
}
- else if (pSymbol->Name.equals ( "FontName" ) )
+ else if (pSymbol->Name == "FontName")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].sFontName;
bHaveFontName = true;
}
- else if (pSymbol->Name.equals ( "CharSet" ) )
+ else if (pSymbol->Name == "CharSet")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharSet;
bHaveCharSet = true;
}
- else if (pSymbol->Name.equals ( "Family" ) )
+ else if (pSymbol->Name == "Family")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nFamily;
bHaveFamily = true;
}
- else if (pSymbol->Name.equals ( "Pitch" ) )
+ else if (pSymbol->Name == "Pitch")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nPitch;
bHavePitch = true;
}
- else if (pSymbol->Name.equals ( "Weight" ) )
+ else if (pSymbol->Name == "Weight")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nWeight;
bHaveWeight = true;
}
- else if (pSymbol->Name.equals ( "Italic" ) )
+ else if (pSymbol->Name == "Italic")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nItalic;
bHaveItalic = true;
}
- else if (pSymbol->Name.equals ( "SymbolSet" ) )
+ else if (pSymbol->Name == "SymbolSet")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].sSymbolSet;
bHaveSymbolSet = true;
}
- else if (pSymbol->Name.equals ( "Character" ) )
+ else if (pSymbol->Name == "Character")
{
pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharacter;
bHaveCharacter = true;
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 939b48ba5e48..807804a52f90 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -184,7 +184,7 @@ XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext(
if( nPrfx == XML_NAMESPACE_MATH &&
IsXMLToken( rLName, XML_MATH ) )
{
- sFilterService = OUString( XML_IMPORT_FILTER_MATH );
+ sFilterService = XML_IMPORT_FILTER_MATH;
aName = SvGlobalName(SO3_SM_CLASSID);
}
else if( nPrfx == XML_NAMESPACE_OFFICE &&
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 9b49b827d082..2c78e1a1b082 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1958,7 +1958,7 @@ OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectUR
if( (getExportFlags() & EXPORT_EMBEDDED) == 0 )
sRet = mxGraphicResolver->resolveGraphicObjectURL( rGraphicObjectURL );
else
- sRet = "";
+ sRet.clear();
}
else
sRet = GetRelativeReference( sRet );
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index c858528a5399..49d6cdbc8601 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -379,8 +379,7 @@ void SdXMLEventContext::EndElement()
}
else
{
- pProperties->Name =
- OUString( "EventType" );
+ pProperties->Name = "EventType";
pProperties->Handle = -1;
pProperties->Value <<= OUString( "Script" );
pProperties->State = beans::PropertyState_DIRECT_VALUE;
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 03b785951d5e..142f1e68a845 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -755,7 +755,7 @@ void SdXMLExport::ImpPrepAutoLayoutInfos()
bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName)
{
- rName = "";
+ rName.clear();
bool bRetval(false);
Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index bc0ee6184675..eb3bab44f9be 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3133,7 +3133,7 @@ lcl_GetMediaReference(SvXMLImport const& rImport, OUString const& rURL)
{
if (rImport.IsPackageURL(rURL))
{
- return OUString( "vnd.sun.star.Package:") + rURL;
+ return "vnd.sun.star.Package:" + rURL;
}
else
{
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 0165193cdebc..ff7335783843 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -169,7 +169,7 @@ namespace xmloff
OUString sToWriteServiceName = sServiceName;
#define CHECK_N_TRANSLATE( name ) \
- else if (sServiceName.equals(SERVICE_PERSISTENT_COMPONENT_##name)) \
+ else if (sServiceName == SERVICE_PERSISTENT_COMPONENT_##name) \
sToWriteServiceName = SERVICE_##name
if (false)
@@ -194,7 +194,7 @@ namespace xmloff
CHECK_N_TRANSLATE( HIDDENCONTROL );
CHECK_N_TRANSLATE( IMAGECONTROL );
CHECK_N_TRANSLATE( FORMATTEDFIELD );
- else if (sServiceName.equals(SERVICE_PERSISTENT_COMPONENT_EDIT))
+ else if (sServiceName == SERVICE_PERSISTENT_COMPONENT_EDIT)
{
// special handling for the edit field: we have two controls using this as persistence service name
sToWriteServiceName = SERVICE_EDIT;
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index f1911a49d0b8..eede26ad743a 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -936,8 +936,8 @@ namespace xmloff
{
// we have exactly 2 properties where this type class is allowed:
OSL_ENSURE(
- !_rPropValue.Name.equals(PROPERTY_EFFECTIVE_VALUE)
- || !_rPropValue.Name.equals(PROPERTY_EFFECTIVE_DEFAULT),
+ _rPropValue.Name != PROPERTY_EFFECTIVE_VALUE
+ || _rPropValue.Name != PROPERTY_EFFECTIVE_DEFAULT,
"OControlImport::implTranslateValueProperty: invalid property type/name combination!");
// Both properties are allowed to have a double or a string value,
diff --git a/xmloff/source/forms/eventexport.cxx b/xmloff/source/forms/eventexport.cxx
index 8febf2d3e7fe..e26ed665ceec 100644
--- a/xmloff/source/forms/eventexport.cxx
+++ b/xmloff/source/forms/eventexport.cxx
@@ -50,8 +50,8 @@ namespace xmloff
Sequence< PropertyValue >& rMappedEvent = m_aMappedEvents[sName];
sLocalMacroName = pEvents->ScriptCode;
- sLibrary = "";
- if (pEvents->ScriptType.equals(EVENT_STARBASIC))
+ sLibrary.clear();
+ if (pEvents->ScriptType == EVENT_STARBASIC)
{ // for StarBasic, the library name is part of the ScriptCode
sal_Int32 nPrefixLen = sLocalMacroName.indexOf( ':' );
DBG_ASSERT( 0 <= nPrefixLen, "OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
@@ -59,7 +59,7 @@ namespace xmloff
{
// the export handler for StarBasic expects "StarOffice", not "application" for application modules ...
sLibrary = sLocalMacroName.copy( 0, nPrefixLen );
- if (sLibrary.equals(EVENT_APPLICATION))
+ if (sLibrary == EVENT_APPLICATION)
sLibrary = EVENT_STAROFFICE;
sLocalMacroName = sLocalMacroName.copy( nPrefixLen + 1 );
@@ -98,7 +98,7 @@ namespace xmloff
MapString2PropertyValueSequence::const_iterator aPos = m_aMappedEvents.find(_rName);
if (m_aMappedEvents.end() == aPos)
throw NoSuchElementException(
- OUString("There is no element named ") + _rName,
+ "There is no element named " + _rName,
static_cast< ::cppu::OWeakObject* >(this));
return makeAny(aPos->second);
diff --git a/xmloff/source/forms/eventimport.cxx b/xmloff/source/forms/eventimport.cxx
index d3e83a1d5252..2f499e7e84f6 100644
--- a/xmloff/source/forms/eventimport.cxx
+++ b/xmloff/source/forms/eventimport.cxx
@@ -65,18 +65,18 @@ namespace xmloff
pEventDescriptionEnd = pEventDescription + aEvent->second.getLength();
for (;pEventDescription != pEventDescriptionEnd; ++pEventDescription)
{
- if ((pEventDescription->Name.equals(EVENT_LOCALMACRONAME)) ||
- (pEventDescription->Name.equals(EVENT_SCRIPTURL)))
+ if (pEventDescription->Name == EVENT_LOCALMACRONAME ||
+ pEventDescription->Name == EVENT_SCRIPTURL)
pEventDescription->Value >>= pTranslated->ScriptCode;
- else if (pEventDescription->Name.equals(EVENT_TYPE))
+ else if (pEventDescription->Name == EVENT_TYPE)
pEventDescription->Value >>= pTranslated->ScriptType;
- else if (pEventDescription->Name.equals(EVENT_LIBRARY))
+ else if (pEventDescription->Name == EVENT_LIBRARY)
pEventDescription->Value >>= sLibrary;
}
- if (pTranslated->ScriptType.equals(EVENT_STARBASIC))
+ if (pTranslated->ScriptType == EVENT_STARBASIC)
{
- if (sLibrary.equals(EVENT_STAROFFICE))
+ if (sLibrary == EVENT_STAROFFICE)
sLibrary = EVENT_APPLICATION;
if ( !sLibrary.isEmpty() )
diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx
index fc4cbb455271..40b592ec033e 100644
--- a/xmloff/source/style/impastpl.cxx
+++ b/xmloff/source/style/impastpl.cxx
@@ -182,7 +182,7 @@ XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFam
OUStringBuffer aStemBuffer(32);
aStemBuffer.append( rFamilyData.maStrPrefix );
- if (rParentName != "")
+ if (!rParentName.isEmpty())
{
aStemBuffer.append("-");
aStemBuffer.append(rParentName);
@@ -195,7 +195,7 @@ XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFam
if (rState.mnIndex == -1)
continue;
OUString sXMLName(rFamilyData.mxMapper->getPropertySetMapper()->GetEntryXMLName(rState.mnIndex));
- if (sXMLName == "")
+ if (sXMLName.isEmpty())
continue;
aStemBuffer.append("-");
aStemBuffer.append(OUString::number(rFamilyData.mxMapper->getPropertySetMapper()->GetEntryNameSpace(rState.mnIndex)));
@@ -415,8 +415,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
OUString aPrefix( rStrPrefix );
if( bStylesOnly )
{
- aPrefix = "M";
- aPrefix += rStrPrefix;
+ aPrefix = "M" + rStrPrefix;
}
#if OSL_DEBUG_LEVEL > 0
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index f396ede30b13..f8f9d37689fd 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -200,7 +200,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
{
if ( !rTextListsHelper.IsListProcessed( msContinueListId ) )
{
- msContinueListId = "";
+ msContinueListId.clear();
}
else
{
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx
index bfe02f97d44c..8ca93af9d6f4 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.hxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx
@@ -163,15 +163,15 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
inline void XMLTextNumRuleInfo::Reset()
{
mxNumRules = 0;
- msNumRulesName = "";
- msListId = "";
+ msNumRulesName.clear();
+ msListId.clear();
mnListStartValue = -1;
mnListLevel = 0;
// Written OpenDocument file format doesn't fit to the created text document (#i69627#)
mbIsNumbered = mbIsRestart =
mbOutlineStyleAsNormalListStyle = false;
mbContinueingPreviousSubTree = false;
- msListLabelString = "";
+ msListLabelString.clear();
}
#endif // INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 6b7c9ad541a8..90d1be3383a0 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -4088,7 +4088,7 @@ XMLHeaderFieldImportContext::XMLHeaderFieldImportContext(
const OUString& sLocalName) /// element name w/o prefix
: XMLTextFieldImportContext(rImport, rHlp, sAPI_header, nPrfx, sLocalName )
{
- sServicePrefix = OUString(sAPI_presentation_prefix );
+ sServicePrefix = sAPI_presentation_prefix;
bValid = true;
}
@@ -4112,7 +4112,7 @@ XMLFooterFieldImportContext::XMLFooterFieldImportContext(
const OUString& sLocalName) /// element name w/o prefix
: XMLTextFieldImportContext(rImport, rHlp, sAPI_footer, nPrfx, sLocalName )
{
- sServicePrefix = OUString(sAPI_presentation_prefix );
+ sServicePrefix = sAPI_presentation_prefix;
bValid = true;
}
@@ -4137,7 +4137,7 @@ XMLDateTimeFieldImportContext::XMLDateTimeFieldImportContext(
const OUString& sLocalName) /// element name w/o prefix
: XMLTextFieldImportContext(rImport, rHlp, sAPI_datetime, nPrfx, sLocalName )
{
- sServicePrefix = OUString(sAPI_presentation_prefix );
+ sServicePrefix = sAPI_presentation_prefix;
bValid = true;
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index de920891bd22..b2b6772d9293 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2201,12 +2201,12 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
exportTextField( xTxtRange, bAutoStyles, bIsProgress );
bPrevCharIsSpace = false;
}
- else if ( sType.equals( sAnnotation ) )
+ else if ( sType == sAnnotation )
{
exportTextField( xTxtRange, bAutoStyles, bIsProgress );
bPrevCharIsSpace = false;
}
- else if ( sType.equals( sAnnotationEnd ) )
+ else if ( sType == sAnnotationEnd )
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
const OUString& rName = xBookmark->getName();
@@ -2268,7 +2268,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
{
exportRuby(xPropSet, bAutoStyles);
}
- else if (sType.equals(sMeta))
+ else if (sType == sMeta)
{
exportMeta(xPropSet, bAutoStyles, bIsProgress);
}
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index 6792facbf6a9..89f4047433a6 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -329,7 +329,7 @@ void XMLSetVarFieldImportContext::EndElement()
{
// create field/Service
Reference<XPropertySet> xPropSet;
- if (CreateField(xPropSet, OUString(sAPI_textfield_prefix) + GetServiceName()))
+ if (CreateField(xPropSet, sAPI_textfield_prefix + GetServiceName()))
{
Reference<XDependentTextField> xDepTextField(xPropSet, UNO_QUERY);
if (xDepTextField.is())