hwpfilter/source/hwpreader.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 15b65bb992ae8f6d9218606bcefd19a2ce763276 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Mar 1 19:48:00 2026 +0000 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Mar 5 17:25:36 2026 +0100 ofz#481418344 Timeout Change-Id: I12d5cc145e3d2cf156d2b1d30b50d9d9d25a25e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200730 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 5bd6ce333a1e21c68858120d22cac7e25d591f8b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201055 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 121183d4e7a2..568e07101c75 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -1485,6 +1485,11 @@ void HwpReader::makePageStyle() pmCount = 512; } + OUString sBackInfoEncoded; + // Do this once, so if we need it we don't end up with many duplicate strings of the background image + if (hwpinfo.back_info.isset && hwpinfo.back_info.type == 2 && hwpinfo.back_info.size > 0) + sBackInfoEncoded = base64_encode_string(reinterpret_cast<unsigned char*>(hwpinfo.back_info.data.data()), hwpinfo.back_info.size); + for( int i = 0 ; i < pmCount ; i++ ){ mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "pm" + OUString::number(i + 1)); startEl(u"style:page-master"_ustr); @@ -1679,7 +1684,7 @@ void HwpReader::makePageStyle() if( hwpinfo.back_info.type == 2 ){ startEl(u"office:binary-data"_ustr); mxList->clear(); - chars(base64_encode_string(reinterpret_cast<unsigned char*>(hwpinfo.back_info.data.data()), hwpinfo.back_info.size)); + chars(sBackInfoEncoded); endEl(u"office:binary-data"_ustr); } endEl(u"style:background-image"_ustr);
