diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-02-18 11:16:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-02-18 11:40:09 +0100 |
commit | f6a02947896e19160c137032a7fc2e56277656af (patch) | |
tree | 22ba7971527deae714d8961211a2894d33bc55ec /sw | |
parent | d77b25384bfcfcbcce32af8038ff857738406a45 (diff) |
fdo#60710 SwXTextPortionEnumeration: filter out fields from the undo stack
The UNO API provides the annotation field associated to a comment range
fieldmark when the fieldmark starts. To achieve this, it looks up the
annotation field by name, but it failed to ignore the fields which are
present only because the undo stack still holds a reference to them,
making the ODF export filter fail to export the document.
Change-Id: Ia3b738a1eca7ed9981e1963b3d70ea8e3dbe8db8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 91f94db47bd9..412a76d5d761 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -331,7 +331,8 @@ static const SwFmtFld* lcl_getFieldByName(SwDoc* pDoc, const OUString& rName) SwIterator<SwFmtFld, SwFieldType> aIter(*pCurType); for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next()) { - if (pCurFldFmt->GetFld()->GetTyp()->Which() != RES_POSTITFLD) + // Ignore the field if it's not an annotation or it doesn't have an anchor. + if (pCurFldFmt->GetFld()->GetTyp()->Which() != RES_POSTITFLD || !pCurFldFmt->GetTxtFld()) continue; const SwPostItField* pField = dynamic_cast<const SwPostItField*>(pCurFldFmt->GetFld()); |