diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-05 19:29:07 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-05 19:29:07 +0100 |
commit | 871e01af03cebccec8b84cd998cc9525e665a5f9 (patch) | |
tree | c51b04950c734dc378db3e89faed550516608cf6 /cui/source/tabpages/numpages.cxx | |
parent | f8ce8c1eac6e00c00e1bd168ed831c8c0f758522 (diff) | |
parent | 936124154d6dfb50b1342a58ddc3dea5aeed3f03 (diff) |
merge to m67
Diffstat (limited to 'cui/source/tabpages/numpages.cxx')
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 133 |
1 files changed, 102 insertions, 31 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 82ec72f4e..c1a4d7690 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -372,12 +372,24 @@ int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; +// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); if(!pActNum) pActNum = new SvxNumRule(*pSaveNum); @@ -558,12 +570,24 @@ int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); // nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); @@ -783,12 +807,24 @@ int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxNumPickTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); // nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); if(!pActNum) @@ -1083,12 +1119,24 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet ) void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); if(!pActNum) pActNum = new SvxNumRule(*pSaveNum); @@ -1510,12 +1558,24 @@ BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet ) --------------------------------------------------*/ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); // Ebenen einfuegen if(!aLevelLB.GetEntryCount()) @@ -1559,7 +1619,6 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet ) pPreviewWIN->SetNumRule(pActNum); aSameLevelCB.Check(pActNum->IsContinuousNumbering()); - const SfxPoolItem* pItem = 0; //ColorListBox bei Bedarf fuellen if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) ) { @@ -3403,12 +3462,24 @@ BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet ) --------------------------------------------------*/ void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet ) { - nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; - - const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); - + const SfxPoolItem* pItem; + //im Draw gibt es das Item als WhichId, im Writer nur als SlotId + SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); + if(eState != SFX_ITEM_SET) + { + nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); + eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); + + if( eState != SFX_ITEM_SET ) + { + pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + eState = SFX_ITEM_SET; + } + + } + DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); delete pSaveNum; - pSaveNum = new SvxNumRule(*rItem.GetNumRule()); + pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); // Ebenen einfuegen if(!aLevelLB.GetEntryCount()) |