diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-26 16:51:01 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-16 12:49:03 +0200 |
commit | 6d71f1277ec2158db3bdb924d367052ff1758910 (patch) | |
tree | 004c2c46a5ba845ce267c6d4ab431df1483bd8ad /hwpfilter | |
parent | ofz#46526 Abrt (diff) | |
download | core-6d71f1277ec2158db3bdb924d367052ff1758910.tar.gz core-6d71f1277ec2158db3bdb924d367052ff1758910.zip |
ofz#47042 previous use of static variable affecting later runs
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133453
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 24c7741adcb373b4de508b16deef56343119df26)
Change-Id: I64fb184e43fb025798781c85c9a0a8e0354b21b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133929
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 fa337533b3b3..12eb4960f97f 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -71,7 +71,6 @@ rendEl("text:span"); \ tstart = false -static hchar *field = nullptr; static char buf[1024]; namespace @@ -97,12 +96,13 @@ struct HwpReaderPrivate bInHeader = false; nPnPos = 0; pPn = nullptr; - + pField = nullptr; } bool bFirstPara; bool bInBody; bool bInHeader; ShowPageNum *pPn; + hchar *pField; int nPnPos; }; @@ -2932,7 +2932,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); @@ -2945,7 +2945,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(); @@ -3113,8 +3113,8 @@ void HwpReader::makeFieldCode(hchar_string const & rStr, FieldCode const *hbox) if( hbox->type[0] == 4 && hbox->type[1] == 0 ) { padd("text:placeholder-type", sXML_CDATA, "text"); - if( field ) - padd("text:description", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(field))); + if (d->pField) + padd("text:description", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(d->pField))); rstartEl( "text:placeholder", mxList.get()); mxList->clear(); rchars( reinterpret_cast<sal_Unicode const *>(rStr.c_str()) ); |