From 56314ec61aa6952ce94a8de86d68961adb204a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 8 Jun 2011 12:09:41 +0100 Subject: [PATCH] Resolves: rhbz#699909 handle export of field-end mark at index 0 --- sw/source/core/crsr/bookmrk.cxx | 4 +++- sw/source/filter/ww8/wrtw8nds.cxx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 90fec7d..e5600b7 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -120,9 +120,11 @@ namespace sw { namespace mark } } + //We consider the CH_TXT_ATR_FIELDSTART and CH_TXT_ATR_FIELDEND + //themselves to be part of the covered range bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const { - return GetMarkStart() <= rPos && rPos < GetMarkEnd(); + return rPos >= GetMarkStart() && rPos <= GetMarkEnd(); } void MarkBase::SetMarkPos(const SwPosition& rNewPos) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 183fe59..948e948 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1892,8 +1892,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) } else if ( ch == CH_TXT_ATR_FIELDEND ) { - SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos - 1 ) ); + SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) ); ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); + OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" ); ww::eField eFieldId = lcl_getFieldId( pFieldmark ); -- 1.7.5.2