diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-11 11:10:14 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-04-11 12:09:26 +0000 |
commit | 1a8d06881ee7ba679da8b7cc37b53a20a04ee3e8 (patch) | |
tree | dad357ba59e552a27b3a1e662345007413aa5c6b | |
parent | 19d01c838c779d3326c65a798aa39cfc51bcd15e (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 b0cde8d58f27..21416e29c703 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1242,6 +1242,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()) @@ -1291,7 +1294,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(); |