summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-02 15:57:33 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-02 16:47:34 +0200
commite68bfafdcbafc38abe281a2242cfba21354c1bd6 (patch)
tree75f84000636ead62c1701fae79357ce19c78475f /writerfilter
parentd0fead61293fdcee8ce3f7ed620784cc093a21ea (diff)
implement import/export of RTF_MNOR
Change-Id: I9caea7fbea4643e57d81ad3b7812d0cc10f54c11
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx18
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx2
2 files changed, 17 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5afb4532d16b..0afe427dcc0a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -215,12 +215,20 @@ static util::DateTime lcl_getDateTime(RTFParserState& aState)
aState.nDay, aState.nMonth, aState.nYear);
}
-static void lcl_DestinationToMath(OUStringBuffer& rDestinationText, oox::formulaimport::XmlStreamBuilder& rMathBuffer)
+static void lcl_DestinationToMath(OUStringBuffer& rDestinationText, oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor)
{
OUString aStr = rDestinationText.makeStringAndClear();
if (!aStr.isEmpty())
{
rMathBuffer.appendOpeningTag(M_TOKEN(r));
+ if (rMathNor)
+ {
+ rMathBuffer.appendOpeningTag(M_TOKEN(rPr));
+ rMathBuffer.appendOpeningTag(M_TOKEN(nor));
+ rMathBuffer.appendClosingTag(M_TOKEN(nor));
+ rMathBuffer.appendClosingTag(M_TOKEN(rPr));
+ rMathNor = false;
+ }
rMathBuffer.appendOpeningTag(M_TOKEN(t));
rMathBuffer.appendCharacters(aStr);
rMathBuffer.appendClosingTag(M_TOKEN(t));
@@ -275,6 +283,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bIsInFrame(false),
m_aUnicodeBuffer(),
m_aHexBuffer(),
+ m_bMathNor(false),
m_bIgnoreNextContSectBreak(false),
m_bNeedSect(true),
m_bWasInFrame(false),
@@ -2651,6 +2660,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_NOWRAP:
m_aStates.top().aFrame.setSprm(NS_sprm::LN_PWr, NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside);
break;
+ case RTF_MNOR:
+ m_bMathNor = true;
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'");
@@ -3667,7 +3679,7 @@ int RTFDocumentImpl::pushState()
else
{
if (m_aStates.top().nDestinationState == DESTINATION_MR)
- lcl_DestinationToMath(m_aStates.top().aDestinationText, m_aMathBuffer);
+ lcl_DestinationToMath(m_aStates.top().aDestinationText, m_aMathBuffer, m_bMathNor);
m_aStates.push(m_aStates.top());
}
m_aStates.top().aDestinationText.setLength(0);
@@ -4151,7 +4163,7 @@ int RTFDocumentImpl::popState()
}
break;
case DESTINATION_MR:
- lcl_DestinationToMath(m_aStates.top().aDestinationText, m_aMathBuffer);
+ lcl_DestinationToMath(m_aStates.top().aDestinationText, m_aMathBuffer, m_bMathNor);
break;
case DESTINATION_MF:
m_aMathBuffer.appendClosingTag(M_TOKEN(f));
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index e3b84020b398..b7f367b89b48 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -590,6 +590,8 @@ namespace writerfilter {
rtl::OStringBuffer m_aHexBuffer;
/// Formula import.
oox::formulaimport::XmlStreamBuilder m_aMathBuffer;
+ /// Normal text property, that is math italic and math spacing are not applied to the current run.
+ bool m_bMathNor;
/// If the next continous section break should be ignored.
bool m_bIgnoreNextContSectBreak;
/// If a section break is needed before the end of the doc (false right after a section break).