summaryrefslogtreecommitdiff
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
parent06272f678b54e99757c89419acfdc9217c88abd7 (diff)
PrepareClose should probably return bool
Change-Id: Ie62a6c1197594102bc68e246ae6059a9442ce314
-rw-r--r--basctl/source/basicide/basidesh.cxx2
-rw-r--r--basctl/source/inc/basidesh.hxx2
-rw-r--r--include/sfx2/frame.hxx2
-rw-r--r--include/sfx2/objsh.hxx2
-rw-r--r--include/sfx2/viewsh.hxx2
-rw-r--r--include/svx/fmshell.hxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx2
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/OutlineViewShell.hxx2
-rw-r--r--sd/source/ui/inc/ViewShell.hxx2
-rw-r--r--sd/source/ui/inc/ViewShellBase.hxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx6
-rw-r--r--sd/source/ui/view/drviews1.cxx8
-rw-r--r--sd/source/ui/view/outlnvsh.cxx4
-rw-r--r--sd/source/ui/view/viewshel.cxx4
-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
-rw-r--r--svx/source/form/fmshell.cxx8
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/source/ui/app/docsh2.cxx6
-rw-r--r--sw/source/ui/inc/view.hxx2
-rw-r--r--sw/source/ui/uiview/view.cxx9
29 files changed, 62 insertions, 65 deletions
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 674775b79d77..0f4169af0eea 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -371,7 +371,7 @@ void Shell::StoreAllWindowData( bool bPersistent )
}
-sal_uInt16 Shell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool Shell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
(void)bForBrowsing;
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 1945d8afc390..94265a2ca85e 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -119,7 +119,7 @@ private:
virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize );
virtual void OuterResizePixel( const Point &rPos, const Size &rSize );
sal_uInt16 InsertWindowInTable (BaseWindow* pNewWin);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing );
+ virtual bool PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing );
void SetCurWindow (BaseWindow* pNewWin, bool bUpdateTabBar = false, bool bRememberAsCurrent = true);
void ManageToolbars();
diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index 9512f2140a1c..7426ed26a89c 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -172,7 +172,7 @@ public:
SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet );
SAL_DLLPRIVATE void GetViewData_Impl();
SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
- SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False );
+ SAL_DLLPRIVATE bool PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False );
SAL_DLLPRIVATE sal_Bool DocIsModified_Impl();
SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 7477963bebfa..79a0bca2b990 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -426,7 +426,7 @@ public:
static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc );
virtual void ViewAssigned();
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
virtual sal_Bool IsInformationLost();
virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
sal_Int16 QueryHiddenInformation( HiddenWarningFact eFact, Window* pParent );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index f4989a07ea9b..f6bfdb4f8839 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -184,7 +184,7 @@ public:
void VisAreaChanged(const Rectangle& rRect);
// Misc
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
virtual OUString GetSelectionText( bool bCompleteWords = false );
virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
virtual SdrView* GetDrawView() const;
diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx
index 89dc2009f616..815a7862a7ac 100644
--- a/include/svx/fmshell.hxx
+++ b/include/svx/fmshell.hxx
@@ -123,7 +123,7 @@ public:
FmFormPage* GetCurPage() const;
FmXFormShell* GetImpl() const {return m_pImpl;};
- sal_uInt16 PrepareClose(sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
+ bool PrepareClose(sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
bool IsActiveControl() const;
void ForgetActiveControl();
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f3e0e0707cc8..49150e3ef34b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2500,7 +2500,7 @@ sal_Bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId )
}
-sal_uInt16 ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
if(SC_MOD()->GetCurRefDlgId()>0)
{
@@ -2546,8 +2546,8 @@ sal_uInt16 ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
}
// end handler code
- sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
- if (nRet == sal_True) // sal_True = schliessen
+ bool nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
+ if (nRet) // true = close
aDocument.EnableIdle(false); // nicht mehr drin rumpfuschen !!!
return nRet;
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 7e103902fb1f..b71577a56ec2 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -209,7 +209,7 @@ public:
virtual sal_Bool Save();
virtual sal_Bool SaveAs( SfxMedium& rMedium );
virtual sal_Bool ConvertTo( SfxMedium &rMedium );
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
virtual void PrepareReload();
virtual sal_Bool IsInformationLost();
virtual void LoadStyles( SfxObjectShell &rSource );
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 083befed2a53..a1654da5ad15 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -202,7 +202,7 @@ private:
protected:
virtual void Activate(sal_Bool bMDI);
virtual void Deactivate(sal_Bool bMDI);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
virtual void ShowCursor(bool bOn);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index a3aec35e712e..5e591ef23cef 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1551,7 +1551,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa
FmFormShell* pFormSh = aViewData.GetViewShell()->GetFormShell();
if (pFormSh)
{
- bool bAllowed = static_cast<bool>(pFormSh->PrepareClose(true));
+ bool bAllowed = pFormSh->PrepareClose(true);
if (!bAllowed)
{
//! Fehlermeldung? oder macht das die FormShell selber?
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 456df666dc33..2f566a449d39 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -276,7 +276,7 @@ void ScTabViewShell::SetActive()
ActiveGrabFocus();
}
-sal_uInt16 ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
+bool ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
{
// Call EnterHandler even in formula mode here,
// so a formula change in an embedded object isn't lost
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 373a1d055687..e8ab1fa99343 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -227,7 +227,7 @@ public:
const Ruler& rRuler,
const MouseEvent& rMEvt);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
PageKind GetPageKind() { return mePageKind; }
diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx
index f3a02602dc1b..931d62ec7b0e 100644
--- a/sd/source/ui/inc/OutlineViewShell.hxx
+++ b/sd/source/ui/inc/OutlineViewShell.hxx
@@ -70,7 +70,7 @@ public:
*/
virtual void ArrangeGUIElements (void);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
virtual long VirtHScrollHdl(ScrollBar* pHScroll);
virtual long VirtVScrollHdl(ScrollBar* pVHScroll);
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 33d956cfe135..725428f1b408 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -274,7 +274,7 @@ public:
sal_uInt16 GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; }
void SetPrintedHandoutPageCount (sal_uInt16 nPageCount) {mnPrintedHandoutPageCount=nPageCount; }
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
void GetMenuState(SfxItemSet& rSet);
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 294598298c04..cfa022341ee9 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -161,7 +161,7 @@ public:
virtual void SetZoomFactor (
const Fraction &rZoomX,
const Fraction &rZoomY);
- virtual sal_uInt16 PrepareClose (sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
+ virtual bool PrepareClose (sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
virtual void WriteUserData (OUString&, bool bBrowse = false);
virtual void ReadUserData (const OUString&, bool bBrowse = false);
virtual SdrView* GetDrawView (void) const;
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 56ee1054b67e..4478109e3026 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -831,11 +831,11 @@ void ViewShellBase::SetZoomFactor (
-sal_uInt16 ViewShellBase::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
+bool ViewShellBase::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
{
- sal_uInt16 nResult = SfxViewShell::PrepareClose (bUI, bForBrowsing);
+ bool nResult = SfxViewShell::PrepareClose (bUI, bForBrowsing);
- if (nResult == sal_True)
+ if (nResult)
{
mpImpl->mbIsClosing = true;
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 2df556dd7413..de43b57ae7da 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -293,12 +293,12 @@ void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
* discover an refreshed text objext.
*/
-sal_uInt16 DrawViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool DrawViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
- if ( ViewShell::PrepareClose(bUI, bForBrowsing) != sal_True )
- return sal_False;
+ if ( !ViewShell::PrepareClose(bUI, bForBrowsing) )
+ return false;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
if( bRet && HasCurrentFunction() )
{
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 94a5d040347a..79bc5801314f 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1145,10 +1145,10 @@ long OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
* PrepareClose, gets called when the Shell shall be destroyed.
* Forwards the invocation to the View
*/
-sal_uInt16 OutlineViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool OutlineViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
if( ViewShell::PrepareClose(bUI, bForBrowsing) != sal_True )
- return sal_False;
+ return false;
return pOlView == NULL || pOlView->PrepareClose(bUI);
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index cb0924591b5c..4c1c0122dfee 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1035,9 +1035,9 @@ void ViewShell::SetDefTabHRuler( sal_uInt16 nDefTab )
/** Tell the FmFormShell that the view shell is closing. Give it the
oportunity to prevent that.
*/
-sal_uInt16 ViewShell::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
+bool ViewShell::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
{
- sal_uInt16 nResult = sal_True;
+ bool nResult = true;
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
if (pFormShell != NULL)
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;
}
//--------------------------------------------------------------------
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index c897ed5af603..958a58f39155 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -247,13 +247,13 @@ void FmFormShell::NotifyMarkListChanged(FmFormView* pWhichView)
}
//------------------------------------------------------------------------
-sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool /*bForBrowsing*/)
+bool FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool /*bForBrowsing*/)
{
if ( GetImpl()->didPrepareClose() )
// we already did a PrepareClose for the current modifications of the current form
- return sal_True;
+ return true;
- sal_Bool bResult = sal_True;
+ bool bResult = true;
// Save the data records, not in DesignMode and FilterMode
if (!m_bDesignMode && !GetImpl()->isInFilterMode() &&
m_pFormView && m_pFormView->GetActualOutDev() &&
@@ -286,7 +286,7 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool /*bForBrowsing*/)
break;
case RET_CANCEL:
- return sal_False;
+ return false;
}
if ( bModified )
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index f8f60bf71684..fffe7df54cc2 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -91,7 +91,7 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
SW_DLLPRIVATE virtual sal_Bool SaveAs( SfxMedium& rMedium );
SW_DLLPRIVATE virtual sal_Bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
- SW_DLLPRIVATE virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ SW_DLLPRIVATE virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
SW_DLLPRIVATE virtual bool InsertGeneratedStream(SfxMedium& rMedium,
css::uno::Reference<css::text::XTextRange> const& xInsertPosition)
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 6ae5687b553e..7a6bfc8be239 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -303,11 +303,11 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
// Notification Close Doc
-sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
- sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
+ bool nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
- if( sal_True == nRet )
+ if( nRet )
EndListening( *this );
if( pDoc && IsInPrepareClose() )
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index af145924d3c5..271579f91577 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -418,7 +418,7 @@ public:
bool bEraseTrail );
virtual sal_Bool HasSelection( sal_Bool bText ) const;
virtual OUString GetSelectionText( bool bCompleteWords = false );
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual bool PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
virtual void MarginChanged();
// replace word/selection with text from the thesaurus
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index d76c77c5f0fe..109fb73c64f6 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1728,19 +1728,16 @@ void SwView::StopShellTimer()
}
}
-sal_uInt16 SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+bool SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
SfxViewFrame* pVFrame = GetViewFrame();
pVFrame->SetChildWindow( SwInputChild::GetChildWindowId(), sal_False );
if( pVFrame->GetDispatcher()->IsLocked() )
pVFrame->GetDispatcher()->Lock(sal_False);
- sal_uInt16 nRet;
- if ( m_pFormShell &&
- sal_True != (nRet = m_pFormShell->PrepareClose( bUI, bForBrowsing )) )
-
+ if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI, bForBrowsing ) )
{
- return nRet;
+ return false;
}
return SfxViewShell::PrepareClose( bUI, bForBrowsing );
}