summaryrefslogtreecommitdiff
path: root/editeng/source/outliner/outliner.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/outliner/outliner.cxx')
-rw-r--r--editeng/source/outliner/outliner.cxx47
1 files changed, 47 insertions, 0 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 50127c68c787..e703b36408a9 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -370,6 +370,53 @@ void Outliner::SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumb
}
}
+sal_Int16 Outliner::GetBulletsNumberingStatus()
+{
+ sal_Bool bHasBulletsNumbering = FALSE;
+ sal_uInt16 nParaCount = (sal_uInt16)(pParaList->GetParagraphCount());
+ for (sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ {
+ if ((bHasBulletsNumbering = ImplHasBullet(nPara)))
+ {
+ break;
+ }
+ }
+ sal_uInt16 nBulletsCount = 0;
+ sal_uInt16 nNumberingCount = 0;
+ if (bHasBulletsNumbering)
+ {
+ // At least have one paragraph that having bullets or numbering.
+ for (sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ {
+ Paragraph* pPara = pParaList->GetParagraph(nPara);
+ const SfxItemSet& rAttrs = GetParaAttribs(nPara);
+ if (!pPara)
+ {
+ continue;
+ }
+ const SvxNumberFormat* pFmt = GetNumberFormat(nPara);
+ if (!pFmt)
+ {
+ // At least, exists one paragraph that has no Bullets/Numbering.
+ break;
+ }
+ else if ((pFmt->GetNumberingType() == SVX_NUM_BITMAP) || (pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL))
+ {
+ // Having Bullets in this paragraph.
+ nBulletsCount++;
+ }
+ else
+ {
+ // Having Numbering in this paragraph.
+ nNumberingCount++;
+ }
+ }
+ }
+ sal_Int16 nValue = (nBulletsCount == nParaCount) ? 0 : 2;
+ nValue = (nNumberingCount == nParaCount) ? 1 : nValue;
+ return nValue;
+}
+
OutlinerParaObject* Outliner::CreateParaObject( sal_uInt16 nStartPara, sal_uInt16 nCount ) const
{
DBG_CHKTHIS(Outliner,0);