From 8148dd6ed3c61eaf5f9fe3a060ecda9d11611f39 Mon Sep 17 00:00:00 2001 From: Irgaliev Amin Date: Mon, 25 Dec 2023 20:13:34 +0400 Subject: tdf#158023 Add \ before parentheses if they are in the tag. MSO allows you to write unpair opening or closing parentheses in the t tag. The patch adds a backslash before parentheses, which allows you to correctly recognize and correctly save such formulas when exporting. Also add a test to check whether the parentheses are wrapped correctly. Change-Id: Ib1a941858f0843742b56b8089f3c14983ba1222c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158794 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- starmath/source/ooxmlimport.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'starmath') diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index 4023a5e652ac..b0932c43919c 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -602,9 +602,9 @@ OUString SmOoxmlImport::handleR() { XmlStream::Tag rtag = m_rStream.ensureOpeningTag( M_TOKEN( t )); if( rtag.attribute( OOX_TOKEN( xml, space )) != "preserve" ) - text.append(o3tl::trim(rtag.text)); + text.append(o3tl::trim(rtag.text.replaceAll("(", "\\(").replaceAll(")", "\\)"))); else - text.append(rtag.text); + text.append(rtag.text.replaceAll("(", "\\(").replaceAll(")", "\\)")); m_rStream.ensureClosingTag( M_TOKEN( t )); break; } -- cgit breoffice-6-0'>distro/cib/libreoffice-6-0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2018-08-09Various fuzzers need pdffilter_component_getFactoryStephan Bergmann