diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-25 21:37:37 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-25 22:40:23 +0200 |
commit | 5342cd7533a51fd488de85565674ee01649ddcbc (patch) | |
tree | 533d33531076204c002bec87a4dcf8d71c4775dc /writerfilter/source | |
parent | Related: fdo#66400 take uppercase of first field token (diff) | |
download | core-5342cd7533a51fd488de85565674ee01649ddcbc.tar.gz core-5342cd7533a51fd488de85565674ee01649ddcbc.zip |
Resolves: fdo#66400 import combined characters from docx
move .doc combined character parser stuff from sw to filter for reuse in .docx
and fix bad length problem when nSavPtr == -1 after String->OUString conversion
thanks for the pasta CloudOn
Change-Id: I368ca30c14fd089271902b9b874de1099eb40038
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 9f69fab589b1..5a5ab662fe35 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3000,29 +3000,44 @@ void DomainMapper_Impl::CloseFieldCommand() case FIELD_EQ: { OUString aCommand = pContext->GetCommand().trim(); - nSpaceIndex = aCommand.indexOf(' '); - if(nSpaceIndex > 0) - aCommand = aCommand.copy(nSpaceIndex).trim(); - if (aCommand.startsWith("\\s")) + + msfilter::util::EquationResult aResult(msfilter::util::ParseCombinedChars(aCommand)); + if (!aResult.sType.isEmpty() && m_xTextFactory.is()) + { + OUString sServiceName("com.sun.star.text.TextField."); + xFieldInterface = m_xTextFactory->createInstance(sServiceName + aResult.sType); + xFieldProperties = + uno::Reference< beans::XPropertySet >( xFieldInterface, + uno::UNO_QUERY_THROW); + xFieldProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_CONTENT), uno::makeAny(aResult.sResult)); + } + else { - aCommand = aCommand.copy(2); - if (aCommand.startsWith("\\do")) + //merge Read_SubF_Ruby into filter/.../util.cxx and reuse that ? + nSpaceIndex = aCommand.indexOf(' '); + if(nSpaceIndex > 0) + aCommand = aCommand.copy(nSpaceIndex).trim(); + if (aCommand.startsWith("\\s")) { - aCommand = aCommand.copy(3); - sal_Int32 nStartIndex = aCommand.indexOf('('); - sal_Int32 nEndIndex = aCommand.indexOf(')'); - if (nStartIndex > 0 && nEndIndex > 0) + aCommand = aCommand.copy(2); + if (aCommand.startsWith("\\do")) { - // nDown is the requested "lower by" value in points. - sal_Int32 nDown = aCommand.copy(0, nStartIndex).toInt32(); - OUString aContent = aCommand.copy(nStartIndex + 1, nEndIndex - nStartIndex - 1); - PropertyMapPtr pCharContext = GetTopContext(); - // dHeight is the font size of the current style. - double dHeight = 0; - if (GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight) - // Character escapement should be given in negative percents for subscripts. - pCharContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( sal_Int16(- 100 * nDown / dHeight) ) ); - appendTextPortion(aContent, pCharContext); + aCommand = aCommand.copy(3); + sal_Int32 nStartIndex = aCommand.indexOf('('); + sal_Int32 nEndIndex = aCommand.indexOf(')'); + if (nStartIndex > 0 && nEndIndex > 0) + { + // nDown is the requested "lower by" value in points. + sal_Int32 nDown = aCommand.copy(0, nStartIndex).toInt32(); + OUString aContent = aCommand.copy(nStartIndex + 1, nEndIndex - nStartIndex - 1); + PropertyMapPtr pCharContext = GetTopContext(); + // dHeight is the font size of the current style. + double dHeight = 0; + if (GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight) + // Character escapement should be given in negative percents for subscripts. + pCharContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( sal_Int16(- 100 * nDown / dHeight) ) ); + appendTextPortion(aContent, pCharContext); + } } } } |