111#include <rtl/strbuf.hxx>
120#if OSL_DEBUG_LEVEL > 1
121 static bool bFrameId =
false;
133 std::unique_ptr<std::set<sal_uInt16>>
146 static void SectFunc( OStringBuffer& rOut,
DbgAction nAct,
void const * pParam );
154 Record_(pFrame, nFunction, nAct, pParam);
192 virtual void Enter();
193 virtual void Leave();
205 , m_nFrameHeight(pF->getFrameArea().
Height())
209 virtual void Leave()
override;
214 sal_uInt16 m_nFrameId;
223 virtual void Enter()
override;
224 virtual void Leave()
override;
234 , m_aFrame(pF->getFrameArea())
238 virtual void Enter()
override;
239 virtual void Leave()
override;
298 , m_nMaxLines(USHRT_MAX)
329 rLine = rLine.toAsciiLowerCase();
330 rLine = rLine.replace(
'\t',
' ' );
331 if(
'#' == rLine[0] )
333 if(
'[' == rLine[0] )
336 if (aTmp ==
"[frmid")
341 else if (aTmp ==
"[frmtype")
346 else if (aTmp ==
"[record")
351 else if (aTmp ==
"[test")
356 else if (aTmp ==
"[max")
361 else if (aTmp ==
"[var")
367 rLine = rLine.copy(aTmp.size() + 1);
376 if( !aTok.empty() &&
'!' == aTok[0] )
379 aTok = aTok.substr(1);
428 SvFileStream aStream(
"dbg_lay.ini", StreamMode::READ );
433 while( aStream.
good() )
437 if(
'\n' == c ||
'\r' == c )
439 aLine = aLine.trim();
440 if( !aLine.isEmpty() )
445 aLine += OStringChar(c);
447 if( !aLine.isEmpty() )
463 if( rLay.getLength() > 1 )
465 rLay.remove(rLay.getLength() - 2, rLay.getLength());
476 rOut.append(
" ValidSize");
478 rOut.append(
" ValidPos");
480 rOut.append(
" ValidPrtArea");
484static void lcl_Padded(OStringBuffer& rOut,
const OString& s,
size_t length)
489 for (
size_t i = 0;
i <
length - s.getLength();
i++)
497 char sz[RTL_STR_MAX_VALUEOFINT64];
498 rtl_str_valueOfInt64(sz,
n, 10);
512 rOut.append(
", Width:");
514 rOut.append(
", Height:");
530 if (pFrame ==
nullptr)
533 if (pTabLine ==
nullptr)
560 result +=
"Para:" + OUString::number(10) +
" " +
565 return OUString::number(
n) +
" para(s):" +
result;
578 rOut.append(
"SwTextFrame ");
582 rOut.append(
"SwPageFrame ");
584 rOut.append(
"SwColumnFrame ");
588 rOut.append(
"(Col)");
589 rOut.append(
"SwBodyFrame ");
592 rOut.append(
"SwRootFrame ");
594 rOut.append(
"SwCellFrame ");
596 rOut.append(
"SwTabFrame ");
598 rOut.append(
"SwRowFrame ");
600 rOut.append(
"SwSectionFrame ");
602 rOut.append(
"SwHeaderFrame ");
604 rOut.append(
"SwFooterFrame ");
606 rOut.append(
"SwFootnoteFrame ");
608 rOut.append(
"SwFootnoteContFrame ");
610 rOut.append(
"SwFlyFrame ");
612 rOut.append(
"SwLayoutFrame ");
615 rOut.append(
"SwNoTextFrame");
617 rOut.append(
"Not impl. ");
628 sal_uInt16 nSpecial = 0;
672 aOut.append(
"SwFlowFrame::MoveFwd");
674 aOut.append(
"SwFlowFrame::MoveBwd");
678 aOut.append(
" " + OString::number(
static_cast<sal_Int32
>(*
static_cast<sal_uInt16*
>(pParam))));
682 aOut.append(
"SwFrame::Grow (test)");
686 aOut.append(
"SwFrame::Shrink (test)");
694 aOut.append(
"SwFrame::Grow");
698 aOut.append(
"SwFrame::Shrink");
700 aOut.append(
"SwFrame::AdjustNeighbourhood");
705 aOut.append(
" " + OString::number(
static_cast<sal_Int64
>(*
static_cast<tools::Long*
>(pParam))));
716 case PROT::Leaf: aOut.append(
"SwFrame::GetPrev/NextSctLeaf");
726 aOut.append(
"Initialize");
734 aOut.append(
"PROT::Cut from ");
736 aOut.append(
"PROT::Paste to ");
740 aOut.append(
"SwTextFrame::TestFormat");
752 aOut.append(
"PosChg: ("
753 + OString::number(
static_cast<sal_Int64
>(rFrame.
Left()))
755 + OString::number(
static_cast<sal_Int64
>(rFrame.
Top()))
759 + OString::number(
static_cast<sal_Int64
>(pFrame->
getFrameArea().
Top()))
764 aOut.append(
"Height: "
765 + OString::number(
static_cast<sal_Int64
>(rFrame.
Height()))
772 aOut.append(
"Width: "
773 + OString::number(
static_cast<sal_Int64
>(rFrame.
Width()))
784 while (aOut.getLength() < 40) aOut.append(
" ");
788 while (aOut.getLength() < 90) aOut.append(
" ");
794 while (aOut.getLength() < 140) aOut.append(
" ");
795 const OUString&
text =
static_cast<const SwTextFrame*
>(pFrame)->GetText();
816 SAL_INFO(
"sw.layout.debug", aOut.getStr());
818 (*m_pStream) <<
endl;
822 SAL_WARN(
"sw.layout.debug",
"max number of lines reached");
840 rOut.append(
"Master to ");
842 rOut.append(
"Follow from ");
849 rOut.append(
"Master to ");
851 rOut.append(
"Follow from ");
894 case PROT::Shrink :
pImpl.reset(
new SwSizeEnterLeave( pFrame, nFunc, nAct, pPar ) );
break;
896 case PROT::MoveBack :
pImpl.reset(
new SwUpperEnterLeave( pFrame, nFunc, nAct, pPar ) );
break;
921void SwSizeEnterLeave::Leave()
923 m_nFrameHeight = m_pFrame->getFrameArea().Height() - m_nFrameHeight;
927void SwUpperEnterLeave::Enter()
929 m_nFrameId = m_pFrame->GetUpper() ? sal_uInt16(
lcl_GetFrameId(m_pFrame->GetUpper())) : 0;
933void SwUpperEnterLeave::Leave()
935 m_nFrameId = m_pFrame->GetUpper() ? sal_uInt16(
lcl_GetFrameId(m_pFrame->GetUpper())) : 0;
939void SwFrameChangesLeave::Enter()
943void SwFrameChangesLeave::Leave()
945 if (m_pFrame->getFrameArea() != m_aFrame)
SvStream & ReadChar(char &rChar)
SwCellFrame is one table cell in the document layout.
const SwTableBox * GetTabBox() const
const SwModify * GetRegisteredIn() const
Ends a section of nodes in the document model.
std::unique_ptr< SwImplEnterLeave > pImpl
SwEnterLeave(const SwFrame *pFrame, PROT nFunc, DbgAction nAct, void *pPar)
const SwRect & getFrameArea() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
sal_uInt32 GetFrameId() const
Base class of the Writer layout elements.
bool IsFootnoteContFrame() const
bool IsColumnFrame() const
SwFrameType GetType() const
bool IsHeaderFrame() const
bool IsFooterFrame() const
bool IsFootnoteFrame() const
SwLayoutFrame * GetUpper()
bool IsNoTextFrame() const
bool IsLayoutFrame() const
bool IsColBodyFrame() const
These SwFrame inlines are here, so that frame.hxx does not need to include layfrm....
SwImplEnterLeave(const SwFrame *pF, PROT nFunct, DbgAction nAct, void *pPar)
virtual ~SwImplEnterLeave()
void Record_(const SwFrame *pFrame, PROT nFunction, DbgAction nAct, void *pParam)
Is only called if the PROTOCOL macro finds out, that this function should be recorded (.
void InsertFrame(sal_uInt16 nFrameId)
if pFrameIds==NULL all Frames will be logged.
void CheckLine(OString &rLine)
analyze a line in the INI file
static void SectFunc(OStringBuffer &rOut, DbgAction nAct, void const *pParam)
Handle the output of the SectionFrames.
std::unique_ptr< std::set< sal_uInt16 > > m_pFrameIds
void Record(const SwFrame *pFrame, PROT nFunction, DbgAction nAct, void *pParam)
std::vector< tools::Long > m_aVars
void DeleteFrame(sal_uInt16 nFrameId)
Removes a FrameId from the pFrameIds array, so that it won't be logged anymore.
std::unique_ptr< SvFileStream > m_pStream
void FileInit()
read the file "dbg_lay.ini" in the current directory and evaluate it.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
const SwEndNode * EndOfSectionNode() const
SwNodeOffset Count() const
static void SetRecord(PROT nNew)
static SwImplProtocol * s_pImpl
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Pos(const Point &rNew)
void SSize(const Size &rNew)
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
SwRowFrame is one table row in the document layout.
const SwTableLine * GetTabLine() const
Starts a section of nodes in the document model.
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTable * GetTable() const
const SwStartNode * GetSttNd() const
SwTableLine is one table row in the document model.
SwTable is one table in the document model, containing rows (which contain cells).
Represents the visualization of a paragraph.
const OUString & GetText() const
static void lcl_FrameType(OStringBuffer &rOut, const SwFrame *pFrame)
output the type of the frame as plain text.
static void lcl_Padded(OStringBuffer &rOut, const OString &s, size_t length)
static OString lcl_CellInfo(const SwCellFrame *pFrame)
static OUString lcl_CellText(const SwCellFrame *pFrame)
static void lcl_Flags(OStringBuffer &rOut, const SwFrame *pFrame)
output the ValidSize-, ValidPos- and ValidPrtArea-Flag ("Sz","Ps","PA") of the frame; "+" stands for ...
static void lcl_FrameRect(OStringBuffer &rOut, const char *hint, const SwRect &rect)
output the frame as plain text.
static void lcl_Start(OStringBuffer &rOut, OStringBuffer &rLay, DbgAction nAction)
enable indentation by two spaces during DbgAction::Start and disable it again at DbgAction::End.
static OString lcl_RowInfo(const SwRowFrame *pFrame)
static sal_uLong lcl_GetFrameId(const SwFrame *pFrame)
static OString lcl_TableInfo(const SwTabFrame *pTabFrame)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int64 toInt64(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
TOOLS_DLLPUBLIC SvStream & endl(SvStream &rStr)