[Libreoffice-commits] .: tools/inc tools/source

August Sodora augsod at kemper.freedesktop.org
Thu Dec 22 17:29:43 PST 2011


 tools/inc/tools/pstm.hxx          |    5 +++
 tools/inc/tools/stream.hxx        |    1 
 tools/inc/tools/svborder.hxx      |    1 
 tools/source/generic/svborder.cxx |   18 +++++++++++
 tools/source/ref/pstm.cxx         |   58 ++++++++++++++++++++++++++++++++++++++
 tools/source/stream/strmunx.cxx   |   11 +++++++
 6 files changed, 94 insertions(+)

New commits:
commit a0ebf6ee3f555397205713db966aee44de80c0f9
Author: August Sodora <augsod at gmail.com>
Date:   Thu Dec 22 20:29:18 2011 -0500

    Revert "callcatcher: Remove unused code"
    
    This reverts commit bbad7057b2bdb614a5e97a945039323efe39c4ee.

diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 125875c..68b4932 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -127,6 +127,7 @@ class TOOLS_DLLPUBLIC SvPersistBaseMemberList : public SuperSvPersistBaseMemberL
 {
 public:
     SvPersistBaseMemberList();
+    SvPersistBaseMemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );
 
     void   WriteObjects( SvPersistStream &, sal_Bool bOnlyStreamedObj = sal_False ) const;
     TOOLS_DLLPUBLIC friend SvPersistStream& operator << (SvPersistStream &, const SvPersistBaseMemberList &);
@@ -216,6 +217,8 @@ public:
 
                         SvPersistStream( SvClassManager &, SvStream * pStream,
                                          sal_uInt32 nStartIdx = 1 );
+                        SvPersistStream( SvClassManager &, SvStream * pStream,
+                                         const SvPersistStream & rPersStm );
                         ~SvPersistStream();
 
     void                SetStream( SvStream * pStream );
@@ -244,6 +247,8 @@ public:
                         // gespeichert werden.
     friend SvStream& operator >> ( SvStream &, SvPersistStream & );
     friend SvStream& operator << ( SvStream &, SvPersistStream & );
+    sal_uIntPtr             InsertObj( SvPersistBase * );
+    sal_uIntPtr             RemoveObj( SvPersistBase * );
 };
 
 #endif // _PSTM_HXX
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index decae49..2270eff 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -651,6 +651,7 @@ public:
     sal_Bool            LockRange( sal_Size nByteOffset, sal_Size nBytes );
     sal_Bool            UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
     sal_Bool            LockFile();
+    sal_Bool            UnlockFile();
 
     void            Open( const String& rFileName, StreamMode eOpenMode );
     void            Close();
diff --git a/tools/inc/tools/svborder.hxx b/tools/inc/tools/svborder.hxx
index 27ccdd0..86c5feb 100644
--- a/tools/inc/tools/svborder.hxx
+++ b/tools/inc/tools/svborder.hxx
@@ -40,6 +40,7 @@ public:
     { nTop = nRight = nBottom = nLeft = 0; }
     SvBorder( const Size & rSz )
     { nTop = nBottom = rSz.Height(); nRight = nLeft = rSz.Width(); }
+    SvBorder( const Rectangle & rOuter, const Rectangle & rInner );
     SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
     { nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; }
     sal_Bool    operator == ( const SvBorder & rObj ) const
diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx
index 6b9f0d6..0c55c95 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -30,6 +30,24 @@
 #include <tools/svborder.hxx>
 #include <osl/diagnose.h>
 
