summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCao Cuong Ngo <cao.cuong.ngo@gmail.com>2013-04-10 20:41:54 +0200
committerEike Rathke <erack@redhat.com>2013-04-13 15:06:21 +0000
commit5785db93c5739846fb0a84b138be485044d4bda5 (patch)
tree24e3aa42bb3f8d618ab25c094d5dfa13e27264df
parente70d6fbf4610563b7ff31d0e6393b70b4b0e6510 (diff)
fdo#47018 Impress crashes when modifying bullet
Default numbering rules shouldn't be left zero nor hard-coded. Change-Id: I8a34331006abf3de8c170f8dca43ccf9cec92f04 Reviewed-on: https://gerrit.libreoffice.org/3312 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--editeng/source/editeng/eerdll.cxx6
-rw-r--r--editeng/source/uno/unonrule.cxx3
-rw-r--r--filter/source/msfilter/svdfppt.cxx7
-rw-r--r--sd/source/core/drawdoc4.cxx3
-rw-r--r--sd/source/core/stlpool.cxx5
5 files changed, 15 insertions, 9 deletions
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 59086ea31666..c6a008df7eb8 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -36,6 +36,7 @@
#include <editeng/flditem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/scriptspaceitem.hxx>
+#include <editeng/numdef.hxx>
#include <svl/itempool.hxx>
#include <vcl/virdev.hxx>
@@ -98,14 +99,15 @@ SfxPoolItem** GlobalEditData::GetDefItems()
ppDefItems = new SfxPoolItem*[EDITITEMCOUNT];
// Paragraph attributes:
- SvxNumRule aTmpNumRule( 0, 0, sal_False );
+ SvxNumRule aDefaultNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE,
+ SVX_MAX_NUM, sal_False );
ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR );
ppDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS );
ppDefItems[2] = new SfxBoolItem( EE_PARA_HANGINGPUNCTUATION, sal_False );
ppDefItems[3] = new SfxBoolItem( EE_PARA_FORBIDDENRULES, sal_True );
ppDefItems[4] = new SvxScriptSpaceItem( sal_True, EE_PARA_ASIANCJKSPACING );
- ppDefItems[5] = new SvxNumBulletItem( aTmpNumRule, EE_PARA_NUMBULLET );
+ ppDefItems[5] = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET );
ppDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, sal_False );
ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, sal_True );
ppDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE );
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index ea028e1d90aa..cce9583619e2 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -34,6 +34,7 @@
#include <editeng/unofdesc.hxx>
#include <editeng/unonrule.hxx>
#include <editeng/editids.hrc>
+#include <editeng/numdef.hxx>
using ::com::sun::star::util::XCloneable;
using ::com::sun::star::ucb::XAnyCompare;
@@ -490,7 +491,7 @@ com::sun::star::uno::Reference< com::sun::star::container::XIndexReplace > SvxCr
}
else
{
- SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False);
+ SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM , sal_False);
return new SvxUnoNumberingRules( aDefaultRule );
}
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 1de1b2eb82a8..f8530c1d2fa4 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -47,6 +47,7 @@
#include <svx/svdocapt.hxx>
#include <svx/svdotable.hxx>
#include <editeng/outlobj.hxx>
+#include <editeng/numdef.hxx>
#include <svx/svdattr.hxx>
#include "svx/xattr.hxx"
#include "svx/svditext.hxx"
@@ -4295,20 +4296,20 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
eNumRuleType = SVX_RULETYPE_NUMBERING;
break;
case TSS_TYPE_SUBTITLE :
- nLevels = 10;
+ nLevels = SVX_MAX_NUM;
eNumRuleType = SVX_RULETYPE_NUMBERING;
break;
case TSS_TYPE_BODY :
case TSS_TYPE_HALFBODY :
case TSS_TYPE_QUARTERBODY :
- nLevels = 10;
+ nLevels = SVX_MAX_NUM;
eNumRuleType = SVX_RULETYPE_PRESENTATION_NUMBERING;
break;
default :
case TSS_TYPE_NOTES :
case TSS_TYPE_UNUSED :
case TSS_TYPE_TEXT_IN_SHAPE :
- nLevels = 10;
+ nLevels = SVX_MAX_NUM;
eNumRuleType = SVX_RULETYPE_NUMBERING;
break;
}
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 3cdfe86f373a..abbd02b492d4 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -40,6 +40,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lspcitem.hxx>
#include <editeng/adjustitem.hxx>
+#include <editeng/numdef.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx> // SVX_RESSTR
#include <editeng/bulletitem.hxx>
@@ -1223,7 +1224,7 @@ void SdDrawDocument::SetTextDefaults() const
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10, sal_False);
+ SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM, sal_False);
aNumberFormat.SetLSpace( 0 );
aNumberFormat.SetAbsLSpace( 0 );
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index d11de4298920..4f4fb64fb556 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -49,6 +49,7 @@
#include <editeng/bulletitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/adjustitem.hxx>
+#include <editeng/numdef.hxx>
#include <svl/itempool.hxx>
#include "stlpool.hxx"
@@ -989,7 +990,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False);
+ SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM , sal_False);
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
@@ -1045,7 +1046,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,
- 10, sal_False );
+ SVX_MAX_NUM, sal_False );
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34