summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-16 09:09:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-16 14:06:46 +0100
commit59bdafe4c8faecfadde11ecdd5904e655918160a (patch)
tree70b061bdccd01b197de56d7f8776a2b9a4a12993 /unotools
parentea6261a9db25e8bf68ac5729ff04807f85536dca (diff)
why bring ucb into the tempfile story when its always a file://
Change-Id: I48d51cd24831072af647dd0172a2fd2e4a9ed2a5
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index acd15e5443e9..4f6628d3ba16 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -362,30 +362,24 @@ bool TempFile::IsValid() const
OUString TempFile::GetFileName() const
{
OUString aTmp;
- FileBase::getSystemPathFromFileURL( aName, aTmp );
+ FileBase::getSystemPathFromFileURL(aName, aTmp);
return aTmp;
}
OUString TempFile::GetURL()
{
- if ( aURL.isEmpty() )
- {
- OUString const name(GetFileName());
- LocalFileHelper::ConvertPhysicalNameToURL(name, aURL);
- assert((name.isEmpty() || !aURL.isEmpty()) && "TempFile::GetURL failed: unit test is leaking temp files, add the ucpfile1 component!");
- }
-
- return aURL;
+ assert(!aName.isEmpty() && "TempFile::GetURL failed: unit test is leaking temp files, add the ucpfile1 component!");
+ return aName;
}
SvStream* TempFile::GetStream( StreamMode eMode )
{
- if ( !pStream )
+ if (!pStream)
{
- if ( !GetURL().isEmpty() )
- pStream = UcbStreamHelper::CreateStream( aURL, eMode, true /* bFileExists */ );
+ if (!aName.isEmpty())
+ pStream = new SvFileStream(aName, eMode);
else
- pStream = new SvMemoryStream( NULL, 0, eMode );
+ pStream = new SvMemoryStream(NULL, 0, eMode);
}
return pStream;