+SvBorder::SvBorder( const Rectangle & rOuter, const Rectangle & rInner )
+{
+    Rectangle aOuter( rOuter );
+    aOuter.Justify();
+    Rectangle aInner( rInner );
+    if( aInner.IsEmpty() )
+        aInner = Rectangle( aOuter.Center(), aOuter.Center() );
+    else
+        aInner.Justify();
+
+    OSL_ENSURE( aOuter.IsInside( aInner ),
+                "SvBorder::SvBorder: sal_False == aOuter.IsInside( aInner )" );
+    nTop    = aInner.Top()    - aOuter.Top();
+    nRight  = aOuter.Right()  - aInner.Right();
+    nBottom = aOuter.Bottom() - aInner.Bottom();
+    nLeft   = aInner.Left()   - aOuter.Left();
+}
+
 Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder )
 {
     // wegen Empty-Rect, GetSize muss als erstes gerufen werden
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 4956a6a..a91b078 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -62,6 +62,9 @@ TYPEINIT0( SvRttiBase );
 /****************** SvPersistBaseMemberList ******************************/
 
 SvPersistBaseMemberList::SvPersistBaseMemberList(){}
+SvPersistBaseMemberList::SvPersistBaseMemberList(
+    sal_uInt16 nInitSz, sal_uInt16 nResize )
+    : SuperSvPersistBaseMemberList( nInitSz, nResize ){}
 
 #define PERSIST_LIST_VER        (sal_uInt8)0
 #define PERSIST_LIST_DBGUTIL    (sal_uInt8)0x80
@@ -197,6 +200,44 @@ SvPersistStream::SvPersistStream
 }
 
 //=========================================================================
+SvPersistStream::SvPersistStream
+(
+    SvClassManager & rMgr,  /* Alle Factorys, deren Objekt geladen und
+                               gespeichert werdn k"onnen */
+    SvStream * pStream,     /* Dieser Stream wird als Medium genommen, auf
+                               dem der PersistStream arbeitet */
+    const SvPersistStream & rPersStm
+                            /* Wenn PersistStream's verschachtelt werden,
+                               dann ist dies der Parent-Stream. */
+)
+    : rClassMgr( rMgr )
+    , pStm( pStream )
+    // Bereiche nicht ueberschneiden, deshalb nur groessere Indexe
+    , aPUIdx( rPersStm.GetCurMaxIndex() +1 )
+    , nStartIdx( rPersStm.GetCurMaxIndex() +1 )
+    , pRefStm( &rPersStm )
+    , nFlags( 0 )
+/*  [Beschreibung]
+
+    Der Konstruktor der Klasse SvPersistStream. Die Objekte rMgr und
+    pStream d"urfen nicht ver"andert werden, solange sie in einem
+    SvPersistStream eingesetzt sind. Eine Aussnahme gibt es f"ur
+    pStream (siehe <SvPersistStream::SetStream>).
+    Durch diesen Konstruktor wird eine Hierarchiebildung unterst"utzt.
+    Alle Objekte aus einer Hierarchie m"ussen erst geladen werden,
+    wenn das erste aus dieser Hierarchie benutzt werden soll.
+*/
+{
+    bIsWritable = sal_True;
+    if( pStm )
+    {
+        SetVersion( pStm->GetVersion() );
+        SetError( pStm->GetError() );
+        SyncSvStream( pStm->Tell() );
+    }
+}
+
+//=========================================================================
 SvPersistStream::~SvPersistStream()
 /*  [Beschreibung]
 
@@ -862,4 +903,21 @@ SvStream& operator >>
     return rStm;
 }
 
+//=========================================================================
+sal_uIntPtr SvPersistStream::InsertObj( SvPersistBase * pObj )
+{
+    sal_uIntPtr nId = aPUIdx.Insert( pObj );
+    aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
+    return nId;
+}
+
+//=========================================================================
+sal_uIntPtr SvPersistStream::RemoveObj( SvPersistBase * pObj )
+{
+    sal_uIntPtr nIdx = GetIndex( pObj );
+    aPUIdx.Remove( nIdx );
+    aPTable.Remove( (sal_uIntPtr)pObj );
+    return nIdx;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 6aedf2d..ffb75a9 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -592,6 +592,17 @@ sal_Bool SvFileStream::LockFile()
 
 /*************************************************************************
 |*
+|*    SvFileStream::UnlockFile()
+|*
+*************************************************************************/
+
+sal_Bool SvFileStream::UnlockFile()
+{
+    return UnlockRange( 0UL, 0UL );
+}
+
+/*************************************************************************
+|*
 |*    SvFileStream::Open()
 |*
 *************************************************************************/


More information about the Libreoffice-commits mailing list