summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-14 13:38:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-14 13:38:23 +0200
commitc8695c6cce4aaa07ab2d615783d74037abb241b5 (patch)
treea611b43279dd7b70815becec34edd9c70fb2692f
parent8db493240a2caced1ab72a9e0fc87d39a6d3f12d (diff)
Unify utl::TempFile ctors
Change-Id: I0a781a86804808cebf7756506d9299971c13e2ff
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.cxx4
-rw-r--r--framework/source/services/autorecovery.cxx2
-rw-r--r--include/unotools/tempfile.hxx10
-rw-r--r--sd/qa/unit/HtmlExportTest.cxx2
-rw-r--r--sd/qa/unit/sdmodeltestbase.hxx2
-rw-r--r--sfx2/source/doc/docfile.cxx6
-rw-r--r--sw/source/core/doc/docglbl.cxx4
-rw-r--r--sw/source/core/uibase/dbui/dbmgr.cxx4
-rw-r--r--sw/source/core/uibase/misc/glosdoc.cxx2
-rw-r--r--sw/source/core/uibase/uno/unomailmerge.cxx2
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx2
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx7
14 files changed, 18 insertions, 33 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 609161eb2035..9dd02ba42865 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2453,7 +2453,7 @@ OUString ODbaseTable::createTempFile()
OUString sTempName(aIdent);
OUString sExt(OUString(".") + m_pConnection->getExtension());
OUString sName(m_Name);
- TempFile aTempFile(sName, &sExt, &sTempName);
+ TempFile aTempFile(sName, true, &sExt, &sTempName);
if(!aTempFile.IsValid())
getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE, *this);
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index 8c504a6a73d6..4358071b34cb 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -430,7 +430,7 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp )
if( xStorable.is() )
{
OUString const ext(".xml");
- utl::TempFile aTempFile(OUString(), &ext);
+ utl::TempFile aTempFile(OUString(), true, &ext);
OUString aTempFileURL( aTempFile.GetURL() );
const application_info_impl* pAppInfo = getApplicationInfo( m_pFilterInfo->maExportService );
@@ -593,7 +593,7 @@ void XMLFilterTestDialog::import( const OUString& rURL )
if( m_pCBXDisplaySource->IsChecked() )
{
OUString const ext(".xml");
- TempFile aTempFile(OUString(), &ext);
+ TempFile aTempFile(OUString(), true, &ext);
OUString aTempFileURL( aTempFile.GetURL() );
Reference< XImportFilter > xImporter( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.documentconversion.XSLTFilter", mxContext ), UNO_QUERY );
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 1d5178e97e3b..715b4bac6730 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3541,7 +3541,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString& sBack
OUString sName(sUniqueName.makeStringAndClear());
OUString sExtension(rInfo.Extension);
OUString sPath(sBackupPath);
- ::utl::TempFile aTempFile(sName, &sExtension, &sPath);
+ ::utl::TempFile aTempFile(sName, true, &sExtension, &sPath);
rInfo.NewTempURL = aTempFile.GetURL();
}
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 3299e581b016..67f03fbace0a 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -69,17 +69,9 @@ public:
Same as above; additionally the name starts with some given characters followed by a counter ( example:
rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
- */
- TempFile( const OUString& rLeadingChars, const OUString* pExtension=NULL, const OUString* pParent=NULL,
- bool bDirectory=false);
-
- /**
- Same as above; additionally the name starts with some given characters followed by a counter ( example:
- rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
- The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
@param _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
*/
- TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false);
+ TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false);
/**
TempFile will be removed from disk in dtor if EnableKillingTempFile was called before.
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx
index 4ce0a5d4d9dd..a85f4a5bb5dc 100644
--- a/sd/qa/unit/HtmlExportTest.cxx
+++ b/sd/qa/unit/HtmlExportTest.cxx
@@ -22,7 +22,7 @@ private:
{
FileFormat* pFormat = getFormat(HTML);
OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName);
- utl::TempFile aTempFile(OUString(), &aExt);
+ utl::TempFile aTempFile(OUString(), true, &aExt);
aTempFile.EnableKillingFile();
exportTo(xDocShRef, pFormat, aTempFile);
return parseHtml(aTempFile);
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index bc63fa1666bc..bb8292923e5a 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -174,7 +174,7 @@ protected:
{
FileFormat* pFormat = getFormat(nExportType);
OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName);
- utl::TempFile aTempFile(OUString(), &aExt);
+ utl::TempFile aTempFile(OUString(), true, &aExt);
aTempFile.EnableKillingFile();
save(pShell, pFormat, aTempFile);
return loadURL(aTempFile.GetURL());
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 1f525660f864..517da1933746 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2037,7 +2037,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
if ( !pImp->m_aBackupURL.isEmpty() )
return; // the backup was done already
- ::utl::TempFile aTransactTemp( aPrefix, &aExtension, &aDestDir );
+ ::utl::TempFile aTransactTemp( aPrefix, true, &aExtension, &aDestDir );
aTransactTemp.EnableKillingFile( false );
INetURLObject aBackObj( aTransactTemp.GetURL() );
@@ -3504,7 +3504,7 @@ OUString SfxMedium::CreateTempCopyWithExt( const OUString& aURL )
sal_Int32 nPrefixLen = aURL.lastIndexOf( '.' );
OUString aExt = ( nPrefixLen == -1 ) ? OUString() : aURL.copy( nPrefixLen );
- OUString aNewTempFileURL = ::utl::TempFile( OUString(), &aExt ).GetURL();
+ OUString aNewTempFileURL = ::utl::TempFile( OUString(), true, &aExt ).GetURL();
if ( !aNewTempFileURL.isEmpty() )
{
INetURLObject aSource( aURL );
@@ -3579,7 +3579,7 @@ OUString SfxMedium::SwitchDocumentToTempFile()
OUString const aExt = (nPrefixLen == -1)
? OUString()
: aOrigURL.copy(nPrefixLen);
- OUString aNewURL = ::utl::TempFile( OUString(), &aExt ).GetURL();
+ OUString aNewURL = ::utl::TempFile( OUString(), true, &aExt ).GetURL();
// TODO/LATER: In future the aLogicName should be set to shared folder URL
// and a temporary file should be created. Transport_Impl should be impossible then.
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 340770beb778..5b1793fc55af 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -231,7 +231,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
OUString sLeading(aEntry.GetBase());
aEntry.removeSegment();
OUString sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
- utl::TempFile aTemp(sLeading,&sExt,&sPath );
+ utl::TempFile aTemp(sLeading, true, &sExt, &sPath);
aTemp.EnableKillingFile();
DateTime aTmplDate( DateTime::SYSTEM );
@@ -316,7 +316,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
// And what's with all the Bookmarks?
// ?????
- utl::TempFile aTempFile2(sLeading,&sExt,&sPath );
+ utl::TempFile aTempFile2(sLeading, true, &sExt, &sPath);
sFileName = aTempFile2.GetURL();
SfxMedium* pTmpMed = new SfxMedium( sFileName,
STREAM_STD_READWRITE );
diff --git a/sw/source/core/uibase/dbui/dbmgr.cxx b/sw/source/core/uibase/dbui/dbmgr.cxx
index 5b0566f81eac..4574a91603e5 100644
--- a/sw/source/core/uibase/dbui/dbmgr.cxx
+++ b/sw/source/core/uibase/dbui/dbmgr.cxx
@@ -991,7 +991,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
OUString sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*'));
aTempFile.reset(
- new utl::TempFile(sLeading,&sExt,&sPath ));
+ new utl::TempFile(sLeading, true, &sExt, &sPath));
if( bAsSingleFile )
aTempFile->EnableKillingFile();
}
@@ -2354,7 +2354,7 @@ OUString SwDBManager::LoadAndRegisterDataSource()
OUString sOutputExt = ".odb";
OUString sTmpName;
{
- utl::TempFile aTempFile(sNewName , &sOutputExt, &sHomePath);
+ utl::TempFile aTempFile(sNewName, true, &sOutputExt, &sHomePath);
aTempFile.EnableKillingFile(true);
sTmpName = aTempFile.GetURL();
}
diff --git a/sw/source/core/uibase/misc/glosdoc.cxx b/sw/source/core/uibase/misc/glosdoc.cxx
index fd78f33e0dd5..2094257f3963 100644
--- a/sw/source/core/uibase/misc/glosdoc.cxx
+++ b/sw/source/core/uibase/misc/glosdoc.cxx
@@ -80,7 +80,7 @@ OUString lcl_CheckFileName( const OUString& rNewFilePath,
OUString rSG = SwGlossaries::GetExtension();
//generate generic name
- utl::TempFile aTemp(OUString("group"), &rSG, &rNewFilePath );
+ utl::TempFile aTemp("group", true, &rSG, &rNewFilePath);
aTemp.EnableKillingFile();
INetURLObject aTempURL( aTemp.GetURL() );
diff --git a/sw/source/core/uibase/uno/unomailmerge.cxx b/sw/source/core/uibase/uno/unomailmerge.cxx
index 11fb62aef174..4fef3646b335 100644
--- a/sw/source/core/uibase/uno/unomailmerge.cxx
+++ b/sw/source/core/uibase/uno/unomailmerge.cxx
@@ -767,7 +767,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
OUString( FILTER_XML ),
SwDocShell::Factory().GetFilterContainer() );
OUString aExtension(comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(), '*'));
- utl::TempFile aTempFile( OUString("SwMM"), &aExtension );
+ utl::TempFile aTempFile( "SwMM", true, &aExtension );
aTmpFileName = aTempFile.GetURL();
Reference< XStorable > xStorable( xCurModel, UNO_QUERY );
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 283f74e48a11..72ef290efbfc 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -400,7 +400,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
OUString sTmpName;
{
OUString sHomePath(SvtPathOptions().GetWorkPath());
- utl::TempFile aTempFile(sFind , &sExt, &sHomePath);
+ utl::TempFile aTempFile(sFind, true, &sExt, &sHomePath);
aTempFile.EnableKillingFile(true);
sTmpName = aTempFile.GetURL();
}
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 3df9f3a97a9a..14c36fd94080 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -105,7 +105,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
//creating with extension is not supported by a static method :-(
OUString const sExt(
comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(),'*'));
- utl::TempFile aTempFile( OUString(), &sExt );
+ utl::TempFile aTempFile( OUString(), true, &sExt );
m_sExampleURL = aTempFile.GetURL();
aTempFile.EnableKillingFile();
}
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 54799fd52f26..a62e68d2fbd3 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -272,13 +272,6 @@ TempFile::TempFile( const OUString* pParent, bool bDirectory )
aName = CreateTempName_Impl( pParent, true, bDirectory );
}
-TempFile::TempFile( const OUString& rLeadingChars, const OUString* pExtension, const OUString* pParent, bool bDirectory)
- : pStream( 0 )
- , bIsDirectory( bDirectory )
- , bKillingFileEnabled( false )
-{
- aName = lcl_createName(rLeadingChars, 0, true, pExtension, pParent, bDirectory, true);
-}
TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension, const OUString* pParent, bool bDirectory)
: pStream( 0 )
, bIsDirectory( bDirectory )