diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-18 16:50:31 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-23 13:08:22 +0200 |
commit | 4212803e08052af2c1b3618f52fefb651c429345 (patch) | |
tree | c55abe2d356e13ecfeb13371d09e12b920d4b5e4 /sw | |
parent | 6eb1c2304d257d16858b7b51cad63f1dc2bde88b (diff) |
sw: WW8 import: be a little more flexible with FORMTEXT fields
The subsequent export change will somehow create things like
(rr) p pF->nLCode
$1 = 13
(rr) p rStr
$2 = " FORMTEXT \001\062\060"
... so be a little less strict with the 0x01.
Change-Id: Ie99002d099a3803989b71ae8c26b7f4bfe61c943
Reviewed-on: https://gerrit.libreoffice.org/81083
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 97701b5a2ea6..e62e13f6572d 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -91,8 +91,9 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr ) { WW8FormulaEditBox aFormula(*this); - if (pF->nLCode && rStr[pF->nLCode-1]==0x01) { - ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_EDIT); + sal_Int32 const nPos(rStr.indexOf(0x01)); + if (pF->nLCode && nPos != -1 && nPos < pF->nLCode) { + ImportFormulaControl(aFormula, pF->nSCode + nPos, WW8_CT_EDIT); } /* diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 1ddbb49c3823..4089c42a665f 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -895,6 +895,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) if (aF.nId == 33) aF.bCodeNest=false; // do not recurse into nested page fields bool bCodeNest = aF.bCodeNest; if ( aF.nId == 6 ) bCodeNest = false; // We can handle them and lose the inner data + if (aF.nId == 70) bCodeNest = false; // need to import 0x01 in FORMTEXT m_aFieldStack.emplace_back(*m_pPaM->GetPoint(), aF.nId); |