[Libreoffice-commits] core.git: writerfilter/source
Eilidh McAdam
eilidh.mcadam at itomig.de
Fri Dec 19 09:06:35 PST 2014
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 3726737273e488ffab02f4a2dded5640521729cb
Author: Eilidh McAdam <eilidh.mcadam at 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 <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at 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
More information about the Libreoffice-commits
mailing list