diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-26 11:05:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-26 15:32:06 +0200 |
commit | 201aa49d9a386844822087362cccd49dbff9d21a (patch) | |
tree | e35a9dd16ab7f015d366f85a6216281f167302bd /writerfilter | |
parent | b12f15502f89099016e1cb5970649bbee5c39c3e (diff) |
bnc#834035 Introduce msfilter::util::findQuotedText()
This was in writerfilter, but we'll need it soon in sw as well, so move
it down to msfilter.
Change-Id: I8efe02b6bbe8f391d9e14857ed58dbae184d5632
(cherry picked from commit 750f0ebf97d19d1cf305dabe72d52ad6e90adf70)
Conflicts:
include/filter/msfilter/util.hxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 57e2aeda66ab..8f1af5aff78d 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -75,6 +75,7 @@ #include <comphelper/stlunosequence.hxx> #include <vcl/svapp.hxx> #include <vcl/outdev.hxx> +#include <filter/msfilter/util.hxx> using namespace ::com::sun::star; using namespace ::rtl; @@ -1778,33 +1779,12 @@ void DomainMapper_Impl::PopShapeContext() } } - -OUString lcl_FindQuotedText( const OUString& rCommand, - const sal_Char* cStartQuote, const sal_Unicode uEndQuote ) -{ - OUString sRet; - OUString sStartQuote( OUString::createFromAscii(cStartQuote) ); - sal_Int32 nStartIndex = rCommand.indexOf( sStartQuote ); - if( nStartIndex >= 0 ) - { - sal_Int32 nStartLength = sStartQuote.getLength(); - sal_Int32 nEndIndex = rCommand.indexOf( uEndQuote, nStartIndex + nStartLength); - if( nEndIndex > nStartIndex ) - { - sRet = rCommand.copy( nStartIndex + nStartLength, nEndIndex - nStartIndex - nStartLength); - } - } - return sRet; - -} - - sal_Int16 lcl_ParseNumberingType( const OUString& rCommand ) { sal_Int16 nRet = style::NumberingType::PAGE_DESCRIPTOR; // The command looks like: " PAGE \* Arabic " - OUString sNumber = lcl_FindQuotedText(rCommand, "\\* ", ' '); + OUString sNumber = msfilter::util::findQuotedText(rCommand, "\\* ", ' '); if( !sNumber.isEmpty() ) { @@ -1899,7 +1879,7 @@ style::NumberingType:: OUString lcl_ParseFormat( const OUString& rCommand ) { // The command looks like: " DATE \@ "dd MMMM yyyy" - return lcl_FindQuotedText(rCommand, "\\@ \"", '\"'); + return msfilter::util::findQuotedText(rCommand, "\\@ \"", '\"'); } /*------------------------------------------------------------------------- extract a parameter (with or without quotes) between the command and the following backslash |