diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-26 16:51:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-26 20:34:05 +0200 |
commit | 6a1a68596a822811db80c3f9d1bf1c30db75c972 (patch) | |
tree | 3f46cc6e1a75099037d6889d39836e2704b2a08a /hwpfilter | |
parent | 8a2c64fbab84e4c87910e0775aaba6f3f0ce9486 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
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) ); |