diff options
author | Justin Luth <justin_luth@sil.org> | 2022-04-21 14:49:33 +0200 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-04-22 05:55:38 +0200 |
commit | e4243a140345a4bcd800217115b42667e277c6a3 (patch) | |
tree | b56625e30c026b6306e6e588a637c2e8371b286c /writerfilter/source | |
parent | 1768d5705dc72328ae2369fac7fc82437fef4ae1 (diff) |
cleanup writerfilter lcl_ParseFormat
If there is no \@, then we will never match what
util::findQuotedText is looking for, so don't bother.
Change-Id: I0a6709046673d98d00d74e921d7f502c9df54b46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133265
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2ce7081d286d..2aff26ad5ad4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4219,18 +4219,17 @@ style::NumberingType:: static OUString lcl_ParseFormat( const OUString& rCommand ) { // The command looks like: " DATE \@"dd MMMM yyyy" or "09/02/2014" - // Remove whitespace permitted by standard between \@ and " OUString command; sal_Int32 delimPos = rCommand.indexOf("\\@"); if (delimPos != -1) { + // Remove whitespace permitted by standard between \@ and " sal_Int32 wsChars = rCommand.indexOf('\"') - delimPos - 2; command = rCommand.replaceAt(delimPos+2, wsChars, u""); + return OUString(msfilter::util::findQuotedText(command, "\\@\"", '\"')); } - else - command = rCommand; - return OUString(msfilter::util::findQuotedText(command, "\\@\"", '\"')); + return OUString(); } /*------------------------------------------------------------------------- extract a parameter (with or without quotes) between the command and the following backslash |