fftester: another null DestinationText

Change-Id: I84bf3788ac092c491d7c5a9f86421f1cf9f3e814
This commit is contained in:
Caolán McNamara
2016-07-29 09:18:16 +01:00
parent 0dd2216534
commit f9ae1b31f7
3 changed files with 20 additions and 19 deletions

View File

@@ -190,11 +190,13 @@ static util::DateTime lcl_getDateTime(RTFParserState& aState)
aState.nDay, aState.nMonth, aState.nYear, false); aState.nDay, aState.nMonth, aState.nYear, false);
} }
static void lcl_DestinationToMath(OUStringBuffer& rDestinationText, oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor) static void lcl_DestinationToMath(OUStringBuffer* pDestinationText, oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor)
{
OUString aStr = rDestinationText.makeStringAndClear();
if (!aStr.isEmpty())
{ {
if (!pDestinationText)
return;
OUString aStr = pDestinationText->makeStringAndClear();
if (aStr.isEmpty())
return;
rMathBuffer.appendOpeningTag(M_TOKEN(r)); rMathBuffer.appendOpeningTag(M_TOKEN(r));
if (rMathNor) if (rMathNor)
{ {
@@ -210,7 +212,6 @@ static void lcl_DestinationToMath(OUStringBuffer& rDestinationText, oox::formula
rMathBuffer.appendClosingTag(M_TOKEN(t)); rMathBuffer.appendClosingTag(M_TOKEN(t));
rMathBuffer.appendClosingTag(M_TOKEN(r)); rMathBuffer.appendClosingTag(M_TOKEN(r));
} }
}
RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& xContext, RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& xContext,
uno::Reference<io::XInputStream> const& xInputStream, uno::Reference<io::XInputStream> const& xInputStream,
@@ -1768,7 +1769,7 @@ RTFError RTFDocumentImpl::pushState()
m_aStates.top().eRunType = RTFParserState::RunType::LOCH; m_aStates.top().eRunType = RTFParserState::RunType::LOCH;
if (m_aStates.top().eDestination == Destination::MR) if (m_aStates.top().eDestination == Destination::MR)
lcl_DestinationToMath(*m_aStates.top().pDestinationText, m_aMathBuffer, m_bMathNor); lcl_DestinationToMath(m_aStates.top().pDestinationText, m_aMathBuffer, m_bMathNor);
m_aStates.push(m_aStates.top()); m_aStates.push(m_aStates.top());
} }
m_aStates.top().aDestinationText.setLength(0); // was copied: always reset! m_aStates.top().aDestinationText.setLength(0); // was copied: always reset!
@@ -2463,7 +2464,7 @@ RTFError RTFDocumentImpl::popState()
} }
break; break;
case Destination::MR: case Destination::MR:
lcl_DestinationToMath(*m_aStates.top().pDestinationText, m_aMathBuffer, m_bMathNor); lcl_DestinationToMath(m_aStates.top().pDestinationText, m_aMathBuffer, m_bMathNor);
break; break;
case Destination::MF: case Destination::MF:
m_aMathBuffer.appendClosingTag(M_TOKEN(f)); m_aMathBuffer.appendClosingTag(M_TOKEN(f));