summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-26 11:05:04 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-26 13:11:09 +0200
commit750f0ebf97d19d1cf305dabe72d52ad6e90adf70 (patch)
tree6321947fd63324173b87736829e331ae024f2e94 /writerfilter
parent808d3c669c4c49c2dd5ea7fad7841378b5cc2f8c (diff)
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
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx28
1 files changed, 4 insertions, 24 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 6f2a31efed04..7725b86d0604 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -71,6 +71,7 @@
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <officecfg/Office/Common.hxx>
+#include <filter/msfilter/util.hxx>
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -1822,33 +1823,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() )
{
@@ -1943,7 +1923,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
@@ -3238,7 +3218,7 @@ void DomainMapper_Impl::CloseFieldCommand()
// command looks like: " SEQ Table \* ARABIC "
OUString sCmd(pContext->GetCommand());
// find the sequence name, e.g. "SEQ"
- OUString sSeqName = lcl_FindQuotedText(sCmd, "SEQ ", '\\');
+ OUString sSeqName = msfilter::util::findQuotedText(sCmd, "SEQ ", '\\');
sSeqName = sSeqName.trim();
// create a sequence field master using the sequence name