From c426df5086785807972c1a8d2788567f2842a395 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 20 Mar 2013 10:39:08 +0100 Subject: sw: export fieldmark of postit fields if possible This way the UNO export filters won't have to remind if the postit field had an associated fieldmark or not, but can just query the fieldmark type and ignore e.g. comment fieldmarks. Change-Id: I791b07fd371f57ec35d8309e666058237dadf190 --- sw/source/core/unocore/unoportenum.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sw') diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 9fcc536cdd67..78be1234eef2 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -756,6 +756,18 @@ lcl_ExportHints( Reference xField = SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld()); pPortion->SetTextField(xField); + + // If this is a postit field and it has a fieldmark + // associated, set the fieldmark as a bookmark. + const SwField* pField = pAttr->GetFld().GetFld(); + if (pField->Which() == RES_POSTITFLD) + { + const SwPostItField* pPostItField = dynamic_cast(pField); + IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + IDocumentMarkAccess::const_iterator_t it = pMarkAccess->findMark(pPostItField->GetName()); + if (it != pMarkAccess->getMarksEnd()) + pPortion->SetBookmark(SwXFieldmark::CreateXFieldmark(*pDoc, *it->get())); + } } break; case RES_TXTATR_FLYCNT : -- cgit