1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: scmdstrm.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_automation.hxx"
33 #include <svtools/intitem.hxx>
34 #include <svtools/stritem.hxx>
35 #include <svtools/eitem.hxx>
36 #include "scmdstrm.hxx"
37 #include "svcommstream.hxx"
38 #include "rcontrol.hxx"
40 #if OSL_DEBUG_LEVEL > 1
41 #include "editwin.hxx"
42 #include "statemnt.hxx"
45 SCmdStream::SCmdStream(SvStream
*pIn
)
48 pCommStream
= new SvCommStream( pSammel
);
49 // SetCommStream( pCommStream );
52 SCmdStream::~SCmdStream()
57 void SCmdStream::Read (String
* &pString
)
60 pString
= new String();
63 CmdBaseStream::Read( pStr
, nLenInChars
);
65 *pString
= String( pStr
, nLenInChars
);
69 void SCmdStream::Read (String
&aString
)
73 CmdBaseStream::Read( pStr
, nLenInChars
);
75 aString
= String( pStr
, nLenInChars
);
79 void SCmdStream::Read ( SfxPoolItem
*&pItem
)
84 #if OSL_DEBUG_LEVEL > 1
85 StatementList::m_pDbgWin
->AddText( "Parameter: " );
86 StatementList::m_pDbgWin
->AddText( String::CreateFromInt32( nId
) );
87 StatementList::m_pDbgWin
->AddText( " " );
96 pItem
= new SfxUInt16Item(nId
,nNr
);
97 #if OSL_DEBUG_LEVEL > 1
98 StatementList::m_pDbgWin
->AddText( "USHORT:" );
99 StatementList::m_pDbgWin
->AddText( String::CreateFromInt32( nNr
) );
107 pItem
= new SfxUInt32Item(nId
,nNr
);
108 #if OSL_DEBUG_LEVEL > 1
109 StatementList::m_pDbgWin
->AddText( "ULONG:" );
110 StatementList::m_pDbgWin
->AddText( String::CreateFromInt64( nNr
) );
119 pItem
= new SfxStringItem(nId
,aString
);
120 #if OSL_DEBUG_LEVEL > 1
121 StatementList::m_pDbgWin
->AddText( "String:" );
122 StatementList::m_pDbgWin
->AddText( aString
);
130 pItem
= new SfxBoolItem(nId
,bBool
);
131 #if OSL_DEBUG_LEVEL > 1
132 StatementList::m_pDbgWin
->AddText( "BOOL:" );
133 StatementList::m_pDbgWin
->AddText( bBool
? "TRUE" : "FALSE" );
138 DBG_ERROR1( "Ungültiger Typ im Stream:%hu", nType
);
139 #if OSL_DEBUG_LEVEL > 1
140 StatementList::m_pDbgWin
->AddText( "Ungültiger Typ !!!! " );
144 #if OSL_DEBUG_LEVEL > 1
145 StatementList::m_pDbgWin
->AddText( "\n" );
149 void SCmdStream::Read ( ::com::sun::star::beans::PropertyValue
&rItem
)
154 rItem
.Name
= rtl::OUString( aId
);
155 #if OSL_DEBUG_LEVEL > 1
156 StatementList::m_pDbgWin
->AddText( "Parameter: " );
157 StatementList::m_pDbgWin
->AddText( aId
);
158 StatementList::m_pDbgWin
->AddText( " " );
160 nType
= GetNextType();
168 #if OSL_DEBUG_LEVEL > 1
169 StatementList::m_pDbgWin
->AddText( "USHORT:" );
170 StatementList::m_pDbgWin
->AddText( String::CreateFromInt32( nNr
) );
179 #if OSL_DEBUG_LEVEL > 1
180 StatementList::m_pDbgWin
->AddText( "ULONG:" );
181 StatementList::m_pDbgWin
->AddText( String::CreateFromInt64( nNr
) );
189 rItem
.Value
<<= ::rtl::OUString( aString
);
190 #if OSL_DEBUG_LEVEL > 1
191 StatementList::m_pDbgWin
->AddText( "String:" );
192 StatementList::m_pDbgWin
->AddText( aString
);
200 rItem
.Value
<<= bBool
;
201 #if OSL_DEBUG_LEVEL > 1
202 StatementList::m_pDbgWin
->AddText( "BOOL:" );
203 StatementList::m_pDbgWin
->AddText( bBool
? "TRUE" : "FALSE" );
208 DBG_ERROR1( "Ungültiger Typ im Stream:%hu", nType
);
209 #if OSL_DEBUG_LEVEL > 1
210 StatementList::m_pDbgWin
->AddText( "Ungültiger Typ !!!! " );
214 #if OSL_DEBUG_LEVEL > 1
215 StatementList::m_pDbgWin
->AddText( "\n" );