[Libreoffice-commits] core.git: Branch 'libreoffice-4-1-6' - writerfilter/source

Caolán McNamara caolanm at redhat.com
Tue Apr 22 06:23:26 PDT 2014


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 16f5d0504c3385a746c8936318d55082ce30998d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 11 11:10:14 2014 +0100

    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 at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 1a8d06881ee7ba679da8b7cc37b53a20a04ee3e8)
    Reviewed-on: https://gerrit.libreoffice.org/9127
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b0cde8d..21416e2 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();
 


More information about the Libreoffice-commits mailing list