summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-11-14 17:37:17 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-01-25 14:42:03 +0100
commitc02b6220f3f1c24342f37b4cc7425763f5a2355c (patch)
tree6bd42e2ba1f99b5576f728d57a4c3259e918a7f3
parent6d3c50331eb1cabf1aa0c71100fb7b5fdbe681d7 (diff)
sw: WW8 import: instead of control character insert '?' for footnote
SwWW8ImplReader::ReadChar() inserts a U+0002 control character to temporarily mark a footnote anchor; this is then deleted and replaced with a real footnote hint by SwWW8ImplReader::End_Footnote(). The assumption is that it is necessary to insert a placeholder character to be able to apply formatting to it. But if the document is corrupted, the control character could survive the import, which sounds less than ideal. So either make this magic character more explicit by documenting it in hintids.hxx and removing any outstanding ones at the end of the import, or use a non-offensive character instead; since this should only affect invalid documents, choose the solution with the least effort. Change-Id: I76d396258b32e0f0fb6393942a58a4dc57912211 Reviewed-on: https://gerrit.libreoffice.org/82760 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 13ba765c444713b0b0b2f4b4231bdafcbbef6ad0)
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 097e1f8d273d..174c1f3d4a41 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3726,7 +3726,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
break;
case 0x2: // TODO: Auto-Footnote-Number, should be replaced by SwWW8ImplReader::End_Footnote later
if (!m_aFootnoteStack.empty())
- cInsert = 0x2;
+ cInsert = '?';
break;
default:
SAL_INFO( "sw.ww8.level2", "<unknownValue val=\"" << nWCharVal << "\">" );