diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-26 11:27:22 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-27 11:16:11 +0200 |
commit | b3a8056a499ca2a5cb809fcec52aebddd4e17f23 (patch) | |
tree | 176da629cc41ffba02616c8b8caf919da77eb9da /padmin | |
parent | b3c860acf3a9e0806f2e4451a6f8ceb74565f57d (diff) |
Related: fdo#38838 remove UniString::SearchBackward
Change-Id: Ia474ee07b1bd411eae8cd1ddd55c4fa83dbd5f47
Diffstat (limited to 'padmin')
-rw-r--r-- | padmin/source/adddlg.cxx | 9 | ||||
-rw-r--r-- | padmin/source/helper.cxx | 6 | ||||
-rw-r--r-- | padmin/source/helper.hxx | 2 | ||||
-rw-r--r-- | padmin/source/newppdlg.cxx | 2 |
4 files changed, 10 insertions, 9 deletions
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx index 852c7555dbef..d87d7dbb2ca9 100644 --- a/padmin/source/adddlg.cxx +++ b/padmin/source/adddlg.cxx @@ -265,8 +265,8 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton ) std::list< OUString >::iterator dir; for( dir = aDirs.begin(); dir != aDirs.end(); ++dir ) { - ::std::list< String > aFiles; - ::std::list< String >::iterator file; + ::std::list< OUString > aFiles; + ::std::list< OUString >::iterator file; OUStringBuffer aDir( *dir ); aDir.append( sal_Unicode( '/' ) ); aDir.appendAscii( PRINTER_PPDDIR ); @@ -279,8 +279,9 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton ) aFile += "/"; aFile += *file; - int nPos = file->SearchBackward( '.' ); - if( file->Copy( 0, nPos ) == String( aPPD ) ) + sal_Int32 nPos = file->lastIndexOf( '.' ); + OUString sCopy = nPos == -1 ? *file : file->copy(0, nPos); + if( sCopy == aPPD ) { OString aSysPath(OUStringToOString(aFile, aEncoding)); if (unlink(aSysPath.getStr())) diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx index 1ca8803d7635..a4a72d2d2c73 100644 --- a/padmin/source/helper.cxx +++ b/padmin/source/helper.cxx @@ -79,7 +79,7 @@ ResId padmin::PaResId( sal_uInt32 nId ) * FindFiles */ -void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive ) +void padmin::FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive ) { rResult.clear(); @@ -121,9 +121,9 @@ void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResu OUStringBuffer aSubDir( rDirectory ); aSubDir.appendAscii( "/", 1 ); aSubDir.append( aStatus.getFileName() ); - std::list< String > subfiles; + std::list< OUString > subfiles; FindFiles( aSubDir.makeStringAndClear(), subfiles, rSuffixes, bRecursive ); - for( std::list< String >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it ) + for( std::list< OUString >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it ) { OUStringBuffer aSubFile( aStatus.getFileName() ); aSubFile.appendAscii( "/", 1 ); diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx index ce4c40986e0f..0e7b6270df3a 100644 --- a/padmin/source/helper.hxx +++ b/padmin/source/helper.hxx @@ -103,7 +103,7 @@ sal_Bool AreYouSure( Window*, int nRid = -1 ); ResId PaResId( sal_uInt32 nId ); -void FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive = false ); +void FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive = false ); Config& getPadminRC(); void freePadminRC(); diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx index 56c2cbd2bc7c..74a303507477 100644 --- a/padmin/source/newppdlg.cxx +++ b/padmin/source/newppdlg.cxx @@ -122,7 +122,7 @@ void PPDImportDialog::Import() ProgressDialog aProgress( Application::GetFocusWindow() ); aProgress.startOperation( m_aLoadingPPD ); - ::std::list< String > aFiles; + ::std::list< OUString > aFiles; FindFiles( aImportPath, aFiles, OUString( "PS;PPD;PS.GZ;PPD.GZ" ), true ); int i = 0; |