diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-11 11:10:14 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-04-13 12:16:18 +0200 |
commit | 52e8cf6b55ace96d962d3f3ef1dd4cce28858c86 (patch) | |
tree | 88799c843bfc4cf549f2ad9aa8ca3adbd33c9061 | |
parent | 47ac8726523a75eac3f119a7dae4a831c33a5c02 (diff) |
check that stacks are not empty before top()
Change-Id: Iad5b3381b8201c5ac32a5bdf99bd3d5872ea3afc
(cherry picked from commit a1ea3838adee634ccf725bc5f2be7805c6294a16)
Reviewed-on: https://gerrit.libreoffice.org/8933
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 6f908a81cad3..a696e12df0c5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1245,6 +1245,9 @@ void DomainMapper_Impl::appendTextContent( const uno::Sequence< beans::PropertyValue > xPropertyValues ) { + SAL_WARN_IF(m_aTextAppendStack.empty(), "writerfilter.dmapper", "no text append stack"); + if (m_aTextAppendStack.empty()) + return; uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( m_aTextAppendStack.top().xTextAppend, uno::UNO_QUERY ); OSL_ENSURE( xTextAppendAndConvert.is(), "trying to append a text content without XTextAppendAndConvert" ); if(xTextAppendAndConvert.is() && ! getTableManager( ).isIgnore()) @@ -1294,7 +1297,9 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO // gives a better ( visually ) result xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ), uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) ); // remove ( if valid ) associated shape ( used for graphic replacement ) - m_aAnchoredStack.top( ).bToRemove = true; + SAL_WARN_IF(m_aAnchoredStack.empty(), "writerfilter.dmapper", "no anchor stack"); + if (!m_aAnchoredStack.empty()) + m_aAnchoredStack.top( ).bToRemove = true; RemoveLastParagraph(); m_aTextAppendStack.pop(); |