summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-12-22 20:29:18 -0500
committerAugust Sodora <augsod@gmail.com>2011-12-22 20:29:18 -0500
commita0ebf6ee3f555397205713db966aee44de80c0f9 (patch)
tree7b6ba19241e1b8c275f0d1d522915b3fe5aaf550 /tools
parentbbad7057b2bdb614a5e97a945039323efe39c4ee (diff)
Revert "callcatcher: Remove unused code"
This reverts commit bbad7057b2bdb614a5e97a945039323efe39c4ee.
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/pstm.hxx5
-rw-r--r--tools/inc/tools/stream.hxx1
-rw-r--r--tools/inc/tools/svborder.hxx1
-rw-r--r--tools/source/generic/svborder.cxx18
-rw-r--r--tools/source/ref/pstm.cxx58
-rw-r--r--tools/source/stream/strmunx.cxx11
6 files changed, 94 insertions, 0 deletions
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 125875cac8c4..68b4932e1e51 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 decae4934f35..2270effbd074 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 27ccdd008d74..86c5feb4f4dc 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 6b9f0d636e7f..0c55c9515f56 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 4956a6aa46f5..a91b078409cb 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 6aedf2dd6064..ffb75a9f4bf4 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()
|*
*************************************************************************/