diff options
author | Eilidh McAdam <eilidh.mcadam@itomig.de> | 2014-12-09 19:55:18 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-19 17:06:12 +0000 |
commit | 3726737273e488ffab02f4a2dded5640521729cb (patch) | |
tree | 5244a52dfbaba7e259768874b1b2f09b10bda665 /writerfilter/source/dmapper/DomainMapper_Impl.cxx | |
parent | a072b3533f44730565f42b45cfd9f77f44f506a9 (diff) |
Small fix for docx date field format import.
The standard allows for arbitrary amounts of whitespace between
tokens. MSO outputs with a space between \@ and ", LO doesn't.
To account for this, any whitespace between these tokens is
stripped and parsing assumes a command looks like:
DATE \@"some format".
Change-Id: I2620780da3ee873af6f35e236c7c34a073aebe73
Reviewed-on: https://gerrit.libreoffice.org/13430
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 59fff49dc589..d080ae84c1e1 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2159,8 +2159,13 @@ style::NumberingType:: OUString lcl_ParseFormat( const OUString& rCommand ) { - // The command looks like: " DATE \@ "dd MMMM yyyy" - return msfilter::util::findQuotedText(rCommand, "\\@ \"", '\"'); + // The command looks like: " DATE \@"dd MMMM yyyy" + // Remove whitespace permitted by standard between \@ and " + sal_Int32 delimPos = rCommand.indexOf("\\@"); + sal_Int32 wsChars = rCommand.indexOf('\"') - delimPos - 2; + OUString command = rCommand.replaceAt(delimPos+2, wsChars, ""); + + return msfilter::util::findQuotedText(command, "\\@\"", '\"'); } /*------------------------------------------------------------------------- extract a parameter (with or without quotes) between the command and the following backslash |