drviewsf.cxx (766ce4d0) drviewsf.cxx (1ff378ef)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 492 unchanged lines hidden (view full) ---

501 case SID_STYLE_UPDATE_BY_EXAMPLE:
502 {
503 if (!mpDrawView->AreObjectsMarked())
504 {
505 rSet.DisableItem(nWhich);
506 }
507 }
508 break;
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 492 unchanged lines hidden (view full) ---

501 case SID_STYLE_UPDATE_BY_EXAMPLE:
502 {
503 if (!mpDrawView->AreObjectsMarked())
504 {
505 rSet.DisableItem(nWhich);
506 }
507 }
508 break;
509 case FN_BUL_NUM_RULE_INDEX:
510 case FN_NUM_NUM_RULE_INDEX:
511 {
512 SfxItemSet aEditAttr( GetDoc()->GetPool() );
513 mpDrawView->GetAttributes( aEditAttr );
514
515 SfxItemSet aNewAttr( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
516 aNewAttr.Put( aEditAttr, sal_False );
517
518
519 sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
520 SvxNumRule* pNumRule = NULL;
521 const SfxPoolItem* pTmpItem=NULL;
522 sal_uInt16 nNumItemId = SID_ATTR_NUMBERING_RULE;
523
524 //if(SFX_ITEM_SET == aNewAttr.GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pTmpItem))
525 // nActNumLvl = ((const SfxUInt16Item*)pTmpItem)->GetValue();
526 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE));
527 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE));
528 nActNumLvl = mpDrawView->GetSelectionLevel();
529 pTmpItem=GetNumBulletItem(aNewAttr, nNumItemId);
530
531 if (pTmpItem)
532 pNumRule = new SvxNumRule(*((SvxNumBulletItem*)pTmpItem)->GetNumRule());
533
534 if ( pNumRule )
535 {
536 sal_uInt16 nMask = 1;
537 sal_uInt16 nCount = 0;
538 sal_uInt16 nCurLevel = (sal_uInt16)0xFFFF;
539 for(sal_uInt16 i = 0; i < pNumRule->GetLevelCount(); i++)
540 {
541 if(nActNumLvl & nMask)
542 {
543 nCount++;
544 nCurLevel = i;
545 }
546 nMask <<= 1;
547 }
548 if ( nCount == 1 )
549 {
550 sal_Bool bBullets = sal_False;
551 const SvxNumberFormat* pNumFmt = pNumRule->Get(nCurLevel);
552 if ( pNumFmt )
553 {
554 switch(pNumFmt->GetNumberingType())
555 {
556 case SVX_NUM_CHAR_SPECIAL:
557 case SVX_NUM_BITMAP:
558 bBullets = sal_True;
559 break;
560
561 default:
562 bBullets = sal_False;
563 }
564
565 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
566 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
567 if ( bBullets )
568 {
569 NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS);
570 if ( pBullets )
571 {
572 sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
573 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,nBulIndex));
574 }
575 }else
576 {
577 NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING);
578 if ( pNumbering )
579 {
580 sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
581 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex));
582 }
583 }
584 }
585 }
586 }
587 }
588 break;
589 //End
590 // Added by Li Hui for story 179.
591 case FN_NUM_BULLET_ON:
592 case FN_NUM_NUMBERING_ON:
593 {
594 sal_Bool bEnable = sal_False;
595 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
596 const ULONG nMarkCount = rMarkList.GetMarkCount();
597 for (ULONG nIndex = 0; nIndex < nMarkCount; nIndex++)
598 {
599 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(rMarkList.GetMark(nIndex)->GetMarkedSdrObj());
600 if (pTextObj && pTextObj->GetObjInventor() == SdrInventor)
601 {
602 if (pTextObj->GetObjIdentifier() != OBJ_OLE2)
603 {
604 bEnable = sal_True;
605 break;
606 }
607 }
608 }
609 if (bEnable)
610 {
611 rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_False));
612 rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, sal_False));
613 }
614 else
615 {
616 rSet.DisableItem(FN_NUM_BULLET_ON);
617 rSet.DisableItem(FN_NUM_NUMBERING_ON);
618 }
619 }
620 break;
509 }
510 nWhich = aIter.NextWhich();
511 }
512
513 SfxItemSet* pSet = NULL;
514
515 if( bAttr )
516 {

--- 128 unchanged lines hidden ---
621 }
622 nWhich = aIter.NextWhich();
623 }
624
625 SfxItemSet* pSet = NULL;
626
627 if( bAttr )
628 {

--- 128 unchanged lines hidden ---