summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-12-10 08:31:13 +0200
committerNoel Grandin <noel@peralex.com>2013-12-12 13:15:24 +0200
commitfb847101519ad74c02183672c04ebf1d700aae83 (patch)
treefa391cb75ed11817804bb4b9fbafa7ee265b8dbe /sfx2
parent1957303363ea9bd308b5781da09beaa09df7420c (diff)
simplify - use OUString::startsWith where possible
Convert code like if( !aStr.isEmpty() && aStr[0] == 'x' ) to if( aStr.startsWith("x") ) Change-Id: Iabc3a44ed3be2d29eed876e0eeef212ccd271edf
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx2
-rw-r--r--sfx2/source/dialog/splitwin.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx2
4 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e8e23c5d1a4c..c15ce4296198 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1051,7 +1051,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// make URL ready
SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, sal_False );
aFileName = pURLItem->GetValue();
- if( !aFileName.isEmpty() && aFileName[0] == '#' ) // Mark without URL
+ if( aFileName.startsWith("#") ) // Mark without URL
{
SfxViewFrame *pView = pTargetFrame ? pTargetFrame->GetCurrentViewFrame() : 0;
if ( !pView )
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 65974d01b0f7..fd1c75d2c60b 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -747,7 +747,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const OUString& rExt, Sf
// Use extension without dot!
OUString sExt( rExt );
- if ( !sExt.isEmpty() && ( sExt[0] == (sal_Unicode)'.' ))
+ if ( sExt.startsWith(".") )
sExt = sExt.copy(1);
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 15ffacfb8716..f229df6e8fe5 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -272,7 +272,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
OUString aTemp;
if ( aUserItem >>= aTemp )
aWinData = aTemp;
- if ( !aWinData.isEmpty() && aWinData[0] == 'V' )
+ if ( aWinData.startsWith("V") )
{
pEmptyWin->nState = (sal_uInt16) aWinData.getToken( 1, ',' ).toInt32();
if ( pEmptyWin->nState & 2 )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index f7196d83a520..14ca59fbfded 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -290,7 +290,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?");
if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1))
{
- uri = uri + OUString("/");
+ uri = uri + "/";
}
m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess(