LibreOffice Module editeng (master) 1
editdbg.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <memory>
22#include <vcl/svapp.hxx>
23#include <vcl/weld.hxx>
24#include <vcl/window.hxx>
25
26#include <editeng/lspcitem.hxx>
27#include <editeng/lrspitem.hxx>
28#include <editeng/ulspitem.hxx>
30#include <editeng/colritem.hxx>
31#include <editeng/fhgtitem.hxx>
32#include <editeng/fontitem.hxx>
34#include <editeng/wghtitem.hxx>
35#include <editeng/postitem.hxx>
36#include <editeng/udlnitem.hxx>
38#include <editeng/shdditem.hxx>
40#include <editeng/kernitem.hxx>
41#include <editeng/wrlmitem.hxx>
43#include <editeng/langitem.hxx>
45#include <editeng/numitem.hxx>
46#include <editeng/tstpitem.hxx>
50
51#include "impedit.hxx"
52#include <editeng/editeng.hxx>
53#include <editeng/editview.hxx>
54#include <editdoc.hxx>
55
56#include <rtl/strbuf.hxx>
57#include <osl/diagnose.h>
58
59#if defined( DBG_UTIL ) || ( OSL_DEBUG_LEVEL > 1 )
60
61namespace
62{
63struct DebOutBuffer
64{
65 OStringBuffer str;
66 void append(std::string_view descr, const SfxEnumItemInterface& rItem)
67 {
68 str.append(descr + OString::number(rItem.GetEnumValue()));
69 }
70 void append(std::string_view descr, const SvxLRSpaceItem& rItem)
71 {
72 str.append(OString::Concat(descr) + "FI=" + OString::number(rItem.GetTextFirstLineOffset())
73 + ", LI=" + OString::number(rItem.GetTextLeft())
74 + ", RI=" + OString::number(rItem.GetRight()));
75 }
76 void append(std::string_view descr, const SvxNumBulletItem& rItem)
77 {
78 str.append(descr);
79 for (sal_uInt16 nLevel = 0; nLevel < 3; nLevel++)
80 {
81 str.append("Level" + OString::number(nLevel) + "=");
82 const SvxNumberFormat* pFmt = rItem.GetNumRule().Get(nLevel);
83 if (pFmt)
84 {
85 str.append("(" + OString::number(pFmt->GetFirstLineOffset()) + ","
86 + OString::number(pFmt->GetAbsLSpace()) + ",");
87 if (pFmt->GetNumberingType() == SVX_NUM_BITMAP)
88 str.append("Bitmap");
89 else if (pFmt->GetNumberingType() != SVX_NUM_CHAR_SPECIAL)
90 str.append("Number");
91 else
92 {
93 str.append("Char=[" + OString::number(pFmt->GetBulletChar()) + "]");
94 }
95 str.append(") ");
96 }
97 }
98 }
99 void append(std::string_view descr, const SfxBoolItem& rItem)
100 {
101 str.append(descr + OString::number(static_cast<int>(rItem.GetValue())));
102 }
103 void append(std::string_view descr, const SfxInt16Item& rItem)
104 {
105 str.append(descr + OString::number(rItem.GetValue()));
106 }
107 void append(std::string_view descr, const SfxUInt16Item& rItem)
108 {
109 str.append(descr + OString::number(rItem.GetValue()));
110 }
111 void append(const SvxULSpaceItem& rItem)
112 {
113 str.append("SB=" + OString::number(rItem.GetUpper())
114 + ", SA=" + OString::number(rItem.GetLower()));
115 }
116 void append(std::string_view descr, const SvxLineSpacingItem& rItem)
117 {
118 str.append(descr);
120 {
121 str.append("Min: " + OString::number(rItem.GetInterLineSpace()));
122 }
124 {
125 str.append("Prop: " + OString::number(rItem.GetPropLineSpace()));
126 }
127 else
128 str.append("Unsupported Type!");
129 }
130 void append(const SvxTabStopItem& rTabs)
131 {
132 str.append("Tabs: " + OString::number(rTabs.Count()));
133 if (rTabs.Count())
134 {
135 str.append("( ");
136 for (sal_uInt16 i = 0; i < rTabs.Count(); ++i)
137 {
138 const SvxTabStop& rTab = rTabs[i];
139 str.append(OString::number(rTab.GetTabPos()) + " ");
140 }
141 str.append(')');
142 }
143 }
144 void append(std::string_view descr, const SvxColorItem& rItem)
145 {
146 Color aColor(rItem.GetValue());
147 str.append(descr + OString::number(aColor.GetRed()) + ", "
148 + OString::number(aColor.GetGreen()) + ", " + OString::number(aColor.GetBlue()));
149 }
150 void append(std::string_view descr, const SvxFontItem& rItem)
151 {
152 str.append(descr + OUStringToOString(rItem.GetFamilyName(), RTL_TEXTENCODING_ASCII_US)
153 + " (CharSet: " + OString::number(rItem.GetCharSet()) + ")");
154 }
155 void append(std::string_view descr, const SvxEscapementItem& rItem)
156 {
157 str.append(descr + OString::number(rItem.GetEsc()) + ", "
158 + OString::number(rItem.GetProportionalHeight()));
159 }
160 void appendHeightAndPts(std::string_view descr, tools::Long h, MapUnit eUnit)
161 {
162 MapMode aItemMapMode(eUnit);
163 MapMode aPntMap(MapUnit::MapPoint);
164 Size aSz = OutputDevice::LogicToLogic(Size(0, h), aItemMapMode, aPntMap);
165 str.append(descr + OString::number(h) + " Points=" + OString::number(aSz.Height()));
166 }
167 void append(std::string_view descr, const SvxFontHeightItem& rItem, const SfxItemPool& rPool)
168 {
169 appendHeightAndPts(descr, rItem.GetHeight(), rPool.GetMetric(rItem.Which()));
170 }
171 void append(std::string_view descr, const SvxKerningItem& rItem, const SfxItemPool& rPool)
172 {
173 appendHeightAndPts(descr, rItem.GetValue(), rPool.GetMetric(rItem.Which()));
174 }
175};
176}
177
178static OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
179{
180 DebOutBuffer buffer;
181 switch ( rItem.Which() )
182 {
184 buffer.append("WritingDir=", rItem.StaticWhichCast(EE_PARA_WRITINGDIR));
185 break;
187 buffer.append("Outline ", rItem.StaticWhichCast(EE_PARA_OUTLLRSPACE));
188 break;
189 case EE_PARA_LRSPACE:
190 buffer.append("", rItem.StaticWhichCast(EE_PARA_LRSPACE));
191 break;
193 buffer.append("NumItem ", rItem.StaticWhichCast(EE_PARA_NUMBULLET));
194 break;
196 buffer.append("ShowBullet=", rItem.StaticWhichCast(EE_PARA_BULLETSTATE));
197 break;
199 buffer.append("Hyphenate=", rItem.StaticWhichCast(EE_PARA_HYPHENATE));
200 break;
202 buffer.append("Level=", rItem.StaticWhichCast(EE_PARA_OUTLLEVEL));
203 break;
204 case EE_PARA_ULSPACE:
205 buffer.append(rItem.StaticWhichCast(EE_PARA_ULSPACE));
206 break;
207 case EE_PARA_SBL:
208 buffer.append("SBL=", rItem.StaticWhichCast(EE_PARA_SBL));
209 break;
210 case EE_PARA_JUST:
211 buffer.append("SvxAdust=", rItem.StaticWhichCast(EE_PARA_JUST));
212 break;
213 case EE_PARA_TABS:
214 buffer.append(rItem.StaticWhichCast(EE_PARA_TABS));
215 break;
216 case EE_CHAR_LANGUAGE:
217 buffer.append("Language=", rItem.StaticWhichCast(EE_CHAR_LANGUAGE));
218 break;
220 buffer.append("LanguageCJK=", rItem.StaticWhichCast(EE_CHAR_LANGUAGE_CJK));
221 break;
223 buffer.append("LanguageCTL=", rItem.StaticWhichCast(EE_CHAR_LANGUAGE_CTL));
224 break;
225 case EE_CHAR_COLOR:
226 buffer.append("Color= ", rItem.StaticWhichCast(EE_CHAR_COLOR));
227 break;
228 case EE_CHAR_BKGCOLOR:
229 buffer.append("FillColor= ", rItem.StaticWhichCast(EE_CHAR_BKGCOLOR));
230 break;
231 case EE_CHAR_FONTINFO:
232 buffer.append("Font=", rItem.StaticWhichCast(EE_CHAR_FONTINFO));
233 break;
235 buffer.append("FontCJK=", rItem.StaticWhichCast(EE_CHAR_FONTINFO_CJK));
236 break;
238 buffer.append("FontCTL=", rItem.StaticWhichCast(EE_CHAR_FONTINFO_CTL));
239 break;
241 buffer.append("Size=", rItem.StaticWhichCast(EE_CHAR_FONTHEIGHT), rPool);
242 break;
244 buffer.append("SizeCJK=", rItem.StaticWhichCast(EE_CHAR_FONTHEIGHT_CJK), rPool);
245 break;
247 buffer.append("SizeCTL=", rItem.StaticWhichCast(EE_CHAR_FONTHEIGHT_CTL), rPool);
248 break;
250 buffer.append("Width=", rItem.StaticWhichCast(EE_CHAR_FONTWIDTH));
251 break;
252 case EE_CHAR_WEIGHT:
253 buffer.append("FontWeight=", rItem.StaticWhichCast(EE_CHAR_WEIGHT));
254 break;
256 buffer.append("FontWeightCJK=", rItem.StaticWhichCast(EE_CHAR_WEIGHT_CJK));
257 break;
259 buffer.append("FontWeightCTL=", rItem.StaticWhichCast(EE_CHAR_WEIGHT_CTL));
260 break;
262 buffer.append("FontUnderline=", rItem.StaticWhichCast(EE_CHAR_UNDERLINE));
263 break;
264 case EE_CHAR_OVERLINE:
265 buffer.append("FontOverline=", rItem.StaticWhichCast(EE_CHAR_OVERLINE));
266 break;
268 buffer.append("FontEmphasisMark=", rItem.StaticWhichCast(EE_CHAR_EMPHASISMARK));
269 break;
270 case EE_CHAR_RELIEF:
271 buffer.append("FontRelief=", rItem.StaticWhichCast(EE_CHAR_RELIEF));
272 break;
274 buffer.append("FontStrikeout=", rItem.StaticWhichCast(EE_CHAR_STRIKEOUT));
275 break;
276 case EE_CHAR_ITALIC:
277 buffer.append("FontPosture=", rItem.StaticWhichCast(EE_CHAR_ITALIC));
278 break;
280 buffer.append("FontPostureCJK=", rItem.StaticWhichCast(EE_CHAR_ITALIC_CJK));
281 break;
283 buffer.append("FontPostureCTL=", rItem.StaticWhichCast(EE_CHAR_ITALIC_CTL));
284 break;
285 case EE_CHAR_OUTLINE:
286 buffer.append("FontOutline=", rItem.StaticWhichCast(EE_CHAR_OUTLINE));
287 break;
288 case EE_CHAR_SHADOW:
289 buffer.append("FontShadowed=", rItem.StaticWhichCast(EE_CHAR_SHADOW));
290 break;
292 buffer.append("Escape=", rItem.StaticWhichCast(EE_CHAR_ESCAPEMENT));
293 break;
295 buffer.append("PairKerning=", rItem.StaticWhichCast(EE_CHAR_PAIRKERNING));
296 break;
297 case EE_CHAR_KERNING:
298 buffer.append("Kerning=", rItem.StaticWhichCast(EE_CHAR_KERNING), rPool);
299 break;
300 case EE_CHAR_WLM:
301 buffer.append("WordLineMode=", rItem.StaticWhichCast(EE_CHAR_WLM));
302 break;
304 buffer.str.append("XMLAttribs=...");
305 break;
306 }
307 return buffer.str.makeStringAndClear();
308}
309
310static void DbgOutItemSet(FILE* fp, const SfxItemSet& rSet, bool bSearchInParent, bool bShowALL)
311{
312 for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ )
313 {
314 fprintf( fp, "\nWhich: %i\t", nWhich );
315 if ( rSet.GetItemState( nWhich, bSearchInParent ) == SfxItemState::DEFAULT )
316 fprintf( fp, "ITEM_OFF " );
317 else if ( rSet.GetItemState( nWhich, bSearchInParent ) == SfxItemState::DONTCARE )
318 fprintf( fp, "ITEM_DC " );
319 else if ( rSet.GetItemState( nWhich, bSearchInParent ) == SfxItemState::SET )
320 fprintf( fp, "ITEM_ON *" );
321
322 if ( !bShowALL && ( rSet.GetItemState( nWhich, bSearchInParent ) != SfxItemState::SET ) )
323 continue;
324
325 const SfxPoolItem& rItem = rSet.Get( nWhich, bSearchInParent );
326 OString aDebStr = DbgOutItem( *rSet.GetPool(), rItem );
327 fprintf( fp, "%s", aDebStr.getStr() );
328 }
329}
330
331void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox)
332{
333 if (!pEE)
334 return;
335
336 FILE* fp = fopen( "editenginedump.log", "w" );
337 if ( fp == nullptr )
338 {
339 OSL_FAIL( "Log file could not be created!" );
340 return;
341 }
342
343 const SfxItemPool& rPool = *pEE->GetEmptyItemSet().GetPool();
344
345 fprintf( fp, "================================================================================" );
346 fprintf( fp, "\n================== Document ================================================" );
347 fprintf( fp, "\n================================================================================" );
348 for ( sal_Int32 nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions().Count(); nPortion++)
349 {
350 ParaPortion* pPPortion = pEE->pImpEditEngine->GetParaPortions()[nPortion];
351 fprintf( fp, "\nParagraph %" SAL_PRIdINT32 ": Length = %" SAL_PRIdINT32 ", Invalid = %i\nText = '%s'",
352 nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(),
353 OUStringToOString(pPPortion->GetNode()->GetString(), RTL_TEXTENCODING_UTF8).getStr() );
354 fprintf( fp, "\nVorlage:" );
355 SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
356 if ( pStyle )
357 fprintf( fp, " %s", OUStringToOString( pStyle->GetName(), RTL_TEXTENCODING_UTF8).getStr() );
358 fprintf( fp, "\nParagraph attribute:" );
359 DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), false, false );
360
361 fprintf( fp, "\nCharacter attribute:" );
362 bool bZeroAttr = false;
363 for ( sal_Int32 z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); ++z )
364 {
365 const std::unique_ptr<EditCharAttrib>& rAttr = pPPortion->GetNode()->GetCharAttribs().GetAttribs()[z];
366 OString aCharAttribs =
367 "\nA"
368 + OString::number(nPortion)
369 + ": "
370 + OString::number(rAttr->GetItem()->Which())
371 + "\t"
372 + OString::number(rAttr->GetStart())
373 + "\t"
374 + OString::number(rAttr->GetEnd());
375 if ( rAttr->IsEmpty() )
376 bZeroAttr = true;
377 fprintf(fp, "%s => ", aCharAttribs.getStr());
378
379 OString aDebStr = DbgOutItem( rPool, *rAttr->GetItem() );
380 fprintf( fp, "%s", aDebStr.getStr() );
381 }
382 if ( bZeroAttr )
383 fprintf( fp, "\nNULL-Attribute!" );
384
385 const sal_Int32 nTextPortions = pPPortion->GetTextPortions().Count();
386 OStringBuffer aPortionStr("\nText portions: #"
387 + OString::number(nTextPortions)
388 + " \nA"
389 + OString::number(nPortion)
390 + ": Paragraph Length = "
391 + OString::number(pPPortion->GetNode()->Len())
392 + "\nA"
393 + OString::number(nPortion)
394 + ": ");
395 sal_Int32 n = 0;
396 for ( sal_Int32 z = 0; z < nTextPortions; ++z )
397 {
398 TextPortion& rPortion = pPPortion->GetTextPortions()[z];
399 aPortionStr.append(" "
400 + OString::number(rPortion.GetLen())
401 + "("
402 + OString::number(rPortion.GetSize().Width())
403 + ")"
404 "["
405 + OString::number(static_cast<sal_Int32>(rPortion.GetKind()))
406 + "];");
407 n += rPortion.GetLen();
408 }
409 aPortionStr.append("\nA"
410 + OString::number(nPortion)
411 + ": Total length: "
412 + OString::number(n));
413 if ( pPPortion->GetNode()->Len() != n )
414 aPortionStr.append(" => Error !!!");
415 fprintf(fp, "%s", aPortionStr.getStr());
416
417 fprintf( fp, "\n\nLines:" );
418 // First the content ...
419 for ( sal_Int32 nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ )
420 {
421 EditLine& rLine = pPPortion->GetLines()[nLine];
422
423 OString aLine(OUStringToOString(pPPortion->GetNode()->Copy(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart()), RTL_TEXTENCODING_ASCII_US));
424 fprintf( fp, "\nLine %" SAL_PRIdINT32 "\t>%s<", nLine, aLine.getStr() );
425 }
426 // then the internal data ...
427 for ( sal_Int32 nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ )
428 {
429 EditLine& rLine = pPPortion->GetLines()[nLine];
430 fprintf( fp, "\nLine %" SAL_PRIdINT32 ":\tStart: %" SAL_PRIdINT32 ",\tEnd: %" SAL_PRIdINT32, nLine, rLine.GetStart(), rLine.GetEnd() );
431 fprintf( fp, "\t\tPortions: %" SAL_PRIdINT32 " - %" SAL_PRIdINT32 ".\tHight: %i, Ascent=%i", rLine.GetStartPortion(), rLine.GetEndPortion(), rLine.GetHeight(), rLine.GetMaxAscent() );
432 }
433
434 fprintf( fp, "\n-----------------------------------------------------------------------------" );
435 }
436
437 if ( pEE->pImpEditEngine->GetStyleSheetPool() )
438 {
439 SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), SfxStyleFamily::All );
440 sal_uInt16 nStyles = aIter.Count();
441 fprintf( fp, "\n\n================================================================================" );
442 fprintf( fp, "\n================== Stylesheets =============================================" );
443 fprintf( fp, "\n================================================================================" );
444 fprintf( fp, "\n#Template: %" SAL_PRIuUINT32 "\n", sal_uInt32(nStyles) );
445 SfxStyleSheetBase* pStyle = aIter.First();
446 while ( pStyle )
447 {
448 fprintf( fp, "\nTemplate: %s", OUStringToOString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).getStr() );
449 fprintf( fp, "\nParent: %s", OUStringToOString( pStyle->GetParent(), RTL_TEXTENCODING_ASCII_US ).getStr() );
450 fprintf( fp, "\nFollow: %s", OUStringToOString( pStyle->GetFollow(), RTL_TEXTENCODING_ASCII_US ).getStr() );
451 DbgOutItemSet( fp, pStyle->GetItemSet(), false, false );
452 fprintf( fp, "\n----------------------------------" );
453
454 pStyle = aIter.Next();
455 }
456 }
457
458 fprintf( fp, "\n\n================================================================================" );
459 fprintf( fp, "\n================== Defaults ================================================" );
460 fprintf( fp, "\n================================================================================" );
461 DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), true, true );
462
463 fprintf( fp, "\n\n================================================================================" );
464 fprintf( fp, "\n================== EditEngine & Views ======================================" );
465 fprintf( fp, "\n================================================================================" );
466 fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
467 fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
468 fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) );
469 fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetMaxAutoPaperSize().Width()), sal_Int64(pEE->GetMaxAutoPaperSize().Height()) );
470 fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , sal_Int64(pEE->GetMinAutoPaperSize().Width()), sal_Int64(pEE->GetMinAutoPaperSize().Height()) );
471 fprintf( fp, "\nCalculateLayout: %i", pEE->IsUpdateLayout() );
472 fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() );
473 for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
474 {
475 EditView* pV = pEE->GetView( nView );
476 DBG_ASSERT( pV, "View not found!" );
477 fprintf( fp, "\nView %zu: Focus=%i", nView, pV->GetWindow()->HasFocus() );
479 fprintf( fp, "\n OutputArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64 ", MapMode = %i",
480 sal_Int64(aR.Left()), sal_Int64(aR.Top()), sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
481 aR = pV->GetVisArea();
482 fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64,
483 sal_Int64(aR.Left()), sal_Int64(aR.Top()), sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) );
484 ESelection aSel = pV->GetSelection();
485 fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
486 }
487 if ( pEE->GetActiveView() )
488 {
489 fprintf( fp, "\n\n================================================================================" );
490 fprintf( fp, "\n================== Current View ===========================================" );
491 fprintf( fp, "\n================================================================================" );
492 DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), true, false );
493 }
494 fclose( fp );
495 if ( bInfoBox )
496 {
497 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
498 VclMessageType::Info, VclButtonsType::Ok,
499 "Dumped editenginedump.log!" ));
500 xInfoBox->run();
501 }
502}
503#endif
504
505#if OSL_DEBUG_LEVEL > 0
507{
508 // check, if Portion length ok:
509 sal_uInt16 nXLen = 0;
510 for (sal_Int32 nPortion = 0; nPortion < rPara.aTextPortionList.Count(); nPortion++)
511 {
512 nXLen = nXLen + rPara.aTextPortionList[nPortion].GetLen();
513 }
514 return nXLen == rPara.pNode->Len();
515}
516#endif
517
518#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
520{
521 sal_Int32 nPrev = 0;
522 for (const std::unique_ptr<EditCharAttrib>& rAttr : rAttribs)
523 {
524 sal_Int32 const nCur = rAttr->GetStart();
525 assert(nCur >= nPrev);
526 nPrev = nCur;
527 }
528}
529#endif
530
531/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
AttribsType & GetAttribs()
Definition: editdoc.hxx:222
std::vector< std::unique_ptr< EditCharAttrib > > AttribsType
Definition: editdoc.hxx:186
sal_uInt16 GetValue() const
SfxItemSet & GetItems()
Definition: editdoc.hxx:166
CharAttribList & GetCharAttribs()
Definition: editdoc.hxx:256
const OUString & GetString() const
Definition: editdoc.hxx:281
ContentAttribs & GetContentAttribs()
Definition: editdoc.hxx:254
OUString Copy(sal_Int32 nPos) const
Definition: editdoc.cxx:1756
SfxStyleSheet * GetStyleSheet()
Definition: editdoc.hxx:266
sal_Int32 Len() const
Definition: editdoc.cxx:1615
const Size & GetMinAutoPaperSize() const
Definition: editeng.cxx:548
static void DumpData(const EditEngine *pEE, bool bInfoBox)
Definition: editdbg.cxx:331
const Size & GetMaxAutoPaperSize() const
Definition: editeng.cxx:558
EEControlBits GetControlWord() const
Definition: editeng.cxx:1953
const Size & GetPaperSize() const
Definition: editeng.cxx:421
EditView * GetView(size_t nIndex=0) const
Definition: editeng.cxx:349
size_t GetViewCount() const
Definition: editeng.cxx:354
EditView * GetActiveView() const
Definition: editeng.cxx:365
bool IsUpdateLayout() const
Definition: editeng.cxx:1482
const SfxItemSet & GetEmptyItemSet() const
Definition: editeng.cxx:199
std::unique_ptr< ImpEditEngine > pImpEditEngine
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
Definition: editeng.cxx:1779
sal_Int32 GetStartPortion() const
Definition: editdoc.hxx:521
sal_uInt16 GetHeight() const
Definition: editdoc.hxx:529
sal_Int32 GetEndPortion() const
Definition: editdoc.hxx:525
sal_Int32 GetStart() const
Definition: editdoc.hxx:513
sal_uInt16 GetMaxAscent() const
Definition: editdoc.hxx:536
sal_Int32 GetEnd() const
Definition: editdoc.hxx:517
ESelection GetSelection() const
Definition: editview.cxx:301
tools::Rectangle GetVisArea() const
Definition: editview.cxx:405
SfxItemSet GetAttribs()
Definition: editview.cxx:616
vcl::Window * GetWindow() const
Definition: editview.cxx:357
const tools::Rectangle & GetOutputArea() const
Definition: editview.cxx:421
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
bool IsInvalid() const
Definition: editdoc.hxx:623
TextPortionList & GetTextPortions()
Definition: editdoc.hxx:646
ContentNode * pNode
Definition: editdoc.hxx:596
static bool DbgCheckTextPortions(ParaPortion const &)
Definition: editdbg.cxx:506
ContentNode * GetNode() const
Definition: editdoc.hxx:645
EditLineList & GetLines()
Definition: editdoc.hxx:620
TextPortionList aTextPortionList
Definition: editdoc.hxx:595
bool GetValue() const
virtual sal_uInt16 GetEnumValue() const=0
sal_Int16 GetValue() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
T & StaticWhichCast(TypedWhichId< T > nId)
sal_uInt16 Which() const
virtual const OUString & GetParent() const
const OUString & GetName() const
virtual const OUString & GetFollow() const
virtual SfxItemSet & GetItemSet()
virtual sal_Int32 Count()
virtual SfxStyleSheetBase * Next()
virtual SfxStyleSheetBase * First()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvxColorItem item describes a color.
Definition: colritem.hxx:32
const Color & GetValue() const
Definition: colritem.hxx:57
sal_uInt8 & GetProportionalHeight()
sal_uInt32 GetHeight() const
Definition: fhgtitem.hxx:74
This item describes a Font.
Definition: fontitem.hxx:30
rtl_TextEncoding GetCharSet() const
Definition: fontitem.hxx:99
const OUString & GetFamilyName() const
Definition: fontitem.hxx:63
short GetTextFirstLineOffset() const
Definition: lrspitem.hxx:346
tools::Long GetRight() const
Definition: lrspitem.hxx:328
tools::Long GetTextLeft() const
Definition: frmitems.cxx:567
sal_uInt16 GetPropLineSpace() const
Definition: lspcitem.hxx:81
SvxInterLineSpaceRule GetInterLineSpaceRule() const
Definition: lspcitem.hxx:92
SvxLineSpaceRule GetLineSpaceRule() const
Definition: lspcitem.hxx:89
short GetInterLineSpace() const
Definition: lspcitem.hxx:65
const SvxNumRule & GetNumRule() const
Definition: numitem.hxx:325
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
Definition: numitem.cxx:919
sal_Int32 GetFirstLineOffset() const
Definition: numitem.cxx:484
sal_UCS4 GetBulletChar() const
Definition: numitem.hxx:188
sal_Int32 GetAbsLSpace() const
Definition: numitem.cxx:478
SvxNumType GetNumberingType() const
Definition: numitem.hxx:73
sal_uInt16 Count() const
Definition: tstpitem.hxx:116
sal_Int32 & GetTabPos()
Definition: tstpitem.hxx:53
sal_uInt16 GetUpper() const
Definition: ulspitem.hxx:72
sal_uInt16 GetLower() const
Definition: ulspitem.hxx:73
sal_Int32 Count() const
Definition: editdoc.cxx:392
sal_Int32 GetLen() const
Definition: editdoc.hxx:409
PortionKind GetKind() const
Definition: editdoc.hxx:438
const Size & GetSize() const
Definition: editdoc.hxx:435
constexpr tools::Long Top() const
constexpr Size GetSize() const
constexpr tools::Long Left() const
bool HasFocus() const
const MapMode & GetMapMode() const
#define DBG_ASSERT(sCon, aError)
float z
static OString DbgOutItem(const SfxItemPool &rPool, const SfxPoolItem &rItem)
Definition: editdbg.cxx:178
static void DbgOutItemSet(FILE *fp, const SfxItemSet &rSet, bool bSearchInParent, bool bShowALL)
Definition: editdbg.cxx:310
void CheckOrderedList(const CharAttribList::AttribsType &rAttribs)
Definition: editdbg.cxx:519
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SfxBoolItem > EE_PARA_BULLETSTATE(EE_PARA_START+9)
constexpr TypedWhichId< SvxTabStopItem > EE_PARA_TABS(EE_PARA_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxULSpaceItem > EE_PARA_ULSPACE(EE_PARA_START+14)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr sal_uInt16 EE_PARA_START(EE_ITEMS_START+0)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_LRSPACE(EE_PARA_START+13)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxLineSpacingItem > EE_PARA_SBL(EE_PARA_START+15)
constexpr TypedWhichId< SvxEmphasisMarkItem > EE_CHAR_EMPHASISMARK(EE_CHAR_START+25)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_BKGCOLOR(EE_CHAR_START+32)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_OUTLLRSPACE(EE_PARA_START+10)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvXMLAttrContainerItem > EE_CHAR_XMLATTRIBS(EE_CHAR_START+28)
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxCharReliefItem > EE_CHAR_RELIEF(EE_CHAR_START+26)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
sal_Int64 n
MapUnit
int i
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
long Long
static SfxItemSet & rSet
sal_Int32 nStartPara
Definition: editdata.hxx:113
sal_Int32 nEndPos
Definition: editdata.hxx:116
sal_Int32 nStartPos
Definition: editdata.hxx:114
sal_Int32 nEndPara
Definition: editdata.hxx:115
@ SVX_NUM_BITMAP
Definition: svxenum.hxx:153
@ SVX_NUM_CHAR_SPECIAL
Definition: svxenum.hxx:151
#define SAL_PRI_SIZET
Count