[Libreoffice-commits] .: 2 commits - sot/inc writerperfect/source

Fridrich Strba fridrich at kemper.freedesktop.org
Fri May 25 07:47:35 PDT 2012


 sot/inc/sot/storage.hxx                     |    4 ++--
 writerperfect/source/stream/WPXSvStream.cxx |   22 +++++++++++++---------
 writerperfect/source/stream/WPXSvStream.h   |   14 ++++++++++++--
 3 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 87ccec22b105fda607f70467a14cf60050e45009
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Fri May 25 16:47:13 2012 +0200

    Trying to wrap the tools references inside a struct
    
    Change-Id: Ie4d9a1d2c131f14928d7cc47f1b6314cf7e7f41d

diff --git a/writerperfect/source/stream/WPXSvStream.cxx b/writerperfect/source/stream/WPXSvStream.cxx
index d71e155..cf5c52d 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -163,17 +163,20 @@ WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
         return 0;
     }
 
-    mxChildrenStorages.push_back(new SotStorage( pStream, sal_True ));
+    SotStorageRefWrapper storageRefWrapper;
+    storageRefWrapper.ref = new SotStorage( pStream, sal_True );
+    mxChildrenStorages.push_back( storageRefWrapper );
 
     unsigned i = 0;
     while (i < aElems.size())
     {
-        if( mxChildrenStorages.back()->IsStream(aElems[i]))
+        if( mxChildrenStorages.back().ref->IsStream(aElems[i]))
             break;
-        else if (mxChildrenStorages.back()->IsStorage(aElems[i]))
+        else if (mxChildrenStorages.back().ref->IsStorage(aElems[i]))
         {
-            SotStorageRef &tmpParent(mxChildrenStorages.back());
-            mxChildrenStorages.push_back(tmpParent->OpenSotStorage(aElems[i++], STREAM_STD_READ));
+            SotStorageRef tmpParent(mxChildrenStorages.back().ref);
+            storageRefWrapper.ref = tmpParent->OpenSotStorage(aElems[i++], STREAM_STD_READ);
+            mxChildrenStorages.push_back(storageRefWrapper);
         }
         else
             // should not happen
@@ -186,18 +189,19 @@ WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
     if (i >= aElems.size())
         return 0;
 
-    mxChildrenStreams.push_back( mxChildrenStorages.back()->OpenSotStream(
-                                     aElems[i], STREAM_STD_READ ));
+    SotStorageStreamRefWrapper storageStreamRefWrapper;
+    storageStreamRefWrapper.ref = mxChildrenStorages.back().ref->OpenSotStream( aElems[i], STREAM_STD_READ );
+    mxChildrenStreams.push_back( storageStreamRefWrapper );
 
     mxSeekable->seek(tmpPosition);
 
-    if ( !mxChildrenStreams.back().Is() || mxChildrenStreams.back()->GetError() )
+    if ( !mxChildrenStreams.back().ref.Is() || mxChildrenStreams.back().ref->GetError() )
     {
         mxSeekable->seek(tmpPosition);
         return 0;
     }
 
-    Reference < XInputStream > xContents(new utl::OSeekableInputStreamWrapper( mxChildrenStreams.back() ));
+    Reference < XInputStream > xContents(new utl::OSeekableInputStreamWrapper( mxChildrenStreams.back().ref ));
     mxSeekable->seek(tmpPosition);
     if (xContents.is())
         return new WPXSvInputStream( xContents );
diff --git a/writerperfect/source/stream/WPXSvStream.h b/writerperfect/source/stream/WPXSvStream.h
index 2e9dc09..6206a00 100644
--- a/writerperfect/source/stream/WPXSvStream.h
+++ b/writerperfect/source/stream/WPXSvStream.h
@@ -18,6 +18,16 @@
 #pragma warning( pop )
 #endif
 
+typedef struct
+{
+    SotStorageRef ref;
+} SotStorageRefWrapper;
+
+typedef struct
+{
+    SotStorageStreamRef ref;
+} SotStorageStreamRefWrapper;
+
 class WPXSvInputStream : public WPXInputStream
 {
 public:
@@ -34,8 +44,8 @@ public:
     virtual bool atEOS();
 
 private:
-    std::vector< SotStorageRef > mxChildrenStorages;
-    std::vector< SotStorageStreamRef > mxChildrenStreams;
+    std::vector< SotStorageRefWrapper > mxChildrenStorages;
+    std::vector< SotStorageStreamRefWrapper > mxChildrenStreams;
     ::com::sun::star::uno::Reference<
             ::com::sun::star::io::XInputStream > mxStream;
     ::com::sun::star::uno::Reference<
commit c77918bb03974ff9be90c889f77e62ea0755052f
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Fri May 25 16:46:41 2012 +0200

    Revert "Make SotStorage and SotStorageStream dtors public"
    
    This reverts commit 90f3840e4c767154266c6be1c532f5e748e8c3f7.

diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx
index 7f4a563..925ae42 100644
--- a/sot/inc/sot/storage.hxx
+++ b/sot/inc/sot/storage.hxx
@@ -71,13 +71,13 @@ protected:
     virtual sal_uLong       PutData( const void* pData, sal_uLong nSize );
     virtual sal_uLong       SeekPos( sal_uLong nPos );
     virtual void        FlushData();
+                        ~SotStorageStream();
 public:
                         SotStorageStream( const String &,
                                      StreamMode = STREAM_STD_READWRITE,
                                      StorageMode = 0 );
                         SotStorageStream( BaseStorageStream *pStm );
                         SotStorageStream();
-                        ~SotStorageStream();
                         SO2_DECL_BASIC_CLASS_DLL(SotStorageStream,SOTDATA())
 
     using SvStream::SyncSvStream;
@@ -128,9 +128,9 @@ friend class ::binfilter::SvStorage;
     long        m_nVersion;
 
 protected:
+                        ~SotStorage();
    void                 CreateStorage( sal_Bool bUCBStorage, StreamMode, StorageMode );
 public:
-                        ~SotStorage();
                         SotStorage( const String &,
                                    StreamMode = STREAM_STD_READWRITE,
                                    StorageMode = 0 );


More information about the Libreoffice-commits mailing list