writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 37dde4ef13dee5107249ff6604c0bb134235143e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Jun 12 16:26:49 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Jun 13 06:55:07 2022 +0200

    crashtesting: assert seen on loading forum-mso-de-79405.docx
    
    Change-Id: I91200a8e409eec76de4ead22d200bf45f02b88b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135679
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3d6b26dba8d3..30f07b351ca5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4332,8 +4332,17 @@ static OUString lcl_ParseFormat( const OUString& 
rCommand )
     if (delimPos != -1)
     {
         // Remove whitespace permitted by standard between \@ and "
-        sal_Int32 wsChars = rCommand.indexOf('\"') - delimPos - 2;
-        command = rCommand.replaceAt(delimPos+2, wsChars, u"");
+        const sal_Int32 nQuoteIndex = rCommand.indexOf('\"');
+        if (nQuoteIndex != -1)
+        {
+            sal_Int32 wsChars = nQuoteIndex - delimPos - 2;
+            command = rCommand.replaceAt(delimPos+2, wsChars, u"");
+        }
+        else
+        {
+            // turn date \@ MM into date \@"MM"
+            command = OUString::Concat(rCommand.subView(0, delimPos + 2)) + 
"\"" + o3tl::trim(rCommand.subView(delimPos + 2)) + "\"";
+        }
         return OUString(msfilter::util::findQuotedText(command, "\\@\"", 
'\"'));
     }
 

Reply via email to