summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-10-16 16:02:23 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-11-05 13:58:08 +0100
commit12637c634cfaebb4213f32cc83dcd0a2028c3d55 (patch)
treed455bc88518fdbac9f6f0a982e30fa285cb1f42d /sw/source
parent988477e2cef162c28eb5e8e91a6c40497a18f19c (diff)
operator<< for SwPosition/SwPaM/etc. for use with SAL_DEBUG
Change-Id: I99ffa87afa6dbdbd20042a882af428d166546af3
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/index.cxx5
-rw-r--r--sw/source/core/crsr/pam.cxx14
-rw-r--r--sw/source/core/docnode/ndindex.cxx5
3 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index b6f7632a06a5..d77e23961d6a 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -392,4 +392,9 @@ SwIndex& SwIndex::operator= ( sal_Int32 const nVal )
#endif
+std::ostream& operator <<(std::ostream& s, const SwIndex& index)
+{
+ return s << "SwIndex offset (" << index.GetIndex() << ")";
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 5a1d1fa1eed0..ad5bbf510314 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -190,6 +190,11 @@ SwDoc * SwPosition::GetDoc() const
return nNode.GetNode().GetDoc();
}
+std::ostream &operator <<(std::ostream& s, const SwPosition& position)
+{
+ return s << "SwPosition (node " << position.nNode.GetIndex() << ", offset " << position.nContent.GetIndex() << ")";
+}
+
enum CHKSECTION { Chk_Both, Chk_One, Chk_None };
static CHKSECTION lcl_TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, const SwNode& rEndNd )
@@ -1085,4 +1090,13 @@ void SwPaM::InvalidatePaM()
}
}
+std::ostream &operator <<(std::ostream& s, const SwPaM& pam)
+{
+ if( pam.HasMark())
+ return s << "SwPaM (point " << *pam.GetPoint() << ", mark " << *pam.GetMark() << ")";
+ else
+ return s << "SwPaM (point " << *pam.GetPoint() << ")";
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx
index 3c3a9f61e580..03e98bee77e2 100644
--- a/sw/source/core/docnode/ndindex.cxx
+++ b/sw/source/core/docnode/ndindex.cxx
@@ -130,4 +130,9 @@ SwNodeIndex& SwNodeIndex::Assign( const SwNode& rNd, long nOffset )
return *this;
}
+std::ostream &operator <<(std::ostream& s, const SwNodeIndex& index)
+{
+ return s << "SwNodeIndex (node " << index.GetIndex() << ")";
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */