summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-12-05 19:29:07 +0100
committerMathias Bauer <mba@openoffice.org>2009-12-05 19:29:07 +0100
commit871e01af03cebccec8b84cd998cc9525e665a5f9 (patch)
treec51b04950c734dc378db3e89faed550516608cf6 /cui
parentf8ce8c1eac6e00c00e1bd168ed831c8c0f758522 (diff)
parent936124154d6dfb50b1342a58ddc3dea5aeed3f03 (diff)
merge to m67
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx6
-rw-r--r--cui/source/tabpages/numpages.cxx133
2 files changed, 105 insertions, 34 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index a638be860..9731e3bd0 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -67,11 +67,11 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, BOOL bOne, const SfxItemSet*
if ( pItem )
bOne = pItem->GetValue();
+ mpCharMapData = new SvxCharMapData( this, bOne, &CUI_MGR() );
+
SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR, FALSE );
if ( pCharItem )
- SetChar( pItem->GetValue() );
-
- mpCharMapData = new SvxCharMapData( this, bOne, &CUI_MGR() );
+ SetChar( pCharItem->GetValue() );
SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2, FALSE );
if ( pDisableItem && pDisableItem->GetValue() )
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())