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: editdbg.cxx,v $
10 * $Revision: 1.22.148.1 $
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_svx.hxx"
34 #include <eeng_pch.hxx>
36 #ifndef _MSGBOX_HXX //autogen
37 #include <vcl/msgbox.hxx>
40 #include <svx/lspcitem.hxx>
42 #include <svx/lrspitem.hxx>
43 #include <svx/ulspitem.hxx>
44 #include <svx/cntritem.hxx>
45 #include <svx/colritem.hxx>
46 #include <svx/fhgtitem.hxx>
47 #include <fontitem.hxx>
48 #include <svx/adjitem.hxx>
49 #include <svx/wghtitem.hxx>
50 #include <svx/postitem.hxx>
51 #include <svx/udlnitem.hxx>
52 #include <svx/crsditem.hxx>
53 #include <svx/shdditem.hxx>
54 #include <svx/escpitem.hxx>
55 #include <svx/kernitem.hxx>
56 #include <svx/wrlmitem.hxx>
57 #include <svx/akrnitem.hxx>
58 #include <svx/langitem.hxx>
59 #include <svx/emphitem.hxx>
60 #include <svx/numitem.hxx>
61 #include <svx/tstpitem.hxx>
62 #include <svx/charscaleitem.hxx>
63 #include <svx/charreliefitem.hxx>
64 #include <svx/frmdiritem.hxx>
66 #include <impedit.hxx>
67 #include <svx/editeng.hxx>
68 #include <svx/editview.hxx>
69 #include <editdoc.hxx>
70 #include <editdbg.hxx>
72 #if defined( DBG_UTIL ) || ( OSL_DEBUG_LEVEL > 1 )
74 ByteString
DbgOutItem( const SfxItemPool
& rPool
, const SfxPoolItem
& rItem
)
77 switch ( rItem
.Which() )
79 case EE_PARA_WRITINGDIR
:
80 aDebStr
+= "WritingDir=";
81 aDebStr
+= ByteString::CreateFromInt32( ((SvxFrameDirectionItem
&)rItem
).GetValue() );
83 case EE_PARA_OUTLLRSPACE
:
86 aDebStr
+= ByteString::CreateFromInt32( ((SvxLRSpaceItem
&)rItem
).GetTxtFirstLineOfst() );
88 aDebStr
+= ByteString::CreateFromInt32( ((SvxLRSpaceItem
&)rItem
).GetTxtLeft() );
90 aDebStr
+= ByteString::CreateFromInt32( ((SvxLRSpaceItem
&)rItem
).GetRight() );
92 case EE_PARA_NUMBULLET
:
94 aDebStr
+= "NumItem ";
95 for ( USHORT nLevel
= 0; nLevel
< 3; nLevel
++ )
98 aDebStr
+= ByteString::CreateFromInt32( nLevel
);
100 const SvxNumberFormat
* pFmt
= ((const SvxNumBulletItem
&)rItem
).GetNumRule()->Get( nLevel
);
104 aDebStr
+= ByteString::CreateFromInt32( pFmt
->GetFirstLineOffset() );
106 aDebStr
+= ByteString::CreateFromInt32( pFmt
->GetAbsLSpace() );
108 if ( pFmt
->GetNumberingType() == SVX_NUM_BITMAP
)
112 else if( pFmt
->GetNumberingType() != SVX_NUM_CHAR_SPECIAL
)
119 aDebStr
+= ByteString::CreateFromInt32( pFmt
->GetBulletChar() );
127 case EE_PARA_BULLETSTATE
:
128 aDebStr
+= "ShowBullet=";
129 aDebStr
+= ByteString::CreateFromInt32( ((SfxBoolItem
&)rItem
).GetValue() );
131 case EE_PARA_HYPHENATE
:
132 aDebStr
+= "Hyphenate=";
133 aDebStr
+= ByteString::CreateFromInt32( ((SfxBoolItem
&)rItem
).GetValue() );
135 case EE_PARA_OUTLLEVEL
:
137 aDebStr
+= ByteString::CreateFromInt32( ((SfxInt16Item
&)rItem
).GetValue() );
139 case EE_PARA_ULSPACE
:
141 aDebStr
+= ByteString::CreateFromInt32( ((SvxULSpaceItem
&)rItem
).GetUpper() );
143 aDebStr
+= ByteString::CreateFromInt32( ((SvxULSpaceItem
&)rItem
).GetLower() );
147 if ( ((SvxLineSpacingItem
&)rItem
).GetLineSpaceRule() == SVX_LINE_SPACE_MIN
)
150 aDebStr
+= ByteString::CreateFromInt32( ((SvxLineSpacingItem
&)rItem
).GetInterLineSpace() );
152 else if ( ((SvxLineSpacingItem
&)rItem
).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP
)
155 aDebStr
+= ByteString::CreateFromInt32( (ULONG
)((SvxLineSpacingItem
&)rItem
).GetPropLineSpace() );
158 aDebStr
+= "Unsupported Type!";
161 aDebStr
+= "SvxAdust=";
162 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxAdjustItem
&)rItem
).GetAdjust() );
167 const SvxTabStopItem
& rTabs
= (const SvxTabStopItem
&) rItem
;
168 aDebStr
+= ByteString::CreateFromInt32( rTabs
.Count() );
172 for ( USHORT i
= 0; i
< rTabs
.Count(); i
++ )
174 const SvxTabStop
& rTab
= rTabs
[i
];
175 aDebStr
+= ByteString::CreateFromInt32( rTab
.GetTabPos() );
182 case EE_CHAR_LANGUAGE
:
183 case EE_CHAR_LANGUAGE_CJK
:
184 case EE_CHAR_LANGUAGE_CTL
:
185 aDebStr
+= "Language=";
186 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxLanguageItem
&)rItem
).GetLanguage() );
190 aDebStr
+= "Color= ";
191 Color
aColor( ((SvxColorItem
&)rItem
).GetValue() );
192 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)aColor
.GetRed() );
194 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)aColor
.GetGreen() );
196 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)aColor
.GetBlue() );
199 case EE_CHAR_FONTINFO
:
200 case EE_CHAR_FONTINFO_CJK
:
201 case EE_CHAR_FONTINFO_CTL
:
204 aDebStr
+= ByteString( ((SvxFontItem
&)rItem
).GetFamilyName(), RTL_TEXTENCODING_ASCII_US
);
205 aDebStr
+= " (CharSet: ";
206 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxFontItem
&)rItem
).GetCharSet() );
210 case EE_CHAR_FONTHEIGHT
:
211 case EE_CHAR_FONTHEIGHT_CJK
:
212 case EE_CHAR_FONTHEIGHT_CTL
:
214 aDebStr
+= "Groesse=";
215 aDebStr
+= ByteString::CreateFromInt32( ((SvxFontHeightItem
&)rItem
).GetHeight() );
216 Size
aSz( 0, ((SvxFontHeightItem
&)rItem
).GetHeight() );
217 SfxMapUnit eUnit
= rPool
.GetMetric( rItem
.Which() );
218 MapMode
aItemMapMode( (MapUnit
) eUnit
);
219 MapMode
aPntMap( MAP_POINT
);
220 aSz
= OutputDevice::LogicToLogic( aSz
, aItemMapMode
, aPntMap
);
221 aDebStr
+= " Points=";
222 aDebStr
+= ByteString::CreateFromInt32( aSz
.Height() );
225 case EE_CHAR_FONTWIDTH
:
227 aDebStr
+= "Breite=";
228 aDebStr
+= ByteString::CreateFromInt32( ((SvxCharScaleWidthItem
&)rItem
).GetValue() );
233 case EE_CHAR_WEIGHT_CJK
:
234 case EE_CHAR_WEIGHT_CTL
:
235 aDebStr
+= "FontWeight=";
236 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxWeightItem
&)rItem
).GetWeight() );
238 case EE_CHAR_UNDERLINE
:
239 aDebStr
+= "FontUnderline=";
240 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxUnderlineItem
&)rItem
).GetLineStyle() );
242 case EE_CHAR_OVERLINE
:
243 aDebStr
+= "FontOverline=";
244 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxOverlineItem
&)rItem
).GetLineStyle() );
246 case EE_CHAR_EMPHASISMARK
:
247 aDebStr
+= "FontUnderline=";
248 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxEmphasisMarkItem
&)rItem
).GetEmphasisMark() );
251 aDebStr
+= "FontRelief=";
252 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxCharReliefItem
&)rItem
).GetValue() );
254 case EE_CHAR_STRIKEOUT
:
255 aDebStr
+= "FontStrikeout=";
256 aDebStr
+=ByteString::CreateFromInt32( (USHORT
)((SvxCrossedOutItem
&)rItem
).GetStrikeout() );
259 case EE_CHAR_ITALIC_CJK
:
260 case EE_CHAR_ITALIC_CTL
:
261 aDebStr
+= "FontPosture=";
262 aDebStr
+=ByteString::CreateFromInt32( (USHORT
)((SvxPostureItem
&)rItem
).GetPosture() );
264 case EE_CHAR_OUTLINE
:
265 aDebStr
+= "FontOutline=";
266 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxContourItem
&)rItem
).GetValue() );
269 aDebStr
+= "FontShadowed=";
270 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxShadowedItem
&)rItem
).GetValue() );
272 case EE_CHAR_ESCAPEMENT
:
273 aDebStr
+= "Escape=";
274 aDebStr
+= ByteString::CreateFromInt32( (short)((SvxEscapementItem
&)rItem
).GetEsc() );
276 aDebStr
+= ByteString::CreateFromInt32( (short)((SvxEscapementItem
&)rItem
).GetProp() );
278 case EE_CHAR_PAIRKERNING
:
279 aDebStr
+= "PairKerning=";
280 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxAutoKernItem
&)rItem
).GetValue() );
282 case EE_CHAR_KERNING
:
284 aDebStr
+= "Kerning=";
285 aDebStr
+= ByteString::CreateFromInt32( (short)((SvxKerningItem
&)rItem
).GetValue() );
286 Size
aSz( 0, (short)((SvxKerningItem
&)rItem
).GetValue() );
287 SfxMapUnit eUnit
= rPool
.GetMetric( rItem
.Which() );
288 MapMode
aItemMapMode( (MapUnit
) eUnit
);
289 MapMode
aPntMap( MAP_POINT
);
290 aSz
= OutputDevice::LogicToLogic( aSz
, aItemMapMode
, aPntMap
);
291 aDebStr
+= " Points=";
292 aDebStr
+= ByteString::CreateFromInt32( aSz
.Height() );
296 aDebStr
+= "WordLineMode=";
297 aDebStr
+= ByteString::CreateFromInt32( (USHORT
)((SvxWordLineModeItem
&)rItem
).GetValue() );
299 case EE_CHAR_XMLATTRIBS
:
300 aDebStr
+= "XMLAttribs=...";
306 void DbgOutItemSet( FILE* fp
, const SfxItemSet
& rSet
, BOOL bSearchInParent
, BOOL bShowALL
)
308 for ( USHORT nWhich
= EE_PARA_START
; nWhich
<= EE_CHAR_END
; nWhich
++ )
310 fprintf( fp
, "\nWhich: %i\t", nWhich
);
311 if ( rSet
.GetItemState( nWhich
, bSearchInParent
) == SFX_ITEM_OFF
)
312 fprintf( fp
, "ITEM_OFF " );
313 else if ( rSet
.GetItemState( nWhich
, bSearchInParent
) == SFX_ITEM_DONTCARE
)
314 fprintf( fp
, "ITEM_DC " );
315 else if ( rSet
.GetItemState( nWhich
, bSearchInParent
) == SFX_ITEM_ON
)
316 fprintf( fp
, "ITEM_ON *" );
318 if ( !bShowALL
&& ( rSet
.GetItemState( nWhich
, bSearchInParent
) != SFX_ITEM_ON
) )
321 const SfxPoolItem
& rItem
= rSet
.Get( nWhich
, bSearchInParent
);
322 ByteString aDebStr
= DbgOutItem( *rSet
.GetPool(), rItem
);
323 fprintf( fp
, "%s", aDebStr
.GetBuffer() );
327 void EditDbg::ShowEditEngineData( EditEngine
* pEE
, BOOL bInfoBox
)
330 FILE* fp
= fopen( "/tmp/debug.log", "w" );
332 FILE* fp
= fopen( "d:\\debug.log", "w" );
336 DBG_ERROR( "Log-File konnte nicht angelegt werden!" );
340 const SfxItemPool
& rPool
= *pEE
->GetEmptyItemSet().GetPool();
342 fprintf( fp
, "================================================================================" );
343 fprintf( fp
, "\n================== Dokument ================================================" );
344 fprintf( fp
, "\n================================================================================" );
345 for ( USHORT nPortion
= 0; nPortion
< pEE
->pImpEditEngine
->GetParaPortions(). Count(); nPortion
++)
348 ParaPortion
* pPPortion
= pEE
->pImpEditEngine
->GetParaPortions().GetObject(nPortion
);
349 fprintf( fp
, "\f\nAbsatz %i: Laenge = %i, Invalid = %i\nText = '%s'", nPortion
, pPPortion
->GetNode()->Len(), pPPortion
->IsInvalid(), ByteString( *pPPortion
->GetNode(), RTL_TEXTENCODING_ASCII_US
).GetBuffer() );
350 fprintf( fp
, "\nVorlage:" );
351 SfxStyleSheet
* pStyle
= pPPortion
->GetNode()->GetStyleSheet();
353 fprintf( fp
, " %s", ByteString( pStyle
->GetName(), RTL_TEXTENCODING_ASCII_US
).GetBuffer() );
354 fprintf( fp
, "\nAbsatzattribute:" );
355 DbgOutItemSet( fp
, pPPortion
->GetNode()->GetContentAttribs().GetItems(), FALSE
, FALSE
);
357 fprintf( fp
, "\nZeichenattribute:" );
358 BOOL bZeroAttr
= FALSE
;
360 for ( z
= 0; z
< pPPortion
->GetNode()->GetCharAttribs().Count(); z
++ )
362 EditCharAttrib
* pAttr
= pPPortion
->GetNode()->GetCharAttribs().GetAttribs().GetObject( z
);
363 ByteString aCharAttribs
;
364 aCharAttribs
+= "\nA";
365 aCharAttribs
+= ByteString::CreateFromInt32( nPortion
);
366 aCharAttribs
+= ": ";
367 aCharAttribs
+= ByteString::CreateFromInt32( pAttr
->GetItem()->Which() );
368 aCharAttribs
+= '\t';
369 aCharAttribs
+= ByteString::CreateFromInt32( pAttr
->GetStart() );
370 aCharAttribs
+= '\t';
371 aCharAttribs
+= ByteString::CreateFromInt32( pAttr
->GetEnd() );
372 if ( pAttr
->IsEmpty() )
374 fprintf( fp
, "%s => ", aCharAttribs
.GetBuffer() );
376 ByteString aDebStr
= DbgOutItem( rPool
, *pAttr
->GetItem() );
377 fprintf( fp
, "%s", aDebStr
.GetBuffer() );
380 fprintf( fp
, "\nNULL-Attribute!" );
382 USHORT nTextPortions
= pPPortion
->GetTextPortions().Count();
383 ByteString
aPortionStr("\nTextportions: #");
384 aPortionStr
+= ByteString::CreateFromInt32( nTextPortions
);
385 aPortionStr
+= " \nA";
386 aPortionStr
+= ByteString::CreateFromInt32( nPortion
);
387 aPortionStr
+= ": Absatzlaenge = ";
388 aPortionStr
+= ByteString::CreateFromInt32( pPPortion
->GetNode()->Len() );
389 aPortionStr
+= "\nA";
390 aPortionStr
+= ByteString::CreateFromInt32( nPortion
);
393 for ( z
= 0; z
< nTextPortions
; z
++ )
395 TextPortion
* pPortion
= pPPortion
->GetTextPortions().GetObject( z
);
397 aPortionStr
+= ByteString::CreateFromInt32( pPortion
->GetLen() );
399 aPortionStr
+= ByteString::CreateFromInt32( pPortion
->GetSize().Width() );
402 aPortionStr
+= ByteString::CreateFromInt32( (USHORT
)pPortion
->GetKind() );
405 n
+= pPortion
->GetLen();
407 aPortionStr
+= "\nA";
408 aPortionStr
+= ByteString::CreateFromInt32( nPortion
);
409 aPortionStr
+= ": Gesamtlaenge: ";
410 aPortionStr
+= ByteString::CreateFromInt32( n
);
411 if ( pPPortion
->GetNode()->Len() != n
)
412 aPortionStr
+= " => Fehler !!!";
413 fprintf( fp
, "%s", aPortionStr
.GetBuffer() );
416 fprintf( fp
, "\n\nZeilen:" );
417 // Erstmal die Inhalte...
419 for ( nLine
= 0; nLine
< pPPortion
->GetLines().Count(); nLine
++ )
421 EditLine
* pLine
= pPPortion
->GetLines().GetObject( nLine
);
423 ByteString
aLine( *(pPPortion
->GetNode()), pLine
->GetStart(), pLine
->GetEnd() - pLine
->GetStart(), RTL_TEXTENCODING_ASCII_US
);
424 fprintf( fp
, "\nZeile %i\t>%s<", nLine
, aLine
.GetBuffer() );
426 // dann die internen Daten...
427 for ( nLine
= 0; nLine
< pPPortion
->GetLines().Count(); nLine
++ )
429 EditLine
* pLine
= pPPortion
->GetLines().GetObject( nLine
);
430 fprintf( fp
, "\nZeile %i:\tStart: %i,\tEnd: %i", nLine
, pLine
->GetStart(), pLine
->GetEnd() );
431 fprintf( fp
, "\t\tPortions: %i - %i.\tHoehe: %i, Ascent=%i", pLine
->GetStartPortion(), pLine
->GetEndPortion(), pLine
->GetHeight(), pLine
->GetMaxAscent() );
434 fprintf( fp
, "\n-----------------------------------------------------------------------------" );
437 if ( pEE
->pImpEditEngine
->GetStyleSheetPool() )
439 ULONG nStyles
= pEE
->pImpEditEngine
->GetStyleSheetPool() ? pEE
->pImpEditEngine
->GetStyleSheetPool()->Count() : 0;
440 fprintf( fp
, "\n\n\f================================================================================" );
441 fprintf( fp
, "\n================== Stylesheets =============================================" );
442 fprintf( fp
, "\n================================================================================" );
443 fprintf( fp
, "\n#Vorlagen: %lu\n", nStyles
);
444 SfxStyleSheetIterator
aIter( pEE
->pImpEditEngine
->GetStyleSheetPool(), SFX_STYLE_FAMILY_ALL
);
445 SfxStyleSheetBase
* pStyle
= aIter
.First();
448 fprintf( fp
, "\nVorlage: %s", ByteString( pStyle
->GetName(), RTL_TEXTENCODING_ASCII_US
).GetBuffer() );
449 fprintf( fp
, "\nParent: %s", ByteString( pStyle
->GetParent(), RTL_TEXTENCODING_ASCII_US
).GetBuffer() );
450 fprintf( fp
, "\nFollow: %s", ByteString( pStyle
->GetFollow(), RTL_TEXTENCODING_ASCII_US
).GetBuffer() );
451 DbgOutItemSet( fp
, pStyle
->GetItemSet(), FALSE
, FALSE
);
452 fprintf( fp
, "\n----------------------------------" );
454 pStyle
= aIter
.Next();
458 fprintf( fp
, "\n\n\f================================================================================" );
459 fprintf( fp
, "\n================== Defaults ================================================" );
460 fprintf( fp
, "\n================================================================================" );
461 DbgOutItemSet( fp
, pEE
->pImpEditEngine
->GetEmptyItemSet(), TRUE
, TRUE
);
463 fprintf( fp
, "\n\n\f================================================================================" );
464 fprintf( fp
, "\n================== EditEngine & Views ======================================" );
465 fprintf( fp
, "\n================================================================================" );
466 fprintf( fp
, "\nControl: %lx", pEE
->GetControlWord() );
467 fprintf( fp
, "\nRefMapMode: %i", pEE
->pImpEditEngine
->pRefDev
->GetMapMode().GetMapUnit() );
468 fprintf( fp
, "\nPaperSize: %li x %li", pEE
->GetPaperSize().Width(), pEE
->GetPaperSize().Height() );
469 fprintf( fp
, "\nMaxAutoPaperSize: %li x %li", pEE
->GetMaxAutoPaperSize().Width(), pEE
->GetMaxAutoPaperSize().Height() );
470 fprintf( fp
, "\nMinAutoPaperSize: %li x %li", pEE
->GetMinAutoPaperSize().Width(), pEE
->GetMinAutoPaperSize().Height() );
471 fprintf( fp
, "\nUpdate: %i", pEE
->GetUpdateMode() );
472 fprintf( fp
, "\nAnzahl der Views: %i", pEE
->GetViewCount() );
473 for ( USHORT nView
= 0; nView
< pEE
->GetViewCount(); nView
++ )
475 EditView
* pV
= pEE
->GetView( nView
);
476 DBG_ASSERT( pV
, "View nicht gefunden!" );
477 fprintf( fp
, "\nView %i: Focus=%i", nView
, pV
->GetWindow()->HasFocus() );
478 Rectangle
aR( pV
->GetOutputArea() );
479 fprintf( fp
, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR
.TopLeft().X(), aR
.TopLeft().Y(), aR
.GetSize().Width(), aR
.GetSize().Height() , pV
->GetWindow()->GetMapMode().GetMapUnit() );
480 aR
= pV
->GetVisArea();
481 fprintf( fp
, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR
.TopLeft().X(), aR
.TopLeft().Y(), aR
.GetSize().Width(), aR
.GetSize().Height() );
482 ESelection aSel
= pV
->GetSelection();
483 fprintf( fp
, "\n Selektion: Start=%u,%u, End=%u,%u", aSel
.nStartPara
, aSel
.nStartPos
, aSel
.nEndPara
, aSel
.nEndPos
);
485 if ( pEE
->GetActiveView() )
487 fprintf( fp
, "\n\n\f================================================================================" );
488 fprintf( fp
, "\n================== Aktuelle View ===========================================" );
489 fprintf( fp
, "\n================================================================================" );
490 DbgOutItemSet( fp
, pEE
->GetActiveView()->GetAttribs(), TRUE
, FALSE
);
494 InfoBox(0, String( RTL_CONSTASCII_USTRINGPARAM( "D:\\DEBUG.LOG !" ) ) ).Execute();
497 ByteString
EditDbg::GetPortionInfo( ParaPortion
* pPPortion
)
501 ByteString
aDebStr( "Absatzlaenge = " );
502 aDebStr
+= ByteString::CreateFromInt32( pPPortion
->GetNode()->Len() );
504 aDebStr
+= "\nZeichenattribute:";
505 for ( z
= 0; z
< pPPortion
->GetNode()->GetCharAttribs().Count(); z
++ )
507 EditCharAttrib
* pAttr
= pPPortion
->GetNode()->GetCharAttribs().GetAttribs().GetObject( z
);
509 aDebStr
+= ByteString::CreateFromInt32( pAttr
->GetItem()->Which() );
511 aDebStr
+= ByteString::CreateFromInt32( pAttr
->GetStart() );
513 aDebStr
+= ByteString::CreateFromInt32( pAttr
->GetEnd() );
516 aDebStr
+= "\nTextportions:";
518 for ( z
= 0; z
< pPPortion
->GetTextPortions().Count(); z
++ )
520 TextPortion
* pPortion
= pPPortion
->GetTextPortions().GetObject( z
);
522 aDebStr
+= ByteString::CreateFromInt32( pPortion
->GetLen() );
524 aDebStr
+= ByteString::CreateFromInt32( pPortion
->GetSize().Width() );
527 n
= n
+ pPortion
->GetLen();
529 aDebStr
+= "\nGesamtlaenge: ";
530 aDebStr
+= ByteString::CreateFromInt32( n
);
531 aDebStr
+= "\nSortiert nach Start:";
532 for ( USHORT x
= 0; x
< pPPortion
->GetNode()->GetCharAttribs().Count(); x
++ )
534 EditCharAttrib
* pCurAttrib
= pPPortion
->GetNode()->GetCharAttribs().GetAttribs().GetObject( x
);
535 aDebStr
+= "\nStart: ";
536 aDebStr
+= ByteString::CreateFromInt32( pCurAttrib
->GetStart() );
537 aDebStr
+= "\tEnde: ";
538 aDebStr
+= ByteString::CreateFromInt32( pCurAttrib
->GetEnd() );
543 ByteString
EditDbg::GetTextPortionInfo( TextPortionList
& rPortions
)
546 for ( USHORT z
= 0; z
< rPortions
.Count(); z
++ )
548 TextPortion
* pPortion
= rPortions
.GetObject( z
);
550 aDebStr
+= ByteString::CreateFromInt32( pPortion
->GetLen() );
552 aDebStr
+= ByteString::CreateFromInt32( pPortion
->GetSize().Width() );
559 void EditDbg::ShowPortionData( ParaPortion
* pPortion
)
561 ByteString
aDebStr( GetPortionInfo( pPortion
) );
562 InfoBox( 0, String( aDebStr
, RTL_TEXTENCODING_ASCII_US
) ).Execute();
566 BOOL
ParaPortion::DbgCheckTextPortions()
568 // pruefen, ob Portionlaenge ok:
570 for ( USHORT nPortion
= 0; nPortion
< aTextPortionList
.Count(); nPortion
++ )
571 nXLen
= nXLen
+ aTextPortionList
[nPortion
]->GetLen();
572 return nXLen
== pNode
->Len() ? TRUE
: FALSE
;
575 BOOL
CheckOrderedList( CharAttribArray
& rAttribs
, BOOL bStart
)
578 for ( USHORT nAttr
= 0; nAttr
< rAttribs
.Count(); nAttr
++ )
580 EditCharAttrib
* pAttr
= rAttribs
[nAttr
];
581 USHORT nCur
= bStart
? pAttr
->GetStart() : pAttr
->GetEnd();