chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx | 2 chart2/source/view/main/DummyXShape.cxx | 2 cui/source/customize/cfg.cxx | 40 +-- cui/source/dialogs/colorpicker.cxx | 2 dbaccess/source/core/api/KeySet.cxx | 2 dbaccess/source/core/dataaccess/ContentHelper.cxx | 6 dbaccess/source/core/dataaccess/databasedocument.cxx | 2 dbaccess/source/core/dataaccess/documentcontainer.cxx | 2 dbaccess/source/core/dataaccess/documentdefinition.cxx | 8 dbaccess/source/core/misc/dsntypes.cxx | 31 +- dbaccess/source/filter/xml/xmlfilter.cxx | 2 dbaccess/source/inc/apitools.hxx | 22 +- dbaccess/source/ui/browser/brwctrlr.cxx | 2 dbaccess/source/ui/browser/genericcontroller.cxx | 4 dbaccess/source/ui/dlg/DbAdminImpl.cxx | 4 dbaccess/source/ui/dlg/sqlmessage.cxx | 4 dbaccess/source/ui/querydesign/querycontroller.cxx | 4 dbaccess/source/ui/uno/unoDirectSql.cxx | 4 dbaccess/source/ui/uno/unoadmin.cxx | 4 filter/source/config/cache/filterfactory.cxx | 2 filter/source/msfilter/msvbahelper.cxx | 2 filter/source/pdf/pdfexport.cxx | 4 filter/source/svg/svgdialog.cxx | 4 filter/source/svg/svgwriter.cxx | 16 - filter/source/t602/t602filter.cxx | 180 ++++++++--------- filter/source/xsltfilter/LibXSLTTransformer.cxx | 3 forms/source/component/Filter.cxx | 6 forms/source/misc/InterfaceContainer.cxx | 8 forms/source/xforms/binding.cxx | 2 29 files changed, 184 insertions(+), 190 deletions(-)
New commits: commit 0c1b8516cb290f072e59da62198575cdbc131fce Author: Stephan Bergmann <[email protected]> Date: Mon Dec 15 10:12:09 2014 +0100 forms: Use appropriate OUString functions on string constants Change-Id: I196e847e2f63d1bac6ed0f520cba67508aec1a5d diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 3b566e9..9e1d53e 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -800,19 +800,19 @@ namespace frm continue; } - if ( pName->equalsAscii( "MessageParent" ) ) + if ( *pName == "MessageParent" ) { // the message parent *pValue >>= m_xMessageParent; OSL_ENSURE( m_xMessageParent.is(), "OFilterControl::initialize: invalid MessageParent!" ); } - else if ( pName->equalsAscii( "NumberFormatter" ) ) + else if ( *pName == "NumberFormatter" ) { // the number format. This argument is optional. *pValue >>= m_xFormatter; OSL_ENSURE( m_xFormatter.is(), "OFilterControl::initialize: invalid NumberFormatter!" ); } - else if ( pName->equalsAscii( "ControlModel" ) ) + else if ( *pName == "ControlModel" ) { // the control model for which we act as filter control if ( !(*pValue >>= xControlModel ) ) diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index e740c37..0d4ef2d 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -359,15 +359,15 @@ struct TransformEventTo52Format : public ::std::unary_function< ScriptEventDescr { void operator()( ScriptEventDescriptor& _rDescriptor ) { - if ( _rDescriptor.ScriptType.equalsAscii( "StarBasic" ) ) + if ( _rDescriptor.ScriptType == "StarBasic" ) { // it's a starbasic macro sal_Int32 nPrefixLength = _rDescriptor.ScriptCode.indexOf( ':' ); if ( 0 <= nPrefixLength ) { // the macro name does not already contain a : #ifdef DBG_UTIL const OUString sPrefix = _rDescriptor.ScriptCode.copy( 0, nPrefixLength ); - DBG_ASSERT( sPrefix.equalsAscii( "document" ) - || sPrefix.equalsAscii( "application" ), + DBG_ASSERT( sPrefix == "document" + || sPrefix == "application", "TransformEventTo52Format: invalid (unknown) prefix!" ); #endif // cut the prefix @@ -382,7 +382,7 @@ struct TransformEventTo60Format : public ::std::unary_function< ScriptEventDescr { void operator()( ScriptEventDescriptor& _rDescriptor ) { - if ( _rDescriptor.ScriptType.equalsAscii( "StarBasic" ) ) + if ( _rDescriptor.ScriptType == "StarBasic" ) { // it's a starbasic macro if ( _rDescriptor.ScriptCode.indexOf( ':' ) < 0 ) { // the macro name does not already contain a : diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index 2bfb98b..919ff0d 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -1237,7 +1237,7 @@ void Binding::handleEvent( const XEvent_t& xEvent ) OUString sType(xEvent->getType()); //OUString sEventMIPChanged("xforms-generic"); //if(sType.equals(sEventMIPChanged)) { - if(sType.equalsAscii("xforms-generic")) { + if(sType == "xforms-generic") { // the modification of the 'mnDeferModifyNotifications'-member // is necessary to prevent infinite notication looping. commit 260fbeb21a86f7483891016a483c0b175947a35e Author: Stephan Bergmann <[email protected]> Date: Mon Dec 15 10:11:50 2014 +0100 filter: Use appropriate OUString functions on string constants Change-Id: I4b1c365bb2ff80b30748630d2c6296bf4ed6fd53 diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index 1f23168..9f668cf 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -189,7 +189,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea throw (css::uno::RuntimeException, std::exception) { // reject old deprecated queries ... - if (sQuery.matchAsciiL("_filterquery_",13,0)) + if (sQuery.startsWith("_filterquery_")) throw css::uno::RuntimeException( "Use of deprecated and now unsupported query!", static_cast< css::container::XContainerQuery* >(this)); diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index e4ae3d8..a02a028 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -119,7 +119,7 @@ SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath ) } } - if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) ) + if ( sMacroURLOrPath.endsWithIgnoreAsciiCase( ".dot" ) ) { uno::Reference<document::XDocumentPropertiesSupplier> const xDocPropSupp(xModel, uno::UNO_QUERY); diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 9e83456..84c95b8 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -847,7 +847,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& OUString sShowOnlineLayout( "ShowOnlineLayout" ); uno::Reference< beans::XPropertySet > xViewProperties; - if ( aCreator.equalsAscii( "Writer" ) ) + if ( aCreator == "Writer" ) { //i92835 if Writer is in web layout mode this has to be switched to normal view and back to web view in the end try @@ -868,7 +868,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& const sal_Int32 nPageCount = xRenderable->getRendererCount( aSelection, aRenderOptions ); - if ( mbExportNotesPages && aCreator.equalsAscii( "Impress" ) ) + if ( mbExportNotesPages && aCreator == "Impress" ) { uno::Reference< drawing::XShapes > xShapes; // sj: do not allow to export notes when if ( ! ( aSelection >>= xShapes ) ) // exporting a selection -> todo: in the dialog diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx index 5f6cb47..cf71553 100644 --- a/filter/source/svg/svgdialog.cxx +++ b/filter/source/svg/svgdialog.cxx @@ -193,7 +193,7 @@ Sequence< PropertyValue > SAL_CALL SVGDialog::getPropertyValues() for( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; ++i ) { - if( maMediaDescriptor[ i ].Name.equalsAscii( SVG_FILTER_DATA_NAME ) ) + if( maMediaDescriptor[ i ].Name == SVG_FILTER_DATA_NAME ) break; } @@ -217,7 +217,7 @@ void SAL_CALL SVGDialog::setPropertyValues( const Sequence< PropertyValue >& rPr for( sal_Int32 i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if( maMediaDescriptor[ i ].Name.equalsAscii( SVG_FILTER_DATA_NAME ) ) + if( maMediaDescriptor[ i ].Name == SVG_FILTER_DATA_NAME ) { maMediaDescriptor[ i ].Value >>= maFilterData; break; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 6d2efba..3e9c2d5 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -616,7 +616,7 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC } else { - if( sContent.equalsAscii( "\n" ) ) + if( sContent == "\n" ) mbLineBreak = true; } } @@ -631,7 +631,7 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC } else { - if( sContent.equalsAscii( "\n" ) ) + if( sContent == "\n" ) mbLineBreak = true; } } @@ -941,11 +941,11 @@ bool SVGTextWriter::nextParagraph() for( sal_Int32 i = 0; i < nCount; ++i ) { const PropertyValue& rProp = pPropArray[i]; - if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_NUMBERINGTYPE, sizeof(XML_UNO_NAME_NRULE_NUMBERINGTYPE)-1 ) ) + if( rProp.Name == XML_UNO_NAME_NRULE_NUMBERINGTYPE ) { rProp.Value >>= eType; } - else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_CHAR, sizeof(XML_UNO_NAME_NRULE_BULLET_CHAR)-1 ) ) + else if( rProp.Name == XML_UNO_NAME_NRULE_BULLET_CHAR ) { OUString sValue; rProp.Value >>= sValue; @@ -1094,14 +1094,14 @@ bool SVGTextWriter::nextTextPortion() #if OSL_DEBUG_LEVEL > 0 sInfo += "text field type: " + sFieldName + "; content: " + xTextField->getPresentation( /* show command: */ sal_False ) + "; "; #endif - if( sFieldName.equalsAscii( "DateTime" ) || sFieldName.equalsAscii( "Header" ) - || sFieldName.equalsAscii( "Footer" ) || sFieldName.equalsAscii( "PageNumber" ) ) + if( sFieldName == "DateTime" || sFieldName == "Header" + || sFieldName == "Footer" || sFieldName == "PageNumber" ) { mbIsPlacehlolderShape = true; } else { - mbIsURLField = sFieldName.equalsAscii( "URL" ); + mbIsURLField = sFieldName == "URL"; if( mbIsURLField ) { @@ -1492,7 +1492,7 @@ void SVGTextWriter::writeTextPortion( const Point& rPos, if( sContent.isEmpty() ) continue; - if( sContent.equalsAscii( "\n" ) ) + if( sContent == "\n" ) mbLineBreak = true; if( sContent.match( rText, nStartPos ) ) bNotSync = false; diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index aa4ab8e..2e3d82c 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -114,16 +114,12 @@ namespace T602ImportFilter { "\x04\x4d\x02\xdd\x04\x4e\x02\xc7\x04\x4f\x00\xa7\x04\x34\x00\xe0" // F "\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20"; -#define _AddAtt(_nam, _val) \ - mpAttrList->AddAttribute(OUString::createFromAscii( _nam ),\ - OUString::createFromAscii( _val ) ); - #define _Start(_nam) \ - mxHandler->startElement(OUString::createFromAscii(_nam), mAttrList);\ + mxHandler->startElement(_nam, mAttrList);\ mpAttrList->Clear(); #define _End(_nam) \ - mxHandler->endElement(OUString::createFromAscii(_nam)); + mxHandler->endElement(_nam); #define _Chars(_ch) \ mxHandler->characters(OUString::createFromAscii((sal_Char *) _ch) ); @@ -226,7 +222,7 @@ void T602ImportFilter::inschr(unsigned char ch) } else { char s[20]; sprintf(s,"%i",pst.wasspace); - _AddAtt("text:c",s); + mpAttrList->AddAttribute("text:c",OUString::createFromAscii(s)); _Start("text:s"); _End("text:s"); } @@ -275,28 +271,28 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::be mxHandler->startDocument(); - _AddAtt("xmlns:office", "http://openoffice.org/2000/office"); - _AddAtt("xmlns:style", "http://openoffice.org/2000/style"); - _AddAtt("xmlns:text", "http://openoffice.org/2000/text"); - _AddAtt("xmlns:table", "http://openoffice.org/2000/table"); - _AddAtt("xmlns:draw", "http://openoffice.org/2000/draw"); - _AddAtt("xmlns:fo", "http://www.w3.org/1999/XSL/Format"); - _AddAtt("xmlns:xlink", "http://www.w3.org/1999/xlink"); - _AddAtt("xmlns:number", "http://openoffice.org/2000/datastyle"); - _AddAtt("xmlns:svg", "http://www.w3.org/2000/svg"); - _AddAtt("xmlns:chart", "http://openoffice.org/2000/chart"); - _AddAtt("xmlns:dr3d", "http://openoffice.org/2000/dr3d"); - _AddAtt("xmlns:math", "http://www.w3.org/1998/Math/MathML"); - _AddAtt("xmlns:form", "http://openoffice.org/2000/form"); - _AddAtt("xmlns:script", "http://openoffice.org/2000/script"); - _AddAtt("office:class", "text"); - _AddAtt("office:version", "1.0"); + mpAttrList->AddAttribute("xmlns:office", "http://openoffice.org/2000/office"); + mpAttrList->AddAttribute("xmlns:style", "http://openoffice.org/2000/style"); + mpAttrList->AddAttribute("xmlns:text", "http://openoffice.org/2000/text"); + mpAttrList->AddAttribute("xmlns:table", "http://openoffice.org/2000/table"); + mpAttrList->AddAttribute("xmlns:draw", "http://openoffice.org/2000/draw"); + mpAttrList->AddAttribute("xmlns:fo", "http://www.w3.org/1999/XSL/Format"); + mpAttrList->AddAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); + mpAttrList->AddAttribute("xmlns:number", "http://openoffice.org/2000/datastyle"); + mpAttrList->AddAttribute("xmlns:svg", "http://www.w3.org/2000/svg"); + mpAttrList->AddAttribute("xmlns:chart", "http://openoffice.org/2000/chart"); + mpAttrList->AddAttribute("xmlns:dr3d", "http://openoffice.org/2000/dr3d"); + mpAttrList->AddAttribute("xmlns:math", "http://www.w3.org/1998/Math/MathML"); + mpAttrList->AddAttribute("xmlns:form", "http://openoffice.org/2000/form"); + mpAttrList->AddAttribute("xmlns:script", "http://openoffice.org/2000/script"); + mpAttrList->AddAttribute("office:class", "text"); + mpAttrList->AddAttribute("office:version", "1.0"); _Start("office:document-content"); _Start("office:font-decls"); - _AddAtt("style:name","Courier New"); - _AddAtt("fo:font-family","Courier New"); - _AddAtt("style:font-pitch","fixed"); + mpAttrList->AddAttribute("style:name","Courier New"); + mpAttrList->AddAttribute("fo:font-family","Courier New"); + mpAttrList->AddAttribute("style:font-pitch","fixed"); _Start("style:font-decl"); _End("style:font-decl"); _End("office:font-decls"); @@ -304,128 +300,128 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::be _Start("office:automatic-styles"); // Standardni text - _AddAtt("style:name","P1"); - _AddAtt("style:family","paragraph"); - _AddAtt("style:parent-style-name","Standard"); + mpAttrList->AddAttribute("style:name","P1"); + mpAttrList->AddAttribute("style:family","paragraph"); + mpAttrList->AddAttribute("style:parent-style-name","Standard"); _Start("style:style"); - _AddAtt("style:font-name","Courier New"); - _AddAtt("fo:font-size",fs); + mpAttrList->AddAttribute("style:font-name","Courier New"); + mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs)); _Start("style:properties"); _End("style:properties"); _End("style:style"); // Standardni text - konec stranky - _AddAtt("style:name","P2"); - _AddAtt("style:family","paragraph"); - _AddAtt("style:parent-style-name","Standard"); + mpAttrList->AddAttribute("style:name","P2"); + mpAttrList->AddAttribute("style:family","paragraph"); + mpAttrList->AddAttribute("style:parent-style-name","Standard"); _Start("style:style"); - _AddAtt("style:font-name","Courier New"); - _AddAtt("fo:font-size",fs); - _AddAtt("fo:break-before","page"); + mpAttrList->AddAttribute("style:font-name","Courier New"); + mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs)); + mpAttrList->AddAttribute("fo:break-before","page"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T1 Normalni text - _AddAtt("style:name","T1"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T1"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T2 Tucny text - _AddAtt("style:name","T2"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T2"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-weight","bold"); + mpAttrList->AddAttribute("fo:font-weight","bold"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T3 Kurziva - _AddAtt("style:name","T3"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T3"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-style","italic"); + mpAttrList->AddAttribute("fo:font-style","italic"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T4 Siroky text - _AddAtt("style:name","T4"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T4"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-weight","bold"); - _AddAtt("style:text-scale","200%"); + mpAttrList->AddAttribute("fo:font-weight","bold"); + mpAttrList->AddAttribute("style:text-scale","200%"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T5 Vysoky text - _AddAtt("style:name","T5"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T5"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-size",fs2); - _AddAtt("fo:font-weight","bold"); - _AddAtt("style:text-scale","50%"); + mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2)); + mpAttrList->AddAttribute("fo:font-weight","bold"); + mpAttrList->AddAttribute("style:text-scale","50%"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T6 Velky text - _AddAtt("style:name","T6"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T6"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-size",fs2); - _AddAtt("fo:font-weight","bold"); + mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2)); + mpAttrList->AddAttribute("fo:font-weight","bold"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T7 Podtrzeny text - _AddAtt("style:name","T7"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T7"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("style:text-underline","single"); + mpAttrList->AddAttribute("style:text-underline","single"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T8 Podtrzena tucny text - _AddAtt("style:name","T8"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T8"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-weight","bold"); - _AddAtt("style:text-underline","single"); + mpAttrList->AddAttribute("fo:font-weight","bold"); + mpAttrList->AddAttribute("style:text-underline","single"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T9 Podtrzena kurziva - _AddAtt("style:name","T9"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T9"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("fo:font-style","italic"); - _AddAtt("style:text-underline","single"); + mpAttrList->AddAttribute("fo:font-style","italic"); + mpAttrList->AddAttribute("style:text-underline","single"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T10 Horni index - _AddAtt("style:name","T10"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T10"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("style:text-position","27% 100%"); + mpAttrList->AddAttribute("style:text-position","27% 100%"); _Start("style:properties"); _End("style:properties"); _End("style:style"); // T11 Dolni index - _AddAtt("style:name","T11"); - _AddAtt("style:family","text"); + mpAttrList->AddAttribute("style:name","T11"); + mpAttrList->AddAttribute("style:family","text"); _Start("style:style"); - _AddAtt("style:text-position","-27% 100%"); + mpAttrList->AddAttribute("style:text-position","-27% 100%"); _Start("style:properties"); _End("style:properties"); _End("style:style"); @@ -524,7 +520,8 @@ void T602ImportFilter::wrtfnt() } _End("text:span"); - _AddAtt("text:style-name", style); + mpAttrList->AddAttribute( + "text:style-name", OUString::createFromAscii(style)); _Start("text:span"); } @@ -561,7 +558,7 @@ void T602ImportFilter::par602(bool endofpage) if(pst.waspar||ini.reformatpars) { _End("text:span"); _End("text:p"); - _AddAtt("text:style-name", "P1"); + mpAttrList->AddAttribute("text:style-name", "P1"); _Start("text:p"); _Start("text:span"); wrtfnt(); @@ -587,7 +584,7 @@ void T602ImportFilter::par602(bool endofpage) if(!ini.reformatpars) { _End("text:span"); _End("text:p"); - _AddAtt("text:style-name", "P2"); + mpAttrList->AddAttribute("text:style-name", "P2"); _Start("text:p"); _Start("text:span"); wrtfnt(); @@ -694,9 +691,9 @@ void T602ImportFilter::Read602() if (node==QUIT) return; - _AddAtt("text:style-name", "P1"); + mpAttrList->AddAttribute("text:style-name", "P1"); _Start("text:p"); - _AddAtt("text:style-name", "T1"); + mpAttrList->AddAttribute("text:style-name", "T1"); _Start("text:span"); if (node==START) { node = EOL; } @@ -910,33 +907,30 @@ bool T602ImportFilterDialog::OptionsDlg() Any any; #define _propInt(_prop,_nam,_val) \ any <<= (sal_Int32)_val;\ - _prop->setPropertyValue(OUString::createFromAscii(_nam), any); + _prop->setPropertyValue(_nam, any); #define _propShort(_prop,_nam,_val) \ any <<= (sal_Int16)_val;\ - _prop->setPropertyValue(OUString::createFromAscii(_nam), any); + _prop->setPropertyValue(_nam, any); #define _propBool(_prop,_nam,_val) \ any <<= _val;\ - _prop->setPropertyValue(OUString::createFromAscii(_nam), any); + _prop->setPropertyValue(_nam, any); #define _propString(_prop,_nam,_val) \ - any <<= OUString::createFromAscii(_val);\ - _prop->setPropertyValue(OUString::createFromAscii(_nam), any); + any <<= OUString(_val);\ + _prop->setPropertyValue(_nam, any); #define _propStringFromResId(_prop,_nam,_val) \ any <<= getResStr(_val);\ - _prop->setPropertyValue(OUString::createFromAscii(_nam), any); + _prop->setPropertyValue(_nam, any); #define _propGet(_prop,_nam) \ - _prop->getPropertyValue(OUString::createFromAscii(_nam)); -#define _InstCtx(_path,_ctx)\ - rServiceManager->createInstanceWithContext(\ - OUString::createFromAscii(_path),_ctx); + _prop->getPropertyValue(_nam); #define _Inst(_path)\ - xMultiServiceFactory->createInstance(OUString::createFromAscii(_path) ); + xMultiServiceFactory->createInstance(_path); #define _Insert(_cont,_nam,_obj) \ any <<= _obj;\ - _cont->insertByName( OUString::createFromAscii(_nam), any ); + _cont->insertByName( _nam, any ); Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext(); Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager(); - Reference < XInterface > rInstance = _InstCtx("com.sun.star.awt.UnoControlDialogModel", rComponentContext ); + Reference < XInterface > rInstance = rServiceManager->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", rComponentContext ); Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY); diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index eb07843..c761614 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -334,8 +334,7 @@ namespace XSLT if (lastErr) msg = OUString::createFromAscii(lastErr->message); else - msg = OUString::createFromAscii( - "Unknown XSLT transformation error"); + msg = "Unknown XSLT transformation error"; m_transformer->error(msg); } commit 2b86f17f0538519d468aaa9811f2f1cdfb270134 Author: Stephan Bergmann <[email protected]> Date: Mon Dec 15 10:11:27 2014 +0100 dbaccess: Use appropriate OUString functions on string constants Change-Id: Iea28ad5e1a469830e002471517197365fd6de3ee diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 9992c15..0b2256a 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -397,7 +397,7 @@ void OKeySet::executeStatement(OUStringBuffer& io_aFilter, Reference<XSingleSele for(;pAnd != pAndEnd;++pAnd) { OUString sValue; - if ( !(pAnd->Value >>= sValue) || !( sValue == "?" || sValue.matchAsciiL( ":",1,0 ) ) ) + if ( !(pAnd->Value >>= sValue) || !( sValue == "?" || sValue.startsWith( ":" ) ) ) { // we have a criteria which has to be taken into account for updates m_aFilterColumns.push_back(pAnd->Name); } diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index ff32477..7bca406 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -156,7 +156,7 @@ sal_Int32 SAL_CALL OContentHelper::createCommandIdentifier( ) throw (RuntimeExc Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*CommandId*/, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException, std::exception) { Any aRet; - if ( aCommand.Name.equalsAscii( "getPropertyValues" ) ) + if ( aCommand.Name == "getPropertyValues" ) { // getPropertyValues @@ -174,7 +174,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma } aRet <<= getPropertyValues( Properties); } - else if ( aCommand.Name.equalsAscii( "setPropertyValues" ) ) + else if ( aCommand.Name == "setPropertyValues" ) { // setPropertyValues @@ -205,7 +205,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAscii( "getPropertySetInfo" ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { // getPropertySetInfo diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 657f0cd..4e8099d 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -779,7 +779,7 @@ bool ODatabaseDocument::impl_attachResource( const OUString& i_rLogicalDocumentU { if ( ( i_rLogicalDocumentURL == getURL() ) && ( i_rMediaDescriptor.getLength() == 1 ) - && ( i_rMediaDescriptor[0].Name.equalsAscii( "BreakMacroSignature" ) ) + && ( i_rMediaDescriptor[0].Name == "BreakMacroSignature" ) ) { // this is a BAD hack of the Basic importer code ... there should be a dedicated API for this, diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index be531a4..36465ff 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -401,7 +401,7 @@ Sequence< OUString > SAL_CALL ODocumentContainer::getAvailableServiceNames( ) t Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException, std::exception) { Any aRet; - if ( aCommand.Name.equalsAscii( "open" ) ) + if ( aCommand.Name == "open" ) { // open command for a folder content OpenCommandArgument2 aOpenCommand; diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index d72667c..0cbeb70 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1086,14 +1086,14 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co dispose(); } - else if ( aCommand.Name.equalsAscii( "storeOwn" ) // compatibility - || aCommand.Name.equalsAscii( "store" ) + else if ( aCommand.Name == "storeOwn" // compatibility + || aCommand.Name == "store" ) { impl_store_throw(); } - else if ( aCommand.Name.equalsAscii( "shutdown" ) // compatibility - || aCommand.Name.equalsAscii( "close" ) + else if ( aCommand.Name == "shutdown" // compatibility + || aCommand.Name == "close" ) { aRet <<= impl_close_throw(); diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index c6b2419..a5cf896 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -192,22 +192,22 @@ OUString ODsnTypeCollection::getDatasourcePrefixFromMediaType(const OUString& _s bool ODsnTypeCollection::isShowPropertiesEnabled( const OUString& _sURL ) const { - return !( _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:embedded:hsqldb",sizeof("sdbc:embedded:hsqldb")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:embedded:firebird",sizeof("sdbc:embedded:firebird")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:outlook",sizeof("sdbc:address:outlook")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:outlookexp",sizeof("sdbc:address:outlookexp")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:mozilla:",sizeof("sdbc:address:mozilla:")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:kab",sizeof("sdbc:address:kab")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:evolution:local",sizeof("sdbc:address:evolution:local")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:evolution:groupwise",sizeof("sdbc:address:evolution:groupwise")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:evolution:ldap",sizeof("sdbc:address:evolution:ldap")-1) - || _sURL.matchIgnoreAsciiCaseAsciiL("sdbc:address:macab",sizeof("sdbc:address:macab")-1) ); + return !( _sURL.startsWithIgnoreAsciiCase("sdbc:embedded:hsqldb") + || _sURL.startsWithIgnoreAsciiCase("sdbc:embedded:firebird") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:outlook") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:outlookexp") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:mozilla:") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:kab") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:evolution:local") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:evolution:groupwise") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:evolution:ldap") + || _sURL.startsWithIgnoreAsciiCase("sdbc:address:macab") ); } void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sDatabaseName,OUString& _rsHostname,sal_Int32& _nPortNumber) const { OUString sUrl = cutPrefix(_rDsn); - if ( _rDsn.matchIgnoreAsciiCaseAsciiL("jdbc:oracle:thin:",sizeof("jdbc:oracle:thin:")-1) ) + if ( _rDsn.startsWithIgnoreAsciiCase("jdbc:oracle:thin:") ) { lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber); if ( !_rsHostname.getLength() && comphelper::string::getTokenCount(sUrl, ':') == 2 ) @@ -219,11 +219,12 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD _rsHostname = _rsHostname.getToken(comphelper::string::getTokenCount(_rsHostname, '@') - 1, '@'); _sDatabaseName = sUrl.getToken(comphelper::string::getTokenCount(sUrl, ':') - 1, ':'); } - else if ( _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:address:ldap:",sizeof("sdbc:address:ldap:")-1) ) + else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:address:ldap:") ) { lcl_extractHostAndPort(sUrl,_sDatabaseName,_nPortNumber); } - else if ( _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:mysql:mysqlc:",sizeof("sdbc:mysql:mysqlc:")-1) || _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:mysql:jdbc:",sizeof("sdbc:mysql:jdbc:")-1) ) + else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:mysql:mysqlc:") + || _rDsn.startsWithIgnoreAsciiCase("sdbc:mysql:jdbc:") ) { lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber); @@ -231,8 +232,8 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD _rsHostname = sUrl.getToken(0,'/'); _sDatabaseName = sUrl.getToken(comphelper::string::getTokenCount(sUrl, '/') - 1, '/'); } - else if ( _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=",sizeof("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=")-1) - || _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=",sizeof("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=")-1)) + else if ( _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=") + || _rDsn.startsWithIgnoreAsciiCase("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=") ) { OUString sNewFileName; if ( ::osl::FileBase::getFileURLFromSystemPath( sUrl, sNewFileName ) == ::osl::FileBase::E_None ) diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 7568034..01b43d4 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -208,7 +208,7 @@ namespace dbaxml pCreatorThread = new FastLoader(m_xContext, FastLoader::E_JAVA); #endif } - else if ( sURL.matchIgnoreAsciiCaseAsciiL("sdbc:calc:",10,0) ) + else if ( sURL.startsWithIgnoreAsciiCase("sdbc:calc:") ) { pCreatorThread = new FastLoader(m_xContext, FastLoader::E_CALC); } diff --git a/dbaccess/source/inc/apitools.hxx b/dbaccess/source/inc/apitools.hxx index b577418..9075c8d 100644 --- a/dbaccess/source/inc/apitools.hxx +++ b/dbaccess/source/inc/apitools.hxx @@ -64,7 +64,7 @@ public: #define IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) \ { \ - return OUString::createFromAscii(implasciiname); \ + return OUString(implasciiname); \ } \ #define IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(classname, implasciiname) \ @@ -74,7 +74,7 @@ public: } \ OUString SAL_CALL classname::getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException) \ { \ - return OUString::createFromAscii(implasciiname); \ + return OUString(implasciiname); \ } \ #define IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ @@ -93,7 +93,7 @@ public: ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) \ { \ ::com::sun::star::uno::Sequence< OUString > aSupported(1); \ - aSupported[0] = OUString::createFromAscii(serviceasciiname); \ + aSupported[0] = serviceasciiname; \ return aSupported; \ } \ @@ -105,7 +105,7 @@ public: ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException) \ { \ ::com::sun::star::uno::Sequence< OUString > aSupported(1); \ - aSupported[0] = OUString::createFromAscii(serviceasciiname); \ + aSupported[0] = serviceasciiname; \ return aSupported; \ } \ @@ -117,8 +117,8 @@ public: ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException) \ { \ ::com::sun::star::uno::Sequence< OUString > aSupported(2); \ - aSupported[0] = OUString::createFromAscii(serviceasciiname1); \ - aSupported[1] = OUString::createFromAscii(serviceasciiname2); \ + aSupported[0] = serviceasciiname1; \ + aSupported[1] = serviceasciiname2; \ return aSupported; \ } \ @@ -126,8 +126,8 @@ public: ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) \ { \ ::com::sun::star::uno::Sequence< OUString > aSupported(2); \ - aSupported[0] = OUString::createFromAscii(serviceasciiname1); \ - aSupported[1] = OUString::createFromAscii(serviceasciiname2); \ + aSupported[0] = serviceasciiname1; \ + aSupported[1] = serviceasciiname2; \ return aSupported; \ } \ @@ -135,9 +135,9 @@ public: ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) \ { \ ::com::sun::star::uno::Sequence< OUString > aSupported(3); \ - aSupported[0] = OUString::createFromAscii(serviceasciiname1); \ - aSupported[1] = OUString::createFromAscii(serviceasciiname2); \ - aSupported[2] = OUString::createFromAscii(serviceasciiname3); \ + aSupported[0] = serviceasciiname1; \ + aSupported[1] = serviceasciiname2; \ + aSupported[2] = serviceasciiname3; \ return aSupported; \ } \ diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 1788fc7..ae53681 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -437,7 +437,7 @@ Sequence< OUString > SAL_CALL SbaXDataBrowserController::FormControllerImpl::get sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::supportsMode( const OUString& aMode ) throw (RuntimeException, std::exception) { - return aMode.equalsAscii( "DataMode" ); + return aMode == "DataMode"; } void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException, std::exception ) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index bc68c79..310078b 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -274,11 +274,11 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen for ( ; pIter != pEnd; ++pIter ) { - if ( ( *pIter >>= aValue ) && aValue.Name.equalsAscii( "Frame" ) ) + if ( ( *pIter >>= aValue ) && aValue.Name == "Frame" ) { xFrame.set(aValue.Value,UNO_QUERY_THROW); } - else if ( ( *pIter >>= aValue ) && aValue.Name.equalsAscii( "Preview" ) ) + else if ( ( *pIter >>= aValue ) && aValue.Name == "Preview" ) { aValue.Value >>= m_bPreview; m_bReadOnly = true; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index fd56da8..2136336 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -600,7 +600,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr PropertyValueSet aInfos; for (sal_Int32 i=0; i<aAdditionalInfo.getLength(); ++i, ++pAdditionalInfo) { - if( pAdditionalInfo->Name.equalsAscii("JDBCDRV")) + if( pAdditionalInfo->Name == "JDBCDRV" ) { // compatibility PropertyValue aCompatibility(*pAdditionalInfo); aCompatibility.Name = "JavaDriverClass"; @@ -752,7 +752,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS *pInfo = *aOverwrittenSetting; aRelevantSettings.erase(aOverwrittenSetting); } - else if( pInfo->Name.equalsAscii("JDBCDRV")) + else if( pInfo->Name == "JDBCDRV" ) { // this is a compatibility setting, remove it from the sequence (it's replaced by JavaDriverClass) nObsoleteSetting = i; } diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 2ab17aa..4ed0b22 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -198,7 +198,7 @@ namespace { return ( !_displayInfo.sErrorCode.isEmpty() ) || ( !_displayInfo.sSQLState.isEmpty() - && !_displayInfo.sSQLState.equalsAscii( "S1000" ) + && _displayInfo.sSQLState != "S1000" ); } @@ -340,7 +340,7 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti ) { lcl_insertExceptionEntry( *m_pExceptionList, elementPos, *loop ); - bHave22018 = loop->sSQLState.equalsAscii( "22018" ); + bHave22018 = loop->sSQLState == "22018"; } // if the error has the code 22018, then add an additional explanation diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index f3b0251..c4cde09 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1620,8 +1620,8 @@ static ::std::vector< CommentStrip > getComment( const OUString& rQuery ) ::std::vector< CommentStrip > aRet; // First a quick search if there is any "--" or "//" or "/*", if not then // the whole copying loop is pointless. - if (rQuery.indexOfAsciiL( "--", 2, 0) < 0 && rQuery.indexOfAsciiL( "//", 2, 0) < 0 && - rQuery.indexOfAsciiL( "/*", 2, 0) < 0) + if (rQuery.indexOf( "--" ) < 0 && rQuery.indexOf( "//" ) < 0 && + rQuery.indexOf( "/*" ) < 0) return aRet; const sal_Unicode* pCopy = rQuery.getStr(); diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 9c214d5..9f752da 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -106,12 +106,12 @@ namespace dbaui PropertyValue aProperty; if (_rValue >>= aProperty) { - if (aProperty.Name.equalsAscii("InitialSelection")) + if (aProperty.Name == "InitialSelection") { OSL_VERIFY( aProperty.Value >>= m_sInitialSelection ); return; } - else if (aProperty.Name.equalsAscii("ActiveConnection")) + else if (aProperty.Name == "ActiveConnection") { m_xActiveConnection.set( aProperty.Value, UNO_QUERY ); OSL_ENSURE( m_xActiveConnection.is(), "ODirectSQLDialog::implInitialize: invalid connection!" ); diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index 7021383..7653ec7 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -80,11 +80,11 @@ void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue) PropertyValue aProperty; if (_rValue >>= aProperty) { - if (aProperty.Name.equalsAscii("InitialSelection")) + if (aProperty.Name == "InitialSelection") { m_aInitialSelection = aProperty.Value; } - else if (aProperty.Name.equalsAscii("ActiveConnection")) + else if (aProperty.Name == "ActiveConnection") { m_xActiveConnection.set(aProperty.Value,UNO_QUERY); } commit a5179f0cf8ee8c244d5cef2781c78755804a23ba Author: Stephan Bergmann <[email protected]> Date: Mon Dec 15 10:10:56 2014 +0100 chart2: Use appropriate OUString functions on string constants Change-Id: Ia5a340049f787d7173140482853730a00d5d12df diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx index 68c6c18..ee3d904 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx @@ -71,7 +71,7 @@ void ChartTypeUnoDlg::implInitialize(const uno::Any& _rValue) beans::PropertyValue aProperty; if (_rValue >>= aProperty) { - if (aProperty.Name.equalsAscii("ChartModel")) + if (aProperty.Name == "ChartModel") m_xChartModel.set(aProperty.Value,uno::UNO_QUERY); else ChartTypeUnoDlg_BASE::implInitialize(_rValue); diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index a5a35e2..6f2378e 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -752,7 +752,7 @@ void DummyRectangle::render() { uno::Any co = itr->second; rtl::OUString aGradientValue = co.get<rtl::OUString>(); - if (aGradientValue.endsWithAsciiL("1", 1)) + if (aGradientValue.endsWith("1")) { pChart->m_GLRender.SetChartTransparencyGradient(1); } commit 6c0c2fa0178dfdddc530ae4727949aa445567617 Author: Stephan Bergmann <[email protected]> Date: Mon Dec 15 10:10:36 2014 +0100 cui: Use appropriate OUString functions on string constants Change-Id: I3140945b57decf8ea605c35b11e18d063a5a5c83 diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 77d3afc..6c9b2de 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -498,19 +498,19 @@ bool GetMenuItemData( { for ( sal_Int32 i = 0; i < aProp.getLength(); ++i ) { - if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) + if ( aProp[i].Name == ITEM_DESCRIPTOR_COMMANDURL ) { aProp[i].Value >>= rCommandURL; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_CONTAINER ) { aProp[i].Value >>= rSubMenu; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_LABEL ) { aProp[i].Value >>= rLabel; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_TYPE ) { aProp[i].Value >>= rType; } @@ -543,27 +543,27 @@ bool GetToolbarItemData( { for ( sal_Int32 i = 0; i < aProp.getLength(); ++i ) { - if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) + if ( aProp[i].Name == ITEM_DESCRIPTOR_COMMANDURL ) { aProp[i].Value >>= rCommandURL; } - if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_STYLE ) { aProp[i].Value >>= rStyle; } - else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_CONTAINER)) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_CONTAINER ) { aProp[i].Value >>= rSubMenu; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_LABEL ) { aProp[i].Value >>= rLabel; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE )) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_TYPE ) { aProp[i].Value >>= rType; } - else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_ISVISIBLE)) + else if ( aProp[i].Name == ITEM_DESCRIPTOR_ISVISIBLE ) { aProp[i].Value >>= rIsVisible; } @@ -1111,7 +1111,7 @@ bool MenuSaveInData::LoadSubMenus( { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); ++i ) { - if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) ) + if ( aPropSeq[i].Name == ITEM_DESCRIPTOR_LABEL ) { aPropSeq[i].Value >>= aLabel; break; @@ -3538,7 +3538,7 @@ void ToolbarSaveInData::SetSystemStyle( { for ( sal_Int32 i = 0; i < aProps.getLength(); ++i ) { - if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE) ) + if ( aProps[ i ].Name == ITEM_DESCRIPTOR_STYLE ) { aProps[ i ].Value = uno::makeAny( nStyle ); break; @@ -3576,7 +3576,7 @@ sal_Int32 ToolbarSaveInData::GetSystemStyle( const OUString& rResourceURL ) { for ( sal_Int32 i = 0; i < aProps.getLength(); ++i ) { - if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE) ) + if ( aProps[ i ].Name == ITEM_DESCRIPTOR_STYLE ) { aProps[i].Value >>= result; break; @@ -3610,7 +3610,7 @@ OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL ) { for ( sal_Int32 i = 0; i < aProps.getLength(); ++i ) { - if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) ) + if ( aProps[ i ].Name == ITEM_DESCRIPTOR_UINAME ) { aProps[ i ].Value >>= result; } @@ -3637,7 +3637,7 @@ OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL ) { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); ++i ) { - if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) ) + if ( aPropSeq[i].Name == ITEM_DESCRIPTOR_LABEL ) { aPropSeq[i].Value >>= result; } @@ -3688,12 +3688,12 @@ SvxEntries* ToolbarSaveInData::GetEntries() for ( sal_Int32 j = 0; j < props.getLength(); ++j ) { - if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_RESOURCEURL) ) + if ( props[ j ].Name == ITEM_DESCRIPTOR_RESOURCEURL ) { props[ j ].Value >>= url; systemname = url.copy( url.lastIndexOf( '/' ) + 1 ); } - else if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) ) + else if ( props[ j ].Name == ITEM_DESCRIPTOR_UINAME ) { props[ j ].Value >>= uiname; } @@ -3765,12 +3765,12 @@ SvxEntries* ToolbarSaveInData::GetEntries() for ( sal_Int32 j = 0; j < props.getLength(); ++j ) { - if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_RESOURCEURL) ) + if ( props[ j ].Name == ITEM_DESCRIPTOR_RESOURCEURL ) { props[ j ].Value >>= url; systemname = url.copy( url.lastIndexOf( '/' ) + 1 ); } - else if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) ) + else if ( props[ j ].Name == ITEM_DESCRIPTOR_UINAME ) { props[ j ].Value >>= uiname; } @@ -4204,7 +4204,7 @@ bool ToolbarSaveInData::LoadToolbar( { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); ++i ) { - if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) ) + if ( aPropSeq[i].Name == ITEM_DESCRIPTOR_LABEL ) { aPropSeq[i].Value >>= aLabel; break; diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 540c7be..843347b 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -226,7 +226,7 @@ void HexColorControl::Paste() OUString aText; aData >>= aText; - if( !aText.isEmpty() && aText.matchAsciiL( "#", 1, 0 ) ) + if( !aText.isEmpty() && aText.startsWith( "#" ) ) aText = aText.copy(1); if( aText.getLength() > 6 ) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
