xref: /trunk/main/sw/source/core/text/txtio.cxx (revision efeef26f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 #ifdef DBG_UTIL
28 
29 #include "viewsh.hxx"       // IsDbg()
30 #include "viewopt.hxx"      // IsDbg()
31 #include "txtatr.hxx"
32 #include "errhdl.hxx"
33 #include "txtcfg.hxx"
34 #include "txtfrm.hxx"       // IsDbg()
35 #include "rootfrm.hxx"
36 #include "flyfrms.hxx"
37 #include "inftxt.hxx"
38 #include "porexp.hxx"
39 #include "porfld.hxx"
40 #include "porfly.hxx"
41 #include "porftn.hxx"
42 #include "porglue.hxx"
43 #include "porhyph.hxx"
44 #include "porlay.hxx"
45 #include "porlin.hxx"
46 #include "porref.hxx"
47 #include "porrst.hxx"
48 #include "portab.hxx"
49 #include "portox.hxx"
50 #include "portxt.hxx"
51 #include "pordrop.hxx"
52 #include "pormulti.hxx"
53 #include "ndhints.hxx"
54 
55 // So kann man die Layoutstruktur ausgeben lassen
56 // #define AMA_LAYOUT
57 #ifdef AMA_LAYOUT
58 #include <stdio.h>
59 #include <stdlib.h> 		// getenv()
60 #include <flowfrm.hxx>
61 #include <pagefrm.hxx>
62 #include <svx/svdobj.hxx>
63 #include <dflyobj.hxx>
64 
65 
lcl_OutFollow(XubString & rTmp,const SwFrm * pFrm)66 void lcl_OutFollow( XubString &rTmp, const SwFrm* pFrm )
67 {
68 	if( pFrm->IsFlowFrm() )
69 	{
70 		const SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( pFrm );
71 		if( pFlow->IsFollow() || pFlow->GetFollow() )
72 		{
73 			rTmp += "(";
74 			if( pFlow->IsFollow() )
75 				rTmp += ".";
76 			if( pFlow->GetFollow() )
77 			{
78 				MSHORT nFrmId = pFlow->GetFollow()->GetFrm()->GetFrmId();
79 				rTmp += nFrmId;
80 			}
81 			rTmp += ")";
82 		}
83 	}
84 }
85 
lcl_OutFrame(SvFileStream & rStr,const SwFrm * pFrm,ByteString & rSp,sal_Bool bNxt)86 void lcl_OutFrame( SvFileStream& rStr, const SwFrm* pFrm, ByteString& rSp, sal_Bool bNxt )
87 {
88 	if( !pFrm )
89 		return;
90 	KSHORT nSpc = 0;
91 	MSHORT nFrmId = pFrm->GetFrmId();
92 	ByteString aTmp;
93 	if( pFrm->IsLayoutFrm() )
94 	{
95 		if( pFrm->IsRootFrm() )
96 			aTmp = "R";
97 		else if( pFrm->IsPageFrm() )
98 			aTmp = "P";
99 		else if( pFrm->IsBodyFrm() )
100 			aTmp = "B";
101 		else if( pFrm->IsColumnFrm() )
102 			aTmp = "C";
103 		else if( pFrm->IsTabFrm() )
104 			aTmp = "Tb";
105 		else if( pFrm->IsRowFrm() )
106 			aTmp = "Rw";
107 		else if( pFrm->IsCellFrm() )
108 			aTmp = "Ce";
109 		else if( pFrm->IsSctFrm() )
110 			aTmp = "S";
111 		else if( pFrm->IsFlyFrm() )
112 		{
113 			aTmp = "F";
114 			const SwFlyFrm *pFly = (SwFlyFrm*)pFrm;
115 			if( pFly->IsFlyInCntFrm() )
116 				aTmp += "in";
117 			else if( pFly->IsFlyAtCntFrm() )
118 			{
119 				aTmp += "a";
120 				if( pFly->IsAutoPos() )
121 					aTmp += "u";
122 				else
123 					aTmp += "t";
124 			}
125 			else
126 				aTmp += "l";
127 		}
128 		else if( pFrm->IsHeaderFrm() )
129 			aTmp = "H";
130 		else if( pFrm->IsFooterFrm() )
131 			aTmp = "Fz";
132 		else if( pFrm->IsFtnContFrm() )
133 			aTmp = "Fc";
134 		else if( pFrm->IsFtnFrm() )
135 			aTmp = "Fn";
136 		else
137 			aTmp = "?L?";
138 		aTmp += nFrmId;
139 		lcl_OutFollow( aTmp, pFrm );
140 		aTmp += " ";
141 		rStr << aTmp;
142 		nSpc = aTmp.Len();
143 		rSp.Expand( nSpc + rSp.Len() );
144 		lcl_OutFrame( rStr, ((SwLayoutFrm*)pFrm)->Lower(), rSp, sal_True );
145 	}
146 	else
147 	{
148 		if( pFrm->IsTxtFrm() )
149 			aTmp = "T";
150 		else if( pFrm->IsNoTxtFrm() )
151 			aTmp = "N";
152 		else
153 			aTmp = "?C?";
154 		aTmp += nFrmId;
155 		lcl_OutFollow( aTmp, pFrm );
156 		aTmp += " ";
157 		rStr << aTmp;
158 		nSpc = aTmp.Len();
159 		rSp.Expand( nSpc + rSp.Len() );
160 	}
161 	if( pFrm->IsPageFrm() )
162 	{
163 		const SwPageFrm* pPg = (SwPageFrm*)pFrm;
164         const SwSortedObjs *pSorted = pPg->GetSortedObjs();
165 		const MSHORT nCnt = pSorted ? pSorted->Count() : 0;
166 		if( nCnt )
167 		{
168 			for( MSHORT i=0; i < nCnt; ++i )
169 			{
170                 // --> OD 2004-07-07 #i28701# - consider changed type of
171                 // <SwSortedObjs> entries
172                 SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
173                 if( pAnchoredObj->ISA(SwFlyFrm) )
174 				{
175                     SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
176 					lcl_OutFrame( rStr, pFly, rSp, sal_False );
177 				}
178 				else
179 				{
180                     aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
181 					rStr << aTmp;
182 				}
183                 // <--
184 				if( i < nCnt - 1 )
185 					rStr << endl << rSp;
186 			}
187 		}
188 	}
189 	else if( pFrm->GetDrawObjs() )
190 	{
191 		MSHORT nCnt = pFrm->GetDrawObjs()->Count();
192 		if( nCnt )
193 		{
194 			for( MSHORT i=0; i < nCnt; ++i )
195 			{
196                 // --> OD 2004-07-07 #i28701# - consider changed type of
197                 // <SwSortedObjs> entries
198                 SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[ i ];
199                 if( pAnchoredObj->ISA(SwFlyFrm) )
200 				{
201                     SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
202 					lcl_OutFrame( rStr, pFly, rSp, sal_False );
203 				}
204 				else
205 				{
206                     aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
207 					rStr << aTmp;
208 				}
209 				if( i < nCnt - 1 )
210 					rStr << endl << rSp;
211 			}
212 		}
213 	}
214 	if( nSpc )
215 		rSp.Erase( rSp.Len() - nSpc );
216 	if( bNxt && pFrm->GetNext() )
217 	{
218 		do
219 		{
220 			pFrm = pFrm->GetNext();
221 			rStr << endl << rSp;
222 			lcl_OutFrame( rStr, pFrm, rSp, sal_False );
223 		} while ( pFrm->GetNext() );
224 	}
225 }
226 
LayOutPut(const SwFrm * pFrm)227 void LayOutPut( const SwFrm* pFrm )
228 {
229     static char* pOutName = 0;
230 	const sal_Bool bFirstOpen = pOutName ? sal_False : sal_True;
231 	if( bFirstOpen )
232 	{
233 		char *pPath = getenv( "TEMP" );
234 		char *pName = "layout.txt";
235 		if( !pPath )
236 			pOutName = pName;
237 		else
238 		{
239 			const int nLen = strlen(pPath);
240 			// fuer dieses new wird es kein delete geben.
241 			pOutName = new char[nLen + strlen(pName) + 3];
242 			if(nLen && (pPath[nLen-1] == '\\') || (pPath[nLen-1] == '/'))
243 				snprintf( pOutName, sizeof(pOutName), "%s%s", pPath, pName );
244 			else
245 				snprintf( pOutName, sizeof(pOutName), "%s/%s", pPath, pName );
246 		}
247 	}
248 	SvFileStream aStream( pOutName, (bFirstOpen
249 										? STREAM_WRITE | STREAM_TRUNC
250 										: STREAM_WRITE ));
251 
252 	if( !aStream.GetError() )
253 	{
254 		if ( bFirstOpen )
255 			aStream << "Layout-Struktur";
256 		else
257 			aStream.Seek( STREAM_SEEK_TO_END );
258 		aStream << endl;
259 		aStream << "---------------------------------------------" << endl;
260 		XubString aSpace;
261 		lcl_OutFrame( aStream, pFrm, aSpace, sal_False );
262 	}
263 }
264 
265 #endif
266 
operator <<(SvStream & rOs,const SwpHints &)267 SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream
268 {
269 	rOs << " {HINTS:";
270 
271 // REMOVED
272 
273 	rOs << '}';
274 	return rOs;
275 }
276 
277 /*************************************************************************
278  *                          IsDbg()
279  *************************************************************************/
280 
IsDbg(const SwTxtFrm * pFrm)281 sal_Bool IsDbg( const SwTxtFrm *pFrm )
282 {
283 	if( pFrm && pFrm->getRootFrm()->GetCurrShell() )
284 		return pFrm->getRootFrm()->GetCurrShell()->GetViewOptions()->IsTest4();
285 	else
286 		return sal_False;
287 }
288 
289 #if OSL_DEBUG_LEVEL < 2
290 
Error()291 static void Error()
292 {
293 	// wegen PM und BCC
294 	sal_Bool bFalse = sal_False;
295 	ASSERT( bFalse, "txtio: No debug version" );
296 }
297 
298 #define IMPL_OUTOP(class) \
299         SvStream &class::operator<<( SvStream &rOs ) const /*$ostream*/\
300 		{ \
301 			Error(); \
302 			return rOs; \
303 		}
304 
305 IMPL_OUTOP( SwTxtPortion )
IMPL_OUTOP(SwLinePortion)306 IMPL_OUTOP( SwLinePortion )
307 IMPL_OUTOP( SwBreakPortion )
308 IMPL_OUTOP( SwGluePortion )
309 IMPL_OUTOP( SwFldPortion )
310 IMPL_OUTOP( SwHiddenPortion )
311 IMPL_OUTOP( SwHyphPortion )
312 IMPL_OUTOP( SwFixPortion )
313 IMPL_OUTOP( SwFlyPortion )
314 IMPL_OUTOP( SwFlyCntPortion )
315 IMPL_OUTOP( SwMarginPortion )
316 IMPL_OUTOP( SwNumberPortion )
317 IMPL_OUTOP( SwBulletPortion )
318 IMPL_OUTOP( SwGrfNumPortion )
319 IMPL_OUTOP( SwLineLayout )
320 IMPL_OUTOP( SwParaPortion )
321 IMPL_OUTOP( SwFtnPortion )
322 IMPL_OUTOP( SwFtnNumPortion )
323 IMPL_OUTOP( SwTmpEndPortion )
324 IMPL_OUTOP( SwHyphStrPortion )
325 IMPL_OUTOP( SwExpandPortion )
326 IMPL_OUTOP( SwBlankPortion )
327 IMPL_OUTOP( SwToxPortion )
328 IMPL_OUTOP( SwRefPortion )
329 IMPL_OUTOP( SwIsoToxPortion )
330 IMPL_OUTOP( SwIsoRefPortion )
331 IMPL_OUTOP( SwSoftHyphPortion )
332 IMPL_OUTOP( SwSoftHyphStrPortion )
333 IMPL_OUTOP( SwTabPortion )
334 IMPL_OUTOP( SwTabLeftPortion )
335 IMPL_OUTOP( SwTabRightPortion )
336 IMPL_OUTOP( SwTabCenterPortion )
337 IMPL_OUTOP( SwTabDecimalPortion )
338 IMPL_OUTOP( SwPostItsPortion )
339 IMPL_OUTOP( SwQuoVadisPortion )
340 IMPL_OUTOP( SwErgoSumPortion )
341 IMPL_OUTOP( SwHolePortion )
342 IMPL_OUTOP( SwDropPortion )
343 IMPL_OUTOP( SwKernPortion )
344 IMPL_OUTOP( SwArrowPortion )
345 IMPL_OUTOP( SwMultiPortion )
346 IMPL_OUTOP( SwCombinedPortion )
347 
348 const char *GetPortionName( const MSHORT )
349 {
350 	return 0;
351 }
352 
GetPrepName(const PrepareHint)353 const char *GetPrepName( const PrepareHint )
354 {
355 	return 0;
356 }
357 
DebugPortions(SvStream &,const XubString &,const xub_StrLen)358 void SwLineLayout::DebugPortions( SvStream &, const XubString &, //$ ostream
359 												const xub_StrLen  )
360 {
361 }
362 
GetLangName(const MSHORT)363 const char *GetLangName( const MSHORT  )
364 {
365 	return 0;
366 }
367 
368 #else
369 # include <limits.h>
370 # include <stdlib.h>
371 # include "swtypes.hxx"      // ZTCCONST
372 # include "swfont.hxx"     // SwDropPortion
373 
374 CONSTCHAR( pClose, "} " );
375 
376 /*************************************************************************
377  *                    GetPortionName()
378  *************************************************************************/
379 
380 CONSTCHAR( pPOR_LIN, "LIN" );
381 CONSTCHAR( pPOR_TXT, "TXT" );
382 CONSTCHAR( pPOR_SHADOW, "SHADOW" );
383 CONSTCHAR( pPOR_TAB, "TAB" );
384 CONSTCHAR( pPOR_TABLEFT, "TABLEFT" );
385 CONSTCHAR( pPOR_TABRIGHT, "TABRIGHT" );
386 CONSTCHAR( pPOR_TABCENTER, "TABCENTER" );
387 CONSTCHAR( pPOR_TABDECIMAL, "TABDECIMAL" );
388 CONSTCHAR( pPOR_EXP, "EXP" );
389 CONSTCHAR( pPOR_HYPH, "HYPH" );
390 CONSTCHAR( pPOR_HYPHSTR, "HYPHSTR" );
391 CONSTCHAR( pPOR_FLD, "FLD" );
392 CONSTCHAR( pPOR_FIX, "FIX" );
393 CONSTCHAR( pPOR_FLY, "FLY" );
394 CONSTCHAR( pPOR_FLYCNT, "FLYCNT" );
395 CONSTCHAR( pPOR_MARGIN, "MARGIN" );
396 CONSTCHAR( pPOR_GLUE, "GLUE" );
397 CONSTCHAR( pPOR_HOLE, "HOLE" );
398 CONSTCHAR( pPOR_END, "END" );
399 CONSTCHAR( pPOR_BRK, "BRK" );
400 CONSTCHAR( pPOR_LAY, "LAY" );
401 CONSTCHAR( pPOR_BLANK, "BLANK" );
402 CONSTCHAR( pPOR_FTN, "FTN" );
403 CONSTCHAR( pPOR_FTNNUM, "FTNNUM" );
404 CONSTCHAR( pPOR_POSTITS, "POSTITS" );
405 CONSTCHAR( pPOR_SOFTHYPH, "SOFTHYPH" );
406 CONSTCHAR( pPOR_SOFTHYPHSTR, "SOFTHYPHSTR" );
407 CONSTCHAR( pPOR_TOX, "TOX" );
408 CONSTCHAR( pPOR_REF, "REF" );
409 
410 CONSTCHAR( pPOR_ISOTOX, "ISOTOX" );
411 CONSTCHAR( pPOR_ISOREF, "ISOREF" );
412 CONSTCHAR( pPOR_HIDDEN, "Hidden" );
413 CONSTCHAR( pPOR_QUOVADIS, "QuoVadis" );
414 CONSTCHAR( pPOR_ERGOSUM, "ErgoSum" );
415 CONSTCHAR( pPOR_NUMBER, "NUMBER" );
416 CONSTCHAR( pPOR_BULLET, "BULLET" );
417 CONSTCHAR( pPOR_UNKW, "UNKW" );
418 CONSTCHAR( pPOR_PAR, "PAR" );
419 
GetPortionName(const MSHORT)420 const char *GetPortionName( const MSHORT /*nType*/ )
421 {
422 	return 0;
423 }
424 
425 CONSTCHAR( pPREP_CLEAR, "CLEAR" );
426 CONSTCHAR( pPREP_WIDOWS_ORPHANS, "WIDOWS_ORPHANS" );
427 CONSTCHAR( pPREP_FIXSIZE_CHG, "FIXSIZE_CHG" );
428 CONSTCHAR( pPREP_FOLLOW_FOLLOWS, "FOLLOW_FOLLOWS" );
429 CONSTCHAR( pPREP_ADJUST_FRM, "ADJUST_FRM" );
430 CONSTCHAR( pPREP_FREE_SPACE, "FREE_SPACE" );
431 CONSTCHAR( pPREP_FLY_CHGD, "FLY_CHGD" );
432 CONSTCHAR( pPREP_FLY_ATTR_CHG, "FLY_ATTR_CHG" );
433 CONSTCHAR( pPREP_FLY_ARRIVE, "FLY_ARRIVE" );
434 CONSTCHAR( pPREP_FLY_LEAVE, "FLY_LEAVE" );
435 CONSTCHAR( pPREP_VIEWOPT, "VIEWOPT" );
436 CONSTCHAR( pPREP_FTN, "FTN" );
437 CONSTCHAR( pPREP_POS_CHGD, "POS" );
438 CONSTCHAR( pPREP_UL_SPACE, "UL_SPACE" );
439 CONSTCHAR( pPREP_MUST_FIT, "MUST_FIT" );
440 CONSTCHAR( pPREP_WIDOWS, "ORPHANS" );
441 CONSTCHAR( pPREP_QUOVADIS, "QUOVADIS" );
442 CONSTCHAR( pPREP_PAGE, "PAGE" );
443 
GetPrepName(const PrepareHint ePrep)444 const char *GetPrepName( const PrepareHint ePrep )
445 {
446 	// Kurz und schmerzlos:
447 	const char *ppNameArr[PREP_END] =
448 	{
449 		pPREP_CLEAR, pPREP_WIDOWS_ORPHANS, pPREP_FIXSIZE_CHG,
450 		pPREP_FOLLOW_FOLLOWS, pPREP_ADJUST_FRM, pPREP_FREE_SPACE,
451 		pPREP_FLY_CHGD, pPREP_FLY_ATTR_CHG, pPREP_FLY_ARRIVE,
452 		pPREP_FLY_LEAVE, pPREP_VIEWOPT, pPREP_FTN, pPREP_POS_CHGD,
453 		pPREP_UL_SPACE, pPREP_MUST_FIT, pPREP_WIDOWS, pPREP_QUOVADIS,
454 		pPREP_PAGE
455 	};
456 	ASSERT( ePrep < PREP_END, "GetPrepName: unknown PrepareHint" );
457 	return( ppNameArr[ePrep] );
458 }
459 
460 /*************************************************************************
461  *                    SwLineLayout::DebugPortions()
462  *
463  * DebugPortion() iteriert ueber alle Portions einer Zeile und deckt die
464  * internen Strukturen auf.
465  * Im Gegensatz zum Ausgabe-Operator werden auch die Textteile ausgegeben.
466  *************************************************************************/
467 
DebugPortions(SvStream & rOs,const XubString &,const xub_StrLen)468 void SwLineLayout::DebugPortions( SvStream &rOs, const XubString &/*rTxt*/, //$ ostream
469                                                 const xub_StrLen /*nStart*/ )
470 {
471     SwLinePortion *pPortion2 = GetPortion();
472 
473 	xub_StrLen nPos = 0;
474 	MSHORT nNr = 0;
475 	KSHORT nPrtWidth, nLastPrt;
476 	nPrtWidth = nLastPrt = 0;
477 
478 	SwLinePortion::operator<<( rOs );
479 	rOs << '\"' << endl;
480 
481     while( pPortion2 )
482 	{
483 		DBG_LOOP;
484         SwTxtPortion *pTxtPor = pPortion2->InTxtGrp() ?
485                                 (SwTxtPortion *)pPortion2 : NULL ;
486         (void)pTxtPor;
487 		++nNr;
488         nLastPrt = nPrtWidth;
489         nPrtWidth = nPrtWidth + pPortion2->PrtWidth();
490 		rOs << "\tNr:"  << nNr
491 			<< " Pos:" << nPos
492 			<< " Org:" << nLastPrt
493 			<< endl;
494 
495 		rOs << "\t";
496         pPortion2->operator<<( rOs );
497 		rOs << endl;
498         nPos = nPos + pPortion2->GetLen();
499         pPortion2 = pPortion2->GetPortion();
500 	}
501 }
502 
GetLangName(const MSHORT)503 const char *GetLangName( const MSHORT /*nLang*/ )
504 {
505 	return "???";
506 }
507 
operator <<(SvStream & rOs) const508 SvStream &SwLinePortion::operator<<( SvStream &rOs ) const //$ ostream
509 {
510 	rOs << " {";
511 	rOs <<	"L:" << nLineLength;
512 	rOs << " H:" << Height();
513 	rOs << " W:" << PrtWidth();
514 	rOs << " A:" << nAscent;
515 	rOs << pClose;
516 	return rOs;
517 }
518 
operator <<(SvStream & rOs) const519 SvStream &SwTxtPortion::operator<<( SvStream &rOs ) const //$ ostream
520 {
521 	CONSTCHAR( pTxt, " {TXT:" );
522 	rOs << pTxt;
523 	SwLinePortion::operator<<( rOs );
524 	rOs << pClose;
525 	return rOs;
526 }
527 
operator <<(SvStream & rOs) const528 SvStream &SwTmpEndPortion::operator<<( SvStream &rOs ) const //$ ostream
529 {
530 	CONSTCHAR( pTxt, " {END:" );
531 	rOs << pTxt;
532 	SwLinePortion::operator<<( rOs );
533 	if( PrtWidth() )
534 		rOs << "(view)";
535 	rOs << pClose;
536 	return rOs;
537 }
538 
operator <<(SvStream & rOs) const539 SvStream &SwBreakPortion::operator<<( SvStream &rOs ) const //$ ostream
540 {
541 	CONSTCHAR( pTxt, " {BREAK:" );
542 	rOs << pTxt;
543 	SwLinePortion::operator<<( rOs );
544 	rOs << pClose;
545 	return rOs;
546 }
547 
operator <<(SvStream & rOs) const548 SvStream &SwKernPortion::operator<<( SvStream &rOs ) const //$ ostream
549 {
550 	CONSTCHAR( pTxt, " {KERN:" );
551 	rOs << pTxt;
552 	SwLinePortion::operator<<( rOs );
553 	rOs << pClose;
554 	return rOs;
555 }
556 
operator <<(SvStream & rOs) const557 SvStream &SwArrowPortion::operator<<( SvStream &rOs ) const //$ ostream
558 {
559 	CONSTCHAR( pTxt, " {ARROW:" );
560 	rOs << pTxt;
561 	SwLinePortion::operator<<( rOs );
562 	rOs << pClose;
563 	return rOs;
564 }
565 
operator <<(SvStream & rOs) const566 SvStream &SwMultiPortion::operator<<( SvStream &rOs ) const //$ ostream
567 {
568 	CONSTCHAR( pTxt, " {MULTI:" );
569 	rOs << pTxt;
570 	SwLinePortion::operator<<( rOs );
571 	rOs << pClose;
572 	return rOs;
573 }
574 
operator <<(SvStream & rOs) const575 SvStream &SwCombinedPortion::operator<<( SvStream &rOs ) const //$ ostream
576 {
577 	CONSTCHAR( pTxt, " {COMBINED:" );
578 	rOs << pTxt;
579 	SwLinePortion::operator<<( rOs );
580 	rOs << pClose;
581 	return rOs;
582 }
583 
operator <<(SvStream & rOs) const584 SvStream &SwLineLayout::operator<<( SvStream &rOs ) const //$ ostream
585 {
586 	CONSTCHAR( pTxt, " {LINE:" );
587 	rOs << pTxt;
588 	SwLinePortion::operator<<( rOs );
589 	SwLinePortion *pPos = GetPortion();
590 	while( pPos )
591 	{
592 		DBG_LOOP;
593 		rOs << "\t";
594 		pPos->operator<<( rOs );
595 		pPos = pPos->GetPortion();
596 	}
597 	rOs << pClose;
598 	return rOs;
599 }
600 
operator <<(SvStream & rOs) const601 SvStream &SwGluePortion::operator<<( SvStream &rOs ) const //$ ostream
602 {
603 	CONSTCHAR( pTxt, " {GLUE:" );
604 	rOs << pTxt;
605 	SwLinePortion::operator<<( rOs );
606 	rOs << " F:" << GetFixWidth();
607 	rOs << " G:" << GetPrtGlue();
608 	rOs << pClose;
609 	return rOs;
610 }
611 
operator <<(SvStream & rOs) const612 SvStream &SwFixPortion::operator<<( SvStream &rOs ) const //$ ostream
613 {
614 	CONSTCHAR( pTxt, " {FIX:" );
615 	rOs << pTxt;
616 	SwGluePortion::operator<<( rOs );
617 	rOs << " Fix:" << nFix;
618 	rOs << pClose;
619 	return rOs;
620 }
621 
operator <<(SvStream & rOs) const622 SvStream &SwFlyPortion::operator<<( SvStream &rOs ) const //$ ostream
623 {
624 	CONSTCHAR( pTxt, " {FLY:" );
625 	rOs << pTxt;
626 	SwFixPortion::operator<<( rOs );
627 	rOs << pClose;
628 	return rOs;
629 }
630 
operator <<(SvStream & rOs) const631 SvStream &SwMarginPortion::operator<<( SvStream &rOs ) const //$ ostream
632 {
633 	CONSTCHAR( pTxt, " {MAR:" );
634 	rOs << pTxt;
635 	SwGluePortion::operator<<( rOs );
636 	rOs << pClose;
637 	return rOs;
638 }
639 
operator <<(SvStream & rOs) const640 SvStream &SwFlyCntPortion::operator<<( SvStream &rOs ) const //$ ostream
641 {
642 	CONSTCHAR( pTxt, " {FLYCNT:" );
643 	rOs << pTxt;
644 	SwLinePortion::operator<<( rOs );
645 	if( bDraw )
646 	{
647         CONSTCHAR( pTxt2, " {DRAWINCNT" );
648         rOs << pTxt2;
649 		rOs << pClose;
650 	}
651 	else
652 	{
653         CONSTCHAR( pTxt2, " {FRM:" );
654         rOs << pTxt2;
655 		rOs << " {FRM:" << GetFlyFrm()->Frm() << pClose;
656 		rOs << " {PRT:" << GetFlyFrm()->Prt() << pClose;
657 		rOs << pClose;
658 	}
659 	rOs << pClose;
660 	return rOs;
661 }
662 
operator <<(SvStream & rOs) const663 SvStream &SwExpandPortion::operator<<( SvStream &rOs ) const //$ ostream
664 {
665 	CONSTCHAR( pTxt, " {EXP:" );
666 	rOs << pTxt;
667 	SwLinePortion::operator<<( rOs );
668 	rOs << pClose;
669 	return rOs;
670 }
671 
operator <<(SvStream & rOs) const672 SvStream &SwFtnPortion::operator<<( SvStream &rOs ) const //$ ostream
673 {
674 	CONSTCHAR( pTxt, " {FTN:" );
675 	rOs << pTxt;
676 	SwExpandPortion::operator<<( rOs );
677 	rOs << pClose;
678 	return rOs;
679 }
680 
operator <<(SvStream & rOs) const681 SvStream &SwFtnNumPortion::operator<<( SvStream &rOs ) const //$ ostream
682 {
683 	CONSTCHAR( pTxt, " {FTNNUM:" );
684 	rOs << pTxt;
685 	SwNumberPortion::operator<<( rOs );
686 	rOs << pClose;
687 	return rOs;
688 }
689 
operator <<(SvStream & rOs) const690 SvStream &SwNumberPortion::operator<<( SvStream &rOs ) const //$ ostream
691 {
692 	CONSTCHAR( pTxt, " {NUMBER:" );
693 	rOs << pTxt;
694 	SwExpandPortion::operator<<( rOs );
695 	rOs << " Exp:\"" << '\"';
696 	rOs << pClose;
697 	return rOs;
698 }
699 
operator <<(SvStream & rOs) const700 SvStream &SwBulletPortion::operator<<( SvStream &rOs ) const //$ ostream
701 {
702 	CONSTCHAR( pTxt, " {BULLET:" );
703 	rOs << pTxt;
704 	SwNumberPortion::operator<<( rOs );
705 	rOs << pClose;
706 	return rOs;
707 }
708 
operator <<(SvStream & rOs) const709 SvStream &SwGrfNumPortion::operator<<( SvStream &rOs ) const //$ ostream
710 {
711 	CONSTCHAR( pTxt, " {GRFNUM:" );
712 	rOs << pTxt;
713     SwNumberPortion::operator<<( rOs );
714 	rOs << pClose;
715 	return rOs;
716 }
717 
operator <<(SvStream & rOs) const718 SvStream &SwHiddenPortion::operator<<( SvStream &rOs ) const //$ ostream
719 {
720 	CONSTCHAR( pTxt, " {Hidden:" );
721 	rOs << pTxt;
722 	SwFldPortion::operator<<( rOs );
723 	rOs << pClose;
724 	return rOs;
725 }
726 
operator <<(SvStream & rOs) const727 SvStream &SwToxPortion::operator<<( SvStream &rOs ) const //$ ostream
728 {
729 	CONSTCHAR( pTxt, " {TOX:" );
730 	rOs << pTxt;
731 	SwTxtPortion::operator<<( rOs );
732 	rOs << pClose;
733 	return rOs;
734 }
735 
operator <<(SvStream & rOs) const736 SvStream &SwRefPortion::operator<<( SvStream &rOs ) const //$ ostream
737 {
738 	CONSTCHAR( pTxt, " {Ref:" );
739 	rOs << pTxt;
740 	SwTxtPortion::operator<<( rOs );
741 	rOs << pClose;
742 	return rOs;
743 }
744 
operator <<(SvStream & rOs) const745 SvStream &SwIsoToxPortion::operator<<( SvStream &rOs ) const //$ ostream
746 {
747 	CONSTCHAR( pTxt, " {ISOTOX:" );
748 	rOs << pTxt;
749 	SwToxPortion::operator<<( rOs );
750 	rOs << pClose;
751 	return rOs;
752 }
753 
operator <<(SvStream & rOs) const754 SvStream &SwIsoRefPortion::operator<<( SvStream &rOs ) const //$ ostream
755 {
756 	CONSTCHAR( pTxt, " {ISOREF:" );
757 	rOs << pTxt;
758 	SwRefPortion::operator<<( rOs );
759 	rOs << pClose;
760 	return rOs;
761 }
762 
operator <<(SvStream & rOs) const763 SvStream &SwHyphPortion::operator<<( SvStream &rOs ) const //$ ostream
764 {
765 	CONSTCHAR( pTxt, " {HYPH:" );
766 	rOs << pTxt;
767 	SwExpandPortion::operator<<( rOs );
768 	rOs << pClose;
769 	return rOs;
770 }
771 
operator <<(SvStream & rOs) const772 SvStream &SwHyphStrPortion::operator<<( SvStream &rOs ) const //$ ostream
773 {
774 	CONSTCHAR( pTxt, " {HYPHSTR:" );
775 	rOs << pTxt;
776 	SwExpandPortion::operator<<( rOs );
777 	rOs << pClose;
778 	return rOs;
779 }
780 
operator <<(SvStream & rOs) const781 SvStream &SwSoftHyphPortion::operator<<( SvStream &rOs ) const //$ ostream
782 {
783 	CONSTCHAR( pTxt, " {SOFTHYPH:" );
784 	rOs << pTxt;
785 	SwHyphPortion::operator<<( rOs );
786 	rOs << (IsExpand() ? " on" : " off");
787 	rOs << pClose;
788 	return rOs;
789 }
790 
operator <<(SvStream & rOs) const791 SvStream &SwSoftHyphStrPortion::operator<<( SvStream &rOs ) const //$ ostream
792 {
793 	CONSTCHAR( pTxt, " {SOFTHYPHSTR:" );
794 	rOs << pTxt;
795 	SwHyphStrPortion::operator<<( rOs );
796 	rOs << pClose;
797 	return rOs;
798 }
799 
operator <<(SvStream & rOs) const800 SvStream &SwBlankPortion::operator<<( SvStream &rOs ) const //$ ostream
801 {
802 	CONSTCHAR( pTxt, " {BLANK:" );
803 	rOs << pTxt;
804 	SwExpandPortion::operator<<( rOs );
805 	rOs << pClose;
806 	return rOs;
807 }
808 
operator <<(SvStream & rOs) const809 SvStream &SwFldPortion::operator<<( SvStream &rOs ) const //$ ostream
810 {
811 	CONSTCHAR( pTxt, " {FLD:" );
812 	rOs << pTxt;
813 	SwLinePortion::operator<<( rOs );
814 	if( IsFollow() )
815 		rOs << " F!";
816 	rOs << pClose;
817 	return rOs;
818 }
819 
operator <<(SvStream & rOs) const820 SvStream &SwPostItsPortion::operator<<( SvStream &rOs ) const //$ ostream
821 {
822 	CONSTCHAR( pTxt, " {POSTITS" );
823 	rOs << pTxt;
824 	SwLinePortion::operator<<( rOs );
825 	rOs << pClose;
826 	return rOs;
827 }
828 
operator <<(SvStream & rOs) const829 SvStream &SwTabPortion::operator<<( SvStream &rOs ) const //$ ostream
830 {
831 	CONSTCHAR( pTxt, " {TAB" );
832 	rOs << pTxt;
833 	SwFixPortion::operator<<( rOs );
834 	rOs << " T:" << nTabPos;
835 	if( IsFilled() )
836 		rOs << " \"" << cFill << '\"';
837 	rOs << pClose;
838 	return rOs;
839 }
840 
operator <<(SvStream & rOs) const841 SvStream &SwTabLeftPortion::operator<<( SvStream &rOs ) const //$ ostream
842 {
843 	CONSTCHAR( pTxt, " {TABLEFT" );
844 	rOs << pTxt;
845 	SwTabPortion::operator<<( rOs );
846 	rOs << pClose;
847 	return rOs;
848 }
849 
operator <<(SvStream & rOs) const850 SvStream &SwTabRightPortion::operator<<( SvStream &rOs ) const //$ ostream
851 {
852 	CONSTCHAR( pTxt, " {TABRIGHT" );
853 	rOs << pTxt;
854 	SwTabPortion::operator<<( rOs );
855 	rOs << pClose;
856 	return rOs;
857 }
858 
operator <<(SvStream & rOs) const859 SvStream &SwTabCenterPortion::operator<<( SvStream &rOs ) const //$ ostream
860 {
861 	CONSTCHAR( pTxt, " {TABCENTER" );
862 	rOs << pTxt;
863 	SwTabPortion::operator<<( rOs );
864 	rOs << pClose;
865 	return rOs;
866 }
867 
operator <<(SvStream & rOs) const868 SvStream &SwTabDecimalPortion::operator<<( SvStream &rOs ) const //$ ostream
869 {
870 	CONSTCHAR( pTxt, " {TABDECIMAL" );
871 	rOs << pTxt;
872 	SwTabPortion::operator<<( rOs );
873 	rOs << pClose;
874 	return rOs;
875 }
876 
operator <<(SvStream & rOs) const877 SvStream &SwParaPortion::operator<<( SvStream &rOs ) const //$ ostream
878 {
879 	CONSTCHAR( pTxt, " {PAR" );
880 	rOs << pTxt;
881 	SwLineLayout::operator<<( rOs );
882 	rOs << pClose;
883 	return rOs;
884 }
885 
operator <<(SvStream & rOs) const886 SvStream &SwHolePortion::operator<<( SvStream &rOs ) const //$ ostream
887 {
888 	CONSTCHAR( pTxt, " {HOLE" );
889 	rOs << pTxt;
890 	SwLinePortion::operator<<( rOs );
891 	rOs << pClose;
892 	return rOs;
893 }
894 
operator <<(SvStream & rOs) const895 SvStream &SwQuoVadisPortion::operator<<( SvStream &rOs ) const //$ ostream
896 {
897 	CONSTCHAR( pTxt, " {QUOVADIS" );
898 	rOs << pTxt;
899 	SwFldPortion::operator<<( rOs );
900 	rOs << pClose;
901 	return rOs;
902 }
903 
operator <<(SvStream & rOs) const904 SvStream &SwErgoSumPortion::operator<<( SvStream &rOs ) const //$ ostream
905 {
906 	CONSTCHAR( pTxt, " {ERGOSUM" );
907 	rOs << pTxt;
908 	SwFldPortion::operator<<( rOs );
909 	rOs << pClose;
910 	return rOs;
911 }
912 
operator <<(SvStream & rOs,const SwTxtSizeInfo & rInf)913 SvStream &operator<<( SvStream &rOs, const SwTxtSizeInfo &rInf ) //$ ostream
914 {
915 	CONSTCHAR( pTxt, " {SIZEINFO:" );
916 	rOs << pTxt;
917 	rOs << ' ' << (rInf.OnWin() ? "WIN:" : "PRT:" );
918 	rOs << " Idx:" << rInf.GetIdx();
919 	rOs << " Len:" << rInf.GetLen();
920 	rOs << pClose;
921 	return rOs;
922 }
923 
operator <<(SvStream & rOs) const924 SvStream &SwDropPortion::operator<<( SvStream &rOs ) const //$ ostream
925 {
926 	CONSTCHAR( pTxt, " {DROP:" );
927 	rOs << pTxt;
928 	SwTxtPortion::operator<<( rOs );
929     if( pPart && nDropHeight )
930 	{
931 		rOs << " H:" << nDropHeight;
932 		rOs << " L:" << nLines;
933         rOs <<" Fnt:" << pPart->GetFont().GetHeight();
934         if( nX || nY )
935             rOs << " [" << nX << '/' << nY << ']';
936 	}
937 	rOs << pClose;
938 	return rOs;
939 }
940 
941 #endif /* OSL_DEBUG_LEVEL */
942 
943 #endif // DBG_UTIL
944 
945