diff --git a/inc/pam.hxx b/inc/pam.hxx index 39a9343..1aee1ac 100644 --- sw/inc/pam.hxx +++ sw/inc/pam.hxx @@ -256,6 +256,8 @@ public: { return *Start() <= rPos && rPos <= *End(); } static BOOL Overlap(const SwPaM & a, const SwPaM & b); + + static BOOL LessThan(const SwPaM & a, const SwPaM & b); DECL_FIXEDMEMPOOL_NEWDEL(SwPaM); diff --git a/source/core/crsr/pam.cxx b/source/core/crsr/pam.cxx index 04de143..15cf4d9 100644 --- sw/source/core/crsr/pam.cxx +++ sw/source/core/crsr/pam.cxx @@ -1154,3 +1154,8 @@ BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b) { return !(*b.End() <= *a.Start() || *a.End() <= *b.End()); } + +BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b) +{ + return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End()); +} diff --git a/source/filter/ww8/ww8par2.cxx b/source/filter/ww8/ww8par2.cxx index ff3ddb5..af0114c 100644 --- sw/source/filter/ww8/ww8par2.cxx +++ sw/source/filter/ww8/ww8par2.cxx @@ -3532,8 +3532,11 @@ void SwWW8ImplReader::TabCellEnd() { pTableDesc->TableCellEnd(); - if (bReadTable && pWFlyPara == NULL && mpTableEndPaM.get() != NULL && - ! SwPaM::Overlap(*pPaM, *mpTableEndPaM)) + if (bReadTable + && pWFlyPara == NULL + && mpTableEndPaM.get() != NULL + && (! SwPaM::Overlap(*pPaM, *mpTableEndPaM)) + && SwPaM::LessThan(*mpTableEndPaM, *pPaM)) { if (mpTableEndPaM->GetPoint()->nNode.GetNode().IsTxtNode()) {