summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-09-24 18:06:53 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-10-04 12:11:43 +0200
commit080eb8544ab65f757b0dc6c95328d3b9b47a5e64 (patch)
tree3692bb5d5c27ea01d039773303bf15d1d1ed8c93 /sw
parent7ade17fd46c986ad2a624982c5737d7c667b8c89 (diff)
sw: add CH_TXT_ATR_FIELDSEP
... and handle it in obvious places. Change-Id: I7e9668994be0bd246f89ecc60fd0a42c240cce0c Reviewed-on: https://gerrit.libreoffice.org/80051 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/hintids.hxx1
-rw-r--r--sw/source/core/text/itratr.cxx16
-rw-r--r--sw/source/core/text/itrform2.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx1
-rw-r--r--sw/source/core/undo/undel.cxx2
-rw-r--r--sw/source/filter/ascii/ascatr.cxx1
6 files changed, 18 insertions, 7 deletions
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 6e818b03349b..dcbc5f4247ff 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -50,6 +50,7 @@ class SvxLRSpaceItem;
#define CH_TXT_ATR_FORMELEMENT u'\x0006'
#define CH_TXT_ATR_FIELDSTART u'\x0007'
+#define CH_TXT_ATR_FIELDSEP u'\x0003'
#define CH_TXT_ATR_FIELDEND u'\x0008'
#define CH_TXT_ATR_SUBST_FIELDSTART ("[")
#define CH_TXT_ATR_SUBST_FIELDEND ("]")
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 59b7277ff849..02f44d5cc74e 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -707,16 +707,18 @@ static sal_Int32 GetNextAttrImpl(SwTextNode const*const pTextNode,
while (p < l)
{
sal_Unicode aChar = pStr[p];
- if (aChar < CH_TXT_ATR_FORMELEMENT
- || aChar > CH_TXT_ATR_FIELDEND)
+ switch (aChar)
{
- ++p;
- }
- else
- {
- break;
+ case CH_TXT_ATR_FORMELEMENT:
+ case CH_TXT_ATR_FIELDSTART:
+ case CH_TXT_ATR_FIELDSEP:
+ case CH_TXT_ATR_FIELDEND:
+ goto break_; // sigh...
+ default:
+ ++p;
}
}
+break_:
assert(p <= nNext);
if (p < l)
{
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index c273d32f0009..395fcc23ce2c 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -889,11 +889,15 @@ SwTextPortion *SwTextFormatter::WhichTextPor( SwTextFormatInfo &rInf ) const
{
if (ch == CH_TXT_ATR_FIELDSTART)
pPor = new SwFieldFormDatePortion(pBM, true);
+ else if (ch == CH_TXT_ATR_FIELDSEP)
+ pPor = new SwFieldMarkPortion(); // it's added in DateFieldmark?
else if (ch == CH_TXT_ATR_FIELDEND)
pPor = new SwFieldFormDatePortion(pBM, false);
}
else if (ch == CH_TXT_ATR_FIELDSTART)
pPor = new SwFieldMarkPortion();
+ else if (ch == CH_TXT_ATR_FIELDSEP)
+ pPor = new SwFieldMarkPortion();
else if (ch == CH_TXT_ATR_FIELDEND)
pPor = new SwFieldMarkPortion();
else if (ch == CH_TXT_ATR_FORMELEMENT)
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 062343808edd..8d321ddd9b45 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3575,6 +3575,7 @@ bool SwTextNode::CopyExpandText(SwTextNode& rDestNd, const SwIndex* pDestIdx,
sal_Unicode const cur(rDestNd.GetText()[aDestIdx.GetIndex()]);
if ( (cChar == cur) // filter substituted hidden text
|| (CH_TXT_ATR_FIELDSTART == cur) // filter all fieldmarks
+ || (CH_TXT_ATR_FIELDSEP == cur)
|| (CH_TXT_ATR_FIELDEND == cur)
|| (CH_TXT_ATR_FORMELEMENT == cur))
{
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index a1a8ca52f841..e23382e5f0a3 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -641,6 +641,7 @@ static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
case CH_TXT_ATR_INPUTFIELDEND:
case CH_TXT_ATR_FORMELEMENT:
case CH_TXT_ATR_FIELDSTART:
+ case CH_TXT_ATR_FIELDSEP:
case CH_TXT_ATR_FIELDEND:
return true;
@@ -681,6 +682,7 @@ static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_I
case CH_TXT_ATR_INPUTFIELDEND:
case CH_TXT_ATR_FORMELEMENT:
case CH_TXT_ATR_FIELDSTART:
+ case CH_TXT_ATR_FIELDSEP:
case CH_TXT_ATR_FIELDEND:
break; // nothing?
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 5058b45c5c00..3da9c5a2117b 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -348,6 +348,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode )
CH_TXT_ATR_INPUTFIELDEND,
CH_TXT_ATR_FORMELEMENT,
CH_TXT_ATR_FIELDSTART,
+ CH_TXT_ATR_FIELDSEP,
CH_TXT_ATR_FIELDEND,
0
};