Kaydet (Commit) 2174bb1a authored tarafından Caolán McNamara's avatar Caolán McNamara

Restore SfxControllerItem::GetCoreMetric

was correctly removed by 9c2f7056 but we will
need it again soon

Change-Id: I7b2af6a17fc1c34d9313428e759e93fdde9ba0d7
üst 81f33687
...@@ -71,6 +71,8 @@ public: ...@@ -71,6 +71,8 @@ public:
const SfxPoolItem* pState ); const SfxPoolItem* pState );
virtual void DeleteFloatingWindow(); virtual void DeleteFloatingWindow();
SfxMapUnit GetCoreMetric() const;
static SfxItemState GetItemState( const SfxPoolItem* pState ); static SfxItemState GetItemState( const SfxPoolItem* pState );
SAL_DLLPRIVATE sal_Bool IsBindable_Impl() const SAL_DLLPRIVATE sal_Bool IsBindable_Impl() const
......
...@@ -353,4 +353,43 @@ SfxItemState SfxControllerItem::GetItemState ...@@ -353,4 +353,43 @@ SfxItemState SfxControllerItem::GetItemState
: SFX_ITEM_AVAILABLE; : SFX_ITEM_AVAILABLE;
} }
//--------------------------------------------------------------------
SfxMapUnit SfxControllerItem::GetCoreMetric() const
/* [Description]
Gets the measurement unit from the competent pool, in which the Status
item exist.
*/
{
SfxStateCache *pCache = pBindings->GetStateCache( nId );
SfxDispatcher *pDispat = pBindings->GetDispatcher_Impl();
if ( !pDispat )
{
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
if ( !pViewFrame )
SfxViewFrame::GetFirst();
if ( pViewFrame )
pDispat = pViewFrame->GetDispatcher();
}
if ( pDispat && pCache )
{
const SfxSlotServer *pServer = pCache->GetSlotServer( *pDispat );
if ( pServer )
{
SfxShell *pSh = pDispat->GetShell( pServer->GetShellLevel() );
SfxItemPool &rPool = pSh->GetPool();
sal_uInt16 nWhich = rPool.GetWhich( nId );
return rPool.GetMetric( nWhich );
}
}
DBG_WARNING( "W1: Can not find ItemPool!" );
return SFX_MAPUNIT_100TH_MM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment