writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit 3726737273e488ffab02f4a2dded5640521729cb Author: Eilidh McAdam <eilidh.mca...@itomig.de> Date: Tue Dec 9 19:55:18 2014 +0000 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 <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 59fff49..d080ae8 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits