summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-05-22 15:06:04 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-22 15:10:19 +0000
commit1d38c10d5b98c3c2efb08a4685863e69205bfa68 (patch)
treea538a77f289734ac8d5607fd040e4336671ff4eb /sfx2
parent5ff0bef5caa0b310b8e177cef2cba4034661f8d0 (diff)
tdf#89329: use unique_ptr for pImpl in bindings
Change-Id: I57d06a0e534062259acdeb7ecb0aee71500dac2c Reviewed-on: https://gerrit.libreoffice.org/25304 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/bindings.cxx532
1 files changed, 266 insertions, 266 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index ad1fb7166f9f..3bdeb277a8fa 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -153,31 +153,32 @@ public:
};
SfxBindings::SfxBindings()
-: pImp(new SfxBindings_Impl),
+: pImpl(new SfxBindings_Impl),
pDispatcher(nullptr),
nRegLevel(1) // first becomes 0, when the Dispatcher is set
+
{
- pImp->nMsgPos = 0;
- pImp->bAllMsgDirty = true;
- pImp->bContextChanged = false;
- pImp->bMsgDirty = true;
- pImp->bAllDirty = true;
- pImp->ePopupAction = SfxPopupAction::DELETE;
- pImp->nCachedFunc1 = 0;
- pImp->nCachedFunc2 = 0;
- pImp->bCtrlReleased = false;
- pImp->bFirstRound = false;
- pImp->bInNextJob = false;
- pImp->bInUpdate = false;
- pImp->pSubBindings = nullptr;
- pImp->pSuperBindings = nullptr;
- pImp->pWorkWin = nullptr;
- pImp->nOwnRegLevel = nRegLevel;
+ pImpl->nMsgPos = 0;
+ pImpl->bAllMsgDirty = true;
+ pImpl->bContextChanged = false;
+ pImpl->bMsgDirty = true;
+ pImpl->bAllDirty = true;
+ pImpl->ePopupAction = SfxPopupAction::DELETE;
+ pImpl->nCachedFunc1 = 0;
+ pImpl->nCachedFunc2 = 0;
+ pImpl->bCtrlReleased = false;
+ pImpl->bFirstRound = false;
+ pImpl->bInNextJob = false;
+ pImpl->bInUpdate = false;
+ pImpl->pSubBindings = nullptr;
+ pImpl->pSuperBindings = nullptr;
+ pImpl->pWorkWin = nullptr;
+ pImpl->nOwnRegLevel = nRegLevel;
// all caches are valid (no pending invalidate-job)
// create the list of caches
- pImp->pCaches = new SfxStateCacheArr_Impl;
- pImp->aTimer.SetTimeoutHdl( LINK(this, SfxBindings, NextJob) );
+ pImpl->pCaches = new SfxStateCacheArr_Impl;
+ pImpl->aTimer.SetTimeoutHdl( LINK(this, SfxBindings, NextJob) );
}
@@ -197,52 +198,51 @@ SfxBindings::~SfxBindings()
{
// The SubBindings should not be locked!
- pImp->pSubBindings = nullptr;
+ pImpl->pSubBindings = nullptr;
ENTERREGISTRATIONS();
- pImp->aTimer.Stop();
+ pImpl->aTimer.Stop();
DeleteControllers_Impl();
// Delete Caches
- for(SfxStateCacheArr_Impl::const_iterator it = pImp->pCaches->begin(); it != pImp->pCaches->end(); ++it)
+ for(SfxStateCacheArr_Impl::const_iterator it = pImpl->pCaches->begin(); it != pImpl->pCaches->end(); ++it)
delete *it;
- DELETEZ( pImp->pWorkWin );
+ DELETEZ( pImpl->pWorkWin );
- delete pImp->pCaches;
- delete pImp;
+ delete pImpl->pCaches;
}
void SfxBindings::DeleteControllers_Impl()
{
// in the first round delete SfxPopupWindows
- sal_uInt16 nCount = pImp->pCaches->size();
+ sal_uInt16 nCount = pImpl->pCaches->size();
sal_uInt16 nCache;
for ( nCache = 0; nCache < nCount; ++nCache )
{
// Remember were you are
- SfxStateCache *pCache = (*pImp->pCaches)[nCache];
+ SfxStateCache *pCache = (*pImpl->pCaches)[nCache];
sal_uInt16 nSlotId = pCache->GetId();
// Re-align, because the cache may have been reduced
- sal_uInt16 nNewCount = pImp->pCaches->size();
+ sal_uInt16 nNewCount = pImpl->pCaches->size();
if ( nNewCount < nCount )
{
nCache = GetSlotPos(nSlotId);
if ( nCache >= nNewCount ||
- nSlotId != (*pImp->pCaches)[nCache]->GetId() )
+ nSlotId != (*pImpl->pCaches)[nCache]->GetId() )
--nCache;
nCount = nNewCount;
}
}
// Delete all Caches
- for ( nCache = pImp->pCaches->size(); nCache > 0; --nCache )
+ for ( nCache = pImpl->pCaches->size(); nCache > 0; --nCache )
{
// Get Cache via css::sdbcx::Index
- SfxStateCache *pCache = (*pImp->pCaches)[ nCache-1 ];
+ SfxStateCache *pCache = (*pImpl->pCaches)[ nCache-1 ];
// unbind all controllers in the cache
SfxControllerItem *pNext;
@@ -257,9 +257,9 @@ void SfxBindings::DeleteControllers_Impl()
pCache->GetInternalController()->UnBind();
// Delete Cache
- if( nCache-1 < (sal_uInt16) pImp->pCaches->size() )
- delete (*pImp->pCaches)[nCache-1];
- pImp->pCaches->erase(pImp->pCaches->begin()+ nCache - 1);
+ if( nCache-1 < (sal_uInt16) pImpl->pCaches->size() )
+ delete (*pImpl->pCaches)[nCache-1];
+ pImpl->pCaches->erase(pImpl->pCaches->begin()+ nCache - 1);
}
}
@@ -268,17 +268,17 @@ void SfxBindings::HidePopups( bool bHide )
{
// Hide SfxPopupWindows
HidePopupCtrls_Impl( bHide );
- SfxBindings *pSub = pImp->pSubBindings;
+ SfxBindings *pSub = pImpl->pSubBindings;
while ( pSub )
{
- pImp->pSubBindings->HidePopupCtrls_Impl( bHide );
- pSub = pSub->pImp->pSubBindings;
+ pImpl->pSubBindings->HidePopupCtrls_Impl( bHide );
+ pSub = pSub->pImpl->pSubBindings;
}
// Hide SfxChildWindows
DBG_ASSERT( pDispatcher, "HidePopups not allowed without dispatcher" );
- if ( pImp->pWorkWin )
- pImp->pWorkWin->HidePopups_Impl( bHide, true );
+ if ( pImpl->pWorkWin )
+ pImpl->pWorkWin->HidePopups_Impl( bHide, true );
}
void SfxBindings::HidePopupCtrls_Impl( bool bHide )
@@ -286,15 +286,15 @@ void SfxBindings::HidePopupCtrls_Impl( bool bHide )
if ( bHide )
{
// Hide SfxPopupWindows
- pImp->ePopupAction = SfxPopupAction::HIDE;
+ pImpl->ePopupAction = SfxPopupAction::HIDE;
}
else
{
// Show SfxPopupWindows
- pImp->ePopupAction = SfxPopupAction::SHOW;
+ pImpl->ePopupAction = SfxPopupAction::SHOW;
}
- pImp->ePopupAction = SfxPopupAction::DELETE;
+ pImpl->ePopupAction = SfxPopupAction::DELETE;
}
@@ -357,19 +357,19 @@ void SfxBindings::Update_Impl
void SfxBindings::InvalidateSlotsInMap_Impl()
{
- InvalidateSlotMap::const_iterator pIter = pImp->m_aInvalidateSlots.begin();
- while ( pIter != pImp->m_aInvalidateSlots.end() )
+ InvalidateSlotMap::const_iterator pIter = pImpl->m_aInvalidateSlots.begin();
+ while ( pIter != pImpl->m_aInvalidateSlots.end() )
{
Invalidate( pIter->first );
++pIter;
}
- pImp->m_aInvalidateSlots.clear();
+ pImpl->m_aInvalidateSlots.clear();
}
void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 nId )
{
- pImp->m_aInvalidateSlots[nId] = true;
+ pImpl->m_aInvalidateSlots[nId] = true;
}
@@ -378,19 +378,19 @@ void SfxBindings::Update
sal_uInt16 nId // the bound and up-to-date Slot-Id
)
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
if ( pDispatcher )
pDispatcher->Flush();
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Update( nId );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Update( nId );
SfxStateCache* pCache = GetStateCache( nId );
if ( pCache )
{
- pImp->bInUpdate = true;
- if ( pImp->bMsgDirty )
+ pImpl->bInUpdate = true;
+ if ( pImpl->bMsgDirty )
{
UpdateSlotServer_Impl();
pCache = GetStateCache( nId );
@@ -408,17 +408,17 @@ void SfxBindings::Update
if ( bInternalUpdate )
{
// Query Status
- const SfxSlotServer* pMsgServer = pDispatcher ? pCache->GetSlotServer(*pDispatcher, pImp->xProv) : nullptr;
+ const SfxSlotServer* pMsgServer = pDispatcher ? pCache->GetSlotServer(*pDispatcher, pImpl->xProv) : nullptr;
if ( !pCache->IsControllerDirty() )
{
- pImp->bInUpdate = false;
+ pImpl->bInUpdate = false;
InvalidateSlotsInMap_Impl();
return;
}
if (!pMsgServer)
{
pCache->SetState(SfxItemState::DISABLED, nullptr);
- pImp->bInUpdate = false;
+ pImpl->bInUpdate = false;
InvalidateSlotsInMap_Impl();
return;
}
@@ -426,10 +426,10 @@ void SfxBindings::Update
Update_Impl(pCache);
}
- pImp->bAllDirty = false;
+ pImpl->bAllDirty = false;
}
- pImp->bInUpdate = false;
+ pImpl->bInUpdate = false;
InvalidateSlotsInMap_Impl();
}
}
@@ -437,22 +437,22 @@ void SfxBindings::Update
void SfxBindings::Update()
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Update();
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Update();
if ( pDispatcher )
{
if ( nRegLevel )
return;
- pImp->bInUpdate = true;
+ pImpl->bInUpdate = true;
pDispatcher->Flush();
pDispatcher->Update_Impl();
while ( !NextJob_Impl(nullptr) )
; // loop
- pImp->bInUpdate = false;
+ pImpl->bInUpdate = false;
InvalidateSlotsInMap_Impl();
}
}
@@ -475,7 +475,7 @@ void SfxBindings::SetState
else
{
// Status may be accepted only if all slot-pointers are set
- if ( pImp->bMsgDirty )
+ if ( pImpl->bMsgDirty )
UpdateSlotServer_Impl();
// Iterate over the itemset, update if the slot bound
@@ -513,7 +513,7 @@ void SfxBindings::SetState
else
{
// Status may be accepted only if all slot-pointers are set
- if ( pImp->bMsgDirty )
+ if ( pImpl->bMsgDirty )
UpdateSlotServer_Impl();
//update if the slot bound
@@ -536,8 +536,8 @@ void SfxBindings::SetState
SfxStateCache* SfxBindings::GetAnyStateCache_Impl( sal_uInt16 nId )
{
SfxStateCache* pCache = GetStateCache( nId );
- if ( !pCache && pImp->pSubBindings )
- return pImp->pSubBindings->GetAnyStateCache_Impl( nId );
+ if ( !pCache && pImpl->pSubBindings )
+ return pImpl->pSubBindings->GetAnyStateCache_Impl( nId );
return pCache;
}
@@ -558,17 +558,17 @@ SfxStateCache* SfxBindings::GetStateCache
or where it was inserted. */
)
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
// is the specified function bound?
const sal_uInt16 nStart = ( pPos ? *pPos : 0 );
const sal_uInt16 nPos = GetSlotPos( nId, nStart );
- if ( nPos < pImp->pCaches->size() &&
- (*pImp->pCaches)[nPos]->GetId() == nId )
+ if ( nPos < pImpl->pCaches->size() &&
+ (*pImpl->pCaches)[nPos]->GetId() == nId )
{
if ( pPos )
*pPos = nPos;
- return (*pImp->pCaches)[nPos];
+ return (*pImpl->pCaches)[nPos];
}
return nullptr;
}
@@ -580,32 +580,32 @@ void SfxBindings::InvalidateAll
false Slot Server remains valid */
)
{
- DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+ DBG_ASSERT( !pImpl->bInUpdate, "SfxBindings::Invalidate while in update" );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->InvalidateAll( bWithMsg );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->InvalidateAll( bWithMsg );
// everything is already set dirty or downing => nothing to do
if ( !pDispatcher ||
- ( pImp->bAllDirty && ( !bWithMsg || pImp->bAllMsgDirty ) ) ||
+ ( pImpl->bAllDirty && ( !bWithMsg || pImpl->bAllMsgDirty ) ) ||
SfxGetpApp()->IsDowning() )
{
return;
}
- pImp->bAllMsgDirty = pImp->bAllMsgDirty || bWithMsg;
- pImp->bMsgDirty = pImp->bMsgDirty || pImp->bAllMsgDirty || bWithMsg;
- pImp->bAllDirty = true;
+ pImpl->bAllMsgDirty = pImpl->bAllMsgDirty || bWithMsg;
+ pImpl->bMsgDirty = pImpl->bMsgDirty || pImpl->bAllMsgDirty || bWithMsg;
+ pImpl->bAllDirty = true;
- for (SfxStateCache* pCache : *pImp->pCaches)
+ for (SfxStateCache* pCache : *pImpl->pCaches)
pCache->Invalidate(bWithMsg);
- pImp->nMsgPos = 0;
+ pImpl->nMsgPos = 0;
if ( !nRegLevel )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
}
}
@@ -616,31 +616,31 @@ void SfxBindings::Invalidate
slot IDs (individual, not as a couple!) */
)
{
- if ( pImp->bInUpdate )
+ if ( pImpl->bInUpdate )
{
sal_Int32 i = 0;
while ( pIds[i] != 0 )
AddSlotToInvalidateSlotsMap_Impl( pIds[i++] );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Invalidate( pIds );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Invalidate( pIds );
return;
}
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Invalidate( pIds );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Invalidate( pIds );
// everything is already set dirty or downing => nothing to do
- if ( !pDispatcher || pImp->bAllDirty || SfxGetpApp()->IsDowning() )
+ if ( !pDispatcher || pImpl->bAllDirty || SfxGetpApp()->IsDowning() )
return;
// Search binary in always smaller areas
for ( sal_uInt16 n = GetSlotPos(*pIds);
- *pIds && n < pImp->pCaches->size();
+ *pIds && n < pImpl->pCaches->size();
n = GetSlotPos(*pIds, n) )
{
// If SID is ever bound, then invalidate the cache
- SfxStateCache *pCache = (*pImp->pCaches)[n];
+ SfxStateCache *pCache = (*pImpl->pCaches)[n];
if ( pCache->GetId() == *pIds )
pCache->Invalidate(false);
@@ -651,12 +651,12 @@ void SfxBindings::Invalidate
}
// if not enticed to start update timer
- pImp->nMsgPos = 0;
+ pImpl->nMsgPos = 0;
if ( !nRegLevel )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
}
}
@@ -674,19 +674,19 @@ void SfxBindings::InvalidateShell
// for now always bDeep
)
{
- DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+ DBG_ASSERT( !pImpl->bInUpdate, "SfxBindings::Invalidate while in update" );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->InvalidateShell( rSh, bDeep );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->InvalidateShell( rSh, bDeep );
- if ( !pDispatcher || pImp->bAllDirty || SfxGetpApp()->IsDowning() )
+ if ( !pDispatcher || pImpl->bAllDirty || SfxGetpApp()->IsDowning() )
return;
// flush now already, it is done in GetShellLevel (rsh) anyway,
- // important so that is set correctly: pimp-> ball(Msg)Dirty
+ // important so that is set correctly: pImpl-> ball(Msg)Dirty
pDispatcher->Flush();
- if ((pImp->bAllDirty && pImp->bAllMsgDirty) || SfxGetpApp()->IsDowning())
+ if ((pImpl->bAllDirty && pImpl->bAllMsgDirty) || SfxGetpApp()->IsDowning())
{
// if the next one is anyway, then all the servers are collected
return;
@@ -696,21 +696,21 @@ void SfxBindings::InvalidateShell
sal_uInt16 nLevel = pDispatcher->GetShellLevel(rSh);
if ( nLevel != USHRT_MAX )
{
- for (SfxStateCache* pCache : *pImp->pCaches)
+ for (SfxStateCache* pCache : *pImpl->pCaches)
{
const SfxSlotServer *pMsgServer =
- pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ pCache->GetSlotServer(*pDispatcher, pImpl->xProv);
if ( pMsgServer && pMsgServer->GetShellLevel() == nLevel )
pCache->Invalidate(false);
}
- pImp->nMsgPos = 0;
+ pImpl->nMsgPos = 0;
if ( !nRegLevel )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
- pImp->bFirstRound = true;
- pImp->nFirstShell = nLevel;
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
+ pImpl->bFirstRound = true;
+ pImpl->nFirstShell = nLevel;
}
}
}
@@ -721,30 +721,30 @@ void SfxBindings::Invalidate
sal_uInt16 nId // Status value to be set
)
{
- if ( pImp->bInUpdate )
+ if ( pImpl->bInUpdate )
{
AddSlotToInvalidateSlotsMap_Impl( nId );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Invalidate( nId );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Invalidate( nId );
return;
}
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Invalidate( nId );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Invalidate( nId );
- if ( !pDispatcher || pImp->bAllDirty || SfxGetpApp()->IsDowning() )
+ if ( !pDispatcher || pImpl->bAllDirty || SfxGetpApp()->IsDowning() )
return;
SfxStateCache* pCache = GetStateCache(nId);
if ( pCache )
{
pCache->Invalidate(false);
- pImp->nMsgPos = std::min(GetSlotPos(nId), pImp->nMsgPos);
+ pImpl->nMsgPos = std::min(GetSlotPos(nId), pImpl->nMsgPos);
if ( !nRegLevel )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
}
}
}
@@ -757,10 +757,10 @@ void SfxBindings::Invalidate
bool bWithMsg // Get new SlotServer?
)
{
- DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+ DBG_ASSERT( !pImpl->bInUpdate, "SfxBindings::Invalidate while in update" );
- if ( pImp->pSubBindings )
- pImp->pSubBindings->Invalidate( nId, bWithItem, bWithMsg );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->Invalidate( nId, bWithItem, bWithMsg );
if ( SfxGetpApp()->IsDowning() )
return;
@@ -772,15 +772,15 @@ void SfxBindings::Invalidate
pCache->ClearCache();
pCache->Invalidate(bWithMsg);
- if ( !pDispatcher || pImp->bAllDirty )
+ if ( !pDispatcher || pImpl->bAllDirty )
return;
- pImp->nMsgPos = std::min(GetSlotPos(nId), pImp->nMsgPos);
+ pImpl->nMsgPos = std::min(GetSlotPos(nId), pImpl->nMsgPos);
if ( !nRegLevel )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
}
}
}
@@ -788,7 +788,7 @@ void SfxBindings::Invalidate
bool SfxBindings::IsBound( sal_uInt16 nSlotId )
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
sal_uInt16 nStartSearchAt = 0;
return GetStateCache(nSlotId, &nStartSearchAt ) != nullptr;
}
@@ -796,43 +796,43 @@ bool SfxBindings::IsBound( sal_uInt16 nSlotId )
sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt )
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
// answer immediately if a function-seek comes repeated
- if ( pImp->nCachedFunc1 < pImp->pCaches->size() &&
- (*pImp->pCaches)[pImp->nCachedFunc1]->GetId() == nId )
+ if ( pImpl->nCachedFunc1 < pImpl->pCaches->size() &&
+ (*pImpl->pCaches)[pImpl->nCachedFunc1]->GetId() == nId )
{
- return pImp->nCachedFunc1;
+ return pImpl->nCachedFunc1;
}
- if ( pImp->nCachedFunc2 < pImp->pCaches->size() &&
- (*pImp->pCaches)[pImp->nCachedFunc2]->GetId() == nId )
+ if ( pImpl->nCachedFunc2 < pImpl->pCaches->size() &&
+ (*pImpl->pCaches)[pImpl->nCachedFunc2]->GetId() == nId )
{
// swap the caches
- sal_uInt16 nTemp = pImp->nCachedFunc1;
- pImp->nCachedFunc1 = pImp->nCachedFunc2;
- pImp->nCachedFunc2 = nTemp;
- return pImp->nCachedFunc1;
+ sal_uInt16 nTemp = pImpl->nCachedFunc1;
+ pImpl->nCachedFunc1 = pImpl->nCachedFunc2;
+ pImpl->nCachedFunc2 = nTemp;
+ return pImpl->nCachedFunc1;
}
// binary search, if not found, seek to target-position
- if ( pImp->pCaches->size() <= nStartSearchAt )
+ if ( pImpl->pCaches->size() <= nStartSearchAt )
{
return 0;
}
- if ( (sal_uInt16) pImp->pCaches->size() == (nStartSearchAt+1) )
+ if ( (sal_uInt16) pImpl->pCaches->size() == (nStartSearchAt+1) )
{
- return (*pImp->pCaches)[nStartSearchAt]->GetId() >= nId ? 0 : 1;
+ return (*pImpl->pCaches)[nStartSearchAt]->GetId() >= nId ? 0 : 1;
}
sal_uInt16 nLow = nStartSearchAt;
sal_uInt16 nMid = 0;
sal_uInt16 nHigh = 0;
bool bFound = false;
- nHigh = pImp->pCaches->size() - 1;
+ nHigh = pImpl->pCaches->size() - 1;
while ( !bFound && nLow <= nHigh )
{
nMid = (nLow + nHigh) >> 1;
- DBG_ASSERT( nMid < pImp->pCaches->size(), "bsearch is buggy" );
- int nDiff = (int) nId - (int) ( ((*pImp->pCaches)[nMid])->GetId() );
+ DBG_ASSERT( nMid < pImpl->pCaches->size(), "bsearch is buggy" );
+ int nDiff = (int) nId - (int) ( ((*pImpl->pCaches)[nMid])->GetId() );
if ( nDiff < 0)
{ if ( nMid == 0 )
break;
@@ -847,15 +847,15 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt )
bFound = true;
}
sal_uInt16 nPos = bFound ? nMid : nLow;
- DBG_ASSERT( nPos <= pImp->pCaches->size(), "" );
- DBG_ASSERT( nPos == pImp->pCaches->size() ||
- nId <= (*pImp->pCaches)[nPos]->GetId(), "" );
+ DBG_ASSERT( nPos <= pImpl->pCaches->size(), "" );
+ DBG_ASSERT( nPos == pImpl->pCaches->size() ||
+ nId <= (*pImpl->pCaches)[nPos]->GetId(), "" );
DBG_ASSERT( nPos == nStartSearchAt ||
- nId > (*pImp->pCaches)[nPos-1]->GetId(), "" );
- DBG_ASSERT( ( (nPos+1) >= (sal_uInt16) pImp->pCaches->size() ) ||
- nId < (*pImp->pCaches)[nPos+1]->GetId(), "" );
- pImp->nCachedFunc2 = pImp->nCachedFunc1;
- pImp->nCachedFunc1 = nPos;
+ nId > (*pImpl->pCaches)[nPos-1]->GetId(), "" );
+ DBG_ASSERT( ( (nPos+1) >= (sal_uInt16) pImpl->pCaches->size() ) ||
+ nId < (*pImpl->pCaches)[nPos+1]->GetId(), "" );
+ pImpl->nCachedFunc2 = pImpl->nCachedFunc1;
+ pImpl->nCachedFunc1 = nPos;
return nPos;
}
@@ -873,33 +873,33 @@ void SfxBindings::Register( SfxControllerItem& rItem )
void SfxBindings::Register_Impl( SfxControllerItem& rItem, bool bInternal )
{
// DBG_ASSERT( nRegLevel > 0, "registration without EnterRegistrations" );
- DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Register while status-updating" );
+ DBG_ASSERT( !pImpl->bInNextJob, "SfxBindings::Register while status-updating" );
// insert new cache if it does not already exist
sal_uInt16 nId = rItem.GetId();
sal_uInt16 nPos = GetSlotPos(nId);
- if ( nPos >= pImp->pCaches->size() ||
- (*pImp->pCaches)[nPos]->GetId() != nId )
+ if ( nPos >= pImpl->pCaches->size() ||
+ (*pImpl->pCaches)[nPos]->GetId() != nId )
{
SfxStateCache* pCache = new SfxStateCache(nId);
- pImp->pCaches->insert( pImp->pCaches->begin() + nPos, pCache );
+ pImpl->pCaches->insert( pImpl->pCaches->begin() + nPos, pCache );
DBG_ASSERT( nPos == 0 ||
- (*pImp->pCaches)[nPos]->GetId() >
- (*pImp->pCaches)[nPos-1]->GetId(), "" );
- DBG_ASSERT( (nPos == pImp->pCaches->size()-1) ||
- (*pImp->pCaches)[nPos]->GetId() <
- (*pImp->pCaches)[nPos+1]->GetId(), "" );
- pImp->bMsgDirty = true;
+ (*pImpl->pCaches)[nPos]->GetId() >
+ (*pImpl->pCaches)[nPos-1]->GetId(), "" );
+ DBG_ASSERT( (nPos == pImpl->pCaches->size()-1) ||
+ (*pImpl->pCaches)[nPos]->GetId() <
+ (*pImpl->pCaches)[nPos+1]->GetId(), "" );
+ pImpl->bMsgDirty = true;
}
// enqueue the new binding
if ( bInternal )
{
- (*pImp->pCaches)[nPos]->SetInternalController( &rItem );
+ (*pImpl->pCaches)[nPos]->SetInternalController( &rItem );
}
else
{
- SfxControllerItem *pOldItem = (*pImp->pCaches)[nPos]->ChangeItemLink(&rItem);
+ SfxControllerItem *pOldItem = (*pImpl->pCaches)[nPos]->ChangeItemLink(&rItem);
rItem.ChangeItemLink(pOldItem);
}
}
@@ -907,14 +907,14 @@ void SfxBindings::Register_Impl( SfxControllerItem& rItem, bool bInternal )
void SfxBindings::Release( SfxControllerItem& rItem )
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
- DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Release while status-updating" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( !pImpl->bInNextJob, "SfxBindings::Release while status-updating" );
ENTERREGISTRATIONS();
// find the bound function
sal_uInt16 nId = rItem.GetId();
sal_uInt16 nPos = GetSlotPos(nId);
- SfxStateCache* pCache = (nPos < pImp->pCaches->size()) ? (*pImp->pCaches)[nPos] : nullptr;
+ SfxStateCache* pCache = (nPos < pImpl->pCaches->size()) ? (*pImpl->pCaches)[nPos] : nullptr;
if ( pCache && pCache->GetId() == nId )
{
if ( pCache->GetInternalController() == &rItem )
@@ -942,7 +942,7 @@ void SfxBindings::Release( SfxControllerItem& rItem )
// was this the last controller?
if ( pCache->GetItemLink() == nullptr && !pCache->GetInternalController() )
{
- pImp->bCtrlReleased = true;
+ pImpl->bCtrlReleased = true;
}
}
@@ -953,7 +953,7 @@ void SfxBindings::Release( SfxControllerItem& rItem )
const SfxPoolItem* SfxBindings::ExecuteSynchron( sal_uInt16 nId, const SfxPoolItem** ppItems,
const SfxPoolItem **ppInternalArgs )
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
if( !nId || !pDispatcher )
return nullptr;
@@ -964,7 +964,7 @@ const SfxPoolItem* SfxBindings::ExecuteSynchron( sal_uInt16 nId, const SfxPoolIt
bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, SfxCallMode nCallMode,
const SfxPoolItem **ppInternalArgs )
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
if( !nId || !pDispatcher )
return false;
@@ -979,12 +979,12 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
SfxStateCache *pCache = GetStateCache( nId );
if ( !pCache )
{
- SfxBindings *pBind = pImp->pSubBindings;
+ SfxBindings *pBind = pImpl->pSubBindings;
while ( pBind )
{
if ( pBind->GetStateCache( nId ) )
return pBind->Execute_Impl( nId, ppItems, nModi, nCallMode, ppInternalArgs, bGlobalOnly );
- pBind = pBind->pImp->pSubBindings;
+ pBind = pBind->pImpl->pSubBindings;
}
}
@@ -999,7 +999,7 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
// slot is uncached, use SlotCache to handle external dispatch providers
xCache.reset(new SfxStateCache(nId));
pCache = xCache.get();
- pCache->GetSlotServer( rDispatcher, pImp->xProv );
+ pCache->GetSlotServer( rDispatcher, pImpl->xProv );
}
if ( pCache->GetDispatch().is() )
@@ -1021,13 +1021,13 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
}
// slot is handled internally by SfxDispatcher
- if ( pImp->bMsgDirty )
+ if ( pImpl->bMsgDirty )
UpdateSlotServer_Impl();
SfxShell *pShell=nullptr;
const SfxSlot *pSlot=nullptr;
- const SfxSlotServer* pServer = pCache->GetSlotServer( rDispatcher, pImp->xProv );
+ const SfxSlotServer* pServer = pCache->GetSlotServer( rDispatcher, pImpl->xProv );
if ( !pServer )
{
return nullptr;
@@ -1170,29 +1170,29 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
void SfxBindings::UpdateSlotServer_Impl()
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
// synchronize
pDispatcher->Flush();
- if ( pImp->bAllMsgDirty )
+ if ( pImpl->bAllMsgDirty )
{
if ( !nRegLevel )
{
css::uno::Reference < css::frame::XFrame > xFrame
( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
- pImp->bContextChanged = false;
+ pImpl->bContextChanged = false;
}
else
- pImp->bContextChanged = true;
+ pImpl->bContextChanged = true;
}
- for (SfxStateCache* pCache : *pImp->pCaches)
+ for (SfxStateCache* pCache : *pImpl->pCaches)
{
- //GetSlotServer can modify pImp->pCaches
- pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ //GetSlotServer can modify pImpl->pCaches
+ pCache->GetSlotServer(*pDispatcher, pImpl->xProv);
}
- pImp->bMsgDirty = pImp->bAllMsgDirty = false;
+ pImpl->bMsgDirty = pImpl->bAllMsgDirty = false;
Broadcast( SfxSimpleHint(SFX_HINT_DOCCHANGED) );
}
@@ -1206,12 +1206,12 @@ SfxItemSet* SfxBindings::CreateSet_Impl
SfxFoundCacheArr_Impl& rFound // out: List of Caches for Siblings
)
{
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
- DBG_ASSERT( !pImp->bMsgDirty, "CreateSet_Impl with dirty MessageServer" );
+ DBG_ASSERT( !pImpl->bMsgDirty, "CreateSet_Impl with dirty MessageServer" );
assert(pDispatcher);
- const SfxSlotServer* pMsgSvr = pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ const SfxSlotServer* pMsgSvr = pCache->GetSlotServer(*pDispatcher, pImpl->xProv);
if (!pMsgSvr)
return nullptr;
@@ -1248,7 +1248,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
// Search through the bindings for slots served by the same function. This , // will only affect slots which are present in the found interface.
// The position of the Statecaches in StateCache-Array
- sal_uInt16 nCachePos = pImp->nMsgPos;
+ sal_uInt16 nCachePos = pImpl->nMsgPos;
const SfxSlot *pSibling = pRealSlot->GetNextSlot();
// the Slots ODF a interfaces ar linked in a circle
@@ -1261,7 +1261,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
// Is the slot cached ?
if ( pSiblingCache )
{
- const SfxSlotServer *pServ = pSiblingCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ const SfxSlotServer *pServ = pSiblingCache->GetSlotServer(*pDispatcher, pImpl->xProv);
if ( pServ && pServ->GetShellLevel() == nShellLevel )
pSiblingFnc = pServ->GetSlot()->GetStateFnc();
}
@@ -1286,7 +1286,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
DBG_ASSERT(pSlaveSlot->GetLinkedSlot() == pSibling,
"Wrong Master/Slave relationship!");
- sal_uInt16 nCurMsgPos = pImp->nMsgPos;
+ sal_uInt16 nCurMsgPos = pImpl->nMsgPos;
const SfxStateCache *pSlaveCache =
GetStateCache( pSlaveSlot->GetSlotId(), &nCurMsgPos );
@@ -1447,11 +1447,11 @@ bool SfxBindings::NextJob_Impl(Timer * pTimer)
#endif
const unsigned MAX_INPUT_DELAY = 200;
- DBG_ASSERT( pImp->pCaches != nullptr, "SfxBindings not initialized" );
+ DBG_ASSERT( pImpl->pCaches != nullptr, "SfxBindings not initialized" );
if ( Application::GetLastInputInterval() < MAX_INPUT_DELAY && pTimer )
{
- pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
+ pImpl->aTimer.SetTimeout(TIMEOUT_UPDATING);
return true;
}
@@ -1462,7 +1462,7 @@ bool SfxBindings::NextJob_Impl(Timer * pTimer)
// modifying the SfxObjectInterface-stack without SfxBindings => nothing to do
SfxViewFrame* pFrame = pDispatcher ? pDispatcher->GetFrame() : nullptr;
- if ( (pFrame && !pFrame->GetObjectShell()->AcceptStateUpdate()) || pSfxApp->IsDowning() || pImp->pCaches->empty() )
+ if ( (pFrame && !pFrame->GetObjectShell()->AcceptStateUpdate()) || pSfxApp->IsDowning() || pImpl->pCaches->empty() )
{
return true;
}
@@ -1474,65 +1474,65 @@ bool SfxBindings::NextJob_Impl(Timer * pTimer)
// if possible Update all server / happens in its own time slice
// but process all events at once when unit testing, for reliability reasons
static bool bTest = getenv("LO_TESTNAME");
- if ( pImp->bMsgDirty && !bTest )
+ if ( pImpl->bMsgDirty && !bTest )
{
UpdateSlotServer_Impl();
return false;
}
- pImp->bAllDirty = false;
- pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
+ pImpl->bAllDirty = false;
+ pImpl->aTimer.SetTimeout(TIMEOUT_UPDATING);
// at least 10 loops and further if more jobs are available but no input
bool bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule;
sal_uInt16 nLoops = 10;
- pImp->bInNextJob = true;
- const sal_uInt16 nCount = pImp->pCaches->size();
- while ( pImp->nMsgPos < nCount )
+ pImpl->bInNextJob = true;
+ const sal_uInt16 nCount = pImpl->pCaches->size();
+ while ( pImpl->nMsgPos < nCount )
{
// iterate through the bound functions
bool bJobDone = false;
while ( !bJobDone )
{
- SfxStateCache* pCache = (*pImp->pCaches)[pImp->nMsgPos];
+ SfxStateCache* pCache = (*pImpl->pCaches)[pImpl->nMsgPos];
DBG_ASSERT( pCache, "invalid SfxStateCache-position in job queue" );
bool bWasDirty = pCache->IsControllerDirty();
if ( bWasDirty )
{
Update_Impl( pCache );
- DBG_ASSERT( nCount == pImp->pCaches->size(),
+ DBG_ASSERT( nCount == pImpl->pCaches->size(),
"Reschedule in StateChanged => buff" );
}
// skip to next function binding
- ++pImp->nMsgPos;
+ ++pImpl->nMsgPos;
// keep job if it is not completed, but any input is available
- bJobDone = pImp->nMsgPos >= nCount;
- if ( bJobDone && pImp->bFirstRound )
+ bJobDone = pImpl->nMsgPos >= nCount;
+ if ( bJobDone && pImpl->bFirstRound )
{
// Update of the preferred shell has been done, now may
// also the others shells be updated
bJobDone = false;
- pImp->bFirstRound = false;
- pImp->nMsgPos = 0;
+ pImpl->bFirstRound = false;
+ pImpl->nMsgPos = 0;
}
if ( bWasDirty && !bJobDone && bPreEmptive && (--nLoops == 0) )
{
- pImp->bInNextJob = false;
+ pImpl->bInNextJob = false;
return false;
}
}
}
- pImp->nMsgPos = 0;
+ pImpl->nMsgPos = 0;
- pImp->aTimer.Stop();
+ pImpl->aTimer.Stop();
// Update round is finished
- pImp->bInNextJob = false;
+ pImpl->bInNextJob = false;
Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE));
return true;
#ifdef DBG_UTIL
@@ -1540,7 +1540,7 @@ bool SfxBindings::NextJob_Impl(Timer * pTimer)
catch (...)
{
OSL_FAIL("C++ exception caught!");
- pImp->bInNextJob = false;
+ pImpl->bInNextJob = false;
}
return false;
@@ -1558,31 +1558,31 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine)
? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
// When bindings are locked, also lock sub bindings.
- if ( pImp->pSubBindings )
+ if ( pImpl->pSubBindings )
{
- pImp->pSubBindings->ENTERREGISTRATIONS();
+ pImpl->pSubBindings->ENTERREGISTRATIONS();
// These EnterRegistrations are not "real" for the SubBindings
- pImp->pSubBindings->pImp->nOwnRegLevel--;
+ pImpl->pSubBindings->pImpl->nOwnRegLevel--;
// Synchronize Bindings
- pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel + 1;
+ pImpl->pSubBindings->nRegLevel = nRegLevel + pImpl->pSubBindings->pImpl->nOwnRegLevel + 1;
}
- pImp->nOwnRegLevel++;
+ pImpl->nOwnRegLevel++;
// check if this is the outer most level
if ( ++nRegLevel == 1 )
{
// stop background-processing
- pImp->aTimer.Stop();
+ pImpl->aTimer.Stop();
// flush the cache
- pImp->nCachedFunc1 = 0;
- pImp->nCachedFunc2 = 0;
+ pImpl->nCachedFunc1 = 0;
+ pImpl->nCachedFunc2 = 0;
// Mark if the all of the Caches have disappeared.
- pImp->bCtrlReleased = false;
+ pImpl->bCtrlReleased = false;
}
return nRegLevel;
@@ -1597,55 +1597,55 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int
// Only when the SubBindings are still locked by the Superbindings,
// remove this lock (i.e. if there are more locks than "real" ones)
- if ( pImp->pSubBindings && pImp->pSubBindings->nRegLevel > pImp->pSubBindings->pImp->nOwnRegLevel )
+ if ( pImpl->pSubBindings && pImpl->pSubBindings->nRegLevel > pImpl->pSubBindings->pImpl->nOwnRegLevel )
{
// Synchronize Bindings
- pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel;
+ pImpl->pSubBindings->nRegLevel = nRegLevel + pImpl->pSubBindings->pImpl->nOwnRegLevel;
// This LeaveRegistrations is not "real" for SubBindings
- pImp->pSubBindings->pImp->nOwnRegLevel++;
- pImp->pSubBindings->LEAVEREGISTRATIONS();
+ pImpl->pSubBindings->pImpl->nOwnRegLevel++;
+ pImpl->pSubBindings->LEAVEREGISTRATIONS();
}
- pImp->nOwnRegLevel--;
+ pImpl->nOwnRegLevel--;
// check if this is the outer most level
if ( --nRegLevel == 0 && !SfxGetpApp()->IsDowning() )
{
- if ( pImp->bContextChanged )
+ if ( pImpl->bContextChanged )
{
- pImp->bContextChanged = false;
+ pImpl->bContextChanged = false;
}
SfxViewFrame* pFrame = pDispatcher->GetFrame();
// If possible remove unused Caches, for example prepare PlugInInfo
- if ( pImp->bCtrlReleased )
+ if ( pImpl->bCtrlReleased )
{
- for ( sal_uInt16 nCache = pImp->pCaches->size(); nCache > 0; --nCache )
+ for ( sal_uInt16 nCache = pImpl->pCaches->size(); nCache > 0; --nCache )
{
// Get Cache via css::sdbcx::Index
- SfxStateCache *pCache = (*pImp->pCaches)[nCache-1];
+ SfxStateCache *pCache = (*pImpl->pCaches)[nCache-1];
// No interested Controller present
if ( pCache->GetItemLink() == nullptr && !pCache->GetInternalController() )
{
// Remove Cache. Safety: first remove and then delete
- pImp->pCaches->erase(pImp->pCaches->begin() + nCache - 1);
+ pImpl->pCaches->erase(pImpl->pCaches->begin() + nCache - 1);
delete pCache;
}
}
}
// restart background-processing
- pImp->nMsgPos = 0;
+ pImpl->nMsgPos = 0;
if ( !pFrame || !pFrame->GetObjectShell() )
return;
- if ( pImp->pCaches && !pImp->pCaches->empty() )
+ if ( pImpl->pCaches && !pImpl->pCaches->empty() )
{
- pImp->aTimer.Stop();
- pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
- pImp->aTimer.Start();
+ pImpl->aTimer.Stop();
+ pImpl->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImpl->aTimer.Start();
}
}
@@ -1668,9 +1668,9 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
SfxBindings* pBind = pOldDispat->GetBindings();
while ( pBind )
{
- if ( pBind->pImp->pSubBindings == this && pBind->pDispatcher != pDisp )
+ if ( pBind->pImpl->pSubBindings == this && pBind->pDispatcher != pDisp )
pBind->SetSubBindings_Impl( nullptr );
- pBind = pBind->pImp->pSubBindings;
+ pBind = pBind->pImpl->pSubBindings;
}
}
@@ -1685,20 +1685,20 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
if ( pDispatcher && !pOldDispat )
{
- if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat )
+ if ( pImpl->pSubBindings && pImpl->pSubBindings->pDispatcher != pOldDispat )
{
OSL_FAIL( "SubBindings already set before activating!" );
- pImp->pSubBindings->ENTERREGISTRATIONS();
+ pImpl->pSubBindings->ENTERREGISTRATIONS();
}
LEAVEREGISTRATIONS();
}
else if( !pDispatcher )
{
ENTERREGISTRATIONS();
- if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat )
+ if ( pImpl->pSubBindings && pImpl->pSubBindings->pDispatcher != pOldDispat )
{
OSL_FAIL( "SubBindings still set even when deactivating!" );
- pImp->pSubBindings->LEAVEREGISTRATIONS();
+ pImpl->pSubBindings->LEAVEREGISTRATIONS();
}
}
@@ -1709,13 +1709,13 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
SfxBindings* pBind = pDisp->GetBindings();
while ( pBind && pBind != this )
{
- if ( !pBind->pImp->pSubBindings )
+ if ( !pBind->pImpl->pSubBindings )
{
pBind->SetSubBindings_Impl( this );
break;
}
- pBind = pBind->pImp->pSubBindings;
+ pBind = pBind->pImpl->pSubBindings;
}
}
}
@@ -1733,12 +1733,12 @@ void SfxBindings::ClearCache_Impl( sal_uInt16 nSlotId )
void SfxBindings::StartUpdate_Impl( bool bComplete )
{
- if ( pImp->pSubBindings )
- pImp->pSubBindings->StartUpdate_Impl( bComplete );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->StartUpdate_Impl( bComplete );
if ( !bComplete )
// Update may be interrupted
- NextJob_Impl(&pImp->aTimer);
+ NextJob_Impl(&pImpl->aTimer);
else
// Update all slots in a row
NextJob_Impl(nullptr);
@@ -1766,7 +1766,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
aURL.Main = aCmd;
if ( !xDisp.is() )
- xDisp = pImp->xProv->queryDispatch( aURL, OUString(), 0 );
+ xDisp = pImpl->xProv->queryDispatch( aURL, OUString(), 0 );
if ( xDisp.is() )
{
@@ -1784,7 +1784,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
if ( !pCache )
{
pCache = new SfxStateCache( nSlot );
- pCache->GetSlotServer( *GetDispatcher_Impl(), pImp->xProv );
+ pCache->GetSlotServer( *GetDispatcher_Impl(), pImpl->xProv );
bDeleteCache = true;
}
@@ -1859,41 +1859,41 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
void SfxBindings::SetSubBindings_Impl( SfxBindings *pSub )
{
- if ( pImp->pSubBindings )
+ if ( pImpl->pSubBindings )
{
- pImp->pSubBindings->SetDispatchProvider_Impl( css::uno::Reference< css::frame::XDispatchProvider > () );
- pImp->pSubBindings->pImp->pSuperBindings = nullptr;
+ pImpl->pSubBindings->SetDispatchProvider_Impl( css::uno::Reference< css::frame::XDispatchProvider > () );
+ pImpl->pSubBindings->pImpl->pSuperBindings = nullptr;
}
- pImp->pSubBindings = pSub;
+ pImpl->pSubBindings = pSub;
if ( pSub )
{
- pImp->pSubBindings->SetDispatchProvider_Impl( pImp->xProv );
- pSub->pImp->pSuperBindings = this;
+ pImpl->pSubBindings->SetDispatchProvider_Impl( pImpl->xProv );
+ pSub->pImpl->pSuperBindings = this;
}
}
SfxBindings* SfxBindings::GetSubBindings_Impl() const
{
- return pImp->pSubBindings;
+ return pImpl->pSubBindings;
}
void SfxBindings::SetWorkWindow_Impl( SfxWorkWindow* pWork )
{
- pImp->pWorkWin = pWork;
+ pImpl->pWorkWin = pWork;
}
SfxWorkWindow* SfxBindings::GetWorkWindow_Impl() const
{
- return pImp->pWorkWin;
+ return pImpl->pWorkWin;
}
bool SfxBindings::IsInUpdate() const
{
- bool bInUpdate = pImp->bInUpdate;
- if ( !bInUpdate && pImp->pSubBindings )
- bInUpdate = pImp->pSubBindings->IsInUpdate();
+ bool bInUpdate = pImpl->bInUpdate;
+ if ( !bInUpdate && pImpl->pSubBindings )
+ bInUpdate = pImpl->pSubBindings->IsInUpdate();
return bInUpdate;
}
@@ -1916,7 +1916,7 @@ void SfxBindings::SetActiveFrame( const css::uno::Reference< css::frame::XFrame
const css::uno::Reference< css::frame::XFrame > SfxBindings::GetActiveFrame() const
{
- const css::uno::Reference< css::frame::XFrame > xFrame( pImp->xProv, css::uno::UNO_QUERY );
+ const css::uno::Reference< css::frame::XFrame > xFrame( pImpl->xProv, css::uno::UNO_QUERY );
if ( xFrame.is() || !pDispatcher )
return xFrame;
else
@@ -1925,30 +1925,30 @@ const css::uno::Reference< css::frame::XFrame > SfxBindings::GetActiveFrame() co
void SfxBindings::SetDispatchProvider_Impl( const css::uno::Reference< css::frame::XDispatchProvider > & rProv )
{
- bool bInvalidate = ( rProv != pImp->xProv );
+ bool bInvalidate = ( rProv != pImpl->xProv );
if ( bInvalidate )
{
- pImp->xProv = rProv;
+ pImpl->xProv = rProv;
InvalidateAll( true );
}
- if ( pImp->pSubBindings )
- pImp->pSubBindings->SetDispatchProvider_Impl( pImp->xProv );
+ if ( pImpl->pSubBindings )
+ pImpl->pSubBindings->SetDispatchProvider_Impl( pImpl->xProv );
}
const css::uno::Reference< css::frame::XDispatchRecorder >& SfxBindings::GetRecorder() const
{
- return pImp->xRecorder;
+ return pImpl->xRecorder;
}
void SfxBindings::SetRecorder_Impl( css::uno::Reference< css::frame::XDispatchRecorder >& rRecorder )
{
- pImp->xRecorder = rRecorder;
+ pImpl->xRecorder = rRecorder;
}
void SfxBindings::ContextChanged_Impl()
{
- if ( !pImp->bInUpdate && ( !pImp->bContextChanged || !pImp->bAllMsgDirty ) )
+ if ( !pImpl->bInUpdate && ( !pImpl->bContextChanged || !pImpl->bAllMsgDirty ) )
{
InvalidateAll( true );
}