Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2558

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/58/2558/1

tempfile: aRet is always empty

pParent is no longer used so this code makes
no sense.

Change-Id: I9c53b263a640e53140a8ae8795181b1c5e43f26d
---
M tools/source/fsys/tempfile.cxx
1 file changed, 6 insertions(+), 26 deletions(-)



diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx
index 1a1da1e..781fe2a 100644
--- a/tools/source/fsys/tempfile.cxx
+++ b/tools/source/fsys/tempfile.cxx
@@ -55,33 +55,13 @@
 
 #define TMPNAME_SIZE  ( 1 + 5 + 5 + 4 + 1 )
 
-OUString ConstructTempDir_Impl( const String* pParent )
+OUString ConstructTempDir_Impl( const String* /* pParent */ )
 {
-    OUString aName;
-    if ( pParent && pParent->Len() )
-    {
-        rtl::OUString aRet;
-
-        // test for valid filename
-        {
-            ::osl::DirectoryItem aItem;
-            sal_Int32 i = aRet.getLength();
-            if ( aRet[i-1] == '/' )
-                i--;
-
-            if ( DirectoryItem::get( aRet.copy(0, i), aItem ) == FileBase::E_None )
-                aName = aRet;
-        }
-    }
-
-    if ( aName.isEmpty() )
-    {
-        // if no parent or invalid parent : use system directory
-        ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get();
-        if ( rTempNameBase_Impl.isEmpty() )
-            rTempNameBase_Impl = GetSystemTempDirPath_Impl();
-        aName = rTempNameBase_Impl;
-    }
+    // use system directory
+    ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get();
+    if ( rTempNameBase_Impl.isEmpty() )
+        rTempNameBase_Impl = GetSystemTempDirPath_Impl();
+    OUString aName = rTempNameBase_Impl;
 
     // Make sure that directory ends with a separator
     if( !aName.endsWith( "/" ) )

-- 
To view, visit https://gerrit.libreoffice.org/2558
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c53b263a640e53140a8ae8795181b1c5e43f26d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Thomas Arnhold <thomas@arnhold.org>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.