summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-11 11:10:14 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-04-22 13:22:58 +0000
commit16f5d0504c3385a746c8936318d55082ce30998d (patch)
treeeb6611bc7f3e93ce5e2c794de325171ea68406fa
parent96c60b814c487a23aa7d1ae8db4407304a50b097 (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> (cherry picked from commit 1a8d06881ee7ba679da8b7cc37b53a20a04ee3e8) Reviewed-on: https://gerrit.libreoffice.org/9127 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx7
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();