diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-11 13:07:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-11 22:33:34 -0500 |
commit | ec3e84c89e6abcd12cc79ed38c5148e89a7a4f35 (patch) | |
tree | f6f3992750187e47191bb93a015a51a5f55c6865 /editeng/source | |
parent | bc2fdbeba39aa5598d7b084481d1c4c1b291ffee (diff) |
Add Dump() method to dump content of EditTextObject.
Useful during debugging. Turned off in the default build.
Change-Id: Ia0b280337707f762b90d1d80c04671f2e8c21b01
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 42 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 8 |
2 files changed, 50 insertions, 0 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 5f400be2f16d..244978781356 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -27,6 +27,7 @@ #include <tools/stream.hxx> #include "editeng/fieldupdater.hxx" +#include "editeng/macros.hxx" #include <editobj2.hxx> #include <editeng/editdata.hxx> #include <editattr.hxx> @@ -39,11 +40,18 @@ #include <editeng/bulitem.hxx> #include <editeng/numitem.hxx> #include <editeng/brshitem.hxx> + #include <vcl/graph.hxx> #include <svl/intitem.hxx> #include <unotools/fontcvt.hxx> #include <tools/tenccvt.hxx> +#if DEBUG_EDIT_ENGINE +#include <iostream> +using std::cout; +using std::endl; +#endif + using namespace com::sun::star; DBG_NAME( EE_EditTextObject ) @@ -154,6 +162,24 @@ bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const return (*GetWrongList() == *rCompare.GetWrongList()); } +#if DEBUG_EDIT_ENGINE +void ContentInfo::Dump() const +{ + cout << "--" << endl; + cout << "text: '" << aText << "'" << endl; + cout << "style: '" << aStyle << "'" << endl; + + XEditAttributesType::const_iterator it = aAttribs.begin(), itEnd = aAttribs.end(); + for (; it != itEnd; ++it) + { + const XEditAttribute& rAttr = *it; + cout << "attribute: " << endl; + cout << " span: [begin=" << rAttr.GetStart() << ", end=" << rAttr.GetEnd() << "]" << endl; + cout << " feature: " << (rAttr.IsFeature() ? "yes":"no") << endl; + } +} +#endif + bool ContentInfo::operator==( const ContentInfo& rCompare ) const { if( (aText == rCompare.aText) && @@ -393,6 +419,13 @@ void EditTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) mpImpl->ObjectInDestruction(rSfxItemPool); } +#if DEBUG_EDIT_ENGINE +void EditTextObject::Dump() const +{ + mpImpl->Dump(); +} +#endif + // from SfxItemPoolUser void EditTextObjectImpl::ObjectInDestruction(const SfxItemPool& rSfxItemPool) { @@ -422,6 +455,15 @@ void EditTextObjectImpl::ObjectInDestruction(const SfxItemPool& rSfxItemPool) } } +#if DEBUG_EDIT_ENGINE +void EditTextObjectImpl::Dump() const +{ + ContentInfosType::const_iterator it = aContents.begin(), itEnd = aContents.end(); + for (; it != itEnd; ++it) + it->Dump(); +} +#endif + EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool) { EditEngineItemPool* pRetval = dynamic_cast< EditEngineItemPool* >(pPool); diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 4d8923f4729a..ef213f0bfb68 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -149,6 +149,10 @@ public: // #i102062# bool isWrongListEqual(const ContentInfo& rCompare) const; + +#if DEBUG_EDIT_ENGINE + void Dump() const; +#endif }; class EditTextObjectImpl : boost::noncopyable @@ -245,6 +249,10 @@ public: // from SfxItemPoolUser void ObjectInDestruction(const SfxItemPool& rSfxItemPool); + +#if DEBUG_EDIT_ENGINE + void Dump() const; +#endif }; #endif // _EDITOBJ2_HXX |