[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-0' - connectivity/source cppu/source cui/source dtrans/source editeng/source embeddedobj/source extensions/source filter/source framework/source i18npool/source reportdesign/source sal/rtl sc/qa sc/source sdext/source sfx2/source stoc/source stoc/test svtools/source svx/source sw/source ucb/source vcl/unx
Stephan Bergmann
sbergman at redhat.com
Tue Jan 21 11:50:09 PST 2014
connectivity/source/commontools/dbtools2.cxx | 2
cppu/source/uno/lbmap.cxx | 2
cui/source/customize/cfg.cxx | 4
cui/source/options/treeopt.cxx | 6 -
dtrans/source/cnttype/mcnttype.cxx | 6 -
editeng/source/editeng/edtspell.cxx | 2
editeng/source/editeng/impedit4.cxx | 6 -
editeng/source/items/paraitem.cxx | 2
embeddedobj/source/msole/ownview.cxx | 4
extensions/source/update/check/updatecheckjob.cxx | 2
filter/source/msfilter/eschesdo.cxx | 2
filter/source/placeware/filter.cxx | 6 -
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 2
framework/source/fwe/xml/menudocumenthandler.cxx | 22 ++--
framework/source/jobs/jobexecutor.cxx | 8 -
framework/source/services/autorecovery.cxx | 22 ++--
framework/source/uielement/newmenucontroller.cxx | 2
framework/source/uielement/recentfilesmenucontroller.cxx | 2
framework/source/uielement/statusbarmerger.cxx | 40 ++++----
i18npool/source/collator/collator_unicode.cxx | 4
reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 14 +-
reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 22 ++--
reportdesign/source/ui/misc/toolboxcontroller.cxx | 2
sal/rtl/bootstrap.cxx | 4
sc/qa/unit/ucalc.cxx | 10 +-
sc/source/core/tool/appoptio.cxx | 2
sc/source/ui/dbgui/foptmgr.cxx | 2
sc/source/ui/docshell/dbdocfun.cxx | 2
sc/source/ui/unoobj/chart2uno.cxx | 2
sc/source/ui/unoobj/nameuno.cxx | 4
sc/source/ui/unoobj/styleuno.cxx | 6 -
sc/source/ui/vba/vbaworkbook.cxx | 6 -
sdext/source/pdfimport/filterdet.cxx | 8 -
sfx2/source/appl/sfxhelp.cxx | 28 ++---
sfx2/source/appl/shutdowniconunx.cxx | 2
sfx2/source/doc/graphhelp.cxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 2
sfx2/source/notify/eventsupplier.cxx | 8 -
sfx2/source/view/sfxbasecontroller.cxx | 2
stoc/source/security/access_controller.cxx | 2
stoc/source/security/permissions.cxx | 2
stoc/test/testiadapter.cxx | 58 ++++++------
svtools/source/uno/unogridcolumnfacade.cxx | 12 +-
svx/source/form/fmdpage.cxx | 4
svx/source/form/formcontroller.cxx | 2
svx/source/gallery2/galbrws2.cxx | 4
svx/source/items/galleryitem.cxx | 10 +-
svx/source/sidebar/nbdtmg.cxx | 12 +-
svx/source/tbxctrls/grafctrl.cxx | 16 +--
svx/source/unodraw/UnoGraphicExporter.cxx | 10 +-
svx/source/unodraw/unopage.cxx | 4
svx/source/unodraw/unoshap2.cxx | 2
sw/source/core/unocore/unocrsrhelper.cxx | 2
sw/source/core/unocore/unosett.cxx | 2
sw/source/core/unocore/unostyle.cxx | 2
ucb/source/ucp/webdav/webdavcontent.cxx | 20 ++--
vcl/unx/gtk/gdi/salprn-gtk.cxx | 18 +--
57 files changed, 227 insertions(+), 229 deletions(-)
New commits:
commit 592f4e2a716e91a49485eb921f00fd92b2e3dfed
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jan 21 15:53:55 2014 +0100
fdo#73618: Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to
startsWith calls" should rather have converted to oprator ==.
(cherry picked from commit a3f32769fc4bb23c64168b412dd10ec769a3854d)
Conflicts:
sc/source/ui/unoobj/nameuno.cxx
sc/source/ui/unoobj/styleuno.cxx
sfx2/source/appl/sfxhelp.cxx
stoc/source/security/permissions.cxx
sw/source/core/unocore/unocrsrhelper.cxx
(None of those bogus startsWith calls seem problematic enough to warrant
backporting also to libreoffice-4-2-0.) <- this is utter nonsense, this
commit actually fixes fdo#73618
Reviewed-on: https://gerrit.libreoffice.org/7578
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 523ad9696c9135a29393a0c4d147ab206b6de4f5)
squashed fixup:
ucb: fix inverted condition in webdav lcl_sendPartialGETRequest
(regression from a3f32769fc4bb23c64168b412dd10ec769a3854d)
(cherry picked from commit 3780738154b8c3b3f9d85c64cccf621d97574886)
Reviewed-on: https://gerrit.libreoffice.org/7581
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
(cherry picked from commit bd121d45f847ff353e3796510fac3181b88a87b1)
Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21
Reviewed-on: https://gerrit.libreoffice.org/7580
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index ca012d1..dd1117d 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -875,7 +875,7 @@ bool isEmbeddedInDatabase( const Reference< XInterface >& _rxComponent, Referenc
const PropertyValue* pContextEnd = pContextIter + aDocumentContext.getLength();
for(;pContextIter != pContextEnd;++pContextIter)
{
- if ( pContextIter->Name.startsWith( "ActiveConnection" )
+ if ( pContextIter->Name == "ActiveConnection"
&& ( pContextIter->Value >>= _rxActualConnection )
)
{
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 4f281ba..56d97c1 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -386,7 +386,7 @@ static Mapping loadExternalMapping(
OUString aName;
uno_ext_getMappingFunc fpGetMapFunc = 0;
- if (EnvDcp::getTypeName(rFrom.getTypeName()).startsWith( UNO_LB_UNO ))
+ if (EnvDcp::getTypeName(rFrom.getTypeName()) == UNO_LB_UNO)
{
aName = getBridgeName( rTo, rFrom, rAddPurpose );
fpGetMapFunc = selectMapFunc( aName );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 54f745c..c646ec6 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -411,8 +411,8 @@ SvxConfigPage::CanConfig( const OUString& aModuleId )
OUString GetModuleName( const OUString& aModuleId )
{
- if ( aModuleId.startsWith( "com.sun.star.text.TextDocument" ) ||
- aModuleId.startsWith( "com.sun.star.text.GlobalDocument" ) )
+ if ( aModuleId == "com.sun.star.text.TextDocument" ||
+ aModuleId == "com.sun.star.text.GlobalDocument" )
return OUString("Writer");
else if ( aModuleId == "com.sun.star.text.WebDocument" )
return OUString("Writer/Web");
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6d5c27e..5e53d52 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1613,9 +1613,9 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
// text document
ResStringArray& rTextArray = aDlgResource.GetTextArray();
- if ( aFactory.startsWith( "com.sun.star.text.TextDocument" )
- || aFactory.startsWith( "com.sun.star.text.WebDocument" )
- || aFactory.startsWith( "com.sun.star.text.GlobalDocument" ) )
+ if ( aFactory == "com.sun.star.text.TextDocument"
+ || aFactory == "com.sun.star.text.WebDocument"
+ || aFactory == "com.sun.star.text.GlobalDocument" )
{
SfxModule* pSwMod = (*(SfxModule**) GetAppData(SHL_WRITER));
if ( !lcl_isOptionHidden( SID_SW_EDITOPTIONS, aOptionsDlgOpt ) )
diff --git a/dtrans/source/cnttype/mcnttype.cxx b/dtrans/source/cnttype/mcnttype.cxx
index 015a77f..d710826 100644
--- a/dtrans/source/cnttype/mcnttype.cxx
+++ b/dtrans/source/cnttype/mcnttype.cxx
@@ -170,7 +170,7 @@ void SAL_CALL CMimeContentType::acceptSym( const OUString& pSymTlb )
void SAL_CALL CMimeContentType::skipSpaces( void )
{
- while (m_nxtSym.startsWith(SPACE))
+ while (m_nxtSym == SPACE)
getSym( );
}
@@ -353,8 +353,8 @@ OUString SAL_CALL CMimeContentType::quotedPValue( )
while ( !m_nxtSym.isEmpty( ) )
{
if ( bAfterQuoteSign && (
- (m_nxtSym.startsWith(SPACE)) ||
- (m_nxtSym.startsWith(SEMICOLON)))
+ (m_nxtSym == SPACE) ||
+ (m_nxtSym == SEMICOLON))
)
{
break;
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 3ec1a92..68628f7 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -651,7 +651,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd,
{
SfxItemPool* pPool = &mpEditEngine->GetEditDoc().GetItemPool();
while ( pPool->GetSecondaryPool() &&
- !pPool->GetName().startsWith("EditEngineItemPool") )
+ pPool->GetName() != "EditEngineItemPool" )
{
pPool = pPool->GetSecondaryPool();
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index f9adc4c..a0f54df 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -158,13 +158,13 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
// The SvRTF parser expects the Which-mapping passed on in the pool, not
// dependant on a secondary.
SfxItemPool* pPool = &aEditDoc.GetItemPool();
- while (pPool->GetSecondaryPool() && !pPool->GetName().startsWith("EditEngineItemPool"))
- {
+ while (pPool->GetSecondaryPool() && pPool->GetName() != "EditEngineItemPool")
+ {
pPool = pPool->GetSecondaryPool();
}
- DBG_ASSERT(pPool && pPool->GetName().startsWith("EditEngineItemPool"),
+ DBG_ASSERT(pPool && pPool->GetName() == "EditEngineItemPool",
"ReadRTF: no EditEnginePool!");
EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine);
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 5f11920..39a2e69 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -1164,7 +1164,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
const SfxItemPool *pPool = SfxItemPool::GetStoringPool();
const bool bStoreDefTabs = pPool
- && pPool->GetName().startsWith("SWG")
+ && pPool->GetName() == "SWG"
&& ::IsDefaultItem( this );
const short nTabs = Count();
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index d28f30b..6bba050 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -242,7 +242,7 @@ OUString OwnView_Impl::GetFilterNameFromExtentionAndInStream(
{
for ( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ )
{
- if ( aTypes[nInd].Name.startsWith( "PreferredFilter" ) && ( aTypes[nInd].Value >>= aFilterName ) )
+ if ( aTypes[nInd].Name == "PreferredFilter" && ( aTypes[nInd].Value >>= aFilterName ) )
{
aTypes[nInd].Value >>= aFilterName;
break;
@@ -589,7 +589,7 @@ void SAL_CALL OwnView_Impl::notifyEvent( const document::EventObject& aEvent )
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( aEvent.Source == m_xModel && aEvent.EventName.startsWith( "OnSaveAsDone" ) )
+ if ( aEvent.Source == m_xModel && aEvent.EventName == "OnSaveAsDone" )
{
// SaveAs operation took place, so just forget the model and deregister listeners
xModel = m_xModel;
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index ae7a49e..fecf12f 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -226,7 +226,7 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues)
m_pInitThread.reset(
new InitUpdateCheckJobThread(
m_xContext, aConfig,
- !aEventName.startsWith("onFirstVisibleTask")));
+ aEventName != "onFirstVisibleTask"));
return uno::Any();
}
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index a164591..25efbad 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -1051,7 +1051,7 @@ basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape
{
if(rxShape.is())
{
- if(rxShape->getShapeType().startsWith("com.sun.star.drawing.GroupShape"))
+ if(rxShape->getShapeType() == "com.sun.star.drawing.GroupShape")
{
// it's a group shape, iterate over children
const Reference< XIndexAccess > xXIndexAccess(rxShape, UNO_QUERY);
diff --git a/filter/source/placeware/filter.cxx b/filter/source/placeware/filter.cxx
index b2f7c98..28e55c7 100644
--- a/filter/source/placeware/filter.cxx
+++ b/filter/source/placeware/filter.cxx
@@ -88,15 +88,15 @@ sal_Bool SAL_CALL PlaceWareExportFilter::filter( const ::com::sun::star::uno::Se
Reference < XStatusIndicator > xStatusIndicator;
for ( sal_Int32 i = 0 ; i < nLength; i++)
{
- if ( pValue[i].Name.startsWith( "OutputStream" ) )
+ if ( pValue[i].Name == "OutputStream" )
{
pValue[i].Value >>= xOutputStream;
}
- else if( pValue[i].Name.startsWith( "URL" ) )
+ else if( pValue[i].Name == "URL" )
{
pValue[i].Value >>= sURL;
}
- else if( pValue[i].Name.startsWith( "InteractionHandler" ) )
+ else if( pValue[i].Name == "InteractionHandler" )
{
pValue[i].Value >>= xInteractionHandler;
}
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index deea834..17095fa 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1115,7 +1115,7 @@ void XMLFilterSettingsDialog::initFilterList()
}
// if this is not a XmlFilterAdaptor entry, skip it
- if( !aFilterService.startsWith( "com.sun.star.comp.Writer.XmlFilterAdaptor" ) )
+ if( aFilterService != "com.sun.star.comp.Writer.XmlFilterAdaptor" )
continue;
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index b8d7a8b..3b81cba 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -294,7 +294,7 @@ void SAL_CALL OReadMenuDocumentHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuBarMode = sal_False;
- if ( !aName.startsWith( ELEMENT_MENUBAR ))
+ if ( aName != ELEMENT_MENUBAR )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menubar expected!";
@@ -442,7 +442,7 @@ void OReadMenuBarHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuMode = sal_False;
- if ( !aName.startsWith( ELEMENT_MENU ))
+ if ( aName != ELEMENT_MENU )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menu expected!";
@@ -528,7 +528,7 @@ void SAL_CALL OReadMenuHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuPopupMode = sal_False;
- if ( !aName.startsWith( ELEMENT_MENUPOPUP ))
+ if ( aName != ELEMENT_MENUPOPUP )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menupopup expected!";
@@ -732,7 +732,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuMode = sal_False;
- if ( !aName.startsWith( ELEMENT_MENU ))
+ if ( aName != ELEMENT_MENU )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menu expected!";
@@ -746,7 +746,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
{
if ( m_nNextElementExpected == ELEM_CLOSE_MENUITEM )
{
- if ( !aName.startsWith( ELEMENT_MENUITEM ))
+ if ( aName != ELEMENT_MENUITEM )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menuitem expected!";
@@ -755,7 +755,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
}
else if ( m_nNextElementExpected == ELEM_CLOSE_MENUSEPARATOR )
{
- if ( !aName.startsWith( ELEMENT_MENUSEPARATOR ))
+ if ( aName != ELEMENT_MENUSEPARATOR )
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menuseparator expected!";
@@ -847,8 +847,8 @@ throw ( SAXException, RuntimeException )
ExtractMenuParameters( aProps, aCommandURL, aLabel, aHelpURL, xSubMenu, nType, nItemBits );
if ( xSubMenu.is() )
{
- if ( aCommandURL.startsWith(ADDDIRECT_CMD) ||
- aCommandURL.startsWith(AUTOPILOTMENU_CMD) )
+ if ( aCommandURL == ADDDIRECT_CMD ||
+ aCommandURL == AUTOPILOTMENU_CMD )
{
WriteMenuItem( aCommandURL, aLabel, aHelpURL, nItemBits );
bSeparator = sal_False;
@@ -862,7 +862,7 @@ throw ( SAXException, RuntimeException )
m_aAttributeType,
aCommandURL );
- if ( !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL)) )
+ if ( aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL )
pListMenu->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ),
m_aAttributeType,
aLabel );
@@ -921,13 +921,13 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
aHelpURL );
}
- if ( !aLabel.isEmpty() && !aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) )
+ if ( !aLabel.isEmpty() && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL )
{
pList->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ),
m_aAttributeType,
aLabel );
}
- if (( nStyle > 0 ) && !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) ))
+ if (( nStyle > 0 ) && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL )
{
OUString aValue;
MenuStyleItem* pStyle = MenuItemStyles;
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index dd98699..1c0c916 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -200,8 +200,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// Special feature: If the events "OnNew" or "OnLoad" occurs - we generate our own event "onDocumentOpened".
if (
- (aEvent.EventName.startsWith(EVENT_ON_NEW)) ||
- (aEvent.EventName.startsWith(EVENT_ON_LOAD))
+ (aEvent.EventName == EVENT_ON_NEW) ||
+ (aEvent.EventName == EVENT_ON_LOAD)
)
{
if (m_lEvents.find(EVENT_ON_DOCUMENT_OPENED) != m_lEvents.end())
@@ -210,8 +210,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// Special feature: If the events "OnCreate" or "OnLoadFinished" occurs - we generate our own event "onDocumentAdded".
if (
- (aEvent.EventName.startsWith(EVENT_ON_CREATE)) ||
- (aEvent.EventName.startsWith(EVENT_ON_LOAD_FINISHED))
+ (aEvent.EventName == EVENT_ON_CREATE) ||
+ (aEvent.EventName == EVENT_ON_LOAD_FINISHED)
)
{
if (m_lEvents.find(EVENT_ON_DOCUMENT_ADDED) != m_lEvents.end())
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 75595d9..8a32d78 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -738,8 +738,8 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
// new document => put it into the internal list
if (
- (aEvent.EventName.startsWith(EVENT_ON_NEW)) ||
- (aEvent.EventName.startsWith(EVENT_ON_LOAD))
+ (aEvent.EventName == EVENT_ON_NEW) ||
+ (aEvent.EventName == EVENT_ON_LOAD)
)
{
implts_registerDocument(xDocument);
@@ -755,17 +755,17 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
for the moment, till this other save requests will be finished.
*/
else if (
- (aEvent.EventName.startsWith(EVENT_ON_SAVE)) ||
- (aEvent.EventName.startsWith(EVENT_ON_SAVEAS)) ||
- (aEvent.EventName.startsWith(EVENT_ON_SAVETO))
+ (aEvent.EventName == EVENT_ON_SAVE) ||
+ (aEvent.EventName == EVENT_ON_SAVEAS) ||
+ (aEvent.EventName == EVENT_ON_SAVETO)
)
{
implts_updateDocumentUsedForSavingState(xDocument, SAVE_IN_PROGRESS);
}
// document saved => remove tmp. files - but hold config entries alive!
else if (
- (aEvent.EventName.startsWith(EVENT_ON_SAVEDONE)) ||
- (aEvent.EventName.startsWith(EVENT_ON_SAVEASDONE))
+ (aEvent.EventName == EVENT_ON_SAVEDONE) ||
+ (aEvent.EventName == EVENT_ON_SAVEASDONE)
)
{
implts_markDocumentAsSaved(xDocument);
@@ -785,9 +785,9 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
// But we can reset the state "used for other save requests". Otherwhise
// these documents will never be saved!
else if (
- (aEvent.EventName.startsWith(EVENT_ON_SAVEFAILED)) ||
- (aEvent.EventName.startsWith(EVENT_ON_SAVEASFAILED)) ||
- (aEvent.EventName.startsWith(EVENT_ON_SAVETOFAILED))
+ (aEvent.EventName == EVENT_ON_SAVEFAILED) ||
+ (aEvent.EventName == EVENT_ON_SAVEASFAILED) ||
+ (aEvent.EventName == EVENT_ON_SAVETOFAILED)
)
{
implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED);
@@ -2885,7 +2885,7 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent(
aEvent.FeatureURL.Complete = AutoRecovery::implst_getJobDescription(eJob);
aEvent.FeatureDescriptor = sEventType;
- if (pInfo && sEventType.startsWith(OPERATION_UPDATE))
+ if (pInfo && sEventType == OPERATION_UPDATE)
{
// pack rInfo for transport via UNO
::comphelper::NamedValueCollection aInfo;
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 0472218..905a3e6 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -521,7 +521,7 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments )
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
m_bShowImages = rSettings.GetUseImagesInMenus();
- m_bNewMenu = m_aCommandURL.startsWith( ".uno:AddDirect" );
+ m_bNewMenu = m_aCommandURL == ".uno:AddDirect";
}
}
}
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 3866355..b9181cf 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -280,7 +280,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent
OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
- if ( aCommand.startsWith( CMD_CLEAR_LIST ) )
+ if ( aCommand == CMD_CLEAR_LIST )
{
SvtHistoryOptions().Clear( ePICKLIST );
dispatchCommand(
diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx
index 667929f..f62af3e 100644
--- a/framework/source/uielement/statusbarmerger.cxx
+++ b/framework/source/uielement/statusbarmerger.cxx
@@ -61,19 +61,19 @@ static void lcl_ConvertSequenceToValues(
for ( sal_Int32 i = 0; i < rSequence.getLength(); i++ )
{
aPropVal = rSequence[i];
- if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_URL ) )
+ if ( aPropVal.Name == MERGE_STATUSBAR_URL )
aPropVal.Value >>= rItem.aCommandURL;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_TITLE ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_TITLE )
aPropVal.Value >>= rItem.aLabel;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_CONTEXT ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_CONTEXT )
aPropVal.Value >>= rItem.aContext;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_ALIGN ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_ALIGN )
aPropVal.Value >>= sAlignment;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_AUTOSIZE ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_AUTOSIZE )
aPropVal.Value >>= bAutoSize;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_OWNERDRAW ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_OWNERDRAW )
aPropVal.Value >>= bOwnerDraw;
- else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_WIDTH ) )
+ else if ( aPropVal.Name == MERGE_STATUSBAR_WIDTH )
{
sal_Int32 aWidth = 0;
aPropVal.Value >>= aWidth;
@@ -86,9 +86,9 @@ static void lcl_ConvertSequenceToValues(
nItemBits |= SIB_AUTOSIZE;
if ( bOwnerDraw )
nItemBits |= SIB_USERDRAW;
- if ( sAlignment.startsWith( STATUSBAR_ALIGN_CENTER ))
+ if ( sAlignment == STATUSBAR_ALIGN_CENTER )
nItemBits |= SIB_CENTER;
- else if ( sAlignment.startsWith( STATUSBAR_ALIGN_RIGHT ))
+ else if ( sAlignment == STATUSBAR_ALIGN_RIGHT )
nItemBits |= SIB_RIGHT;
else
// if unset, defaults to left alignment
@@ -214,13 +214,13 @@ bool StatusbarMerger::ProcessMergeOperation(
const ::rtl::OUString& rMergeCommandParameter,
const AddonStatusbarItemContainer& rItems )
{
- if ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER ) )
+ if ( rMergeCommand == MERGECOMMAND_ADDAFTER )
return lcl_MergeItems( pStatusbar, nPos, 1, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE ) )
+ else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE )
return lcl_MergeItems( pStatusbar, nPos, 0, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE ) )
+ else if ( rMergeCommand == MERGECOMMAND_REPLACE )
return lcl_ReplaceItem( pStatusbar, nPos, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE ) )
+ else if ( rMergeCommand == MERGECOMMAND_REMOVE )
return lcl_RemoveItems( pStatusbar, nPos, rMergeCommandParameter );
return false;
@@ -236,18 +236,18 @@ bool StatusbarMerger::ProcessMergeFallback(
const AddonStatusbarItemContainer& rItems )
{
// fallback IGNORE or REPLACE/REMOVE item not found
- if (( rMergeFallback.startsWith( MERGEFALLBACK_IGNORE )) ||
- ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE )) ||
- ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE )) )
+ if (( rMergeFallback == MERGEFALLBACK_IGNORE ) ||
+ ( rMergeCommand == MERGECOMMAND_REPLACE ) ||
+ ( rMergeCommand == MERGECOMMAND_REMOVE ) )
{
return true;
}
- else if (( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE )) ||
- ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER )) )
+ else if (( rMergeCommand == MERGECOMMAND_ADDBEFORE ) ||
+ ( rMergeCommand == MERGECOMMAND_ADDAFTER ) )
{
- if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDFIRST ))
+ if ( rMergeFallback == MERGEFALLBACK_ADDFIRST )
return lcl_MergeItems( pStatusbar, 0, 0, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDLAST ))
+ else if ( rMergeFallback == MERGEFALLBACK_ADDLAST )
return lcl_MergeItems( pStatusbar, STATUSBAR_APPEND, 0, rItemId, rModuleIdentifier, rItems );
}
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 52620ac..2429594 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -140,9 +140,9 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
} else {
if ( rLocale.Language == "ja" ) {
// replace algorithm name to implementation name.
- if (rAlgorithm.startsWith("phonetic (alphanumeric first)") )
+ if (rAlgorithm == "phonetic (alphanumeric first)")
aBuf.appendAscii("phonetic_alphanumeric_first");
- else if (rAlgorithm.startsWith("phonetic (alphanumeric last)"))
+ else if (rAlgorithm == "phonetic (alphanumeric last)")
aBuf.appendAscii("phonetic_alphanumeric_last");
else
aBuf.append(rAlgorithm);
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index 1136de1..9a1cda5 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -195,7 +195,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
{
m_bCountColumnHeader = true;
}
- else if ( m_bCountColumnHeader && _sName.startsWith("table:table-cell") )
+ else if ( m_bCountColumnHeader && _sName == "table:table-cell" )
{
++m_nColumnCount;
}
@@ -207,7 +207,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
m_bTableRowsStarted = true;
m_bFirstRowExported = true;
}
- else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.startsWith("table:table-row") || _sName.startsWith("table:table-cell")) )
+ else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName == "table:table-row" || _sName == "table:table-cell") )
bExport = false;
else if ( _sName == "chart:plot-area" )
{
@@ -224,13 +224,13 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
static OUString s_sCellAddress(lcl_createAttribute(XML_NP_CHART,XML_VALUES_CELL_RANGE_ADDRESS));
lcl_correctCellAddress(s_sCellAddress,xAttribs);
}
- else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName.startsWith("table:table-cell") )
+ else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == "table:table-cell" )
{
SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs);
static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE));
pList->RemoveAttribute(s_sValue);
}
- else if ( m_bTableRowsStarted && _sName.startsWith("text:p") )
+ else if ( m_bTableRowsStarted && _sName == "text:p" )
{
bExport = false;
}
@@ -258,11 +258,11 @@ void SAL_CALL ExportDocumentHandler::endElement(const OUString & _sName) throw (
}
else if ( _sName == "table:table-rows" )
m_bTableRowsStarted = false;
- else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.startsWith("table:table-row") || _sName.startsWith("table:table-cell")) )
+ else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName == "table:table-row" || _sName == "table:table-cell") )
bExport = false;
- else if ( m_bTableRowsStarted && _sName.startsWith("table:table-row") )
+ else if ( m_bTableRowsStarted && _sName == "table:table-row" )
m_bFirstRowExported = true;
- else if ( m_bTableRowsStarted && _sName.startsWith("text:p") )
+ else if ( m_bTableRowsStarted && _sName == "text:p" )
{
bExport = !m_bFirstRowExported;
}
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 88fe433..1763b02 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -249,11 +249,11 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
}
bExport = false;
}
- else if ( _sName.startsWith("rpt:detail")
- || _sName.startsWith("rpt:formatted-text")
- || _sName.startsWith("rpt:master-detail-fields")
- || _sName.startsWith("rpt:report-component")
- || _sName.startsWith("rpt:report-element"))
+ else if ( _sName == "rpt:detail"
+ || _sName == "rpt:formatted-text"
+ || _sName == "rpt:master-detail-fields"
+ || _sName == "rpt:report-component"
+ || _sName == "rpt:report-element")
bExport = false;
else if ( _sName == "chart:plot-area" )
{
@@ -274,7 +274,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
if ( sLocalName == "data-source-has-labels" )
{
const OUString sValue = _xAttrList->getValueByIndex( i );
- bHasCategories = sValue.startsWith("both");
+ bHasCategories = sValue == "both";
break;
}
}
@@ -316,11 +316,11 @@ void SAL_CALL ImportDocumentHandler::endElement(const OUString & _sName) throw (
m_xDatabaseDataProvider->setDetailFields(uno::Sequence< OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
bExport = false;
}
- else if ( _sName.startsWith("rpt:detail")
- || _sName.startsWith("rpt:formatted-text")
- || _sName.startsWith("rpt:master-detail-field")
- || _sName.startsWith("rpt:report-component")
- || _sName.startsWith("rpt:report-element"))
+ else if ( _sName == "rpt:detail"
+ || _sName == "rpt:formatted-text"
+ || _sName == "rpt:master-detail-field"
+ || _sName == "rpt:report-component"
+ || _sName == "rpt:report-element")
bExport = false;
if ( bExport )
diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx
index a81f390..b5af954 100644
--- a/reportdesign/source/ui/misc/toolboxcontroller.cxx
+++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx
@@ -180,7 +180,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments
m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True));
m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox));
}
- else if ( m_aCommandURL.startsWith(".uno:FontColor") || m_aCommandURL.startsWith(".uno:Color") )
+ else if ( m_aCommandURL == ".uno:FontColor" || m_aCommandURL == ".uno:Color" )
{
m_aStates.insert(TCommandState::value_type(OUString(".uno:FontColor"),sal_True));
m_aStates.insert(TCommandState::value_type(OUString(".uno:Color"),sal_True));
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index 0d47a7b..e72ea68 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -483,9 +483,7 @@ bool Bootstrap_Impl::getValue(
LookupMode mode, bool override, ExpandRequestLink const * requestStack)
const
{
- if (mode == LOOKUP_MODE_NORMAL &&
- key.startsWith("URE_BOOTSTRAP"))
- {
+ if (mode == LOOKUP_MODE_NORMAL && key == "URE_BOOTSTRAP") {
mode = LOOKUP_MODE_URE_BOOTSTRAP;
}
if (override && getDirectValue(key, value, mode, requestStack)) {
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d6320ec..e993a9b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3340,7 +3340,7 @@ void Test::testCopyPaste()
fValue = m_pDoc->GetValue(ScAddress(1,1,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 2 after redo", fValue, 2);
aString = m_pDoc->GetString(2, 1, 1);
- CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString == "test");
m_pDoc->GetFormula(1,1,1, aString);
CPPUNIT_ASSERT_MESSAGE("Formula should be correct again", aString == aFormulaString);
@@ -3440,13 +3440,13 @@ void Test::testCopyPasteTranspose()
//check cell content after transposed copy/paste
OUString aString = m_pDoc->GetString(3, 3, 1);
- CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString == "test");
double fValue = m_pDoc->GetValue(ScAddress(3,1,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied cell should return 1", fValue, 1);
fValue = m_pDoc->GetValue(ScAddress(3,2,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied formula should return 2", fValue, 2);
m_pDoc->GetFormula(3, 2, 1, aString);
- CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString.startsWith("=D2+1"));
+ CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString == "=D2+1");
// check notes after transposed copy/paste
CPPUNIT_ASSERT_MESSAGE("There should be a note on Sheet2.D2", m_pDoc->HasNote(ScAddress(3, 1, 1)));
@@ -3505,9 +3505,9 @@ void Test::testMoveBlock()
//check cell content
OUString aString = m_pDoc->GetString(3, 0, 0);
- CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString == "test");
m_pDoc->GetFormula(2, 0, 0, aString);
- CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString.startsWith("=B1+1"));
+ CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString == "=B1+1");
double fValue = m_pDoc->GetValue(aAddrB1);
ASSERT_DOUBLES_EQUAL_MESSAGE("Cell B1 should contain 1", fValue, 1);
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 7479c45..39cada0 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -176,7 +176,7 @@ static void lcl_SetSortList( const Any& rValue )
// if setting is "default", keep default values from ScUserList ctor
//! mark "default" in a safe way
- sal_Bool bDefault = ( nCount == 1 && pArray[0].startsWith( "NULL" ) );
+ sal_Bool bDefault = ( nCount == 1 && pArray[0] == "NULL" );
if (!bDefault)
{
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index bdf5702..3471246 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -159,7 +159,7 @@ void ScFilterOptionsMgr::Init()
}
}
- if ( !theDbName.startsWith(STR_DB_LOCAL_NONAME) )
+ if ( theDbName != STR_DB_LOCAL_NONAME )
{
theDbArea.append(" (");
theDbArea.append(theDbName).append(')');
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 13588ff..13f42ca 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -199,7 +199,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
bool bUndo = pDoc->IsUndoEnabled();
ScDBData* pData = NULL;
- if (rNewData.GetName().startsWith(STR_DB_LOCAL_NONAME))
+ if (rNewData.GetName() == STR_DB_LOCAL_NONAME)
{
ScRange aRange;
rNewData.GetArea(aRange);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 1057fb5..8754057 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1796,7 +1796,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
Reference< beans::XPropertySet > xSeqProp( xLS->getValues(), uno::UNO_QUERY );
OUString aRole;
if( xSeqProp.is() && (xSeqProp->getPropertyValue("Role") >>= aRole) &&
- aRole.startsWith("categories") )
+ aRole == "categories" )
bThisIsCategories = bHasCategories = true;
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index ef920d2..c67e577 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -430,8 +430,8 @@ OUString SAL_CALL ScNamedRangeObj::getImplementationName() throw(uno::RuntimeExc
sal_Bool SAL_CALL ScNamedRangeObj::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException)
{
- return rServiceName.startsWith( SCNAMEDRANGEOBJ_SERVICE ) ||
- rServiceName.startsWith( SCLINKTARGET_SERVICE );
+ return rServiceName == SCNAMEDRANGEOBJ_SERVICE ||
+ rServiceName == SCLINKTARGET_SERVICE;
}
uno::Sequence<OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames()
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 82cd940..52733b9 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1842,7 +1842,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
SolarMutexGuard aGuard;
uno::Any aAny;
- if ( aPropertyName.startsWith( SC_UNONAME_DISPNAME ) ) // read-only
+ if ( aPropertyName == SC_UNONAME_DISPNAME ) // read-only
{
// core always has the display name
SfxStyleSheetBase* pStyle = GetStyle_Impl();
@@ -1987,8 +1987,8 @@ sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException)
{
bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE );
- return rServiceName.startsWith( SCSTYLE_SERVICE ) ||
- ( bPage ? rServiceName.startsWith( SCPAGESTYLE_SERVICE ) : rServiceName.startsWith( SCCELLSTYLE_SERVICE ) );
+ return rServiceName == SCSTYLE_SERVICE ||
+ ( bPage ? rServiceName == SCPAGESTYLE_SERVICE : rServiceName == SCCELLSTYLE_SERVICE );
}
uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 0dbaef6..db401bd 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -151,7 +151,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aArgs[1].Value >>= aFilterName;
}
- if (aFilterName.startsWith("Text - txt - csv (StarCalc)")) {
+ if (aFilterName == "Text - txt - csv (StarCalc)") {
aFileFormat = excel::XlFileFormat::xlCSV; //xlFileFormat.
}
@@ -179,7 +179,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aFileFormat = excel::XlFileFormat::xlExcel9795;
}
- if (aFilterName.startsWith("HTML (StarCalc)")) {
+ if (aFilterName == "HTML (StarCalc)") {
aFileFormat = excel::XlFileFormat::xlHtml;
}
@@ -187,7 +187,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aFileFormat = excel::XlFileFormat::xlTemplate;
}
- if (aFilterName.startsWith("StarOffice XML (Calc)")) {
+ if (aFilterName == "StarOffice XML (Calc)") {
aFileFormat = excel::XlFileFormat::xlWorkbookNormal;
}
if ( aFilterName == "calc8" ) {
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index ab49cdb..1327d3e 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -301,13 +301,13 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
osl_removeFile( aURL.pData );
if( !aEmbedMimetype.isEmpty() )
{
- if( aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.text" )
- || aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.text-master" ) )
+ if( aEmbedMimetype == "application/vnd.oasis.opendocument.text"
+ || aEmbedMimetype == "application/vnd.oasis.opendocument.text-master" )
aOutFilterName = "writer_pdf_addstream_import";
else if ( aEmbedMimetype == "application/vnd.oasis.opendocument.presentation" )
aOutFilterName = "impress_pdf_addstream_import";
- else if( aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.graphics" )
- || aEmbedMimetype.startsWith( "application/vnd.oasis.opendocument.drawing" ) )
+ else if( aEmbedMimetype == "application/vnd.oasis.opendocument.graphics"
+ || aEmbedMimetype == "application/vnd.oasis.opendocument.drawing" )
aOutFilterName = "draw_pdf_addstream_import";
else if ( aEmbedMimetype == "application/vnd.oasis.opendocument.spreadsheet" )
aOutFilterName = "calc_pdf_addstream_import";
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 3640b46..5736c54 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -328,22 +328,22 @@ OUString SfxHelp::GetHelpModuleName_Impl()
aFactoryShortName = "schart" ;
else if ( aFactoryShortName == "BasicIDE" )
aFactoryShortName = "sbasic";
- else if ( aFactoryShortName.startsWith("sweb")
- || aFactoryShortName.startsWith("sglobal")
- || aFactoryShortName.startsWith("swxform") )
+ else if ( aFactoryShortName == "sweb"
+ || aFactoryShortName == "sglobal"
+ || aFactoryShortName == "swxform" )
aFactoryShortName = "swriter" ;
- else if ( aFactoryShortName.startsWith("dbquery")
- || aFactoryShortName.startsWith("dbbrowser")
- || aFactoryShortName.startsWith("dbrelation")
- || aFactoryShortName.startsWith("dbtable")
- || aFactoryShortName.startsWith("dbapp")
- || aFactoryShortName.startsWith("dbreport")
- || aFactoryShortName.startsWith("swreport")
- || aFactoryShortName.startsWith("dbbrowser")
- || aFactoryShortName.startsWith("swform") )
+ else if ( aFactoryShortName == "dbquery"
+ || aFactoryShortName == "dbbrowser"
+ || aFactoryShortName == "dbrelation"
+ || aFactoryShortName == "dbtable"
+ || aFactoryShortName == "dbapp"
+ || aFactoryShortName == "dbreport"
+ || aFactoryShortName == "swreport"
+ || aFactoryShortName == "dbbrowser"
+ || aFactoryShortName == "swform" )
aFactoryShortName = "sdatabase";
- else if ( aFactoryShortName.startsWith("sbibliography")
- || aFactoryShortName.startsWith("StartModule") )
+ else if ( aFactoryShortName == "sbibliography"
+ || aFactoryShortName == "StartModule" )
aFactoryShortName = sDefaultModule;
}
else
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index 937cabe..02bde57 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -212,7 +212,7 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
aEntry[m].Value >>= aDescription;
}
- if ( aURL.startsWith(BASE_URL) && !aDescription.isEmpty() )
+ if ( aURL == BASE_URL && !aDescription.isEmpty() )
{
add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback);
break;
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 22ac9ae..bef3bb8 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -498,7 +498,7 @@ sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const OUS
{
nResult = BMP_128X128_MATH_DOC;
}
- else if ( aFactoryShortName.startsWith( "swriter" ) )
+ else if ( aFactoryShortName == "swriter" || aFactoryShortName.startsWith("swriter/") )
{
nResult = BMP_128X128_WRITER_DOC;
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 70e9c3d..1de92d6 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2311,7 +2311,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const datatransfer::DataF
&& aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.startsWith("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"") )
+ else if ( aFlavor.MimeType == "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 3a12c9e..67c2743 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -211,13 +211,13 @@ static void Execute( uno::Any& aEventData, const document::DocumentEvent& aTrigg
nIndex += 1;
}
- if (aType.startsWith(STAR_BASIC) && !aScript.isEmpty())
+ if (aType == STAR_BASIC && !aScript.isEmpty())
{
uno::Any aAny;
SfxMacroLoader::loadMacro( aScript, aAny, pDoc );
}
- else if (aType.startsWith("Service") ||
- aType.startsWith("Script"))
+ else if (aType == "Service" ||
+ aType == "Script")
{
if ( !aScript.isEmpty() )
{
@@ -385,7 +385,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const uno::Any& rElement, SfxObjectShe
ScriptType eType( STARBASIC );
if ( aType == STAR_BASIC )
eType = STARBASIC;
- else if (aType.startsWith("Script") && !aScriptURL.isEmpty())
+ else if (aType == "Script" && !aScriptURL.isEmpty())
eType = EXTENDED_STYPE;
else if ( aType == SVX_MACRO_LANGUAGE_JAVASCRIPT )
eType = JAVASCRIPT;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 72643d9..5feb401 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -850,7 +850,7 @@ Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const
}
}
}
- else if( sTargetFrameName.startsWith("_self") || sTargetFrameName.isEmpty() )
+ else if( sTargetFrameName == "_self" || sTargetFrameName.isEmpty() )
{
// check for already loaded URL ... but with additional jumpmark!
Reference< frame::XModel > xModel = getModel();
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index ee218a8..f4b8b95 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -295,7 +295,7 @@ void acc_CurrentContext::release()
Any acc_CurrentContext::getValueByName( OUString const & name )
throw (RuntimeException)
{
- if (name.startsWith(s_acRestriction))
+ if (name == s_acRestriction)
{
return m_restriction;
}
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 448db7e..1642003 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -318,7 +318,7 @@ FilePermission::FilePermission(
: Permission( FILE, next )
, m_actions( makeMask( perm.Actions, s_actions ) )
, m_url( perm.URL )
- , m_allFiles( sal_False != perm.URL.startsWith("<<ALL FILES>>") )
+ , m_allFiles( perm.URL == "<<ALL FILES>>" )
{
if (! m_allFiles)
{
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index e13b486..1f850cb 100644
--- a/stoc/test/testiadapter.cxx
+++ b/stoc/test/testiadapter.cxx
@@ -633,36 +633,36 @@ Any XLB_Invocation::getValue( const OUString & rName )
sal_Bool XLB_Invocation::hasMethod( const OUString & rName )
throw(::com::sun::star::uno::RuntimeException)
{
- return (rName.startsWith( "raiseException" ) ||
- rName.startsWith( "getValues" ) ||
- rName.startsWith( "setValues2" ) ||
- rName.startsWith( "setValues" ) ||
- rName.startsWith( "acquire" ) ||
- rName.startsWith( "release" ) ||
- rName.startsWith( "queryInterface" ));
+ return (rName == "raiseException" ||
+ rName == "getValues" ||
+ rName == "setValues2" ||
+ rName == "setValues" ||
+ rName == "acquire" ||
+ rName == "release" ||
+ rName == "queryInterface" );
}
//__________________________________________________________________________________________________
sal_Bool XLB_Invocation::hasProperty( const OUString & rName )
throw(::com::sun::star::uno::RuntimeException)
{
- return (rName.startsWith( "Bool" ) ||
- rName.startsWith( "Byte" ) ||
- rName.startsWith( "Char" ) ||
- rName.startsWith( "Short" ) ||
- rName.startsWith( "UShort" ) ||
- rName.startsWith( "Long" ) ||
- rName.startsWith( "ULong" ) ||
- rName.startsWith( "Hyper" ) ||
- rName.startsWith( "UHyper" ) ||
- rName.startsWith( "Float" ) ||
- rName.startsWith( "Double" ) ||
- rName.startsWith( "Enum" ) ||
- rName.startsWith( "String" ) ||
- rName.startsWith( "Interface" ) ||
- rName.startsWith( "Any" ) ||
- rName.startsWith( "Sequence" ) ||
- rName.startsWith( "Struct" ) ||
- rName.startsWith( "RuntimeException" ) );
+ return (rName == "Bool" ||
+ rName == "Byte" ||
+ rName == "Char" ||
+ rName == "Short" ||
+ rName == "UShort" ||
+ rName == "Long" ||
+ rName == "ULong" ||
+ rName == "Hyper" ||
+ rName == "UHyper" ||
+ rName == "Float" ||
+ rName == "Double" ||
+ rName == "Enum" ||
+ rName == "String" ||
+ rName == "Interface" ||
+ rName == "Any" ||
+ rName == "Sequence" ||
+ rName == "Struct" ||
+ rName == "RuntimeException" );
}
//##################################################################################################
@@ -895,7 +895,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
catch (const IllegalArgumentException &aExc)
{
OSL_ENSURE( aExc.ArgumentPosition == 5 &&
- aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ aExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -910,7 +910,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const RuntimeException & rExc)
{
- OSL_ENSURE( rExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ OSL_ENSURE( rExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -925,9 +925,9 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const Exception & aExc)
{
- OSL_ENSURE( aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ OSL_ENSURE( aExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
- return aExc.Message.startsWith("dum dum dum ich tanz im kreis herum...");
+ return aExc.Message == "dum dum dum ich tanz im kreis herum...";
}
return sal_False;
}
diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx
index 8c93642..3c63cbc 100644
--- a/svtools/source/uno/unogridcolumnfacade.cxx
+++ b/svtools/source/uno/unogridcolumnfacade.cxx
@@ -146,12 +146,12 @@ namespace svt { namespace table
if ( i_event.AttributeName == "HorizontalAlign" )
nChangedAttributes |= COL_ATTRS_APPEARANCE;
- if ( i_event.AttributeName.startsWith("ColumnWidth")
- || i_event.AttributeName.startsWith("MaxWidth")
- || i_event.AttributeName.startsWith("MinWidth")
- || i_event.AttributeName.startsWith("PreferredWidth")
- || i_event.AttributeName.startsWith("Resizeable")
- || i_event.AttributeName.startsWith("Flexibility")
+ if ( i_event.AttributeName == "ColumnWidth"
+ || i_event.AttributeName == "MaxWidth"
+ || i_event.AttributeName == "MinWidth"
+ || i_event.AttributeName == "PreferredWidth"
+ || i_event.AttributeName == "Resizeable"
+ || i_event.AttributeName == "Flexibility"
)
nChangedAttributes |= COL_ATTRS_WIDTH;
diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index db03d58..70ff3e9 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -85,8 +85,8 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen
{
OUString aShapeType( xDescr->getShapeType() );
- if ( aShapeType.startsWith( "com.sun.star.drawing.ShapeControl" ) // compatibility
- || aShapeType.startsWith( "com.sun.star.drawing.ControlShape" )
+ if ( aShapeType == "com.sun.star.drawing.ShapeControl" // compatibility
+ || aShapeType == "com.sun.star.drawing.ControlShape"
)
return new FmFormObj();
else
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 972822a..109e77a 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4115,7 +4115,7 @@ FormController::interceptedQueryDispatch( const URL& aURL,
Reference< XDispatch > xReturn;
// dispatches handled by ourself
if ( ( aURL.Complete == FMURL_CONFIRM_DELETION )
- || ( ( aURL.Complete.startsWith( "private:/InteractionHandler" ) )
+ || ( ( aURL.Complete == "private:/InteractionHandler" )
&& ensureInteractionHandler()
)
)
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 2767816..915844b 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -178,14 +178,14 @@ void SAL_CALL GalleryThemePopup::statusChanged(
throw ( css::uno::RuntimeException )
{
const OUString &rURL = rEvent.FeatureURL.Complete;
- if ( rURL.startsWith( CMD_SID_GALLERY_ENABLE_ADDCOPY ) )
+ if ( rURL == CMD_SID_GALLERY_ENABLE_ADDCOPY )
{
if ( !rEvent.IsEnabled )
{
maPopupMenu.EnableItem( MN_ADD, sal_False );
}
}
- else if ( rURL.startsWith( CMD_SID_GALLERY_BG_BRUSH ) )
+ else if ( rURL == CMD_SID_GALLERY_BG_BRUSH )
{
maBackgroundPopup.Clear();
if ( rEvent.IsEnabled )
diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx
index c07ed06..6911394 100644
--- a/svx/source/items/galleryitem.cxx
+++ b/svx/source/items/galleryitem.cxx
@@ -87,27 +87,27 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
const css::beans::PropertyValue *pEnd = pProp + aSeq.getLength();
for ( ; pProp != pEnd; pProp++ )
{
- if ( pProp->Name.startsWith( SVXGALLERYITEM_TYPE ) )
+ if ( pProp->Name == SVXGALLERYITEM_TYPE )
{
bAllConverted &= bIsSetType = ( pProp->Value >>= nType );
++nConverted;
}
- else if ( pProp->Name.startsWith( SVXGALLERYITEM_URL ) )
+ else if ( pProp->Name == SVXGALLERYITEM_URL )
{
bAllConverted &= ( pProp->Value >>= aURL );
++nConverted;
}
- else if ( pProp->Name.startsWith( SVXGALLERYITEM_FILTER ) )
+ else if ( pProp->Name == SVXGALLERYITEM_FILTER )
{
bAllConverted &= ( pProp->Value >>= aFilterName );
++nConverted;
}
- else if ( pProp->Name.startsWith( SVXGALLERYITEM_DRAWING ) )
+ else if ( pProp->Name == SVXGALLERYITEM_DRAWING )
{
bAllConverted &= ( pProp->Value >>= xDrawing );
++nConverted;
}
- else if ( pProp->Name.startsWith( SVXGALLERYITEM_GRAPHIC ) )
+ else if ( pProp->Name == SVXGALLERYITEM_GRAPHIC )
{
bAllConverted &= ( pProp->Value >>= xGraphic );
++nConverted;
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 4a14f46..5ae6b73 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -114,17 +114,17 @@ NumSettings_ImplPtr lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue>
NumSettings_ImplPtr pNew = new NumSettings_Impl;
for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
{
- if(pValues[j].Name.startsWith(sNumberingType))
+ if(pValues[j].Name == sNumberingType)
pValues[j].Value >>= pNew->nNumberType;
- else if(pValues[j].Name.startsWith(sPrefix))
+ else if(pValues[j].Name == sPrefix)
pValues[j].Value >>= pNew->sPrefix;
- else if(pValues[j].Name.startsWith(sSuffix))
+ else if(pValues[j].Name == sSuffix)
pValues[j].Value >>= pNew->sSuffix;
- else if(pValues[j].Name.startsWith(sParentNumbering))
+ else if(pValues[j].Name == sParentNumbering)
pValues[j].Value >>= pNew->nParentNumbering;
- else if(pValues[j].Name.startsWith(sBulletChar))
+ else if(pValues[j].Name == sBulletChar)
pValues[j].Value >>= pNew->sBulletChar;
- else if(pValues[j].Name.startsWith(sBulletFontName))
+ else if(pValues[j].Name == sBulletFontName)
pValues[j].Value >>= pNew->sBulletFont;
}
const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 59b7a31..4a3fe6b 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -128,7 +128,7 @@ ImplGrafMetricField::ImplGrafMetricField( Window* pParent, const OUString& rCmd,
}
else
{
- const long nMinVal = maCommand.startsWith( ".uno:GrafTransparence" ) ? 0 : -100;
+ const long nMinVal = maCommand == ".uno:GrafTransparence" ? 0 : -100;
SetUnit( FUNIT_CUSTOM );
SetCustomUnitText( OUString(" %") );
@@ -160,14 +160,14 @@ IMPL_LINK_NOARG(ImplGrafMetricField, ImplModifyHdl)
// Convert value to an any to be usable with dispatch API
Any a;
- if ( maCommand.startsWith( ".uno:GrafRed" ) ||
- maCommand.startsWith( ".uno:GrafGreen" ) ||
- maCommand.startsWith( ".uno:GrafBlue" ) ||
- maCommand.startsWith( ".uno:GrafLuminance" ) ||
- maCommand.startsWith( ".uno:GrafContrast" ))
+ if ( maCommand == ".uno:GrafRed" ||
+ maCommand == ".uno:GrafGreen" ||
+ maCommand == ".uno:GrafBlue" ||
+ maCommand == ".uno:GrafLuminance" ||
+ maCommand == ".uno:GrafContrast" )
a = makeAny( sal_Int16( nVal ));
- else if ( maCommand.startsWith( ".uno:GrafGamma" ) ||
- maCommand.startsWith( ".uno:GrafTransparence" ))
+ else if ( maCommand == ".uno:GrafGamma" ||
+ maCommand == ".uno:GrafTransparence" )
a = makeAny( sal_Int32( nVal ));
if ( a.hasValue() )
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 0c83a67..6d4d484 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -521,15 +521,15 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
{
pValues->Value >>= rSettings.mxInteractionHandler;
}
- else if( pValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name == "Width" ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mnWidth;
}
- else if( pValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name == "Height" ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mnHeight;
}
- else if( pValues->Name.startsWith( "ExportOnlyBackground" ) ) // for compatibility reasons, deprecated
+ else if( pValues->Name == "ExportOnlyBackground" ) // for compatibility reasons, deprecated
{
pValues->Value >>= rSettings.mbExportOnlyBackground;
}
@@ -558,12 +558,12 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
{
pDataValues->Value >>= rSettings.mnHeight;
}
- else if( pDataValues->Name.startsWith( "Width" ) ) // for compatibility reasons, deprecated
+ else if( pDataValues->Name == "Width" ) // for compatibility reasons, deprecated
{
pDataValues->Value >>= rSettings.mnWidth;
pDataValues->Name = "PixelWidth";
}
- else if( pDataValues->Name.startsWith( "Height" ) ) // for compatibility reasons, deprecated
+ else if( pDataValues->Name == "Height" ) // for compatibility reasons, deprecated
{
pDataValues->Value >>= rSettings.mnHeight;
pDataValues->Name = "PixelHeight";
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 771f8e8..f23ab2a 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -532,8 +532,8 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor,
if( nTempType == UHASHMAP_NOTFOUND )
{
- if( aName.startsWith("com.sun.star.drawing.TableShape") ||
- aName.startsWith("com.sun.star.presentation.TableShape") )
+ if( aName == "com.sun.star.drawing.TableShape" ||
+ aName == "com.sun.star.presentation.TableShape" )
{
rInventor = SdrInventor;
rType = OBJ_TABLE;
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 3d8370f..3218776 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1901,7 +1901,7 @@ void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, c
::SolarMutexGuard aGuard;
SdrObject* pObject = mpObj.get();
- bool bCustomShapeGeometry = pObject && aPropertyName.startsWith( "CustomShapeGeometry" );
+ bool bCustomShapeGeometry = pObject && aPropertyName == "CustomShapeGeometry";
sal_Bool bMirroredX = sal_False;
sal_Bool bMirroredY = sal_False;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 0543f65..751648b 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1184,7 +1184,7 @@ void makeRedline( SwPaM& rPaM,
eType = nsRedlineType_t::REDLINE_FORMAT;
else if ( rRedlineType == "TextTable" )
eType = nsRedlineType_t::REDLINE_TABLE;
- else if( !rRedlineType.startsWith( "Insert" ))
+ else if( rRedlineType != "Insert" )
throw lang::IllegalArgumentException();
//todo: what about REDLINE_FMTCOLL?
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 32e74d1..41bbfeb 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1108,7 +1108,7 @@ const char aInvalidStyle[] = "__XXX___invalid";
bool SwXNumberingRules::isInvalidStyle(const OUString &rName)
{
- return rName.startsWith(aInvalidStyle);
+ return rName == aInvalidStyle;
}
namespace
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 3df0b18..a1bc926 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1692,7 +1692,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
sal_uInt16 nBin = USHRT_MAX;
if ( !( rValue >>= sTmp ) )
throw lang::IllegalArgumentException();
- if ( sTmp.startsWith ( "[From printer settings]" ) )
+ if ( sTmp == "[From printer settings]" )
nBin = USHRT_MAX-1;
else if ( pPrinter )
{
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 07ecebe..d98c39b 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -97,7 +97,7 @@ static void lcl_sendPartialGETRequest( bool &bError,
for ( std::vector< rtl::OUString >::const_iterator it = aHeaderNames.begin();
it != aHeaderNames.end(); ++it )
{
- if ( it->startsWith( "Content-Length" ) )
+ if ( *it == "Content-Length" )
{
bIsRequestSize = true;
break;
@@ -129,11 +129,11 @@ static void lcl_sendPartialGETRequest( bool &bError,
for ( std::vector< DAVPropertyValue >::const_iterator it = aResponseProps.begin();
it != aResponseProps.end(); ++it )
{
- if ( it->Name.startsWith( "Accept-Ranges" ) )
+ if ( it->Name == "Accept-Ranges" )
it->Value >>= aAcceptRanges;
- else if ( it->Name.startsWith( "Content-Range" ) )
+ else if ( it->Name == "Content-Range" )
it->Value >>= aContentRange;
- else if ( it->Name.startsWith( "Content-Length" ) )
+ else if ( it->Name == "Content-Length" )
it->Value >>= aContentLength;
}
@@ -148,7 +148,7 @@ static void lcl_sendPartialGETRequest( bool &bError,
// MAY ignore ranges specified using other units.
if ( nSize == 1 &&
aContentRange.getLength() &&
- aAcceptRanges.startsWith( "bytes" ) )
+ aAcceptRanges == "bytes" )
{
// Parse the Content-Range to get the size
// vid. http://tools.ietf.org/html/rfc2616#section-14.16
@@ -158,12 +158,12 @@ static void lcl_sendPartialGETRequest( bool &bError,
{
rtl::OUString aSize = aContentRange.copy( nSlash + 1 );
// "*" means that the instance-length is unknown at the time when the response was generated
- if ( !aSize.startsWith( "*" ))
+ if ( aSize != "*" )
{
for ( std::vector< DAVPropertyValue >::iterator it = aResponseProps.begin();
it != aResponseProps.end(); ++it )
{
- if ( it->Name.startsWith( "Content-Length" ) )
+ if (it->Name == "Content-Length")
{
it->Value <<= aSize;
break;
@@ -743,7 +743,7 @@ uno::Any SAL_CALL Content::execute(
aRet = uno::makeAny( createNewContent( aArg ) );
}
- else if ( aCommand.Name.startsWith( "addProperty" ))
+ else if ( aCommand.Name == "addProperty" )
{
ucb::PropertyCommandArgument aPropArg;
if ( !( aCommand.Argument >>= aPropArg ))
@@ -775,7 +775,7 @@ uno::Any SAL_CALL Content::execute(
ucbhelper::cancelCommandExecution( uno::makeAny( e ), Environment );
}
}
- else if ( aCommand.Name.startsWith( "removeProperty" ))
+ else if ( aCommand.Name == "removeProperty" )
{
rtl::OUString sPropName;
if ( !( aCommand.Argument >>= sPropName ) )
@@ -1893,7 +1893,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
"Property is read-only!" ),
static_cast< cppu::OWeakObject * >( this ) );
}
- if ( rName.startsWith( "CreatableContentsInfo" ) )
+ if ( rName == "CreatableContentsInfo" )
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx
index 7d2790c..0fa24b8 100644
--- a/vcl/unx/gtk/gdi/salprn-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx
@@ -557,7 +557,7 @@ GtkPrintDialog::impl_initCustomTab()
if ( aPropertyName == "PrintContent" )
bGtkInternal = true;
- if (aCtrlType.startsWith("Group") || !pCurParent)
+ if (aCtrlType == "Group" || !pCurParent)
{
pCurTabPage = gtk_vbox_new(FALSE, 12);
gtk_container_set_border_width(GTK_CONTAINER(pCurTabPage), 6);
@@ -566,7 +566,7 @@ GtkPrintDialog::impl_initCustomTab()
pCurParent = pCurTabPage;
aCustomTabs.push_back(std::make_pair(pCurTabPage, aText));
}
- else if (aCtrlType.startsWith("Subgroup") && (pCurParent /*|| bOnJobPageValue*/))
+ else if (aCtrlType == "Subgroup" && (pCurParent /*|| bOnJobPageValue*/))
{
bIgnoreSubgroup = bIgnore;
if (bIgnore)
@@ -600,7 +600,7 @@ GtkPrintDialog::impl_initCustomTab()
GtkWidget* pWidget = NULL;
beans::PropertyValue* pVal = NULL;
- if (aCtrlType.startsWith("Bool") && pCurParent)
+ if (aCtrlType == "Bool" && pCurParent)
{
pWidget = gtk_check_button_new_with_mnemonic(
OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
@@ -616,7 +616,7 @@ GtkPrintDialog::impl_initCustomTab()
m_rController.isUIOptionEnabled(aPropertyName) && pVal != NULL);
g_signal_connect(pWidget, "toggled", G_CALLBACK(GtkPrintDialog::UIOption_CheckHdl), this);
}
- else if (aCtrlType.startsWith("Radio") && pCurParent)
+ else if (aCtrlType == "Radio" && pCurParent)
{
GtkWidget* const pVbox = gtk_vbox_new(FALSE, 12);
gtk_container_set_border_width(GTK_CONTAINER(pVbox), 0);
@@ -653,9 +653,9 @@ GtkPrintDialog::impl_initCustomTab()
else
pWidget = pVbox;
}
- else if ((aCtrlType.startsWith("List") ||
- aCtrlType.startsWith("Range") ||
- aCtrlType.startsWith("Edit")
+ else if ((aCtrlType == "List" ||
+ aCtrlType == "Range" ||
+ aCtrlType == "Edit"
) && pCurParent)
{
GtkWidget* const pHbox = gtk_hbox_new(FALSE, 12);
@@ -678,7 +678,7 @@ GtkPrintDialog::impl_initCustomTab()
gtk_combo_box_set_active(GTK_COMBO_BOX(pWidget), nSelectVal);
g_signal_connect(pWidget, "changed", G_CALLBACK(GtkPrintDialog::UIOption_SelectHdl), this);
}
- else if (aCtrlType.startsWith("Edit") && pCurParent)
+ else if (aCtrlType == "Edit" && pCurParent)
{
pWidget = gtk_entry_new();
@@ -689,7 +689,7 @@ GtkPrintDialog::impl_initCustomTab()
gtk_entry_set_text(GTK_ENTRY(pWidget),
OUStringToOString(aCurVal, RTL_TEXTENCODING_UTF8).getStr());
}
- else if (aCtrlType.startsWith("Range") && pCurParent)
+ else if (aCtrlType == "Range" && pCurParent)
{
pWidget = gtk_spin_button_new_with_range(nMinValue, nMaxValue, 1.0);
More information about the Libreoffice-commits
mailing list