summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-20 10:39:08 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-20 11:35:23 +0100
commitc426df5086785807972c1a8d2788567f2842a395 (patch)
tree9cd5522d4896ac02f8871ab2aa6dae57f507ebca /sw
parentc60b6c7665220b4383a4851708cfa74f9c2a6fcb (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoportenum.cxx12
1 files changed, 12 insertions, 0 deletions
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<XTextField> 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<const SwPostItField*>(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 :