56#include <rtl/strbuf.hxx>
57#include <osl/diagnose.h>
59#if defined( DBG_UTIL ) || ( OSL_DEBUG_LEVEL > 1 )
68 str.append(descr + OString::number(rItem.
GetEnumValue()));
74 +
", RI=" + OString::number(rItem.
GetRight()));
79 for (sal_uInt16 nLevel = 0; nLevel < 3; nLevel++)
81 str.append(
"Level" + OString::number(nLevel) +
"=");
93 str.append(
"Char=[" + OString::number(pFmt->
GetBulletChar()) +
"]");
99 void append(std::string_view descr,
const SfxBoolItem& rItem)
101 str.append(descr + OString::number(
static_cast<int>(rItem.
GetValue())));
103 void append(std::string_view descr,
const SfxInt16Item& rItem)
105 str.append(descr + OString::number(rItem.
GetValue()));
107 void append(std::string_view descr,
const SfxUInt16Item& rItem)
109 str.append(descr + OString::number(rItem.
GetValue()));
113 str.append(
"SB=" + OString::number(rItem.
GetUpper())
114 +
", SA=" + OString::number(rItem.
GetLower()));
128 str.append(
"Unsupported Type!");
132 str.append(
"Tabs: " + OString::number(rTabs.
Count()));
136 for (sal_uInt16 i = 0;
i < rTabs.
Count(); ++
i)
139 str.append(OString::number(rTab.
GetTabPos()) +
" ");
144 void append(std::string_view descr,
const SvxColorItem& rItem)
147 str.append(descr + OString::number(aColor.GetRed()) +
", "
148 + OString::number(aColor.GetGreen()) +
", " + OString::number(aColor.GetBlue()));
150 void append(std::string_view descr,
const SvxFontItem& rItem)
153 +
" (CharSet: " + OString::number(rItem.
GetCharSet()) +
")");
157 str.append(descr + OString::number(rItem.
GetEsc()) +
", "
163 MapMode aPntMap(MapUnit::MapPoint);
165 str.append(descr + OString::number(h) +
" Points=" + OString::number(aSz.
Height()));
181 switch ( rItem.
Which() )
304 buffer.str.append(
"XMLAttribs=...");
307 return buffer.str.makeStringAndClear();
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 *" );
322 if ( !bShowALL && (
rSet.
GetItemState( nWhich, bSearchInParent ) != SfxItemState::SET ) )
327 fprintf( fp,
"%s", aDebStr.getStr() );
336 FILE* fp = fopen(
"editenginedump.log",
"w" );
339 OSL_FAIL(
"Log file could not be created!" );
345 fprintf( fp,
"================================================================================" );
346 fprintf( fp,
"\n================== Document ================================================" );
347 fprintf( fp,
"\n================================================================================" );
348 for ( sal_Int32 nPortion = 0; nPortion < pEE->
pImpEditEngine->GetParaPortions().
Count(); nPortion++)
351 fprintf( fp,
"\nParagraph %" SAL_PRIdINT32
": Length = %" SAL_PRIdINT32
", Invalid = %i\nText = '%s'",
354 fprintf( fp,
"\nVorlage:" );
358 fprintf( fp,
"\nParagraph attribute:" );
361 fprintf( fp,
"\nCharacter attribute:" );
362 bool bZeroAttr =
false;
366 OString aCharAttribs =
368 + OString::number(nPortion)
370 + OString::number(rAttr->GetItem()->Which())
372 + OString::number(rAttr->GetStart())
374 + OString::number(rAttr->GetEnd());
375 if ( rAttr->IsEmpty() )
377 fprintf(fp,
"%s => ", aCharAttribs.getStr());
379 OString aDebStr =
DbgOutItem( rPool, *rAttr->GetItem() );
380 fprintf( fp,
"%s", aDebStr.getStr() );
383 fprintf( fp,
"\nNULL-Attribute!" );
386 OStringBuffer aPortionStr(
"\nText portions: #"
387 + OString::number(nTextPortions)
389 + OString::number(nPortion)
390 +
": Paragraph Length = "
391 + OString::number(pPPortion->
GetNode()->
Len())
393 + OString::number(nPortion)
396 for ( sal_Int32
z = 0;
z < nTextPortions; ++
z )
399 aPortionStr.append(
" "
400 + OString::number(rPortion.
GetLen())
405 + OString::number(
static_cast<sal_Int32
>(rPortion.
GetKind()))
409 aPortionStr.append(
"\nA"
410 + OString::number(nPortion)
412 + OString::number(
n));
414 aPortionStr.append(
" => Error !!!");
415 fprintf(fp,
"%s", aPortionStr.getStr());
417 fprintf( fp,
"\n\nLines:" );
419 for ( sal_Int32 nLine = 0; nLine < pPPortion->
GetLines().
Count(); nLine++ )
424 fprintf( fp,
"\nLine %" SAL_PRIdINT32
"\t>%s<", nLine, aLine.getStr() );
427 for ( sal_Int32 nLine = 0; nLine < pPPortion->
GetLines().
Count(); nLine++ )
430 fprintf( fp,
"\nLine %" SAL_PRIdINT32
":\tStart: %" SAL_PRIdINT32
",\tEnd: %" SAL_PRIdINT32, nLine, rLine.
GetStart(), rLine.
GetEnd() );
434 fprintf( fp,
"\n-----------------------------------------------------------------------------" );
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) );
452 fprintf( fp,
"\n----------------------------------" );
454 pStyle = aIter.
Next();
458 fprintf( fp,
"\n\n================================================================================" );
459 fprintf( fp,
"\n================== Defaults ================================================" );
460 fprintf( fp,
"\n================================================================================" );
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() ) );
473 for (
size_t nView = 0; nView < pEE->
GetViewCount(); nView++ )
479 fprintf( fp,
"\n OutputArea: nX=%" SAL_PRIdINT64
", nY=%" SAL_PRIdINT64
", dX=%" SAL_PRIdINT64
", dY=%" SAL_PRIdINT64
", MapMode = %i",
482 fprintf( fp,
"\n VisArea: nX=%" SAL_PRIdINT64
", nY=%" SAL_PRIdINT64
", dX=%" SAL_PRIdINT64
", dY=%" SAL_PRIdINT64,
485 fprintf( fp,
"\n Selection: Start=%" SAL_PRIdINT32
",%" SAL_PRIdINT32
", End=%" SAL_PRIdINT32
",%" SAL_PRIdINT32, aSel.
nStartPara, aSel.
nStartPos, aSel.
nEndPara, aSel.
nEndPos );
489 fprintf( fp,
"\n\n================================================================================" );
490 fprintf( fp,
"\n================== Current View ===========================================" );
491 fprintf( fp,
"\n================================================================================" );
498 VclMessageType::Info, VclButtonsType::Ok,
499 "Dumped editenginedump.log!" ));
505#if OSL_DEBUG_LEVEL > 0
509 sal_uInt16 nXLen = 0;
518#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
522 for (
const std::unique_ptr<EditCharAttrib>& rAttr : rAttribs)
524 sal_Int32
const nCur = rAttr->GetStart();
525 assert(nCur >= nPrev);
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
AttribsType & GetAttribs()
std::vector< std::unique_ptr< EditCharAttrib > > AttribsType
sal_uInt16 GetValue() const
CharAttribList & GetCharAttribs()
const OUString & GetString() const
ContentAttribs & GetContentAttribs()
OUString Copy(sal_Int32 nPos) const
SfxStyleSheet * GetStyleSheet()
const Size & GetMinAutoPaperSize() const
static void DumpData(const EditEngine *pEE, bool bInfoBox)
const Size & GetMaxAutoPaperSize() const
EEControlBits GetControlWord() const
const Size & GetPaperSize() const
EditView * GetView(size_t nIndex=0) const
size_t GetViewCount() const
EditView * GetActiveView() const
bool IsUpdateLayout() const
const SfxItemSet & GetEmptyItemSet() const
std::unique_ptr< ImpEditEngine > pImpEditEngine
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
sal_Int32 GetStartPortion() const
sal_uInt16 GetHeight() const
sal_Int32 GetEndPortion() const
sal_Int32 GetStart() const
sal_uInt16 GetMaxAscent() const
ESelection GetSelection() const
tools::Rectangle GetVisArea() const
vcl::Window * GetWindow() const
const tools::Rectangle & GetOutputArea() const
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
TextPortionList & GetTextPortions()
static bool DbgCheckTextPortions(ParaPortion const &)
ContentNode * GetNode() const
EditLineList & GetLines()
TextPortionList aTextPortionList
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)
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.
const Color & GetValue() const
sal_uInt8 & GetProportionalHeight()
sal_uInt32 GetHeight() const
This item describes a Font.
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetTextLeft() const
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
short GetInterLineSpace() const
const SvxNumRule & GetNumRule() const
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
SvxNumType GetNumberingType() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
PortionKind GetKind() const
const Size & GetSize() const
const MapMode & GetMapMode() const
#define DBG_ASSERT(sCon, aError)
static OString DbgOutItem(const SfxItemPool &rPool, const SfxPoolItem &rItem)
static void DbgOutItemSet(FILE *fp, const SfxItemSet &rSet, bool bSearchInParent, bool bShowALL)
void CheckOrderedList(const CharAttribList::AttribsType &rAttribs)
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)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)