Kaydet (Commit) 3c1bc231 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

sw: build hidden debug features in all cases

To activate the layout and node dumping features in sw, set the SW_DEBUG
environement variable to anything before running the office. F12 will
then dump the layout as a layout.xml file in the working directory, and
Shift+F12 will dump the nodes structure as nodes.xml at the same place.
üst 009eac0a
......@@ -2038,13 +2038,11 @@ public:
::sw::UndoManager const& GetUndoManager() const;
SfxObjectShell* CreateCopy(bool bCallInitNew) const;
#ifdef DBG_UTIL
/**
* Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
* @since 3.5
*/
void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
/// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created
void SetDrawDefaults();
......
......@@ -337,13 +337,11 @@ public:
SwNode * DocumentSectionStartNode(SwNode * pNode) const;
SwNode * DocumentSectionEndNode(SwNode * pNode) const;
#ifdef DBG_UTIL
/**
* Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
* @since 3.5
*/
void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
};
#endif
......
......@@ -801,9 +801,7 @@ public:
bool IsCollapse() const;
#ifdef DBG_UTIL
virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
};
......
......@@ -292,13 +292,11 @@ public:
sal_uInt8 HasPrevNextLayNode() const;
#ifdef DBG_UTIL
/**
* Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
* @since 3.5
*/
virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
private:
// Private constructor because copying is never allowed!!
......@@ -333,9 +331,7 @@ public:
// Call ChkCondcoll to all ContentNodes of section.
void CheckSectionCondColl() const;
#ifdef DBG_UTIL
virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
#endif
private:
// Private constructor because copying is never allowed!!
......
......@@ -29,8 +29,6 @@
#include "doc.hxx"
#include "ndtxt.hxx"
#ifdef DBG_UTIL
namespace
{
......@@ -153,6 +151,7 @@ void SwNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
writer.endElement();
if( GetNodeType() == ND_ENDNODE )
writer.endElement(); // end start node
......@@ -185,6 +184,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
// writer.endElement(); - it is a start node, so don't end, will make xml better nested
}
......@@ -193,6 +193,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
WriterHelper writer( w );
writer.startElement( "text" );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
rtl::OUString txt = GetTxt();
for( int i = 0; i < 32; ++i )
txt = txt.replace( i, '*' );
......@@ -201,6 +202,4 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
writer.endElement();
}
#endif // DBG_UTIL
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1360,8 +1360,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
sal_Bool bChkInsBlank = pQuickHlpData->bChkInsBlank;
pQuickHlpData->bChkInsBlank = sal_False;
#ifdef DBG_UTIL
if (rKEvt.GetKeyCode().GetCode() == KEY_F12)
if ( getenv("SW_DEBUG") && rKEvt.GetKeyCode().GetCode() == KEY_F12 )
{
if( rKEvt.GetKeyCode().IsShift())
{
......@@ -1375,7 +1374,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
return;
}
}
#endif
KeyEvent aKeyEvent( rKEvt );
// look for vertical mappings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment