diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-02-09 13:41:27 +0000 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2016-02-09 19:06:58 +0000 |
commit | 5f2db838a0bbadc9e0f710237a39dde231a138f2 (patch) | |
tree | 69da3e48c5c3fe4c0f37f96cd6dabd7962571597 /slideshow/source | |
parent | 49f55eabda703e9b651f3ca549193b89c2a5b0fd (diff) |
slideshow: Don't de-reference Nodes cast to const char *.
This crept in with a conversion in:
7bdc6be9c23517eec02ce7139edd7003abbee1f8
Change-Id: Ic1c62122934d5857326258565e4b54ef6e81b884
Reviewed-on: https://gerrit.libreoffice.org/22237
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/22240
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'slideshow/source')
4 files changed, 16 insertions, 12 deletions
diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index 95e9ef1ddf4d..cf4c2382049c 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx @@ -181,9 +181,9 @@ void BaseContainerNode::showState() const boost::dynamic_pointer_cast<BaseNode>(maChildren[i]); SAL_INFO("slideshow.verbose", "Node connection: n" << - reinterpret_cast<const char*>(this)+debugGetCurrentOffset() << + debugGetNodeName(this) << " -> n" << - reinterpret_cast<const char*>(pNode.get())+debugGetCurrentOffset() ); + debugGetNodeName(pNode.get())); pNode->showState(); } diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index 5e0b3fb868a0..edfe95ee604c 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -681,13 +681,13 @@ void BaseNode::showState() const if( eNodeState == AnimationNode::INVALID ) SAL_INFO("slideshow.verbose", "Node state: n" << - reinterpret_cast<const char*>(this)+debugGetCurrentOffset() << + debugGetNodeName(this) << " [label=\"" << getDescription() << "\",style=filled, fillcolor=\"0.5,0.2,0.5\"]"); else SAL_INFO("slideshow.verbose", "Node state: n" << - reinterpret_cast<const char*>(this)+debugGetCurrentOffset() << + debugGetNodeName(this) << " [label=\"" << getDescription() << "fillcolor=\"" << @@ -721,7 +721,7 @@ void BaseNode::showState() const if( xPropSet->getPropertyValue("Name") >>= aName ) { SAL_INFO("slideshow.verbose", "Node info: n" << - reinterpret_cast<const char*>(this)+debugGetCurrentOffset() << + debugGetNodeName(this) << ", name \"" << aName << "\""); diff --git a/slideshow/source/engine/animationnodes/nodetools.cxx b/slideshow/source/engine/animationnodes/nodetools.cxx index 1d0b122f6444..e38445bd10ea 100644 --- a/slideshow/source/engine/animationnodes/nodetools.cxx +++ b/slideshow/source/engine/animationnodes/nodetools.cxx @@ -31,11 +31,15 @@ namespace slideshow namespace internal { #if defined(DBG_UTIL) - int& debugGetCurrentOffset() - { - static int lcl_nOffset = 0; // to make each tree output distinct + static sal_Int32 lcl_nOffset = 0; - return lcl_nOffset; + OUString debugGetNodeName( const BaseNode *pNode ) + { + OUStringBuffer aBuf; + aBuf.append(lcl_nOffset); + aBuf.append(" - 0x"); + aBuf.append(reinterpret_cast<sal_Int64>(pNode), 16); + return aBuf.makeStringAndClear(); } void debugNodesShowTree( const BaseNode* pNode ) @@ -43,7 +47,7 @@ namespace slideshow if( pNode ) pNode->showState(); - ++debugGetCurrentOffset(); + ++lcl_nOffset; } #endif diff --git a/slideshow/source/engine/animationnodes/nodetools.hxx b/slideshow/source/engine/animationnodes/nodetools.hxx index cf25d793226f..55a4c4fb8e3e 100644 --- a/slideshow/source/engine/animationnodes/nodetools.hxx +++ b/slideshow/source/engine/animationnodes/nodetools.hxx @@ -45,8 +45,8 @@ namespace slideshow #if defined(DBG_UTIL) - int& debugGetCurrentOffset(); - void debugNodesShowTree( const BaseNode* ); + OUString debugGetNodeName( const BaseNode *pNode ); + void debugNodesShowTree( const BaseNode* ); #endif /** Look up an AttributableShape from ShapeManager. |