[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source
Miklos Vajna
vmiklos at suse.cz
Mon Feb 18 14:26:57 PST 2013
sw/source/core/unocore/unoportenum.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 3d9911a925607ed58002c6c9488507bd5a818975
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Feb 18 11:16:38 2013 +0100
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.
(cherry picked from commit f6a02947896e19160c137032a7fc2e56277656af)
Change-Id: Ia3b738a1eca7ed9981e1963b3d70ea8e3dbe8db8
Reviewed-on: https://gerrit.libreoffice.org/2231
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 6849d03..d05b8f5 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -330,7 +330,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());
More information about the Libreoffice-commits
mailing list