[Libreoffice-commits] core.git: 21 commits - fpicker/source hwpfilter/source oox/source package/source reportdesign/source scaddins/source sc/inc sc/qa scripting/source sc/source sdext/source sd/qa sd/source shell/source starmath/source svgio/source sw/qa sw/source tools/qa unoxml/source uui/source vbahelper/source writerfilter/source writerperfect/source xmlhelp/source
Stephan Bergmann
sbergman at redhat.com
Mon Dec 15 01:22:52 PST 2014
fpicker/source/office/OfficeControlAccess.cxx | 2
hwpfilter/source/formula.cxx | 121
hwpfilter/source/hwpreader.cxx | 2374 +++++++-------
oox/source/core/filterdetect.cxx | 28
oox/source/core/xmlfilterbase.cxx | 6
oox/source/drawingml/table/tableproperties.cxx | 6
oox/source/drawingml/textfield.cxx | 2
oox/source/ole/olehelper.cxx | 4
oox/source/ppt/animationtypes.cxx | 4
oox/source/ppt/pptshape.cxx | 2
oox/source/ppt/timenodelistcontext.cxx | 2
oox/source/vml/vmldrawing.cxx | 2
oox/source/vml/vmlshape.cxx | 6
oox/source/vml/vmlshapecontext.cxx | 4
package/source/manifest/ManifestImport.cxx | 2
reportdesign/source/filter/xml/xmlGroup.cxx | 2
reportdesign/source/ui/inspection/DataProviderHandler.cxx | 4
reportdesign/source/ui/inspection/GeometryHandler.cxx | 10
sc/inc/editutil.hxx | 2
sc/inc/miscuno.hxx | 4
sc/qa/unit/ucalc_pivottable.cxx | 26
sc/source/core/data/dptabsrc.cxx | 110
sc/source/core/tool/chgtrack.cxx | 14
sc/source/core/tool/compiler.cxx | 4
sc/source/core/tool/editutil.cxx | 4
sc/source/core/tool/interpr1.cxx | 28
sc/source/core/tool/interpr5.cxx | 10
sc/source/core/tool/rangeutl.cxx | 2
sc/source/filter/excel/xestyle.cxx | 2
sc/source/filter/excel/xihelper.cxx | 2
sc/source/filter/xml/xmldrani.cxx | 4
sc/source/filter/xml/xmlfilti.cxx | 24
sc/source/filter/xml/xmlimprt.cxx | 47
sc/source/filter/xml/xmlsorti.cxx | 4
sc/source/ui/app/inputhdl.cxx | 11
sc/source/ui/dbgui/asciiopt.cxx | 8
sc/source/ui/dbgui/dbnamdlg.cxx | 2
sc/source/ui/dbgui/imoptdlg.cxx | 6
sc/source/ui/docshell/docsh.cxx | 83
sc/source/ui/docshell/servobj.cxx | 6
sc/source/ui/miscdlgs/linkarea.cxx | 2
sc/source/ui/undo/undodat.cxx | 2
sc/source/ui/unoobj/addruno.cxx | 20
sc/source/ui/unoobj/afmtuno.cxx | 24
sc/source/ui/unoobj/appluno.cxx | 72
sc/source/ui/unoobj/chartuno.cxx | 8
sc/source/ui/unoobj/confuno.cxx | 120
sc/source/ui/unoobj/dapiuno.cxx | 112
sc/source/ui/unoobj/datauno.cxx | 150
sc/source/ui/unoobj/defltuno.cxx | 8
sc/source/ui/unoobj/docuno.cxx | 146
sc/source/ui/unoobj/eventuno.cxx | 6
sc/source/ui/unoobj/filtuno.cxx | 12
sc/source/ui/unoobj/fmtuno.cxx | 50
sc/source/ui/unoobj/linkuno.cxx | 40
sc/source/ui/unoobj/shapeuno.cxx | 40
sc/source/ui/unoobj/srchuno.cxx | 52
sc/source/ui/unoobj/styleuno.cxx | 12
sc/source/ui/unoobj/targuno.cxx | 4
sc/source/ui/unoobj/tokenuno.cxx | 24
sc/source/ui/unoobj/viewuno.cxx | 94
sc/source/ui/vba/vbachartobject.cxx | 2
sc/source/ui/view/formatsh.cxx | 4
sc/source/ui/view/prevwsh.cxx | 4
sc/source/ui/view/viewdata.cxx | 90
scaddins/source/analysis/analysis.cxx | 4
scaddins/source/pricing/pricing.cxx | 19
scripting/source/dlgprov/dlgevtatt.cxx | 2
scripting/source/protocolhandler/scripthandler.cxx | 4
scripting/source/provider/URIHelper.cxx | 8
sd/qa/unit/export-tests.cxx | 2
sd/source/filter/ppt/pptinanimations.cxx | 4
sd/source/ui/app/optsitem.cxx | 28
sd/source/ui/dlg/dlgass.cxx | 4
sd/source/ui/framework/factories/FullScreenPane.cxx | 2
sd/source/ui/inc/unokywds.hxx | 9
sd/source/ui/presenter/PresenterTextView.cxx | 4
sd/source/ui/unoidl/unolayer.cxx | 8
sd/source/ui/unoidl/unopage.cxx | 4
sd/source/ui/unoidl/unopback.cxx | 2
sdext/source/minimizer/pppoptimizer.cxx | 6
sdext/source/minimizer/pppoptimizerdialog.cxx | 8
sdext/source/pdfimport/test/tests.cxx | 28
sdext/source/presenter/PresenterPaneFactory.cxx | 2
shell/source/cmdmail/cmdmailmsg.cxx | 28
starmath/source/document.cxx | 2
starmath/source/node.cxx | 12
svgio/source/svgreader/svgcharacternode.cxx | 2
svgio/source/svgreader/svgnode.cxx | 8
sw/qa/extras/inc/swmodeltestbase.hxx | 6
sw/qa/extras/mailmerge/mailmerge.cxx | 2
sw/source/core/access/accdoc.cxx | 6
sw/source/core/access/acchyperlink.cxx | 2
sw/source/core/crsr/annotationmark.cxx | 2
sw/source/core/crsr/findtxt.cxx | 6
sw/source/core/text/EnhancedPDFExportHelper.cxx | 14
sw/source/core/unocore/unoidx.cxx | 6
sw/source/core/unocore/unostyle.cxx | 12
sw/source/filter/basflt/iodetect.cxx | 2
sw/source/filter/html/SwAppletImpl.cxx | 5
sw/source/filter/html/htmlcss1.cxx | 6
sw/source/filter/html/htmlforw.cxx | 4
sw/source/ui/envelp/mailmrge.cxx | 2
sw/source/ui/vba/vbaaddins.cxx | 2
sw/source/uibase/app/docst.cxx | 10
sw/source/uibase/config/modcfg.cxx | 2
sw/source/uibase/dbui/dbmgr.cxx | 2
sw/source/uibase/dbui/mailmergehelper.cxx | 6
sw/source/uibase/uno/unotxdoc.cxx | 20
tools/qa/cppunit/test_urlobj.cxx | 76
unoxml/source/events/eventdispatcher.cxx | 32
unoxml/source/rdf/librdf_repository.cxx | 12
uui/source/iahndl.cxx | 2
vbahelper/source/vbahelper/vbacommandbar.cxx | 2
vbahelper/source/vbahelper/vbacommandbarcontrols.cxx | 2
writerfilter/source/dmapper/StyleSheetTable.cxx | 7
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2
writerperfect/source/common/WPXSvInputStream.cxx | 2
xmlhelp/source/cxxhelp/provider/databases.cxx | 24
xmlhelp/source/cxxhelp/provider/provider.cxx | 2
xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 2
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 36
xmlhelp/source/treeview/tvfactory.cxx | 2
xmlhelp/source/treeview/tvread.cxx | 18
124 files changed, 2289 insertions(+), 2331 deletions(-)
New commits:
commit e09a8259e417cdb571fa1794e990e582cc7360e0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:22:06 2014 +0100
xmlhelp: Use appropriate OUString functions on string constants
Change-Id: I28f68ff0c43366b3877244ba272acf967f141e54
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index a6c8d3e..1a918f3 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -274,7 +274,7 @@ OString Databases::getImagesZipFileURL()
if ( !aSymbolsStyleName.isEmpty() )
{
- if ( aSymbolsStyleName.equalsAscii("auto") )
+ if ( aSymbolsStyleName == "auto" )
{
// with the layered images*.zip, tango is the most
// complete theme, so show that one
@@ -418,8 +418,8 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag
( str[idx + 1] == 'c' || str[idx + 1] == 'C' ) &&
( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) &&
( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) &&
- !( fileName = fileName.copy(0,idx).toAsciiLowerCase() ).equalsAscii( "picture" ) ) {
- if(! m_bShowBasic && fileName.equalsAscii("sbasic") )
+ ( fileName = fileName.copy(0,idx).toAsciiLowerCase() ) != "picture" ) {
+ if(! m_bShowBasic && fileName == "sbasic" )
continue;
m_avModules.push_back( fileName );
}
@@ -630,21 +630,21 @@ Databases::getCollator( const OUString& Language,
OUString countryStr = country(Language);
if( countryStr.isEmpty() )
{
- if( langStr.equalsAscii("de") )
+ if( langStr == "de" )
countryStr = "DE";
- else if( langStr.equalsAscii("en") )
+ else if( langStr == "en" )
countryStr = "US";
- else if( langStr.equalsAscii("es") )
+ else if( langStr == "es" )
countryStr = "ES";
- else if( langStr.equalsAscii("it") )
+ else if( langStr == "it" )
countryStr = "IT";
- else if( langStr.equalsAscii("fr") )
+ else if( langStr == "fr" )
countryStr = "FR";
- else if( langStr.equalsAscii("sv") )
+ else if( langStr == "sv" )
countryStr = "SE";
- else if( langStr.equalsAscii("ja") )
+ else if( langStr == "ja" )
countryStr = "JP";
- else if( langStr.equalsAscii("ko") )
+ else if( langStr == "ko" )
countryStr = "KR";
}
/* FIXME-BCP47: all this does not look right for language tag context,
@@ -1062,7 +1062,7 @@ void Databases::cascadingStylesheet( const OUString& Language,
bool bHighContrastMode = false;
OUString aCSS( m_aCSS );
- if ( aCSS.equalsAscii( "default" ) )
+ if ( aCSS == "default" )
{
// #i50760: "default" needs to adapt HC mode
uno::Reference< awt::XToolkit2 > xToolkit =
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 68323eb..1dcc86a 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -246,7 +246,7 @@ ContentProvider::elementReplaced(const container::ContainerEvent& Event)
OUString accessor;
Event.Accessor >>= accessor;
- if(!accessor.equalsAscii("HelpStyleSheet"))
+ if(accessor != "HelpStyleSheet")
return;
OUString replacedElement,element;
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index 62b1b9c..5656b5f 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -124,7 +124,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
vector< OUString > aCompleteResultVector;
OUString scope = m_aURLParameter.get_scope();
- bool bCaptionsOnly = scope.equalsAscii( "Heading" );
+ bool bCaptionsOnly = scope == "Heading";
sal_Int32 hitCount = m_aURLParameter.get_hitCount();
IndexFolderIterator aIndexFolderIt( *pDatabases, m_aURLParameter.get_module(), m_aURLParameter.get_language() );
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 174aef4..b0a7b23 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -131,7 +131,7 @@ OString URLParameter::getByName( const char* par )
OUString URLParameter::get_id()
{
- if( m_aId.equalsAscii("start") )
+ if( m_aId == "start" )
{ // module is set
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
@@ -158,7 +158,7 @@ OUString URLParameter::get_title()
{
if( isFile() )
return get_the_title();
- else if( !m_aModule.equalsAscii("") )
+ else if( !m_aModule.isEmpty() )
{
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
@@ -268,7 +268,7 @@ OUString URLParameter::get_the_jar()
void URLParameter::readHelpDataFile()
{
- if( get_id().equalsAscii("") )
+ if( get_id().isEmpty() )
return;
OUString aModule = get_module();
@@ -519,7 +519,7 @@ bool URLParameter::scheme()
sal_Int32 nLen = m_aExpr.getLength();
OUString aLastStr =
m_aExpr.copy(sal::static_int_cast<sal_uInt32>(nLen) - 6);
- if( aLastStr.equalsAscii( "DbPAR=" ) )
+ if( aLastStr == "DbPAR=" )
{
OUString aNewExpr = m_aExpr.copy( 0, 20 );
OUString aSharedStr("shared");
@@ -618,39 +618,39 @@ bool URLParameter::query()
query_ = query_.copy( delimIdx+1 ).trim();
}
- if( parameter.equalsAscii( "Language" ) )
+ if( parameter == "Language" )
m_aLanguage = value;
- else if( parameter.equalsAscii( "Device" ) )
+ else if( parameter == "Device" )
m_aDevice = value;
- else if( parameter.equalsAscii( "Program" ) )
+ else if( parameter == "Program" )
m_aProgram = value;
- else if( parameter.equalsAscii( "Eid" ) )
+ else if( parameter == "Eid" )
m_aEid = value;
- else if( parameter.equalsAscii( "UseDB" ) )
- m_bUseDB = !value.equalsAscii("no");
- else if( parameter.equalsAscii( "DbPAR" ) )
+ else if( parameter == "UseDB" )
+ m_bUseDB = value != "no";
+ else if( parameter == "DbPAR" )
m_aDbPar = value;
- else if( parameter.equalsAscii( "Query" ) )
+ else if( parameter == "Query" )
{
if( m_aQuery.isEmpty() )
m_aQuery = value;
else
m_aQuery += ( OUString( " " ) + value );
}
- else if( parameter.equalsAscii( "Scope" ) )
+ else if( parameter == "Scope" )
m_aScope = value;
- else if( parameter.equalsAscii( "System" ) )
+ else if( parameter == "System" )
m_aSystem = value;
- else if( parameter.equalsAscii( "HelpPrefix" ) )
+ else if( parameter == "HelpPrefix" )
m_aPrefix = rtl::Uri::decode(
value,
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8 );
- else if( parameter.equalsAscii( "HitCount" ) )
+ else if( parameter == "HitCount" )
m_nHitCount = value.toInt32();
- else if( parameter.equalsAscii( "Active" ) )
+ else if( parameter == "Active" )
m_aActive = value;
- else if( parameter.equalsAscii( "Version" ) )
+ else if( parameter == "Version" )
; // ignored (but accepted) in the build-in help, useful only for the online help
else
ret = false;
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index 110fbfb..a101b17 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -108,7 +108,7 @@ TVFactory::createInstanceWithArguments(
if( ! ( Arguments[i] >>= pV ) )
continue;
- if( !pV.Name.equalsAscii( "nodepath" ) )
+ if( pV.Name != "nodepath" )
continue;
if( ! ( pV.Value >>= hierview ) )
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 1a1f670..fd9a809 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -262,11 +262,11 @@ TVRead::getByName( const OUString& aName )
{
bool found( true );
Any aAny;
- if( aName.equalsAscii( "Title" ) )
+ if( aName == "Title" )
aAny <<= Title;
- else if( aName.equalsAscii( "TargetURL" ) )
+ else if( aName == "TargetURL" )
aAny <<= TargetURL;
- else if( aName.equalsAscii( "Children" ) )
+ else if( aName == "Children" )
{
cppu::OWeakObject* p = Children.get();
aAny <<= Reference< XInterface >( p );
@@ -297,9 +297,9 @@ sal_Bool SAL_CALL
TVRead::hasByName( const OUString& aName )
throw( RuntimeException, std::exception )
{
- if( aName.equalsAscii( "Title" ) ||
- aName.equalsAscii( "TargetURL" ) ||
- aName.equalsAscii( "Children" ) )
+ if( aName == "Title" ||
+ aName == "TargetURL" ||
+ aName == "Children" )
return true;
return false;
@@ -316,7 +316,7 @@ TVRead::getByHierarchicalName( const OUString& aName )
OUString name( aName );
if( ( idx = name.indexOf( '/' ) ) != -1 &&
- name.copy( 0,idx ).equalsAscii( "Children" ) )
+ name.copy( 0,idx ) == "Children" )
return Children->getByHierarchicalName( name.copy( 1 + idx ) );
return getByName( name );
@@ -330,7 +330,7 @@ TVRead::hasByHierarchicalName( const OUString& aName )
OUString name( aName );
if( ( idx = name.indexOf( '/' ) ) != -1 &&
- name.copy( 0,idx ).equalsAscii( "Children" ) )
+ name.copy( 0,idx ) == "Children" )
return Children->hasByHierarchicalName( name.copy( 1 + idx ) );
return hasByName( name );
@@ -732,7 +732,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
( str[idx_ + 4] == 'e' || str[idx_ + 4] == 'E' ) )
{
OUString baseName = aFileName.copy(0,idx_).toAsciiLowerCase();
- if(! showBasic && baseName.equalsAscii("sbasic") )
+ if(! showBasic && baseName == "sbasic" )
continue;
osl::File aFile( aFileUrl );
if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )
commit f273d6707685816a1eddc849d66f828c4666f5dc
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:21:42 2014 +0100
writerperfect: Use appropriate OUString functions on string constants
Change-Id: Ieb4b5ea8d7f6b19d4311892a11a11bef2acbdf8b
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index 3c22f9d..5e23f6d 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -365,7 +365,7 @@ void ZipStorageImpl::traverse(const Reference<container::XNameAccess> &rxContain
for (sal_Int32 n = 0; n < lNames.getLength(); ++n)
{
- if (!lNames[n].endsWithAsciiL("/", 1)) // skip dirs
+ if (!lNames[n].endsWith("/")) // skip dirs
{
maStreams.push_back(ZipStreamData(rtl::OUStringToOString(lNames[n], RTL_TEXTENCODING_UTF8)));
maNameMap[lNames[n]] = maStreams.size() - 1;
commit 857742d60f579826cbd0ca5a5336348484714b2c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:21:19 2014 +0100
writerfilter: Use appropriate OUString functions on string constants
Change-Id: I113dba36c8c6a15f93fb4f15cd85ddb07ce5eecf
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 89e00d9..dcdad73 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1576,9 +1576,9 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp
const OUString* pStyleNames = aStyleNames.getConstArray();
for( sal_Int32 nStyle = 0; nStyle < aStyleNames.getLength(); ++nStyle )
{
- if( pStyleNames[nStyle].matchAsciiL( cListLabel, sizeof( cListLabel ) - 1 ))
+ OUString sSuffix;
+ if( pStyleNames[nStyle].startsWith( cListLabel, &sSuffix ) )
{
- OUString sSuffix = pStyleNames[nStyle].copy( sizeof( cListLabel ) - 1 );
sal_Int32 nSuffix = sSuffix.toInt32();
if( nSuffix > 0 )
{
@@ -1587,8 +1587,7 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp
}
}
}
- sListLabel = OUString::createFromAscii( cListLabel );
- sListLabel += OUString::number( ++nStyleFound );
+ sListLabel = cListLabel + OUString::number( ++nStyleFound );
//create a new one otherwise
uno::Reference< lang::XMultiServiceFactory > xDocFactory( m_pImpl->m_xTextDocument, uno::UNO_QUERY_THROW );
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8793529..fd5d02b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1153,7 +1153,7 @@ void RTFDocumentImpl::text(OUString& rString)
{
// ; is the end of the entry
bool bEnd = false;
- if (rString.endsWithAsciiL(";", 1))
+ if (rString.endsWith(";"))
{
rString = rString.copy(0, rString.getLength() - 1);
bEnd = true;
commit 14c1ffe5bd1186589a987135207877ef3214db8d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:19:57 2014 +0100
vbahelper: Use appropriate OUString functions on string constants
Change-Id: Iabe3deccf77a79db03909b8ae6ab70322cf0ffba
diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
index a491c36..cfab911 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -50,7 +50,7 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException, std::exception )
{
if( m_bIsMenu )
{
- if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) )
+ if( m_sResourceUrl == ITEM_MENUBAR_URL )
{
if( pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" )
sName = "Worksheet Menu Bar";
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 7f3ab37..b01179e 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -49,7 +49,7 @@ public:
ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const OUString& sResourceUrl ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl )
{
- m_bIsMenu = sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ? sal_True : sal_False;
+ m_bIsMenu = sResourceUrl == ITEM_MENUBAR_URL;
}
uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const OUString& sCommandURL,
commit 514b5d6919bdba95ab31c57920b5a3fd87db0a33
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:19:36 2014 +0100
uui: Use appropriate OUString functions on string constants
Change-Id: Ic9cc90b11cc0097327748a1d3f08cebe037b811e
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index ac56d73..d3563d0 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -322,7 +322,7 @@ namespace
}
const ::com::sun::star::uno::Type aType( pTypeDesc->pWeakRef );
- const bool bExactMatch = i_rPropagation.equalsAscii( "named-only" );
+ const bool bExactMatch = i_rPropagation == "named-only";
if ( bExactMatch )
return i_rRequest.getValueType().equals( aType );
commit 3c262bacf2bff175014ac56d11fd3d209bec8a43
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:19:21 2014 +0100
unoxml: Use appropriate OUString functions on string constants
Change-Id: If4467034e026409dc9d6f0b5ffcafcf98ff8778e
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index aa698e1..ae53ae2 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -116,13 +116,13 @@ namespace DOM { namespace events {
CEvent *pEvent = 0; // pointer to internal event representation
OUString const aType = i_xEvent->getType();
- if (aType.equalsAscii("DOMSubtreeModified") ||
- aType.equalsAscii("DOMNodeInserted") ||
- aType.equalsAscii("DOMNodeRemoved") ||
- aType.equalsAscii("DOMNodeRemovedFromDocument") ||
- aType.equalsAscii("DOMNodeInsertedIntoDocument") ||
- aType.equalsAscii("DOMAttrModified") ||
- aType.equalsAscii("DOMCharacterDataModified") )
+ if (aType == "DOMSubtreeModified" ||
+ aType == "DOMNodeInserted" ||
+ aType == "DOMNodeRemoved" ||
+ aType == "DOMNodeRemovedFromDocument" ||
+ aType == "DOMNodeInsertedIntoDocument" ||
+ aType == "DOMAttrModified" ||
+ aType == "DOMCharacterDataModified" )
{
Reference< XMutationEvent > const aMEvent(i_xEvent,
UNO_QUERY_THROW);
@@ -137,9 +137,9 @@ namespace DOM { namespace events {
aMEvent->getAttrChange());
pEvent = pMEvent;
} else if ( // UIEvent
- aType.equalsAscii("DOMFocusIn") ||
- aType.equalsAscii("DOMFocusOut") ||
- aType.equalsAscii("DOMActivate") )
+ aType == "DOMFocusIn" ||
+ aType == "DOMFocusOut" ||
+ aType == "DOMActivate" )
{
Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW);
CUIEvent* pUIEvent = new CUIEvent;
@@ -148,12 +148,12 @@ namespace DOM { namespace events {
aUIEvent->getView(), aUIEvent->getDetail());
pEvent = pUIEvent;
} else if ( // MouseEvent
- aType.equalsAscii("click") ||
- aType.equalsAscii("mousedown") ||
- aType.equalsAscii("mouseup") ||
- aType.equalsAscii("mouseover") ||
- aType.equalsAscii("mousemove") ||
- aType.equalsAscii("mouseout") )
+ aType == "click" ||
+ aType == "mousedown" ||
+ aType == "mouseup" ||
+ aType == "mouseover" ||
+ aType == "mousemove" ||
+ aType == "mouseout" )
{
Reference< XMouseEvent > const aMouseEvent(i_xEvent,
UNO_QUERY_THROW);
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index fdd5d8a..f768f79 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -969,7 +969,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw lang::IllegalArgumentException(
"librdf_Repository::importGraph: graph name is null", *this, 2);
}
- if (i_xGraphName->getStringValue().matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1))
+ if (i_xGraphName->getStringValue().startsWith(s_nsOOo))
{
throw lang::IllegalArgumentException(
"librdf_Repository::importGraph: URI is reserved", *this, 0);
@@ -1291,7 +1291,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
}
const OUString contextU( i_xGraphName->getStringValue() );
- if (contextU.matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1))
+ if (contextU.startsWith(s_nsOOo))
{
throw lang::IllegalArgumentException(
"librdf_Repository::createGraph: URI is reserved", *this, 0);
@@ -1560,7 +1560,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"ensureMetadataReference did not", *this);
}
OUString const sXmlId(mdref.First + "#" + mdref.Second);
- OUString const sContext(OUString::createFromAscii(s_nsOOo) + sXmlId);
+ OUString const sContext(s_nsOOo + sXmlId);
OUString const content( (i_rRDFaContent.isEmpty())
? xTextRange->getString()
: i_rRDFaContent );
@@ -1637,8 +1637,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
return; // nothing to do...
}
- OUString const sXmlId(
- OUString::createFromAscii(s_nsOOo) + mdref.First + "#" + mdref.Second);
+ OUString const sXmlId(s_nsOOo + mdref.First + "#" + mdref.Second);
clearGraph_NoLock(sXmlId, true);
}
@@ -1660,8 +1659,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
OUString const sXmlId(mdref.First + "#" + mdref.Second);
uno::Reference<rdf::XURI> xXmlId;
try {
- xXmlId.set( rdf::URI::create(m_xContext,
- OUString::createFromAscii(s_nsOOo) + sXmlId),
+ xXmlId.set( rdf::URI::create(m_xContext, s_nsOOo + sXmlId),
uno::UNO_QUERY_THROW);
} catch (const lang::IllegalArgumentException & iae) {
throw lang::WrappedTargetRuntimeException(
commit 9ce073bc170f6956938cfb25fd5e5b1ad118df83
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:19:01 2014 +0100
tools: Use appropriate OUString functions on string constants
Change-Id: Ifeb1aa309db401c9bb6e3184489c17d399cf145f
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index df866bc..038ead7 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -69,14 +69,14 @@ namespace tools_urlobj
( "file://10.10.1.1/sampledir/sample.file" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "10.10.1.1" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/sampledir/sample.file" ) );
- CPPUNIT_ASSERT( aUrl.getName( ).
- equalsAscii( "sample.file" ) );
- CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "sample" ) );
- CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "file" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "10.10.1.1" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/sampledir/sample.file" );
+ CPPUNIT_ASSERT( aUrl.getName( )
+ == "sample.file" );
+ CPPUNIT_ASSERT( aUrl.getBase( ) == "sample" );
+ CPPUNIT_ASSERT( aUrl.getExtension( ) == "file" );
}
void urlobjTest_002( )
@@ -95,14 +95,13 @@ namespace tools_urlobj
equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "137.65.170.24" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/c$/Img0001.jpg" ) );
- CPPUNIT_ASSERT( aUrl.getName( ).
- equalsAscii( "Img0001.jpg" ) );
- CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "Img0001" ) );
- CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "jpg" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "137.65.170.24" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/c$/Img0001.jpg" );
+ CPPUNIT_ASSERT( aUrl.getName( ) == "Img0001.jpg" );
+ CPPUNIT_ASSERT( aUrl.getBase( ) == "Img0001" );
+ CPPUNIT_ASSERT( aUrl.getExtension( ) == "jpg" );
}
@@ -122,10 +121,10 @@ namespace tools_urlobj
equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "hive-winxp-x86" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/pmladek/test2.odt" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "hive-winxp-x86" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/pmladek/test2.odt" );
}
void urlobjTest_004( )
@@ -141,14 +140,13 @@ namespace tools_urlobj
equalsAscii( "file://10.10.1.1/sampledir/sample.file" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "10.10.1.1" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/sampledir/sample.file" ) );
- CPPUNIT_ASSERT( aUrl.getName( ).
- equalsAscii( "sample.file" ) );
- CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "sample" ) );
- CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "file" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "10.10.1.1" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/sampledir/sample.file" );
+ CPPUNIT_ASSERT( aUrl.getName( ) == "sample.file" );
+ CPPUNIT_ASSERT( aUrl.getBase( ) == "sample" );
+ CPPUNIT_ASSERT( aUrl.getExtension( ) == "file" );
}
void urlobjTest_005( )
@@ -166,13 +164,13 @@ namespace tools_urlobj
equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "137.65.170.24" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/c$/Img0001.jpg" ) );
- CPPUNIT_ASSERT( aUrl.getName( ).equalsAscii( "Img0001.jpg" ) );
- CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "Img0001" ) );
- CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "jpg" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "137.65.170.24" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/c$/Img0001.jpg" );
+ CPPUNIT_ASSERT( aUrl.getName( ) == "Img0001.jpg" );
+ CPPUNIT_ASSERT( aUrl.getBase( ) == "Img0001" );
+ CPPUNIT_ASSERT( aUrl.getExtension( ) == "jpg" );
}
@@ -191,10 +189,10 @@ namespace tools_urlobj
equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) );
CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE );
#endif
- CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ).
- equalsAscii( "hive-winxp-x86" ) );
- CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ).
- equalsAscii( "/pmladek/test2.odt" ) );
+ CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE )
+ == "hive-winxp-x86" );
+ CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE )
+ == "/pmladek/test2.odt" );
}
void urlobjCmisTest( )
commit fe99ee368fef4059e187a81059679ca150161119
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:18:44 2014 +0100
sw: Use appropriate OUString functions on string constants
Change-Id: I559d1e44d9096a2583af8e05468b3743ac210c6c
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index dedd5a9..8e8dea8 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -67,7 +67,7 @@ using namespace css;
#define DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, BaseClass) \
class TestName : public BaseClass { \
protected:\
- virtual OUString getTestName() SAL_OVERRIDE { return OUString::createFromAscii(#TestName); } \
+ virtual OUString getTestName() SAL_OVERRIDE { return OUString(#TestName); } \
public:\
CPPUNIT_TEST_SUITE(TestName); \
CPPUNIT_TEST(Import); \
@@ -116,7 +116,7 @@ using namespace css;
#define DECLARE_SW_IMPORT_TEST(TestName, filename, BaseClass) \
class TestName : public BaseClass { \
protected:\
- virtual OUString getTestName() SAL_OVERRIDE { return OUString::createFromAscii(#TestName); } \
+ virtual OUString getTestName() SAL_OVERRIDE { return OUString(#TestName); } \
public:\
CPPUNIT_TEST_SUITE(TestName); \
CPPUNIT_TEST(Import); \
@@ -133,7 +133,7 @@ using namespace css;
#define DECLARE_SW_EXPORT_TEST(TestName, filename, BaseClass) \
class TestName : public BaseClass { \
protected:\
- virtual OUString getTestName() SAL_OVERRIDE { return OUString::createFromAscii(#TestName); } \
+ virtual OUString getTestName() SAL_OVERRIDE { return OUString(#TestName); } \
public:\
CPPUNIT_TEST_SUITE(TestName); \
CPPUNIT_TEST(Import_Export); \
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 94d084b..ca48e68 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -211,7 +211,7 @@ protected:
#define DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, file, BaseClass) \
class TestName : public BaseClass { \
protected: \
- virtual OUString getTestName() SAL_OVERRIDE { return OUString::createFromAscii(#TestName); } \
+ virtual OUString getTestName() SAL_OVERRIDE { return OUString(#TestName); } \
public: \
CPPUNIT_TEST_SUITE(TestName); \
CPPUNIT_TEST(MailMerge); \
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index aed3958..2d82015 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -569,18 +569,18 @@ void SAL_CALL SwAccessibleDocument::notifyEvent( const ::com::sun::star::documen
{
SolarMutexGuard g;
- if ( Event.EventName.equalsAscii( "FirstPageShows" ) )
+ if ( Event.EventName == "FirstPageShows" )
{
FireStateChangedEvent( AccessibleStateType::FOCUSED,true );
}
- else if ( Event.EventName.equalsAscii( "LoadFinished" ) )
+ else if ( Event.EventName == "LoadFinished" )
{
// IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,true );
// MT: LoadFinished => Why not SHOWING == TRUE?
FireStateChangedEvent( AccessibleStateType::SHOWING,false );
}
- else if ( Event.EventName.equalsAscii( "FormatFinished" ) )
+ else if ( Event.EventName == "FormatFinished" )
{
FireStateChangedEvent( AccessibleStateType::BUSY,false );
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,false );
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index ab0452b..09d2d69 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -212,7 +212,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( ! xFactory.is() )
return sal_False;
- uno::Reference< com::sun::star::frame::XDesktop > xDesktop( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ),
+ uno::Reference< com::sun::star::frame::XDesktop > xDesktop( xFactory->createInstance( "com.sun.star.frame.Desktop" ),
uno::UNO_QUERY );
if( !xDesktop.is() )
return sal_False;
diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx
index b4e3c1f..cccc3c4 100644
--- a/sw/source/core/crsr/annotationmark.cxx
+++ b/sw/source/core/crsr/annotationmark.cxx
@@ -41,7 +41,7 @@ namespace sw { namespace mark
{
if ( rName.getLength() == 0 )
{
- SetName( MarkBase::GenerateNewName( ::rtl::OUString::createFromAscii("__Annotation__") ) );
+ SetName( MarkBase::GenerateNewName("__Annotation__") );
}
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 15de11b..8b1d6d1 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -231,9 +231,9 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
const bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType;
const bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() &&
- ( rSearchOpt.searchString.equalsAscii( "^$" ) ||
- rSearchOpt.searchString.equalsAscii( "$^" ) );
- const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString.equalsAscii( "$" );
+ ( rSearchOpt.searchString == "^$" ||
+ rSearchOpt.searchString == "$^" );
+ const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString == "$";
// LanguageType eLastLang = 0;
while( 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) ))
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index d5935f4..6b3b79b 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -174,7 +174,7 @@ bool lcl_IsHeadlineCell( const SwCellFrm& rCellFrm )
OUString sStyleName;
SwStyleNameMapper::FillProgName( pTxtFmt->GetName(), sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true );
- bRet = sStyleName.equalsAscii(aTableHeadingName);
+ bRet = sStyleName == aTableHeadingName;
}
return bRet;
@@ -1081,7 +1081,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Quotations: BlockQuote
- if (sStyleName.equalsAscii(aQuotations))
+ if (sStyleName == aQuotations)
{
nPDFType = vcl::PDFWriter::BlockQuote;
aPDFType = OUString(aBlockQuoteString);
@@ -1089,7 +1089,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Caption: Caption
- else if (sStyleName.equalsAscii(aCaption))
+ else if (sStyleName == aCaption)
{
nPDFType = vcl::PDFWriter::Caption;
aPDFType = OUString(aCaptionString);
@@ -1097,7 +1097,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Caption: Caption
- else if (sParentStyleName.equalsAscii(aCaption))
+ else if (sParentStyleName == aCaption)
{
nPDFType = vcl::PDFWriter::Caption;
aPDFType = sStyleName + aCaptionString;
@@ -1105,7 +1105,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Heading: H
- else if (sStyleName.equalsAscii(aHeading))
+ else if (sStyleName == aHeading)
{
nPDFType = vcl::PDFWriter::Heading;
aPDFType = OUString(aHString);
@@ -1362,12 +1362,12 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
aPDFType = OUString(aLinkString);
}
// Check for Quote/Code character style:
- else if (sStyleName.equalsAscii(aQuotation))
+ else if (sStyleName == aQuotation)
{
nPDFType = vcl::PDFWriter::Quote;
aPDFType = OUString(aQuoteString);
}
- else if (sStyleName.equalsAscii(aSourceText))
+ else if (sStyleName == aSourceText)
{
nPDFType = vcl::PDFWriter::Code;
aPDFType = OUString(aCodeString);
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 9fddc2a..387e888 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -152,7 +152,7 @@ static void lcl_ConvertTOUNameToProgrammaticName(OUString& rTmp)
}
// if the version is not English but the alternative index's name is
// "User-Defined" a " (user)" is appended
- else if(rTmp.equalsAscii(cUserDefined))
+ else if(rTmp == cUserDefined)
{
rTmp += cUserSuffix;
}
@@ -162,11 +162,11 @@ static void
lcl_ConvertTOUNameToUserName(OUString& rTmp)
{
ShellResource* pShellRes = SwViewShell::GetShellRes();
- if (rTmp.equalsAscii(cUserDefined))
+ if (rTmp == cUserDefined)
{
rTmp = pShellRes->aTOXUserName;
}
- else if (!pShellRes->aTOXUserName.equalsAscii(cUserDefined) &&
+ else if (pShellRes->aTOXUserName != cUserDefined &&
USER_AND_SUFFIXLEN == rTmp.getLength())
{
//make sure that in non-English versions the " (user)" suffix is removed
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 8d98606..7f2e842 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4087,11 +4087,11 @@ uno::Any SwXAutoStyles::getByName(const OUString& Name)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{
uno::Any aRet;
- if(Name.equalsAscii("CharacterStyles") )
+ if(Name == "CharacterStyles")
aRet = getByIndex(0);
- else if(Name.equalsAscii("RubyStyles") )
+ else if(Name == "RubyStyles")
aRet = getByIndex(1);
- else if(Name.equalsAscii("ParagraphStyles") )
+ else if(Name == "ParagraphStyles")
aRet = getByIndex(2);
else
throw container::NoSuchElementException();
@@ -4112,9 +4112,9 @@ uno::Sequence< OUString > SwXAutoStyles::getElementNames(void)
sal_Bool SwXAutoStyles::hasByName(const OUString& Name)
throw( uno::RuntimeException, std::exception )
{
- if( Name.equalsAscii("CharacterStyles") ||
- Name.equalsAscii("RubyStyles") ||
- Name.equalsAscii("ParagraphStyles") )
+ if( Name == "CharacterStyles" ||
+ Name == "RubyStyles" ||
+ Name == "ParagraphStyles" )
return sal_True;
else
return sal_False;
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 5c5f6a5..265cfbd 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -230,7 +230,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName)
return pFilter;
}
- return SwIoSystem::GetFilterOfFormat(OUString::createFromAscii(FILTER_TEXT), 0);
+ return SwIoSystem::GetFilterOfFormat(FILTER_TEXT, 0);
}
bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, sal_uLong &rLen,
diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx
index eff1b23..9c562d2 100644
--- a/sw/source/filter/html/SwAppletImpl.cxx
+++ b/sw/source/filter/html/SwAppletImpl.cxx
@@ -50,8 +50,7 @@ SwHtmlOptType SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet
rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_alt ) )
nType = SwHtmlOptType::IGNORE;
else if( bApplet &&
- (rName.equalsIgnoreAsciiCaseAscii( sHTML_O_archive ) ||
- rName.equalsIgnoreAsciiCaseAscii( sHTML_O_Archives )) )
+ (rName == sHTML_O_archive || rName == sHTML_O_Archives ) )
nType = SwHtmlOptType::TAG;
break;
case 'C':
@@ -86,7 +85,7 @@ SwHtmlOptType SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet
break;
case 'O':
case 'o':
- if( bApplet && rName.equalsIgnoreAsciiCaseAscii( sHTML_O_Object ) )
+ if( bApplet && rName == sHTML_O_Object )
nType = SwHtmlOptType::TAG;
break;
case 'S':
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index a2353c6..04a9d71 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -589,17 +589,17 @@ sal_uInt16 SwCSS1Parser::GetScriptFromClass( OUString& rClass,
switch( nLen )
{
case 3:
- if( rClass.matchIgnoreAsciiCaseAsciiL( "cjk", 3, nPos ) )
+ if( rClass.matchIgnoreAsciiCase( "cjk", nPos ) )
{
nScriptFlags = CSS1_SCRIPT_CJK;
}
- else if( rClass.matchIgnoreAsciiCaseAsciiL( "ctl", 3, nPos ) )
+ else if( rClass.matchIgnoreAsciiCase( "ctl", nPos ) )
{
nScriptFlags = CSS1_SCRIPT_CTL;
}
break;
case 7:
- if( rClass.matchIgnoreAsciiCaseAsciiL( "western", 7, nPos ) )
+ if( rClass.matchIgnoreAsciiCase( "western", nPos ) )
{
nScriptFlags = CSS1_SCRIPT_WESTERN;
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index c8a3c0b..2ada383 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -764,7 +764,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
const OUString& rVal = *(OUString*)aTmp.getValue();
if( rVal.isEmpty() )
bEmptyValue = true;
- else if( !rVal.equalsAscii( OOO_STRING_SVTOOLS_HTML_on ) )
+ else if( rVal != OOO_STRING_SVTOOLS_HTML_on )
sValue = rVal;
}
break;
@@ -1204,7 +1204,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( i < nValCnt )
{
const OUString& rVal = pValues[i];
- if( rVal.equalsAscii( "$$$empty$$$" ) )
+ if( rVal == "$$$empty$$$" )
bEmptyVal = true;
else
sVal = rVal;
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 693beba..9adfbb8 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -375,7 +375,7 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
if( !sUIName2.isEmpty() )
{
const sal_Int32 nFilter = m_pFilterLB->InsertEntry( sUIName2 );
- if( sFilter.equalsAscii("writer8") )
+ if( sFilter == "writer8" )
nODT = nFilter;
m_pFilterLB->SetEntryData( nFilter, new OUString( sFilter ) );
}
diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx
index 0531edb..29ae1c5 100644
--- a/sw/source/ui/vba/vbaaddins.cxx
+++ b/sw/source/ui/vba/vbaaddins.cxx
@@ -44,7 +44,7 @@ static uno::Reference< container::XIndexAccess > lcl_getAddinCollection( const u
for( sal_Int32 index = 0; index < nEntry; ++index )
{
OUString sUrl = sEntries[ index ];
- if( !xSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
+ if( !xSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCase( ".dot" ) )
{
maAddins.push_back( uno::Reference< word::XAddin >( new SwVbaAddin( xParent, xContext, sUrl, true ) ) );
}
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 330e033..05914a7 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -394,19 +394,19 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, false, &pItem ))
{
OUString aFamily = static_cast<const SfxStringItem*>(pItem)->GetValue();
- if(aFamily.equalsAscii("CharacterStyles"))
+ if(aFamily == "CharacterStyles")
nFamily = SFX_STYLE_FAMILY_CHAR;
else
- if(aFamily.equalsAscii("ParagraphStyles"))
+ if(aFamily == "ParagraphStyles")
nFamily = SFX_STYLE_FAMILY_PARA;
else
- if(aFamily.equalsAscii("PageStyles"))
+ if(aFamily == "PageStyles")
nFamily = SFX_STYLE_FAMILY_PAGE;
else
- if(aFamily.equalsAscii("FrameStyles"))
+ if(aFamily == "FrameStyles")
nFamily = SFX_STYLE_FAMILY_FRAME;
else
- if(aFamily.equalsAscii("NumberingStyles"))
+ if(aFamily == "NumberingStyles")
nFamily = SFX_STYLE_FAMILY_PSEUDO;
}
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 049cf02..5364393 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1092,7 +1092,7 @@ void SwInsertConfig::Load()
//#i61007# initialize caption order, right now only HUNGARIAN seems to need a different order
SvtSysLocaleOptions aSysLocaleOptions;
OUString sLang = aSysLocaleOptions.GetLocaleConfigString();
- bCaptionOrderNumberingFirst = !sLang.isEmpty() && sLang.matchAsciiL( "hu", 2 );
+ bCaptionOrderNumberingFirst = sLang.startsWith( "hu" );
}
}
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 7b97da3..6005d42 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1165,7 +1165,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
//convert fields to text if we are exporting to PDF
//this prevents a second merge while updating the fields in SwXTextDocument::getRendererCount()
- if( pStoreToFilter && pStoreToFilter->GetFilterName().equalsAscii("writer_pdf_Export"))
+ if( pStoreToFilter && pStoreToFilter->GetFilterName() == "writer_pdf_Export")
rWorkShell.ConvertFieldsToText();
xWorkDocSh->DoSaveAs(*pDstMed);
xWorkDocSh->DoSaveCompleted(pDstMed);
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 798c167..8142dfc 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -635,11 +635,11 @@ uno::Any SwConnectionContext::getValueByName( const OUString& rName )
throw (uno::RuntimeException, std::exception)
{
uno::Any aRet;
- if( rName.equalsAscii( "ServerName" ))
+ if( rName == "ServerName" )
aRet <<= m_sMailServer;
- else if( rName.equalsAscii( "Port" ))
+ else if( rName == "Port" )
aRet <<= (sal_Int32) m_nPort;
- else if( rName.equalsAscii( "ConnectionType" ))
+ else if( rName == "ConnectionType" )
aRet <<= m_sConnectionType;
return aRet;
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 3fdcc45..56c148b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1083,43 +1083,43 @@ void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue
const Any& rVal = pProperties[i].Value;
bool bException;
sal_uInt32 nVal = lcl_Any_To_ULONG(rVal, bException);
- if( sName.equalsAscii("PageRows" ) )
+ if( sName == "PageRows" )
{
if(!nVal || nVal > 0xff)
throw RuntimeException();
aData.SetRow((sal_uInt8)nVal);
}
- else if(sName.equalsAscii("PageColumns"))
+ else if(sName == "PageColumns")
{
if(!nVal || nVal > 0xff)
throw RuntimeException();
aData.SetCol((sal_uInt8)nVal);
}
- else if(sName.equalsAscii("LeftMargin"))
+ else if(sName == "LeftMargin")
{
aData.SetLeftSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("RightMargin"))
+ else if(sName == "RightMargin")
{
aData.SetRightSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("TopMargin"))
+ else if(sName == "TopMargin")
{
aData.SetTopSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("BottomMargin"))
+ else if(sName == "BottomMargin")
{
aData.SetBottomSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("HoriMargin"))
+ else if(sName == "HoriMargin")
{
aData.SetHorzSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("VertMargin"))
+ else if(sName == "VertMargin")
{
aData.SetVertSpace(convertMm100ToTwip(nVal));
}
- else if(sName.equalsAscii("IsLandscape"))
+ else if(sName == "IsLandscape")
{
bException = (::getBooleanCppuType() != rVal.getValueType());
aData.SetLandscape(*(sal_Bool*)rVal.getValue());
@@ -1751,7 +1751,7 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void)
OUString* pRet = aRet.getArray();
for ( sal_Int32 i = 0; i < aRet.getLength(); ++i )
{
- if ( pRet[i].equalsAscii( "com.sun.star.drawing.OLE2Shape" ) )
+ if ( pRet[i] == "com.sun.star.drawing.OLE2Shape" )
{
pRet[i] = pRet[aRet.getLength() - 1];
aRet.realloc( aRet.getLength() - 1 ); // <pRet> no longer valid.
commit 577e90091bc72eb72b1432611c82cbdaf18b557c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:18:14 2014 +0100
svgio: Use appropriate OUString functions on string constants
Change-Id: Idce7768fd43453703ba758d9fddf26e0b7e5cc76
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index ff9237c..7b8e4cb 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -246,7 +246,7 @@ namespace svgio
// of a SVG export with font embedding. Remove this to make font matching work. This
// is pretty safe since there should be no font family names ending on ' embedded'.
// Remove again when FontEmbedding is implemented in SVG import
- if(aFontFamily.endsWithAsciiL(" embedded", 9))
+ if(aFontFamily.endsWith(" embedded"))
{
aFontFamily = aFontFamily.copy(0, aFontFamily.getLength() - 9);
}
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index e4038e0..3066fc0 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -59,9 +59,7 @@ namespace svgio
if(rId.getLength())
{
const OUString aNewConcatenated(
- OUString::createFromAscii("#") +
- rId +
- aConcatenated);
+ "#" + rId + aConcatenated);
if(pParent)
{
@@ -113,9 +111,7 @@ namespace svgio
for(sal_uInt32 a(0); a < aParts.size(); a++)
{
const OUString aNewConcatenated(
- OUString::createFromAscii(".") +
- aParts[a] +
- aConcatenated);
+ "." + aParts[a] + aConcatenated);
if(pParent)
{
commit cfe98bd195e7dd831e1f08dd1e34653ab4f1f152
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:17:51 2014 +0100
starmath: Use appropriate OUString functions on string constants
Change-Id: Iff85fd325211708591c289d083cf3d0ee4269634
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index ca641e8..5bf4abb 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -912,7 +912,7 @@ bool SmDocShell::ConvertTo( SfxMedium &rMedium )
aEquation.SetFlat(true);
bRet = aEquation.Export(rMedium);
}
- else if (pFlt->GetFilterName().equalsAscii("MathType 3.x"))
+ else if (pFlt->GetFilterName() == "MathType 3.x")
bRet = WriteAsMathType3( rMedium );
}
return bRet;
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index e7c01e3..9d8356a 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -1620,11 +1620,11 @@ void SmBraceNode::CreateTextFromNode(OUString &rText)
aStr = comphelper::string::stripStart(aStr, '\\');
if (!aStr.isEmpty())
{
- if (aStr.equalsAscii("divides"))
+ if (aStr == "divides")
rText += "lline";
- else if (aStr.equalsAscii("parallel"))
+ else if (aStr == "parallel")
rText += "ldline";
- else if (aStr.equalsAscii("<"))
+ else if (aStr == "<")
rText += "langle";
else
rText += aStr;
@@ -1643,11 +1643,11 @@ void SmBraceNode::CreateTextFromNode(OUString &rText)
aStr = comphelper::string::stripStart(aStr, '\\');
if (!aStr.isEmpty())
{
- if (aStr.equalsAscii("divides"))
+ if (aStr == "divides")
rText += "rline";
- else if (aStr.equalsAscii("parallel"))
+ else if (aStr == "parallel")
rText += "rdline";
- else if (aStr.equalsAscii(">"))
+ else if (aStr == ">")
rText += "rangle";
else
rText += aStr;
commit 4888f82557f8aec29b1f7fa729888d1c71aef596
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:17:33 2014 +0100
shell: Use appropriate OUString functions on string constants
Change-Id: I2647295383085abf8f217693531ef82632eb4c52
diff --git a/shell/source/cmdmail/cmdmailmsg.cxx b/shell/source/cmdmail/cmdmailmsg.cxx
index 34adde9..287a735 100644
--- a/shell/source/cmdmail/cmdmailmsg.cxx
+++ b/shell/source/cmdmail/cmdmailmsg.cxx
@@ -132,25 +132,25 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
{
MutexGuard aGuard( m_aMutex );
- if( aName.equalsAscii( "body" ) && !m_aBody.isEmpty() )
+ if( aName == "body" && !m_aBody.isEmpty() )
return makeAny( m_aBody );
- if( aName.equalsAscii( "from" ) && !m_aOriginator.isEmpty() )
+ if( aName == "from" && !m_aOriginator.isEmpty() )
return makeAny( m_aOriginator );
- else if( aName.equalsAscii( "to" ) && !m_aRecipient.isEmpty() )
+ else if( aName == "to" && !m_aRecipient.isEmpty() )
return makeAny( m_aRecipient );
- else if( aName.equalsAscii( "cc" ) && m_CcRecipients.getLength() )
+ else if( aName == "cc" && m_CcRecipients.getLength() )
return makeAny( m_CcRecipients );
- else if( aName.equalsAscii( "bcc" ) && m_BccRecipients.getLength() )
+ else if( aName == "bcc" && m_BccRecipients.getLength() )
return makeAny( m_BccRecipients );
- else if( aName.equalsAscii( "subject" ) && !m_aSubject.isEmpty() )
+ else if( aName == "subject" && !m_aSubject.isEmpty() )
return makeAny( m_aSubject );
- else if( aName.equalsAscii( "attachment" ) && m_Attachments.getLength() )
+ else if( aName == "attachment" && m_Attachments.getLength() )
return makeAny( m_Attachments );
throw NoSuchElementException("key not found: " + aName,
@@ -195,25 +195,25 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( )
{
MutexGuard aGuard( m_aMutex );
- if( aName.equalsAscii( "body" ) && !m_aBody.isEmpty() )
+ if( aName == "body" && !m_aBody.isEmpty() )
return sal_True;
- if( aName.equalsAscii( "from" ) && !m_aOriginator.isEmpty() )
+ if( aName == "from" && !m_aOriginator.isEmpty() )
return sal_True;
- else if( aName.equalsAscii( "to" ) && !m_aRecipient.isEmpty() )
+ else if( aName == "to" && !m_aRecipient.isEmpty() )
return sal_True;
- else if( aName.equalsAscii( "cc" ) && m_CcRecipients.getLength() )
+ else if( aName == "cc" && m_CcRecipients.getLength() )
return sal_True;
- else if( aName.equalsAscii( "bcc" ) && m_BccRecipients.getLength() )
+ else if( aName == "bcc" && m_BccRecipients.getLength() )
return sal_True;
- else if( aName.equalsAscii( "subject" ) && !m_aSubject.isEmpty() )
+ else if( aName == "subject" && !m_aSubject.isEmpty() )
return sal_True;
- else if( aName.equalsAscii( "attachment" ) && m_Attachments.getLength() )
+ else if( aName == "attachment" && m_Attachments.getLength() )
return sal_True;
return sal_False;
commit afb28021e99d92c189adeda27300af52ca2c7bad
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:16:27 2014 +0100
sdext: Use appropriate OUString functions on string constants
Change-Id: I0e9800f1c828294e5b97e513dae30a4f2d1161fe
diff --git a/sdext/source/minimizer/pppoptimizer.cxx b/sdext/source/minimizer/pppoptimizer.cxx
index 51c2b7d..c2c5b6b 100644
--- a/sdext/source/minimizer/pppoptimizer.cxx
+++ b/sdext/source/minimizer/pppoptimizer.cxx
@@ -54,7 +54,7 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizer::queryDispat
const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException, std::exception )
{
Reference < XDispatch > xRet;
- if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
+ if ( aURL.Protocol.equalsIgnoreAsciiCase( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
{
// if ( aURL.Path.equalsAscii( "Function1" ) )
xRet = this;
@@ -84,9 +84,9 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizer:
void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments )
throw( RuntimeException, std::exception )
{
- if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
+ if ( mxController.is() && rURL.Protocol.equalsIgnoreAsciiCase( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
{
- if ( rURL.Path.equalsAscii( "optimize" ) )
+ if ( rURL.Path == "optimize" )
{
Reference< XModel > xModel( mxController->getModel() );
if ( xModel.is() )
diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx
index db6c5ff..6be8e71 100644
--- a/sdext/source/minimizer/pppoptimizerdialog.cxx
+++ b/sdext/source/minimizer/pppoptimizerdialog.cxx
@@ -74,7 +74,7 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::query
const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException, std::exception )
{
Reference < XDispatch > xRet;
- if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
+ if ( aURL.Protocol.equalsIgnoreAsciiCase( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
xRet = this;
return xRet;
@@ -98,9 +98,9 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
throw( RuntimeException, std::exception )
{
- if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
+ if ( mxController.is() && rURL.Protocol.equalsIgnoreAsciiCase( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
{
- if ( rURL.Path.equalsAscii( "execute" ) )
+ if ( rURL.Path == "execute" )
{
try
{
@@ -133,7 +133,7 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
}
}
- else if ( rURL.Path.equalsAscii( "statusupdate" ) )
+ else if ( rURL.Path == "statusupdate" )
{
if ( mpOptimizerDialog )
mpOptimizerDialog->UpdateStatus( rArguments );
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index 9538c66..101757e 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -365,9 +365,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask received two properties",
(sal_Int32) 3, xBitmap.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawMask got URL param",
- xBitmap[0].Name.equalsAscii( "URL" ) );
+ xBitmap[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawMask got InputStream param",
- xBitmap[1].Name.equalsAscii( "InputStream" ) );
+ xBitmap[1].Name == "InputStream" );
}
virtual void drawImage(const uno::Sequence<beans::PropertyValue>& xBitmap ) SAL_OVERRIDE
@@ -375,9 +375,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage received two properties",
(sal_Int32) 3, xBitmap.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawImage got URL param",
- xBitmap[0].Name.equalsAscii( "URL" ) );
+ xBitmap[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawImage got InputStream param",
- xBitmap[1].Name.equalsAscii( "InputStream" ) );
+ xBitmap[1].Name == "InputStream" );
m_bImageSeen = true;
}
@@ -387,9 +387,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage received two properties",
(sal_Int32) 3, xBitmap.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got URL param",
- xBitmap[0].Name.equalsAscii( "URL" ) );
+ xBitmap[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got InputStream param",
- xBitmap[1].Name.equalsAscii( "InputStream" ) );
+ xBitmap[1].Name == "InputStream" );
}
virtual void drawMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
@@ -399,16 +399,16 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #1",
(sal_Int32) 3, xBitmap.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #1",
- xBitmap[0].Name.equalsAscii( "URL" ) );
+ xBitmap[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #1",
- xBitmap[1].Name.equalsAscii( "InputStream" ) );
+ xBitmap[1].Name == "InputStream" );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #2",
(sal_Int32) 3, xMask.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #2",
- xMask[0].Name.equalsAscii( "URL" ) );
+ xMask[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #2",
- xMask[1].Name.equalsAscii( "InputStream" ) );
+ xMask[1].Name == "InputStream" );
}
virtual void drawAlphaMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
@@ -417,16 +417,16 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #1",
(sal_Int32) 3, xBitmap.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #1",
- xBitmap[0].Name.equalsAscii( "URL" ) );
+ xBitmap[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #1",
- xBitmap[1].Name.equalsAscii( "InputStream" ) );
+ xBitmap[1].Name == "InputStream" );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #2",
(sal_Int32) 3, xMask.getLength() );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #2",
- xMask[0].Name.equalsAscii( "URL" ) );
+ xMask[0].Name == "URL" );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #2",
- xMask[1].Name.equalsAscii( "InputStream" ) );
+ xMask[1].Name == "InputStream" );
}
virtual void setTextRenderMode( sal_Int32 ) SAL_OVERRIDE
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index 880ff3d..956a5b4 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -243,7 +243,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
rxPaneId,
rsTitle,
xParentPane,
- rxPaneId->getFullResourceURL().Arguments.equalsAscii("Sprite=1") );
+ rxPaneId->getFullResourceURL().Arguments == "Sprite=1");
}
catch (Exception&)
{
commit fc6e89ef5004bbc6f39e70d42a97c3c97c2050f4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:16:06 2014 +0100
sd: Use appropriate OUString functions on string constants
Change-Id: I853f0c45e606297c966cd50d7086646c867596ec
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 2641b71..4c4cf09 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -260,7 +260,7 @@ void SdExportTest::testN828390_4()
const SvxFontItem *pFont = dynamic_cast<const SvxFontItem *>((*it).pAttr);
if( pFont )
{
- CPPUNIT_ASSERT_MESSAGE( "Font is wrong", pFont->GetFamilyName().equalsAscii("Arial"));
+ CPPUNIT_ASSERT_MESSAGE( "Font is wrong", pFont->GetFamilyName() == "Arial");
bPassed = true;
}
const SvxWeightItem *pWeight = dynamic_cast<const SvxWeightItem *>((*it).pAttr);
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 62d1b4e..35e28a1 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -893,7 +893,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any
rValue <<= (sal_Int32)aColor.GetColor();
bRet = true;
}
- else if( aString.matchAsciiL( "rgb(", 4, 0 ) )
+ else if( aString.startsWith( "rgb(" ) )
{
aString = aString.copy( 4, aString.getLength() - 5 );
Color aColor;
@@ -904,7 +904,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any
rValue <<= (sal_Int32)aColor.GetColor();
bRet = true;
}
- else if( aString.matchAsciiL( "hsl(", 4, 0 ) )
+ else if( aString.startsWith( "hsl(" ) )
{
sal_Int32 index = 0;
sal_Int32 nA = aString.getToken( 0, (sal_Unicode)',', index ).toInt32();
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 182cb3d..c3f85ef 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -31,8 +31,6 @@
using namespace ::utl;
using namespace ::com::sun::star::uno;
-#define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr))
-
template< class T > T getSafeValue( const Any& rAny )
{
T value = T();
@@ -176,8 +174,8 @@ bool SdOptionsGeneric::isMetricSystem()
SdOptionsLayout::SdOptionsLayout( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Layout" ) :
- B2U( "Office.Impress/Layout" ) ) :
+ OUString( "Office.Draw/Layout" ) :
+ OUString( "Office.Impress/Layout" ) ) :
OUString() ),
bRuler( true ),
bMoveOutline( true ),
@@ -336,8 +334,8 @@ void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const
SdOptionsContents::SdOptionsContents( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Content" ) :
- B2U( "Office.Impress/Content" ) ) :
+ OUString( "Office.Draw/Content" ) :
+ OUString( "Office.Impress/Content" ) ) :
OUString() )
{
EnableModify( true );
@@ -415,8 +413,8 @@ void SdOptionsContentsItem::SetOptions(SdOptions*) const
SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Misc" ) :
- B2U( "Office.Impress/Misc" ) ) :
+ OUString( "Office.Draw/Misc" ) :
+ OUString( "Office.Impress/Misc" ) ) :
OUString() ),
nDefaultObjectSizeWidth(8000),
nDefaultObjectSizeHeight(5000),
@@ -751,8 +749,8 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
SdOptionsSnap::SdOptionsSnap( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Snap" ) :
- B2U( "Office.Impress/Snap" ) ) :
+ OUString( "Office.Draw/Snap" ) :
+ OUString( "Office.Impress/Snap" ) ) :
OUString() ),
bSnapHelplines( true ),
bSnapBorder( true ),
@@ -916,7 +914,7 @@ void SdOptionsSnapItem::SetOptions( SdOptions* pOpts ) const
SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, ( bUseConfig && ( SDCFG_DRAW == nConfigId ) ) ?
- B2U( "Office.Draw/Zoom" ) :
+ OUString( "Office.Draw/Zoom" ) :
OUString() ),
nX( 1 ),
nY( 1 )
@@ -981,8 +979,8 @@ bool SdOptionsZoom::WriteData( Any* pValues ) const
SdOptionsGrid::SdOptionsGrid( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Grid" ) :
- B2U( "Office.Impress/Grid" ) ) :
+ OUString( "Office.Draw/Grid" ) :
+ OUString( "Office.Impress/Grid" ) ) :
OUString() )
{
EnableModify( false );
@@ -1166,8 +1164,8 @@ void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const
SdOptionsPrint::SdOptionsPrint( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
- B2U( "Office.Draw/Print" ) :
- B2U( "Office.Impress/Print" ) ) :
+ OUString( "Office.Draw/Print" ) :
+ OUString( "Office.Impress/Print" ) ) :
OUString() ),
bDraw( true ),
bNotes( false ),
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 60f6363..294892d 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -728,9 +728,9 @@ void AssistentDlgImpl::ScanDocmenu (void)
OUString sFactoryName;
for( sal_Int32 i=0; i<nPropCount; ++i )
{
- if( lProps[i].Name.equalsAscii( "DocumentService" ) &&
+ if( lProps[i].Name == "DocumentService" &&
(lProps[i].Value >>= sFactoryName) &&
- sFactoryName.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) )
+ sFactoryName == "com.sun.star.presentation.PresentationDocument" )
{
// yes, it's an impress document
INetURLObject aURL;
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 15d3912..ae8698c 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -238,7 +238,7 @@ void FullScreenPane::ExtractArguments (
const OUString sKey = aToken.copy(0, nAssign);
const OUString sValue = aToken.copy(nAssign+1);
- if (sKey.equalsAscii("ScreenNumber"))
+ if (sKey == "ScreenNumber")
{
rnScreenNumberReturnValue = sValue.toInt32();
}
diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx
index c0514db..8e1f902 100644
--- a/sd/source/ui/inc/unokywds.hxx
+++ b/sd/source/ui/inc/unokywds.hxx
@@ -71,14 +71,7 @@ const char sUNO_StyleName_measure[] = "measure";
// SdUnoGraphicStyle
const char sUNO_SdUnoGraphicStyle[] = "SdUnoGraphicStyle";
-// SdUnoPageBackground
-const char sUNO_SdUnoPageBackground[] = "SdUnoPageBackground";
-
-// SdLayerManager
-const char sUNO_SdLayerManager[] = "SdUnoLayerManager";
-
// SdLayer
-const char sUNO_SdLayer[] = "SdUnoLayer";
const char sUNO_LayerName_background[] = "background";
const char sUNO_LayerName_background_objects[] = "backgroundobjects";
const char sUNO_LayerName_layout[] = "layout";
@@ -104,8 +97,6 @@ const char sUNO_Service_ShadowProperties[] = UNO_PREFIX "drawing.ShadowPropertie
const char sUNO_Service_ConnectorProperties[] = UNO_PREFIX "drawing.ConnectorProperties";
const char sUNO_Service_MeasureProperties[] = UNO_PREFIX "drawing.MeasureProperties";
const char sUNO_Service_PageBackground[] = UNO_PREFIX "drawing.PageBackground";
-const char sUNO_Service_DrawingLayer[] = UNO_PREFIX "drawing.Layer";
-const char sUNO_Service_DrawingLayerManager[] = UNO_PREFIX "drawing.LayerManager";
const char sUNO_Service_GraphicObjectShape[] = UNO_PREFIX "drawing.GraphicObjectShape";
const char sUNO_Service_ImageMapRectangleObject[] = UNO_PREFIX "image.ImageMapRectangleObject";
const char sUNO_Service_ImageMapCircleObject[] = UNO_PREFIX "image.ImageMapCircleObject";
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 5b2fe7a..4f2e6ca 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -452,11 +452,11 @@ sal_Int32 PresenterTextView::Implementation::ParseDistance (const OUString& rsDi
{
DBG_ASSERT(mpEditEngine!=NULL, "EditEngine missing");
sal_Int32 nDistance (0);
- if (rsDistance.endsWithAsciiL("px", 2))
+ if (rsDistance.endsWith("px"))
{
nDistance = rsDistance.copy(0,rsDistance.getLength()-2).toInt32();
}
- else if (rsDistance.endsWithAsciiL("l", 1))
+ else if (rsDistance.endsWith("l"))
{
const sal_Int32 nLines (rsDistance.copy(0,rsDistance.getLength()-1).toInt32());
// Take the height of the first line as the height of every line.
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index 659a09f..9ce0982 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -152,7 +152,7 @@ UNO3_GETIMPLEMENTATION_IMPL( SdLayer );
OUString SAL_CALL SdLayer::getImplementationName()
throw(uno::RuntimeException, std::exception)
{
- return OUString( OUString::createFromAscii(sUNO_SdLayer) );
+ return OUString("SdUnoLayer");
}
sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName )
@@ -164,7 +164,7 @@ sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName )
uno::Sequence< OUString > SAL_CALL SdLayer::getSupportedServiceNames()
throw(uno::RuntimeException, std::exception)
{
- OUString aServiceName( OUString::createFromAscii(sUNO_Service_DrawingLayer) );
+ OUString aServiceName(UNO_PREFIX "drawing.Layer");
uno::Sequence< OUString > aSeq( &aServiceName, 1 );
return aSeq;
}
@@ -466,7 +466,7 @@ void SAL_CALL SdLayerManager::removeEventListener( const uno::Reference< lang::X
OUString SAL_CALL SdLayerManager::getImplementationName()
throw(uno::RuntimeException, std::exception)
{
- return OUString( OUString::createFromAscii(sUNO_SdLayerManager) );
+ return OUString("SdUnoLayerManager");
}
sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName )
@@ -478,7 +478,7 @@ sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName )
uno::Sequence< OUString > SAL_CALL SdLayerManager::getSupportedServiceNames()
throw(uno::RuntimeException, std::exception)
{
- OUString aServiceName( OUString::createFromAscii(sUNO_Service_DrawingLayerManager) );
+ OUString aServiceName(UNO_PREFIX "drawing.LayerManager");
uno::Sequence< OUString > aSeq( &aServiceName, 1 );
return aSeq;
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 09f15ca..4993a2e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2866,7 +2866,7 @@ void SdMasterPage::setBackground( const Any& rValue )
Reference< container::XNameAccess > xFamily( xFamilies->getByName( getName() ), UNO_QUERY_THROW ) ;
if( xFamily.is() )
{
- OUString aStyleName( OUString::createFromAscii(sUNO_PseudoSheet_Background) );
+ OUString aStyleName(sUNO_PseudoSheet_Background);
Reference< beans::XPropertySet > xStyleSet( xFamily->getByName( aStyleName ), UNO_QUERY_THROW );
@@ -2965,7 +2965,7 @@ void SdMasterPage::getBackground( Any& rValue ) throw()
Reference< container::XNameAccess > xFamilies( GetModel()->getStyleFamilies(), UNO_QUERY_THROW );
Reference< container::XNameAccess > xFamily( xFamilies->getByName( getName() ), UNO_QUERY_THROW );
- const OUString aStyleName( OUString::createFromAscii(sUNO_PseudoSheet_Background) );
+ const OUString aStyleName(sUNO_PseudoSheet_Background);
rValue <<= Reference< beans::XPropertySet >( xFamily->getByName( aStyleName ), UNO_QUERY_THROW );
}
else
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index f9b2ccca..0bd323a 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -183,7 +183,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
OUString SAL_CALL SdUnoPageBackground::getImplementationName()
throw(uno::RuntimeException, std::exception)
{
- return OUString::createFromAscii( sUNO_SdUnoPageBackground );
+ return OUString("SdUnoPageBackground");
}
sal_Bool SAL_CALL SdUnoPageBackground::supportsService( const OUString& ServiceName )
commit fe17eb9448f6da0e8fab6aca02f49c7cf597e2b0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:15:16 2014 +0100
scripting: Use appropriate OUString functions on string constants
Change-Id: I8ee8eb92ac95937893c894e67882e9df2c16a67d
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 30ac109..62f8803 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -527,7 +527,7 @@ namespace dlgprov
OUString sScriptURL;
OUString sScriptCode( aScriptEvent.ScriptCode );
- if ( aScriptEvent.ScriptType.equalsAscii( "StarBasic" ) )
+ if ( aScriptEvent.ScriptType == "StarBasic" )
{
// StarBasic script: convert ScriptCode to scriptURL
sal_Int32 nIndex = sScriptCode.indexOf( ':' );
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index e959d3f..4f0dc5e 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -203,8 +203,8 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
// Sometimes we get a propertyval with name = "Referer"
// this is not an argument to be passed to script, so
// ignore.
- if ( !lArgs[ index ].Name.equalsAscii("Referer") ||
- lArgs[ index ].Name.isEmpty() )
+ if ( lArgs[ index ].Name != "Referer" ||
+ lArgs[ index ].Name.isEmpty() ) //TODO:???
{
inArgs.realloc( ++argCount );
inArgs[ argCount - 1 ] = lArgs[ index ].Value;
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 8c67606..574b52c 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -113,24 +113,24 @@ ScriptingFrameworkURIHelper::initBaseURI()
OUString uri, test;
bool bAppendScriptsPart = false;
- if ( m_sLocation.equalsAscii(USER))
+ if ( m_sLocation == USER )
{
test = USER;
uri = USER_URI;
bAppendScriptsPart = true;
}
- else if ( m_sLocation.equalsAscii(USER_UNO_PACKAGES))
+ else if ( m_sLocation == USER_UNO_PACKAGES )
{
test = "uno_packages";
uri = OUString( USER_URI ) + USER_UNO_PACKAGES_DIR;
}
- else if (m_sLocation.equalsAscii(SHARE))
+ else if (m_sLocation == SHARE)
{
test = SHARE;
uri = SHARE_URI;
bAppendScriptsPart = true;
}
- else if (m_sLocation.equalsAscii(SHARE_UNO_PACKAGES))
+ else if (m_sLocation == SHARE_UNO_PACKAGES)
{
test = "uno_packages";
uri = SHARE_UNO_PACKAGES_URI;
commit 0d58e6723973211fb57d18dc8aef65510c1f965e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:14:54 2014 +0100
scaddins: Use appropriate OUString functions on string constants
Change-Id: If51c63d22223f968e185a05b79aed5bf861405a4
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index c0137f3..02c6ecb 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -1149,8 +1149,8 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An
case uno::TypeClass_STRING:
{
const OUString* pSuff = ( const OUString* ) rSuff.getValue();
- bi = pSuff->equalsAscii( "i" ) || pSuff->isEmpty();
- if( !bi && !pSuff->equalsAscii( "j" ) )
+ bi = *pSuff == "i" || pSuff->isEmpty();
+ if( !bi && *pSuff != "j" )
throw lang::IllegalArgumentException();
}
break;
diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 7453fd8..18d5212 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -556,24 +556,23 @@ bool getinput_greek(bs::types::Greeks& greek, const uno::Any& anyval) {
return false;
}
- if(str.equalsAscii("value") || str.equalsAscii("price") ||
- str.equalsAscii("v") || str.equalsAscii("p") ) {
+ if(str == "value" || str == "price" || str == "v" || str == "p") {
greek=bs::types::Value;
- } else if(str.equalsAscii("delta") || str.equalsAscii("d")) {
+ } else if(str == "delta" || str == "d") {
greek=bs::types::Delta;
- } else if(str.equalsAscii("gamma") || str.equalsAscii("g")) {
+ } else if(str == "gamma" || str == "g") {
greek=bs::types::Gamma;
- } else if(str.equalsAscii("theta") || str.equalsAscii("t")) {
+ } else if(str == "theta" || str == "t") {
greek=bs::types::Theta;
- } else if(str.equalsAscii("vega") || str.equalsAscii("e")) {
+ } else if(str == "vega" || str == "e") {
greek=bs::types::Vega;
- } else if(str.equalsAscii("volga") || str.equalsAscii("o")) {
+ } else if(str == "volga" || str == "o") {
greek=bs::types::Volga;
- } else if(str.equalsAscii("vanna") || str.equalsAscii("a")) {
+ } else if(str == "vanna" || str == "a") {
greek=bs::types::Vanna;
- } else if(str.equalsAscii("rho") || str.equalsAscii("r")) {
+ } else if(str == "rho" || str == "r") {
greek=bs::types::Rho_d;
- } else if(str.equalsAscii("rhof") || str.equalsAscii("f")) {
+ } else if(str == "rhof" || str == "f") {
greek=bs::types::Rho_f;
} else {
return false;
commit ac97f3388dadfe0127ee2b5c97ccadfb9dd64f39
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Dec 15 10:14:25 2014 +0100
sc: Use appropriate OUString functions on string constants
Change-Id: Ib4c0df8d7637bff7d7a45d24482fff4342169fae
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 142650f..3b9b53a 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -47,8 +47,6 @@ class ScEditUtil
Fraction aZoomX;
Fraction aZoomY;
- static const char pCalcDelimiters[];
-
public:
static OUString ModifyDelimiters( const OUString& rOld );
diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx
index e1fd07c..38e57f1 100644
--- a/sc/inc/miscuno.hxx
+++ b/sc/inc/miscuno.hxx
@@ -34,7 +34,7 @@
OUString SAL_CALL ClassName::getImplementationName() \
throw(::com::sun::star::uno::RuntimeException, std::exception) \
{ \
- return OUString::createFromAscii(ClassNameAscii); \
+ return OUString(ClassNameAscii); \
} \
sal_Bool SAL_CALL ClassName::supportsService( const OUString& ServiceName ) \
throw(::com::sun::star::uno::RuntimeException, std::exception) \
@@ -47,7 +47,7 @@ sal_Bool SAL_CALL ClassName::supportsService( const OUString& ServiceName ) \
{ \
::com::sun::star::uno::Sequence< OUString > aRet(1); \
OUString* pArray = aRet.getArray(); \
- pArray[0] = OUString::createFromAscii(ServiceAscii); \
+ pArray[0] = ServiceAscii; \
return aRet; \
}
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index ef24b49..2e31241 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -775,11 +775,11 @@ void Test::testPivotTableCache()
long nDimCount = aCache.GetColumnCount();
CPPUNIT_ASSERT_MESSAGE("wrong dimension count.", nDimCount == 3);
OUString aDimName = aCache.GetDimensionName(0);
- CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F1"));
+ CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName == "F1");
aDimName = aCache.GetDimensionName(1);
- CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F2"));
+ CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName == "F2");
aDimName = aCache.GetDimensionName(2);
- CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F3"));
+ CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName == "F3");
// In each dimension, member ID values also represent their sort order (in
// source dimensions only, not in group dimensions). Value items are
@@ -796,23 +796,23 @@ void Test::testPivotTableCache()
pItem = aCache.GetItemDataById(0, 1);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("A"));
+ pItem->GetString() == "A");
pItem = aCache.GetItemDataById(0, 2);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("F"));
+ pItem->GetString() == "F");
pItem = aCache.GetItemDataById(0, 3);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("R"));
+ pItem->GetString() == "R");
pItem = aCache.GetItemDataById(0, 4);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("Y"));
+ pItem->GetString() == "Y");
pItem = aCache.GetItemDataById(0, 5);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("Z"));
+ pItem->GetString() == "Z");
pItem = aCache.GetItemDataById(0, 6);
CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);
@@ -822,15 +822,15 @@ void Test::testPivotTableCache()
pItem = aCache.GetItemDataById(1, 0);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("A"));
+ pItem->GetString() == "A");
pItem = aCache.GetItemDataById(1, 1);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("B"));
+ pItem->GetString() == "B");
pItem = aCache.GetItemDataById(1, 2);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
pItem->GetType() == ScDPItemData::String &&
- pItem->GetString().equalsAscii("C"));
+ pItem->GetString() == "C");
pItem = aCache.GetItemDataById(1, 3);
CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);
@@ -1104,7 +1104,7 @@ void Test::testPivotTableNormalGrouping()
// Group A, B and C together.
ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName);
OUString aGroupName = aGroupDim.CreateGroupName(aGroupPrefix);
- CPPUNIT_ASSERT_MESSAGE("Unexpected group name", aGroupName.equalsAscii("Group1"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected group name", aGroupName == "Group1");
ScDPSaveGroupItem aGroup(aGroupName);
aGroup.AddElement(OUString("A"));
@@ -1146,7 +1146,7 @@ void Test::testPivotTableNormalGrouping()
ScDPSaveGroupDimension* pGroupDim = pDimData->GetGroupDimAccForBase(aBaseDimName);
CPPUNIT_ASSERT_MESSAGE("There should be an existing group dimension.", pGroupDim);
OUString aGroupName = pGroupDim->CreateGroupName(aGroupPrefix);
- CPPUNIT_ASSERT_MESSAGE("Unexpected group name", aGroupName.equalsAscii("Group2"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected group name", aGroupName == "Group2");
ScDPSaveGroupItem aGroup(aGroupName);
aGroup.AddElement(OUString("D"));
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 95d221e..d45f235 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1143,15 +1143,15 @@ void SAL_CALL ScDPSource::setPropertyValue( const OUString& aPropertyName, const
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException, std::exception)
{
- if (aPropertyName.equalsAscii(SC_UNO_DP_COLGRAND))
+ if (aPropertyName == SC_UNO_DP_COLGRAND)
bColumnGrand = lcl_GetBoolFromAny(aValue);
- else if (aPropertyName.equalsAscii(SC_UNO_DP_ROWGRAND))
+ else if (aPropertyName == SC_UNO_DP_ROWGRAND)
bRowGrand = lcl_GetBoolFromAny(aValue);
- else if (aPropertyName.equalsAscii(SC_UNO_DP_IGNOREEMPTY))
+ else if (aPropertyName == SC_UNO_DP_IGNOREEMPTY)
setIgnoreEmptyRows( lcl_GetBoolFromAny( aValue ) );
- else if (aPropertyName.equalsAscii(SC_UNO_DP_REPEATEMPTY))
+ else if (aPropertyName == SC_UNO_DP_REPEATEMPTY)
setRepeatIfEmpty( lcl_GetBoolFromAny( aValue ) );
- else if (aPropertyName.equalsAscii(SC_UNO_DP_GRANDTOTAL_NAME))
+ else if (aPropertyName == SC_UNO_DP_GRANDTOTAL_NAME)
{
OUString aName;
if (aValue >>= aName)
@@ -1169,23 +1169,23 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const OUString& aPropertyName )
uno::RuntimeException, std::exception)
{
uno::Any aRet;
- if ( aPropertyName.equalsAscii( SC_UNO_DP_COLGRAND ) )
+ if ( aPropertyName == SC_UNO_DP_COLGRAND )
lcl_SetBoolInAny(aRet, bColumnGrand);
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_ROWGRAND ) )
+ else if ( aPropertyName == SC_UNO_DP_ROWGRAND )
lcl_SetBoolInAny(aRet, bRowGrand);
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_IGNOREEMPTY ) )
+ else if ( aPropertyName == SC_UNO_DP_IGNOREEMPTY )
lcl_SetBoolInAny(aRet, bIgnoreEmptyRows);
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_REPEATEMPTY ) )
+ else if ( aPropertyName == SC_UNO_DP_REPEATEMPTY )
lcl_SetBoolInAny(aRet, bRepeatIfEmpty);
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_DATADESC ) ) // read-only
+ else if ( aPropertyName == SC_UNO_DP_DATADESC ) // read-only
aRet <<= getDataDescription();
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_ROWFIELDCOUNT ) ) // read-only
+ else if ( aPropertyName == SC_UNO_DP_ROWFIELDCOUNT ) // read-only
aRet <<= static_cast<sal_Int32>(maRowDims.size());
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_COLUMNFIELDCOUNT ) ) // read-only
+ else if ( aPropertyName == SC_UNO_DP_COLUMNFIELDCOUNT ) // read-only
aRet <<= static_cast<sal_Int32>(maColDims.size());
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_DATAFIELDCOUNT ) ) // read-only
+ else if ( aPropertyName == SC_UNO_DP_DATAFIELDCOUNT ) // read-only
aRet <<= static_cast<sal_Int32>(maDataDims.size());
- else if (aPropertyName.equalsAscii(SC_UNO_DP_GRANDTOTAL_NAME))
+ else if (aPropertyName == SC_UNO_DP_GRANDTOTAL_NAME)
{
if (mpGrandTotalName.get())
aRet <<= *mpGrandTotalName;
@@ -1525,27 +1525,27 @@ void SAL_CALL ScDPDimension::setPropertyValue( const OUString& aPropertyName, co
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException, std::exception)
{
- if ( aPropertyName.equalsAscii( SC_UNO_DP_USEDHIERARCHY ) )
+ if ( aPropertyName == SC_UNO_DP_USEDHIERARCHY )
{
sal_Int32 nInt = 0;
if (aValue >>= nInt)
setUsedHierarchy( nInt );
}
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_ORIENTATION ) )
+ else if ( aPropertyName == SC_UNO_DP_ORIENTATION )
{
sheet::DataPilotFieldOrientation eEnum;
if (aValue >>= eEnum)
setOrientation( sal::static_int_cast<sal_uInt16>(eEnum) );
}
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_FUNCTION ) )
+ else if ( aPropertyName == SC_UNO_DP_FUNCTION )
{
sheet::GeneralFunction eEnum;
if (aValue >>= eEnum)
setFunction( sal::static_int_cast<sal_uInt16>(eEnum) );
}
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_REFVALUE ) )
+ else if ( aPropertyName == SC_UNO_DP_REFVALUE )
aValue >>= aReferenceValue;
- else if ( aPropertyName.equalsAscii( SC_UNO_DP_FILTER ) )
+ else if ( aPropertyName == SC_UNO_DP_FILTER )
{
bool bDone = false;
uno::Sequence<sheet::TableFilterField> aSeq;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list