sc/source/filter/oox/formulaparser.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 516a3382a774565d4708766ec796c54196563f5a
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Sat Jan 14 09:20:41 2023 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat Jan 14 18:35:43 2023 +0000

    tdf#117266 sc oox: import local macro without reference id
    
    This is what LO exports - a macro without a local ([0]!)
    or remote ([2]!) reference.
    
    It must be at least somewhat valid because MS Word imports
    these just fine. So why don't import what we export...
    
    Change-Id: I8f69c373552b559efcfe7cbb06ea3a706d8ad0d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145511
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sc/source/filter/oox/formulaparser.cxx 
b/sc/source/filter/oox/formulaparser.cxx
index f4eb7419b7cb..b832fa9636d7 100644
--- a/sc/source/filter/oox/formulaparser.cxx
+++ b/sc/source/filter/oox/formulaparser.cxx
@@ -1821,8 +1821,11 @@ OUString FormulaParser::importMacroName( 
std::u16string_view aFormulaString )
         document, ignoring the valid syntax 'Macro1!MyMacro' for sheet-local
         sheet macros.
      */
+    OUString aRemainder(aFormulaString);
+    if (aRemainder.indexOf('!') == -1)
+        return aRemainder;
+
     sal_Int32 nRefId = -1;
-    OUString aRemainder;
     if( lclExtractRefId( nRefId, aRemainder, aFormulaString ) && 
(aRemainder.getLength() > 1) && (aRemainder[ 0 ] == '!') )
     {
         /*  In BIFF12 documents, the reference identifier is always the

Reply via email to