summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/outliner/outlvw.cxx39
-rw-r--r--include/editeng/outliner.hxx1
-rw-r--r--sd/source/ui/func/futext.cxx1
-rw-r--r--sd/source/ui/view/drtxtob.cxx44
-rw-r--r--sd/source/ui/view/drtxtob1.cxx3
-rw-r--r--sd/source/ui/view/drviews2.cxx3
-rw-r--r--sd/source/ui/view/drviewsf.cxx11
-rw-r--r--svx/source/svdraw/svdedxv.cxx11
8 files changed, 107 insertions, 6 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,
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index d1d46dc67326..2948bf6bdfdd 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -317,6 +317,7 @@ public:
or disables bullets/numbering for the selected paragraphs if the bullets/numbering of the first paragraph is on
*/
void ToggleBullets();
+ bool IsBulletOrNumbering(bool& bBullets, bool& bNumbering);
void ToggleBulletsNumbering(
const bool bToggle,
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 799dc51c42aa..59f7558e7aa8 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -126,6 +126,7 @@ const sal_uInt16 SidArray[] = {
SID_PARASPACE_INCREASE, // 11145
SID_PARASPACE_DECREASE, // 11146
FN_NUM_BULLET_ON, // 20138
+ FN_NUM_NUMBERING_ON, // 20144
0 };
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 3e800881960b..92c0d8a62b52 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -53,6 +53,7 @@
#include <sfx2/objface.hxx>
#include <drawdoc.hxx>
+#include <drawview.hxx>
#include <DrawDocShell.hxx>
#include <DrawViewShell.hxx>
#include <OutlineViewShell.hxx>
@@ -444,6 +445,49 @@ void TextObjectBar::GetAttrStateImpl(ViewShell* mpViewShell, ::sd::View* mpView,
}
break;
+ case FN_NUM_BULLET_ON:
+ case FN_NUM_NUMBERING_ON:
+ {
+ bool bEnable = false;
+ const DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+ if (pDrawViewShell)
+ {
+ SdrView* pDrawView = pDrawViewShell->GetDrawView();
+ //TODO: is pDrawView always available?
+ const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList();
+ const size_t nMarkCount = rMarkList.GetMarkCount();
+ for (size_t nIndex = 0; nIndex < nMarkCount; ++nIndex)
+ {
+ SdrTextObj* pTextObj = DynCastSdrTextObj(rMarkList.GetMark(nIndex)->GetMarkedSdrObj());
+ if (pTextObj && pTextObj->GetObjInventor() == SdrInventor::Default)
+ {
+ if (pTextObj->GetObjIdentifier() != SdrObjKind::OLE2)
+ {
+ bEnable = true;
+ break;
+ }
+ }
+ }
+ if (bEnable)
+ {
+ bool bIsBullet = false;
+ bool bIsNumbering = false;
+ OutlinerView* pOlView = pDrawView->GetTextEditOutlinerView();
+ if (pOlView)
+ {
+ pOlView->IsBulletOrNumbering(bIsBullet, bIsNumbering);
+ }
+ rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, bIsBullet));
+ rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, bIsNumbering));
+ }
+ else
+ {
+ rSet.DisableItem(FN_NUM_BULLET_ON);
+ rSet.DisableItem(FN_NUM_NUMBERING_ON);
+ }
+ }
+ }
+ break;
default:
break;
}
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index ad497a5db1ec..b0fbe31bc984 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -476,6 +476,9 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR
}
}
}
+ SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
+ rBindings.Invalidate( FN_NUM_BULLET_ON );
+ rBindings.Invalidate( FN_NUM_NUMBERING_ON );
}
break;
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index ce9359fbebc3..fc011865e7fa 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1521,6 +1521,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
SetCurrentFunction( FuBulletAndPosition::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq ) );
Cancel();
+ SfxBindings& rBindings = GetViewFrame()->GetBindings();
+ rBindings.Invalidate( FN_NUM_BULLET_ON );
+ rBindings.Invalidate( FN_NUM_NUMBERING_ON );
}
break;
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 8444d9129b57..d864a3c1ecd0 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -704,8 +704,15 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
}
if (bEnable)
{
- rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, false));
- rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, false));
+ bool bIsBullet = false;
+ bool bIsNumbering = false;
+ OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
+ if (pOlView)
+ {
+ pOlView->IsBulletOrNumbering(bIsBullet, bIsNumbering);
+ }
+ rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, bIsBullet));
+ rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, bIsNumbering));
}
else
{
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 374c38baf00e..cd7cb89b2e05 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2830,10 +2830,13 @@ sal_uInt16 SdrObjEditView::GetSelectionLevel() const
for (sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++)
{
sal_Int16 nDepth = mpTextEditOutliner->GetDepth(nPara);
- assert(nDepth >= 0 && nDepth <= 15);
- sal_uInt16 nParaDepth = 1 << static_cast<sal_uInt16>(nDepth);
- if (!(nLevel & nParaDepth))
- nLevel += nParaDepth;
+ assert(nDepth <= 15);
+ if (nDepth >= 0)
+ {
+ sal_uInt16 nParaDepth = 1 << static_cast<sal_uInt16>(nDepth);
+ if (!(nLevel & nParaDepth))
+ nLevel += nParaDepth;
+ }
}
//reduce one level for Outliner Object
//if( nLevel > 0 && GetTextEditObject()->GetObjIdentifier() == OBJ_OUTLINETEXT )