diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-01 12:04:31 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-02 00:33:20 +0100 |
commit | 02e2e6df7f089b121bc3599c8e267ffa7f9e46fb (patch) | |
tree | ecfcedd930e7b10a52d90c0097cedc42b6d2023b /sw/inc/edimp.hxx | |
parent | 4f9ed32cb81d9664683c55025d1c6b3e2e524125 (diff) |
use macro in macro
Change-Id: Iadc70ec4ddfced07eeb761302c9d8485263c114b
Diffstat (limited to 'sw/inc/edimp.hxx')
-rw-r--r-- | sw/inc/edimp.hxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index 29aea41c2a71..b3240b981c03 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -22,30 +22,24 @@ #include <tools/solar.h> #include <o3tl/sorted_vector.hxx> +#include <boost/foreach.hpp> class SwPaM; class SwNodeIndex; // Macros to iterate over all ranges. -#define PCURCRSR (_pStartCrsr) +#define PCURCRSR (static_cast<SwPaM *>(&__r)) #define FOREACHPAM_START(pCURSH) \ - {\ - SwPaM *_pStartCrsr = (pCURSH), *__pStartCrsr = _pStartCrsr; \ - do { - -#define FOREACHPAM_END() \ - } while( (_pStartCrsr=static_cast<SwPaM *>(_pStartCrsr->GetNext())) != __pStartCrsr ); \ - } + BOOST_FOREACH(Ring& __r, std::make_pair(static_cast<Ring*>(pCURSH)->beginRing(), static_cast<Ring*>(pCURSH)->endRing())) \ + { #define FOREACHPAM_START_CONST(pCURSH) \ - {\ - const SwPaM *_pStartCrsr = (pCURSH), *__pStartCrsr = _pStartCrsr; \ - do { + BOOST_FOREACH(Ring& __r, std::make_pair(const_cast<Ring*>(static_cast<const Ring*>(pCURSH))->beginRing(), const_cast<Ring*>(static_cast<const Ring*>(pCURSH))->endRing())) \ + { -#define FOREACHPAM_END_CONST() \ - } while( (_pStartCrsr=static_cast<const SwPaM *>(_pStartCrsr->GetNext())) != __pStartCrsr ); \ - } +#define FOREACHPAM_END() } +#define FOREACHPAM_END_CONST() } struct SwPamRange { |