summaryrefslogtreecommitdiff
path: root/editeng/source/outliner
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2025-01-14 14:20:33 +0100
committerGabor Kelemen <gabor.kelemen.extern@allotropia.de>2025-01-21 13:21:26 +0100
commit5337205fdc3917760008dac77f1d0f5c4d55fef7 (patch)
treebd9772d2486f6cf7676077edfd80001183c41120 /editeng/source/outliner
parent530f51fd27127c614320bda06d25bcd70f29de99 (diff)
tdf#105083 Support status of numbering and bullet list
Shows the status of bullet/numbering in the current text selection in the toolbar buttons ToggleUnorder/OrderedList. Change-Id: I458896293c502da8142ad9cb43b5ea62a9f3b558 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180238 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Diffstat (limited to 'editeng/source/outliner')
-rw-r--r--editeng/source/outliner/outlvw.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 62fa083b0321..80b15c89b225 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -926,6 +926,45 @@ void OutlinerView::ToggleBullets()
pOwner->UndoActionEnd();
}
+bool OutlinerView::IsBulletOrNumbering(bool& bBullets, bool& bNumbering)
+{
+ //TODO: returns true if the same list is active in the selection,
+ // sets bBullets/bNumbering if the related list type is found
+ bool bBulletFound = false;
+ bool bNumberingFound = false;
+
+ ESelection aSel( pEditView->GetSelection() );
+ aSel.Adjust();
+ for (sal_Int32 nPara = aSel.start.nPara; nPara <= aSel.end.nPara; nPara++)
+ {
+ Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
+ DBG_ASSERT(pPara, "OutlinerView::IsBulletOrNumbering(), illegal selection?");
+
+ if( pPara )
+ {
+ if (pOwner->GetDepth(nPara) < 0)
+ return false;
+ const SvxNumberFormat* pFmt = pOwner ->GetNumberFormat(nPara);
+ if (pFmt)
+ {
+ sal_Int16 nNumType = pFmt->GetNumberingType();
+ if (nNumType != SVX_NUM_BITMAP && nNumType != SVX_NUM_CHAR_SPECIAL)
+ bNumberingFound = true;
+ else
+ bBulletFound = true;
+ }
+ }
+ }
+ if (bNumberingFound)
+ {
+ if (bBulletFound)
+ return false;
+ bNumbering = true;
+ }
+ else
+ bBullets = true;
+ return true;
+}
void OutlinerView::ToggleBulletsNumbering(
const bool bToggle,