bdf5242
From 7d53f81f0a88afcff0f60bbd066a5645ac2e6a8b Mon Sep 17 00:00:00 2001
bdf5242
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
bdf5242
Date: Fri, 14 Mar 2014 15:30:31 +0000
bdf5242
Subject: [PATCH] Related: rhbz#1075951 abrt crash in
bdf5242
 MSWordExportBase::OutputFormat
bdf5242
bdf5242
Change-Id: I681fa40196eb04f4824e49458cba0acc15b26193
bdf5242
---
bdf5242
 sw/source/filter/ww8/ww8atr.cxx | 7 +++++--
bdf5242
 1 file changed, 5 insertions(+), 2 deletions(-)
bdf5242
bdf5242
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
bdf5242
index 7eb3134..da25acc 100644
bdf5242
--- a/sw/source/filter/ww8/ww8atr.cxx
bdf5242
+++ b/sw/source/filter/ww8/ww8atr.cxx
bdf5242
@@ -745,10 +745,13 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
bdf5242
     case RES_TXTFMTCOLL:
bdf5242
         if( bPapFmt )
bdf5242
         {
bdf5242
+            int nLvl = MAXLEVEL;
bdf5242
+
bdf5242
             if (((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
bdf5242
-            {
bdf5242
-                int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel();
bdf5242
+                nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel();
bdf5242
 
bdf5242
+            if (nLvl >= 0 && nLvl < MAXLEVEL)
bdf5242
+            {
bdf5242
                 //if outline numbered
bdf5242
                 // if Write StyleDefinition then write the OutlineRule
bdf5242
                 const SwNumFmt& rNFmt = pDoc->GetOutlineNumRule()->Get( static_cast<sal_uInt16>( nLvl ) );
bdf5242
-- 
bdf5242
1.8.5.3
bdf5242