summaryrefslogtreecommitdiff
path: root/sw/inc/IMark.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-04-09 23:53:19 +0200
committerMichael Stahl <mstahl@redhat.com>2013-04-12 19:12:31 +0200
commite348c88d3d8db2b6a443a4811d815f40ac17fb44 (patch)
tree2f030683f8fb74e8b0f075650b2057ec938423f2 /sw/inc/IMark.hxx
parent85c5f6c1a78fae00fc13c5d1b7f045dc984589fb (diff)
sw: remove usage of boost::bind for IMarks
Apple llvm-g++ 4.2.1 with _GLIBCXX_DEBUG won't eat boost::bind with IMark::StartsAfter, and MSVC 2008 with _DEBUG even doesn't like IMark::StartsBefore. They evidently try to call the comparison operator with arguments in the wrong order. Change-Id: Ib11a79a459e84ac9d7046824678ad4ccdacc67d0
Diffstat (limited to 'sw/inc/IMark.hxx')
-rw-r--r--sw/inc/IMark.hxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index 1087ef25cf70..f0e20a6511a8 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -23,6 +23,7 @@
#include <calbck.hxx>
#include <pam.hxx>
#include <boost/operators.hpp>
+#include <boost/shared_ptr.hpp>
#include <map>
#include "swdll.hxx"
@@ -36,6 +37,7 @@ struct SwPosition;
namespace sw { namespace mark
{
+
class SAL_DLLPUBLIC_EXPORT IMark
: virtual public SwModify // inherited as interface
, public ::boost::totally_ordered<IMark>
@@ -108,6 +110,53 @@ namespace sw { namespace mark
virtual bool IsChecked() const =0;
virtual void SetChecked(bool checked) =0;
};
+
+ // Apple llvm-g++ 4.2.1 with _GLIBCXX_DEBUG won't eat boost::bind for this
+ // Neither will MSVC 2008 with _DEBUG
+ struct CompareIMarkStartsAfter
+ {
+ bool operator()(SwPosition const& rPos,
+ boost::shared_ptr<sw::mark::IMark> const& pMark)
+ {
+ return pMark->StartsAfter(rPos);
+ }
+#ifdef DBG_UTIL
+ bool operator()(boost::shared_ptr<sw::mark::IMark> const& pMark,
+ SwPosition const& rPos)
+ {
+ return pMark->StartsBefore(rPos);
+ }
+ bool operator()(boost::shared_ptr<sw::mark::IMark> const& pMark1,
+ boost::shared_ptr<sw::mark::IMark> const& pMark2)
+ {
+ return (*pMark1) < (*pMark2);
+ }
+#endif
+ };
+
+ // MSVC 2008 with _DEBUG calls this with parameters in wrong order
+ // so it needs 3 overloads...
+ struct CompareIMarkStartsBefore
+ {
+ bool operator()(boost::shared_ptr<sw::mark::IMark> const& pMark,
+ SwPosition const& rPos)
+ {
+ return pMark->StartsBefore(rPos);
+ }
+#ifdef DBG_UTIL
+ bool operator()(SwPosition const& rPos,
+ boost::shared_ptr<sw::mark::IMark> const& pMark)
+ {
+ return pMark->StartsAfter(rPos);
+ }
+ bool operator()(boost::shared_ptr<sw::mark::IMark> const& pMark1,
+ boost::shared_ptr<sw::mark::IMark> const& pMark2)
+ {
+ return (*pMark1) < (*pMark2);
+ }
+#endif
+ };
+
}}
#endif