summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-13 18:21:52 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-14 11:16:28 +0100
commit3c1bc2311c297bbabba45e62e123d44061bd348c (patch)
tree63a100de7ed6e3a2c828c27ecbaf6c43e9d75c21
parent009eac0af5f0d0167ce6c46896a34cbaae82a5c4 (diff)
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.
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/inc/ndarr.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/node.hxx4
-rw-r--r--sw/source/core/docnode/nodedump.cxx7
-rw-r--r--sw/source/ui/docvw/edtwin.cxx4
6 files changed, 4 insertions, 17 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8165a57b5b72..c7255d94f00d 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -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();
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 389069b0c2ba..d560637b4ae5 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -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
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 52bae7a74b89..b4a772d2455f 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -801,9 +801,7 @@ public:
bool IsCollapse() const;
-#ifdef DBG_UTIL
virtual void dumpAsXml( xmlTextWriterPtr writer = NULL );
-#endif
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
};
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index bbe3c5934be9..f75091ab0684 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -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!!
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 0e723cef34c8..447967c4f557 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -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: */
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 51fa5483823d..78d18fabd4c8 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -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