summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-04-19 19:54:59 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-04-19 20:39:12 +0200
commit8c8b3a4f83f67882b284ddc3b3fe10d3fe6dedf4 (patch)
treec1587f262351563435afacd3f2101ca1a72b1b81 /writerfilter
parent85a6aa5526c1e38865250e88ceb6bf02345248b2 (diff)
tdf#132185: field command does not necessarily end with space
Change-Id: I5a5e54fb42e20855b75af7ab523465a032ab46e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2c84a56ce73a..3bbc3c8e00ff 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3072,7 +3072,14 @@ static sal_Int16 lcl_ParseNumberingType( const OUString& rCommand )
sal_Int16 nRet = style::NumberingType::PAGE_DESCRIPTOR;
// The command looks like: " PAGE \* Arabic "
- OUString sNumber = msfilter::util::findQuotedText(rCommand, "\\* ", ' ');
+ // tdf#132185: but may as well be "PAGE \* Arabic"
+ OUString sNumber;
+ constexpr OUStringLiteral rSeparator("\\* ");
+ if (sal_Int32 nStartIndex = rCommand.indexOf(rSeparator); nStartIndex >= 0)
+ {
+ nStartIndex += rSeparator.getLength();
+ sNumber = rCommand.getToken(0, ' ', nStartIndex);
+ }
if( !sNumber.isEmpty() )
{