Kaydet (Commit) c426df50 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst c60b6c76
...@@ -756,6 +756,18 @@ lcl_ExportHints( ...@@ -756,6 +756,18 @@ lcl_ExportHints(
Reference<XTextField> xField = Reference<XTextField> xField =
SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld()); SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld());
pPortion->SetTextField(xField); 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; break;
case RES_TXTATR_FLYCNT : case RES_TXTATR_FLYCNT :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment