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