summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-09-27 18:12:58 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-10-04 12:13:08 +0200
commit314958decf4491ca7b11c2ef014d29ea2ae14d69 (patch)
tree256c84177dfa8d4723cb008b5313eb56444736bf
parent080eb8544ab65f757b0dc6c95328d3b9b47a5e64 (diff)
sw: SwXTextPortion "TextFieldSeparator"
Change-Id: I60a5036168287b1972c18e74431b7a6101d85304 Reviewed-on: https://gerrit.libreoffice.org/80052 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--sw/source/core/inc/unoport.hxx1
-rw-r--r--sw/source/core/unocore/unoport.cxx3
-rw-r--r--sw/source/core/unocore/unoportenum.cxx9
3 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index 5072f33c4ea7..7817d7d16d36 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -70,6 +70,7 @@ enum SwTextPortionType
PORTION_SOFT_PAGEBREAK,
PORTION_META,
PORTION_FIELD_START,
+ PORTION_FIELD_SEP,
PORTION_FIELD_END,
PORTION_FIELD_START_END,
PORTION_ANNOTATION,
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 319f1c51dbd4..d85eaaa420b8 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -244,6 +244,7 @@ void SwXTextPortion::GetPropertyValue(
case PORTION_SOFT_PAGEBREAK:pRet = "SoftPageBreak";break;
case PORTION_META: pRet = UNO_NAME_META; break;
case PORTION_FIELD_START:pRet = "TextFieldStart";break;
+ case PORTION_FIELD_SEP: pRet = "TextFieldSeparator";break;
case PORTION_FIELD_END:pRet = "TextFieldEnd";break;
case PORTION_FIELD_START_END:pRet = "TextFieldStartEnd";break;
case PORTION_ANNOTATION:
@@ -297,6 +298,7 @@ void SwXTextPortion::GetPropertyValue(
case PORTION_RUBY_START:
case PORTION_RUBY_END:
case PORTION_FIELD_START:
+ case PORTION_FIELD_SEP:
case PORTION_FIELD_END:
rVal <<= m_bIsCollapsed;
break;
@@ -323,6 +325,7 @@ void SwXTextPortion::GetPropertyValue(
case PORTION_BOOKMARK_END:
case PORTION_REDLINE_END:
case PORTION_RUBY_END:
+ case PORTION_FIELD_SEP:
case PORTION_FIELD_END:
bStart = false;
break;
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index f7ad846313d4..42d4658138a1 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -396,7 +396,7 @@ lcl_FillFieldMarkArray(std::deque<sal_Int32> & rFieldMarks, SwUnoCursor const &
if (!pTextNode) return;
const sal_Unicode fld[] = {
- CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND, CH_TXT_ATR_FORMELEMENT, 0 };
+ CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDSEP, CH_TXT_ATR_FIELDEND, CH_TXT_ATR_FORMELEMENT, 0 };
sal_Int32 pos = std::max(static_cast<sal_Int32>(0), i_nStartPos);
while ((pos = ::comphelper::string::indexOfAny(pTextNode->GetText(), fld, pos)) != -1)
{
@@ -443,6 +443,13 @@ lcl_ExportFieldMark(
SwXFieldmark::CreateXFieldmark(*pDoc, pFieldmark));
}
}
+ else if (CH_TXT_ATR_FIELDSEP == Char)
+ {
+ // TODO how to get the field?
+ SwXTextPortion* pPortion = new SwXTextPortion(
+ pUnoCursor, i_xParentText, PORTION_FIELD_SEP);
+ xRef = pPortion;
+ }
else if (CH_TXT_ATR_FIELDEND == Char)
{
::sw::mark::IFieldmark* pFieldmark = nullptr;