summaryrefslogtreecommitdiff
path: root/svx/source/outliner/outlvw.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/outliner/outlvw.cxx')
-rw-r--r--svx/source/outliner/outlvw.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx
index a415692ad4..73e5d7617c 100644
--- a/svx/source/outliner/outlvw.cxx
+++ b/svx/source/outliner/outlvw.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -1192,7 +1192,11 @@ void OutlinerView::ToggleBullets()
}
}
- USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount()-1);
+ // --> OD 2009-03-10 #i100014#
+ // It is not a good idea to substract 1 from a count and cast the result
+ // to USHORT without check, if the count is 0.
+ USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount());
+ // <--
pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount );
pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) );
@@ -1222,7 +1226,11 @@ void OutlinerView::EnableBullets()
}
}
- USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount()-1);
+ // --> OD 2009-03-10 #i100014#
+ // It is not a good idea to substract 1 from a count and cast the result
+ // to USHORT without check, if the count is 0.
+ USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount());
+ // <--
pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount );
pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) );
@@ -1235,7 +1243,7 @@ void OutlinerView::EnableBullets()
void OutlinerView::RemoveAttribsKeepLanguages( BOOL bRemoveParaAttribs )
{
RemoveAttribs( bRemoveParaAttribs, 0, TRUE /*keep language attribs*/ );
-}
+}
void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL bKeepLanguages )
{