convert SfxItemState constants to a proper enum

and while we're at it
- use the enum type all over the place instead of passing around
sal_uInt16
- don't use bitwise logic on enum values
- use enum values instead of numeric constants

Change-Id: I7f24cb4d242e1c00703e7bbcf1a00c18ef1e9fd4
This commit is contained in:
Noel Grandin
2014-07-23 13:26:19 +02:00
parent 11e66edd0e
commit 88a874fcb3
32 changed files with 88 additions and 76 deletions
@@ -153,7 +153,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
m_pCbShowDescription->Check( bCheck );
if( ( aState & SFX_ITEM_DEFAULT ) == 0 )
if( aState != SFX_ITEM_DEFAULT )
m_pCbShowDescription->Hide();
}
@@ -201,7 +201,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
m_pCbTextOverlap->Check( bCheck );
if( ( aState & SFX_ITEM_DEFAULT ) == 0 )
if( aState != SFX_ITEM_DEFAULT )
m_pCbTextOverlap->Hide();
}
@@ -220,7 +220,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
m_pCbTextBreak->Check( bCheck );
if( ( aState & SFX_ITEM_DEFAULT ) == 0 )
if( aState != SFX_ITEM_DEFAULT )
{
m_pCbTextBreak->Hide();
if( ! m_pCbTextOverlap->IsVisible() )
+2
View File
@@ -812,6 +812,8 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
pLangBox->SelectLanguage( eLangType );
break;
}
case SFX_ITEM_DONTCARE:
break;
}
OUString sMapText(pFontList->GetFontMapText(
+1 -1
View File
@@ -2187,7 +2187,7 @@ static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, CheckBox& rBo
{
sal_uInt16 _nWhich = rSet.GetPool()->GetWhich(nSlotId);
SfxItemState eState = rSet.GetItemState(_nWhich, true);
if(!eState || eState == SFX_ITEM_DISABLED )
if( eState == SFX_ITEM_UNKNOWN || eState == SFX_ITEM_DISABLED )
rBox.Enable(false);
else if(eState >= SFX_ITEM_AVAILABLE)
{
+1 -1
View File
@@ -594,7 +594,7 @@ void SvxColorTabPage::UpdateModified()
void SvxColorTabPage::Reset( const SfxItemSet* rSet )
{
sal_uInt16 nState = rSet->GetItemState( XATTR_FILLCOLOR );
SfxItemState nState = rSet->GetItemState( XATTR_FILLCOLOR );
Color aNewColor;
+2 -2
View File
@@ -553,7 +553,7 @@ void SvxAccessibleTextAdapter::GetPortions( sal_Int32 nPara, std::vector<sal_Int
mpTextForwarder->GetPortions( nPara, rList );
}
sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
SfxItemState SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
{
assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder");
@@ -567,7 +567,7 @@ sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_u
nWhich );
}
sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
SfxItemState SvxAccessibleTextAdapter::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder");
+3 -3
View File
@@ -165,7 +165,7 @@ void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32
rEditEngine.FieldClicked( rField, nPara, nPos );
}
sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
{
std::vector<EECharAttrib> aAttribs;
@@ -258,12 +258,12 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection&
return eState;
}
sal_uInt16 SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
SfxItemState SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
{
return GetSvxEditEngineItemState( rEditEngine, rSel, nWhich );
}
sal_uInt16 SvxEditEngineForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
SfxItemState SvxEditEngineForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const SfxItemSet& rSet = rEditEngine.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
+1 -1
View File
@@ -21,7 +21,7 @@
#define INCLUDED_EDITENG_SOURCE_UNO_UNFORED_INTERNAL_HXX
sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich );
SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich );
#endif // INCLUDED_EDITENG_SOURCE_UNO_UNFORED_INTERNAL_HXX
+2 -2
View File
@@ -244,12 +244,12 @@ bool SvxOutlinerForwarder::IsValid() const
return rOutliner.GetUpdateMode();
}
sal_uInt16 SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
SfxItemState SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
{
return GetSvxEditEngineItemState( (EditEngine&)rOutliner.GetEditEngine(), rSel, nWhich );
}
sal_uInt16 SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
SfxItemState SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
+11 -8
View File
@@ -699,7 +699,8 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt
case EE_PARA_NUMBULLET:
{
if((rSet.GetItemState( EE_PARA_NUMBULLET, true ) & (SFX_ITEM_SET|SFX_ITEM_DEFAULT)) == 0)
SfxItemState eState = rSet.GetItemState( EE_PARA_NUMBULLET, true );
if( eState != SFX_ITEM_SET && eState != SFX_ITEM_DEFAULT)
throw uno::RuntimeException();
SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)rSet.GetItem( EE_PARA_NUMBULLET, true );
@@ -740,7 +741,8 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt
case EE_PARA_BULLETSTATE:
{
bool bState = false;
if( rSet.GetItemState( EE_PARA_BULLETSTATE, true ) & (SFX_ITEM_SET|SFX_ITEM_DEFAULT))
SfxItemState eState = rSet.GetItemState( EE_PARA_BULLETSTATE, true );
if( eState == SFX_ITEM_SET || eState == SFX_ITEM_DEFAULT )
{
SfxBoolItem* pItem = (SfxBoolItem*)rSet.GetItem( EE_PARA_BULLETSTATE, true );
bState = pItem->GetValue() ? sal_True : sal_False;
@@ -971,7 +973,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt
case WID_FONTDESC:
{
const sal_uInt16* pWhichId = aSvxUnoFontDescriptorWhichMap;
SfxItemState eTempItemState;
SfxItemState eTempItemState = SFX_ITEM_UNKNOWN;
while( *pWhichId )
{
if(nPara != -1)
@@ -1039,6 +1041,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt
return beans::PropertyState_DIRECT_VALUE;
case SFX_ITEM_DEFAULT:
return beans::PropertyState_DEFAULT_VALUE;
default: break;
// case SFX_ITEM_UNKNOWN:
}
}
@@ -1118,7 +1121,7 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf
case WID_FONTDESC:
{
const sal_uInt16* pWhichId = aSvxUnoFontDescriptorWhichMap;
SfxItemState eTempItemState;
SfxItemState eTempItemState = SFX_ITEM_UNKNOWN;
while( *pWhichId )
{
eTempItemState = pSet->GetItemState( *pWhichId );
@@ -2425,14 +2428,14 @@ void SvxDummyTextSource::GetPortions( sal_Int32, std::vector<sal_Int32>& ) const
{
}
sal_uInt16 SvxDummyTextSource::GetItemState( const ESelection&, sal_uInt16 ) const
SfxItemState SvxDummyTextSource::GetItemState( const ESelection&, sal_uInt16 ) const
{
return 0;
return SFX_ITEM_UNKNOWN;
}
sal_uInt16 SvxDummyTextSource::GetItemState( sal_Int32, sal_uInt16 ) const
SfxItemState SvxDummyTextSource::GetItemState( sal_Int32, sal_uInt16 ) const
{
return 0;
return SFX_ITEM_UNKNOWN;
}
SfxItemPool* SvxDummyTextSource::GetPool() const
+3 -3
View File
@@ -42,10 +42,10 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
virtual sal_uInt16 CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex );
virtual sal_uInt16 CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex );
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
+2 -2
View File
@@ -148,8 +148,8 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const = 0;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0;
virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const = 0;
virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0;
virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const = 0;
virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) = 0;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) = 0;
+2 -2
View File
@@ -44,8 +44,8 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
+2 -2
View File
@@ -62,8 +62,8 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
+2 -2
View File
@@ -184,8 +184,8 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemPool* GetPool() const SAL_OVERRIDE;
+9 -10
View File
@@ -130,16 +130,15 @@ enum SfxItemPresentation
typedef sal_uInt16 SfxItemState;
#define SFX_ITEM_UNKNOWN 0x0000
#define SFX_ITEM_DISABLED 0x0001
#define SFX_ITEM_READONLY 0x0002
#define SFX_ITEM_DONTCARE 0x0010
#define SFX_ITEM_DEFAULT 0x0020
#define SFX_ITEM_SET 0x0030
enum SfxItemState {
// These values have to match the values in the com::sun::star::frame::status::ItemState IDL
SFX_ITEM_UNKNOWN = 0,
SFX_ITEM_DISABLED = 0x0001,
SFX_ITEM_READONLY = 0x0002,
SFX_ITEM_DONTCARE = 0x0010,
SFX_ITEM_DEFAULT = 0x0020,
SFX_ITEM_SET = 0x0030
};
// old stuff - dont use!!!
#define SFX_ITEM_AVAILABLE SFX_ITEM_DEFAULT
+1 -1
View File
@@ -139,7 +139,7 @@ throw( RuntimeException, std::exception )
{
ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
m_eState = aItemStatus.State;
m_eState = (SfxItemState) aItemStatus.State;
m_pItem = new SfxVoidItem( m_nSlotID );
}
else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility>::get() )
+1 -1
View File
@@ -203,7 +203,7 @@ throw( RuntimeException, std::exception )
{
ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
eState = aItemStatus.State;
eState = (SfxItemState) aItemStatus.State;
pItem = new SfxVoidItem( m_nSlotID );
}
else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility >::get() )
+1 -1
View File
@@ -886,7 +886,7 @@ const SfxPoolItem* SfxShell::GetSlotState
// Get Slot on the given Interface
if ( !pIF )
pIF = GetInterface();
SfxItemState eState;
SfxItemState eState = SFX_ITEM_UNKNOWN;
SfxItemPool &rPool = GetPool();
const SfxSlot* pSlot = NULL;
+1 -1
View File
@@ -184,7 +184,7 @@ SfxStateCache::SfxStateCache( sal_uInt16 nFuncId ):
pInternalController(0),
pController(0),
pLastItem( 0 ),
eLastState( 0 ),
eLastState( SFX_ITEM_UNKNOWN ),
bItemVisible( true )
{
bCtrlDirty = true;
+1 -1
View File
@@ -290,7 +290,7 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
{
frame::status::ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
eState = aItemStatus.State;
eState = (SfxItemState) aItemStatus.State;
pItem = new SfxVoidItem( nSlotID );
}
else
+4 -2
View File
@@ -548,7 +548,7 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
{
ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
eState = aItemStatus.State;
eState = (SfxItemState) aItemStatus.State;
pItem = new SfxVoidItem( nSlotId );
}
else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility>::get() )
@@ -939,6 +939,8 @@ void SfxToolBoxControl::StateChanged
nItemBits |= TIB_CHECKABLE;
}
break;
default: break; // do nothing
}
pImpl->pBox->SetItemState( GetId(), eTri );
@@ -1094,7 +1096,7 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
{
ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
eState = aItemStatus.State;
eState = (SfxItemState) aItemStatus.State;
pItem = new SfxVoidItem( nSlotId );
}
else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility>::get() )
+5 -5
View File
@@ -1112,7 +1112,7 @@ void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_Int32, sal_Int32)
{
}
static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
static SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
{
std::vector<EECharAttrib> aAttribs;
@@ -1204,18 +1204,18 @@ static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESel
return eState;
}
sal_uInt16 SmTextForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
SfxItemState SmTextForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
{
sal_uInt16 nState = SFX_ITEM_DISABLED;
SfxItemState nState = SFX_ITEM_DISABLED;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
if (pEditEngine)
nState = GetSvxEditEngineItemState( *pEditEngine, rSel, nWhich );
return nState;
}
sal_uInt16 SmTextForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
SfxItemState SmTextForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
sal_uInt16 nState = SFX_ITEM_DISABLED;
SfxItemState nState = SFX_ITEM_DISABLED;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
if (pEditEngine)
{
+2 -2
View File
@@ -210,8 +210,8 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
+3 -2
View File
@@ -737,7 +737,8 @@ void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
{
// special case: exactly one sal_uInt16 which is already included?
if ( nFrom == nTo && SFX_ITEM_AVAILABLE <= GetItemState(nFrom, false) )
SfxItemState eItemState = GetItemState(nFrom, false);
if ( nFrom == nTo && ( eItemState == SFX_ITEM_DEFAULT || eItemState == SFX_ITEM_SET ) )
return;
// merge new range
@@ -1096,7 +1097,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
sal_uInt16 nWhich = IsInvalidItem( pItem )
? GetWhichByPos( aIter.GetCurPos() )
: pItem->Which();
if( 0 == rSet.GetItemState( nWhich, false ) )
if( SFX_ITEM_UNKNOWN == rSet.GetItemState( nWhich, false ) )
ClearItem( nWhich ); // loeschen
if( aIter.IsAtEnd() )
break;
@@ -107,8 +107,8 @@ namespace accessibility
void RemoveAttribs( const ESelection& /*rSelection*/, bool /*bRemoveParaAttribs*/, sal_uInt16 /*nWhich*/ ) SAL_OVERRIDE {}
void GetPortions( sal_Int32 /*nPara*/, std::vector<sal_Int32>& /*rList*/ ) const SAL_OVERRIDE {}
sal_uInt16 GetItemState( const ESelection& /*rSel*/, sal_uInt16 /*nWhich*/ ) const SAL_OVERRIDE { return 0; }
sal_uInt16 GetItemState( sal_Int32 /*nPara*/, sal_uInt16 /*nWhich*/ ) const SAL_OVERRIDE { return 0; }
SfxItemState GetItemState( const ESelection& /*rSel*/, sal_uInt16 /*nWhich*/ ) const SAL_OVERRIDE { return SFX_ITEM_UNKNOWN; }
SfxItemState GetItemState( sal_Int32 /*nPara*/, sal_uInt16 /*nWhich*/ ) const SAL_OVERRIDE { return SFX_ITEM_UNKNOWN; }
SfxItemPool* GetPool() const SAL_OVERRIDE { return NULL; }
+1
View File
@@ -325,6 +325,7 @@ OUString _SdrItemBrowserControl::GetCellText(long _nRow, sal_uInt16 _nColId) con
case SFX_ITEM_DONTCARE: sRet = "DontCare"; break;
case SFX_ITEM_SET : sRet = "Set"; break;
case SFX_ITEM_DEFAULT : sRet = "Default"; break;
case SFX_ITEM_READONLY: sRet = "ReadOnly"; break;
} // switch
} break;
case ITEMBROWSER_TYPECOL_ID: sRet = pEntry->GetItemTypeStr(); break;
+1 -1
View File
@@ -96,7 +96,7 @@ void FormatPaintBrushToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/)
void FormatPaintBrushToolBoxControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
if( ( eState & SFX_ITEM_SET ) == 0 )
if( eState != SFX_ITEM_SET )
m_bPersistentCopy = false;
SfxToolBoxControl::StateChanged( nSID, eState, pState );
}
+3
View File
@@ -2078,6 +2078,9 @@ void SvxStyleToolBoxControl::StateChanged(
case SFX_ITEM_DONTCARE:
eTri = TRISTATE_INDET;
break;
default:
break;
}
rTbx.SetItemState( nId, eTri );
@@ -4148,9 +4148,9 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// Safe numrule item at destination.
// #i86492# - Safe also <ListId> item of destination.
int aNumRuleState = SFX_ITEM_UNKNOWN;
SfxItemState aNumRuleState = SFX_ITEM_UNKNOWN;
SwNumRuleItem aNumRuleItem;
int aListIdState = SFX_ITEM_UNKNOWN;
SfxItemState aListIdState = SFX_ITEM_UNKNOWN;
SfxStringItem aListIdItem( RES_PARATR_LIST_ID, OUString() );
{
const SfxItemSet * pAttrSet = pDestTxtNd->GetpSwAttrSet();
@@ -4293,9 +4293,9 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// Save numrule at destination
// #i86492# - Safe also <ListId> item of destination.
int aNumRuleState = SFX_ITEM_UNKNOWN;
SfxItemState aNumRuleState = SFX_ITEM_UNKNOWN;
SwNumRuleItem aNumRuleItem;
int aListIdState = SFX_ITEM_UNKNOWN;
SfxItemState aListIdState = SFX_ITEM_UNKNOWN;
SfxStringItem aListIdItem( RES_PARATR_LIST_ID, OUString() );
{
const SfxItemSet* pAttrSet = pDestTxtNd->GetpSwAttrSet();
+1 -1
View File
@@ -366,7 +366,7 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
sal_uInt16 nTmpNumLvl =
pOutlineDlg ? SwOutlineTabDialog::GetActNumLevel() : 0;
const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
if(pExampleSet && pExampleSet->GetItemState(FN_PARAM_NUM_PRESET, false, &pItem))
if(pExampleSet && pExampleSet->GetItemState(FN_PARAM_NUM_PRESET, false, &pItem) != SFX_ITEM_UNKNOWN)
{
bPreset = ((const SfxBoolItem*)pItem)->GetValue();
}
+10 -9
View File
@@ -1493,15 +1493,16 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
}
break;
case SFX_ITEM_DONTCARE:
// set NumRule to default values
// what are the default values?
{
SwNumRule aRule( pNumRule->GetName(),
// #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
rDoc.ChgNumRuleFmts( aRule );
}
break;
// set NumRule to default values
// what are the default values?
{
SwNumRule aRule( pNumRule->GetName(),
// #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
rDoc.ChgNumRuleFmts( aRule );
}
break;
default: break;
}
}
break;
+1 -1
View File
@@ -1671,7 +1671,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSh.GetCurAttr(aSet);
// If a hyperlink is selected, either alone or along with other text...
if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, true )) == 0) || rSh.HasReadonlySel())
if(aSet.GetItemState( RES_TXTATR_INETFMT, true ) != SFX_ITEM_DONTCARE || rSh.HasReadonlySel())
{
rSet.DisableItem(nWhich);
}