[Libreoffice-commits] core.git: include/sot sot/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 17 13:31:45 UTC 2019


 include/sot/stg.hxx              |    1 
 sot/source/sdstor/storage.cxx    |   15 ++-----------
 sot/source/sdstor/ucbstorage.cxx |   42 ++-------------------------------------
 3 files changed, 6 insertions(+), 52 deletions(-)

New commits:
commit 6a8a73566c475c945e45e40e269765959d93164d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 17 13:08:01 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 17 15:30:51 2019 +0200

    ofz#18280 remove LinkedFile support
    
    The code to create these "linked files" added by:
    
    commit 6f2f7e3091504e8e58d9be603ed3739f6f2cd68e
    Author: Mathias Bauer <mba at openoffice.org>
    Date:   Fri Jul 6 14:03:59 2001 +0000
    
        #89377#: new StorageMode for creating unpacked files
    
    use of creating them then introduced in:
    
    commit 53fe2691a3fb65110e7f5aee2919f7d8d559ff02
    Author: Mathias Bauer <mba at openoffice.org>
    Date:   Fri Jul 6 13:55:57 2001 +0000
    
        #88062#: some optimizations
    
    that use then commented out in:
    
    commit 762dd2b15bfd201b2271b460efa72a5b68d6fb2a
    Author: Kurt Zenker <kz at openoffice.org>
    Date:   Mon Oct 4 19:53:11 2004 +0000
    
    and the unused code to create them removed in:
    
    commit 8a91528a3e03fe6e2923c33327b687ecf57adb0b
    Author: Stephan Bergmann <sbergman at redhat.com>
    Date:   Thu May 7 10:37:27 2015 +0200
    
        StorageMode::CreateUnpacked is never used
    
    It seems to me that there is no need to keep support for reading them as they
    seem to have been temporary files rather than something still existant
    
    Change-Id: I783cae63dc078a7e843729d3ca13f45c18168f4c
    Reviewed-on: https://gerrit.libreoffice.org/80943
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx
index d692403b9a72..32bd476422f9 100644
--- a/include/sot/stg.hxx
+++ b/include/sot/stg.hxx
@@ -246,7 +246,6 @@ protected:
                                 virtual ~UCBStorage() override;
 public:
     static bool                 IsStorageFile( SvStream* );
-    static OUString             GetLinkedFile( SvStream& );
 
                                 UCBStorage( const ::ucbhelper::Content& rContent,
                                             const OUString& rName,
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 16d1a976b577..f15fb22dd9f1 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -318,18 +318,9 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode )
 
             if ( bIsUCBStorage )
             {
-                if ( !(UCBStorage::GetLinkedFile( *m_pStorStm ).isEmpty()) )
-                {
-                    // detect special unpacked storages
-                    m_pOwnStg = new UCBStorage( *m_pStorStm, true );
-                    m_bDelStm = true;
-                }
-                else
-                {
-                    // UCBStorage always works directly on the UCB content, so discard the stream first
-                    DELETEZ( m_pStorStm );
-                    m_pOwnStg = new UCBStorage( m_aName, nMode, true, true/*bIsRoot*/ );
-                }
+                // UCBStorage always works directly on the UCB content, so discard the stream first
+                DELETEZ( m_pStorStm );
+                m_pOwnStg = new UCBStorage( m_aName, nMode, true, true/*bIsRoot*/ );
             }
             else
             {
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 5edae19704cb..5340f841454c 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1363,22 +1363,9 @@ sal_uLong UCBStorageStream::GetSize() const
 
 UCBStorage::UCBStorage( SvStream& rStrm, bool bDirect )
 {
-    OUString aURL = GetLinkedFile( rStrm );
-    if ( !aURL.isEmpty() )
-    {
-        StreamMode nMode = StreamMode::READ;
-        if( rStrm.IsWritable() )
-            nMode = StreamMode::READ | StreamMode::WRITE;
-
-        ::ucbhelper::Content aContent( aURL, Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() );
-        pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, true );
-    }
-    else
-    {
-        // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
-        // to class UCBStorage !
-        pImp = new UCBStorage_Impl( rStrm, this, bDirect );
-    }
+    // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
+    // to class UCBStorage !
+    pImp = new UCBStorage_Impl( rStrm, this, bDirect );
 
     pImp->AddFirstRef();
     pImp->Init();
@@ -2870,27 +2857,4 @@ bool UCBStorage::IsStorageFile( SvStream* pFile )
     return bRet;
 }
 
-OUString UCBStorage::GetLinkedFile( SvStream &rStream )
-{
-    OUString aString;
-    sal_uInt64 nPos = rStream.Tell();
-    if ( !rStream.TellEnd() )
-        return aString;
-
-    rStream.Seek(0);
-    sal_uInt32 nBytes;
-    rStream.ReadUInt32( nBytes );
-    if( nBytes == 0x04034b50 )
-    {
-        OString aTmp = read_uInt16_lenPrefixed_uInt8s_ToOString(rStream);
-        if (aTmp.match("ContentURL="))
-        {
-            aString = OStringToOUString(aTmp.copy(11), RTL_TEXTENCODING_UTF8);
-        }
-    }
-
-    rStream.Seek( nPos );
-    return aString;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list