diff options
author | Irgaliev Amin <irgaliev01@mail.ru> | 2023-12-25 20:13:34 +0400 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-25 18:35:18 +0100 |
commit | 8148dd6ed3c61eaf5f9fe3a060ecda9d11611f39 (patch) | |
tree | 89e023f52ed3d49eaa90e70311c473ee8c2b5422 /starmath | |
parent | 11fcb2814ee44e4f9b932e879bb95206e3dbf875 (diff) |
tdf#158023 Add \ before parentheses if they are in the <t> 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 <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/ooxmlimport.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |