hwpfilter/source/hwpreader.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit 6a1a68596a822811db80c3f9d1bf1c30db75c972 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Apr 26 16:51:01 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Apr 26 20:34:05 2022 +0200 ofz#47042 previous use of static variable affecting later runs Change-Id: I64fb184e43fb025798781c85c9a0a8e0354b21b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133452 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index a6df282ede5b..8b5803c09f56 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -46,7 +46,6 @@ // xmloff/xmlkyd.hxx constexpr OUStringLiteral sXML_CDATA = u"CDATA"; -static hchar *field = nullptr; static char buf[1024]; namespace @@ -70,12 +69,13 @@ struct HwpReaderPrivate bInHeader = false; nPnPos = 0; pPn = nullptr; - + pField = nullptr; } bool bFirstPara; bool bInBody; bool bInHeader; ShowPageNum *pPn; + hchar *pField; int nPnPos; }; @@ -2873,7 +2873,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) firstspace = 1; if( hbox->type[0] == 4 && hbox->type[1] == 0 ) { - field = hbox->str3.get(); + d->pField = hbox->str3.get(); } else{ makeFieldCode(str, hbox); @@ -2886,7 +2886,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) if( hbox->type[0] == 4 && hbox->type[1] == 0 ) { makeFieldCode(str, hbox); - field = nullptr; + d->pField = nullptr; } infield = false; str.clear(); @@ -3055,8 +3055,8 @@ void HwpReader::makeFieldCode(hchar_string const & rStr, FieldCode const *hbox) if( hbox->type[0] == 4 && hbox->type[1] == 0 ) { mxList->addAttribute("text:placeholder-type", sXML_CDATA, "text"); - if( field ) - mxList->addAttribute("text:description", sXML_CDATA, hstr2OUString(field)); + if (d->pField) + mxList->addAttribute("text:description", sXML_CDATA, hstr2OUString(d->pField)); startEl("text:placeholder"); mxList->clear(); chars( fromHcharStringToOUString(rStr) );