[Libreoffice-commits] core.git: basctl/source include/sfx2 include/svx sc/source sd/source sfx2/source svx/source sw/inc sw/source

Stephan Bergmann sbergman at redhat.com
Tue Jan 14 00:32:26 PST 2014


 basctl/source/basicide/basidesh.cxx    |    2 +-
 basctl/source/inc/basidesh.hxx         |    2 +-
 include/sfx2/frame.hxx                 |    2 +-
 include/sfx2/objsh.hxx                 |    2 +-
 include/sfx2/viewsh.hxx                |    2 +-
 include/svx/fmshell.hxx                |    2 +-
 sc/source/ui/docshell/docsh.cxx        |    6 +++---
 sc/source/ui/inc/docsh.hxx             |    2 +-
 sc/source/ui/inc/tabvwsh.hxx           |    2 +-
 sc/source/ui/view/tabview3.cxx         |    2 +-
 sc/source/ui/view/tabvwsh4.cxx         |    2 +-
 sd/source/ui/inc/DrawViewShell.hxx     |    2 +-
 sd/source/ui/inc/OutlineViewShell.hxx  |    2 +-
 sd/source/ui/inc/ViewShell.hxx         |    2 +-
 sd/source/ui/inc/ViewShellBase.hxx     |    2 +-
 sd/source/ui/view/ViewShellBase.cxx    |    6 +++---
 sd/source/ui/view/drviews1.cxx         |    8 ++++----
 sd/source/ui/view/outlnvsh.cxx         |    4 ++--
 sd/source/ui/view/viewshel.cxx         |    4 ++--
 sfx2/source/doc/objxtor.cxx            |   18 +++++++++---------
 sfx2/source/view/frame.cxx             |   10 +++++-----
 sfx2/source/view/sfxbasecontroller.cxx |    4 ++--
 sfx2/source/view/viewfrm.cxx           |    2 +-
 sfx2/source/view/viewsh.cxx            |   10 +++++-----
 svx/source/form/fmshell.cxx            |    8 ++++----
 sw/inc/docsh.hxx                       |    2 +-
 sw/source/ui/app/docsh2.cxx            |    6 +++---
 sw/source/ui/inc/view.hxx              |    2 +-
 sw/source/ui/uiview/view.cxx           |    9 +++------
 29 files changed, 62 insertions(+), 65 deletions(-)

New commits:
commit 0d0fd7b4fbc6090fe7112eef8b2b07840cf8a89d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 14 09:31:42 2014 +0100

    PrepareClose should probably return bool
    
    Change-Id: Ie62a6c1197594102bc68e246ae6059a9442ce314

diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 674775b..0f4169a 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 1945d8a..94265a2 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 9512f21..7426ed2 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 7477963..79a0bca 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 f4989a0..f6bfdb4 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 89dc200..815a786 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 f3e0e07..49150e3 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 7e10390..b71577a 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 083befe..a1654da 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 a3aec35..5e591ef 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 456df66..2f566a4 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 373a1d0..e8ab1fa 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 f3a0260..931d62e 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 33d956c..725428f 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 2945982..cfa0223 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 56ee105..4478109 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 2df556d..de43b57 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 94a5d04..79bc580 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 cb09245..4c1c012 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 3a02be1..d65711d 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 fa51f54..e4fb67f 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 72643d9..e54258e 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 8206d6c..9ed3d77 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 6950670..ffcd740 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 c897ed5..958a58f 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 f8f60bf..fffe7df 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 6ae5687..7a6bfc8 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 af14592..271579f 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 d76c77c..109fb73 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 );
 }


More information about the Libreoffice-commits mailing list