XLSX: UserDefined function name can't have spaces

Replace all space characters in user-defined function with underscore

bug-document: forum-mso-en4-435371.xls
Change-Id: I1c6d7232736afdb5987f123dc1956af32ddad020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201025
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204163
Tested-by: Jenkins
This commit is contained in:
Karthik Godha
2026-04-23 15:47:56 +02:00
committed by Xisco Fauli
parent cf04cdbcfa
commit 4235e1ea1b
+13
View File
@@ -1029,6 +1029,19 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
bValid = false;
break;
}
else if (t->GetOpCode() == ocUDExternal && t->GetType() == formula::svExternal)
{
OUString sUDName(t->GetExternal());
OUString sSanitizedName = sUDName.replaceAll(" ", "_");
if (sUDName != sSanitizedName)
{
sal_uInt16 nIndex = aIter.GetIndex();
aTokenArray.ReplaceToken(
nIndex - 1,
new formula::FormulaExternalToken(ocUDExternal, sSanitizedName),
formula::FormulaTokenArray::CODE_ONLY);
}
}
t = aIter.Next();
}
}