summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-14 09:31:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-14 09:31:58 +0100
commit0d0fd7b4fbc6090fe7112eef8b2b07840cf8a89d (patch)
tree5325634108de1bc065273fb7d1cd3d57a4ef675e /sfx2
parent06272f678b54e99757c89419acfdc9217c88abd7 (diff)
PrepareClose should probably return bool
Change-Id: Ie62a6c1197594102bc68e246ae6059a9442ce314
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objxtor.cxx18
-rw-r--r--sfx2/source/view/frame.cxx10
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx4
-rw-r--r--sfx2/source/view/viewfrm.cxx2
-rw-r--r--sfx2/source/view/viewsh.cxx10
5 files changed, 22 insertions, 22 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 3a02be14c515..d65711d02ede 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -565,7 +565,7 @@ struct BoolEnv_Impl
};
-sal_uInt16 SfxObjectShell::PrepareClose
+bool SfxObjectShell::PrepareClose
(
sal_Bool bUI, // sal_True: Dialog and so on is allowed
// sal_False: silent-mode
@@ -573,16 +573,16 @@ sal_uInt16 SfxObjectShell::PrepareClose
)
{
if( pImp->bInPrepareClose || pImp->bPreparedForClose )
- return sal_True;
+ return true;
BoolEnv_Impl aBoolEnv( pImp );
// DocModalDialog?
if ( IsInModalMode() )
- return sal_False;
+ return false;
SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this );
if( pFirst && !pFirst->GetFrame().PrepareClose_Impl( bUI, bForBrowsing ) )
- return sal_False;
+ return false;
// prepare views for closing
for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
@@ -591,8 +591,8 @@ sal_uInt16 SfxObjectShell::PrepareClose
DBG_ASSERT(pFrm->GetViewShell(),"No Shell");
if ( pFrm->GetViewShell() )
{
- sal_uInt16 nRet = pFrm->GetViewShell()->PrepareClose( bUI, bForBrowsing );
- if ( nRet != sal_True )
+ bool nRet = pFrm->GetViewShell()->PrepareClose( bUI, bForBrowsing );
+ if ( !nRet )
return nRet;
}
}
@@ -603,7 +603,7 @@ sal_uInt16 SfxObjectShell::PrepareClose
if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
pImp->bPreparedForClose = sal_True;
- return sal_True;
+ return true;
}
// Ask if possible if it should be saved
@@ -650,11 +650,11 @@ sal_uInt16 SfxObjectShell::PrepareClose
}
else if ( RET_CANCEL == nRet )
// Cancelled
- return sal_False;
+ return false;
}
pImp->bPreparedForClose = sal_True;
- return sal_True;
+ return true;
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index fa51f5438332..e4fb67ff9f82 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -193,9 +193,9 @@ sal_Bool SfxFrame::DocIsModified_Impl()
return sal_False;
}
-sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
+bool SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
{
- sal_uInt16 nRet = RET_OK;
+ bool nRet = true;
// prevent recursive calls
if( !pImp->bPrepClosing )
@@ -224,17 +224,17 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
nRet = pCur->PrepareClose( bUI, bForBrowsing );
}
- if ( nRet == RET_OK )
+ if ( nRet )
{
// if this frame has child frames, ask them too
- for( sal_uInt16 nPos = GetChildFrameCount(); nRet == RET_OK && nPos--; )
+ for( sal_uInt16 nPos = GetChildFrameCount(); nRet && nPos--; )
nRet = (*pChildArr)[ nPos ]->PrepareClose_Impl( bUI, bForBrowsing );
}
pImp->bPrepClosing = sal_False;
}
- if ( nRet == RET_OK && pImp->pWorkWin )
+ if ( nRet && pImp->pWorkWin )
// if closing was accepted by the component the UI subframes must be asked also
nRet = pImp->pWorkWin->PrepareClose_Impl();
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 72643d9b5338..e54258e24af5 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -360,7 +360,7 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const la
SfxViewShell* pShell = m_pController->GetViewShell_Impl();
if ( m_pController != NULL && pShell )
{
- sal_Bool bCanClose = (sal_Bool) pShell->PrepareClose( sal_False );
+ bool bCanClose = pShell->PrepareClose( sal_False );
if ( !bCanClose )
{
if ( bDeliverOwnership && ( !pShell->GetWindow() || !pShell->GetWindow()->IsReallyVisible() ) )
@@ -633,7 +633,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( Runtime
for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); !bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ) )
bOther = (pFrame != pActFrame);
- sal_Bool bRet = bOther || pDocShell->PrepareClose();
+ bool bRet = bOther || pDocShell->PrepareClose();
if ( bRet )
{
ConnectSfxFrame_Impl( E_DISCONNECT );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 8206d6c094d4..9ed3d77ebec5 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -587,7 +587,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
sal_Bool bForEdit = !pSh->IsReadOnly();
// If possible ask the User
- sal_Bool bDo = ( GetViewShell()->PrepareClose() != sal_False );
+ bool bDo = GetViewShell()->PrepareClose();
SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
if ( bDo && GetFrame().DocIsModified_Impl() &&
!rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 695067007e28..ffcd7408d639 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1286,7 +1286,7 @@ SfxViewShell::~SfxViewShell()
//--------------------------------------------------------------------
-sal_uInt16 SfxViewShell::PrepareClose
+bool SfxViewShell::PrepareClose
(
sal_Bool bUI, // TRUE: Allow Dialog and so on, FALSE: silent-mode
sal_Bool /*bForBrowsing*/
@@ -1301,16 +1301,16 @@ sal_uInt16 SfxViewShell::PrepareClose
aInfoBox.Execute();
}
- return sal_False;
+ return false;
}
if( GetViewFrame()->IsInModalMode() )
- return sal_False;
+ return false;
if( bUI && GetViewFrame()->GetDispatcher()->IsLocked() )
- return sal_False;
+ return false;
- return sal_True;
+ return true;
}
//--------------------------------------------------------------------