[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Dec 11 12:00:14 UTC 2017


 include/sfx2/frame.hxx        |    6 ++----
 include/sfx2/viewfrm.hxx      |    4 ++--
 sfx2/source/view/frame.cxx    |    8 ++++----
 sfx2/source/view/impframe.hxx |    4 ++--
 sfx2/source/view/viewfrm.cxx  |    4 ++--
 5 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 7c98099c2577084cc807a4928756e3e7e8600061
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Dec 11 11:16:56 2017 +0200

    convert SFXFRAME_HASTITLE to bool field
    
    this is the only flag we are setting in the "type" field, so simplify
    
    Change-Id: I6079750b915f55486bf815a27d48f673af59bdb0
    Reviewed-on: https://gerrit.libreoffice.org/46214
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index 94c46d6ad05d..0c6169999483 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -76,8 +76,6 @@ class SystemWindow;
 
 typedef ::std::vector<OUString> TargetList;
 
-#define SFXFRAME_HASTITLE     0x0001
-
 
 // SfxFrame is a management class for windows and their content.
 // A SfxApplication represent a hierarchy of SfxFrames, with which the actual
@@ -124,7 +122,7 @@ public:
     SfxObjectShell*     GetCurrentDocument() const;
     SfxViewFrame*       GetCurrentViewFrame() const;
 
-    sal_uInt32          GetFrameType() const;
+    bool                GetHasTitle() const;
     static void         GetDefaultTargetList( TargetList& );
     void                UpdateDescriptor( SfxObjectShell const *pDoc );
     void                Resize();
@@ -141,7 +139,7 @@ public:
     SAL_DLLPRIVATE void SetFrameInterface_Impl( const css::uno::Reference< css::frame::XFrame >& rFrame );
     SAL_DLLPRIVATE void ReleasingComponent_Impl();
     SAL_DLLPRIVATE void GetViewData_Impl();
-    SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
+    SAL_DLLPRIVATE void SetHasTitle( bool );
     SAL_DLLPRIVATE bool PrepareClose_Impl( bool bUI );
     SAL_DLLPRIVATE bool DocIsModified_Impl();
     SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 333e055c6996..3c66418fa6fb 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -146,8 +146,8 @@ public:
     SfxViewFrame*           GetTopViewFrame() const;
 
     bool                    DoClose();
-    sal_uIntPtr             GetFrameType() const
-                            { return GetFrame().GetFrameType(); }
+    bool                    GetHasTitle() const
+                            { return GetFrame().GetHasTitle(); }
     static void             GetTargetList( TargetList& rList )
                             { SfxFrame::GetDefaultTargetList( rList ); }
 
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 8d940ba05bac..b772c62534dc 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -277,14 +277,14 @@ void SfxFrame::SetCurrentViewFrame_Impl( SfxViewFrame *pFrame )
     pImpl->pCurrentViewFrame = pFrame;
 }
 
-sal_uInt32 SfxFrame::GetFrameType() const
+bool SfxFrame::GetHasTitle() const
 {
-    return pImpl->nType;
+    return pImpl->mbHasTitle;
 }
 
-void SfxFrame::SetFrameType_Impl( sal_uInt32 n )
+void SfxFrame::SetHasTitle( bool n )
 {
-    pImpl->nType = n;
+    pImpl->mbHasTitle = n;
 }
 
 void SfxFrame::GetViewData_Impl()
diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx
index 25b4a392d4fd..b5f3413d2894 100644
--- a/sfx2/source/view/impframe.hxx
+++ b/sfx2/source/view/impframe.hxx
@@ -36,7 +36,7 @@ class SfxFrame_Impl : public SfxBroadcaster
 {
 public:
     css::uno::Reference< css::frame::XFrame > xFrame;
-    sal_uInt32                nType;
+    bool                      mbHasTitle;
     SfxViewFrame*             pCurrentViewFrame;
     SfxFrameDescriptor*       pDescr;
     bool                      bClosing : 1;
@@ -54,7 +54,7 @@ public:
     bool                      bMenuBarOn;
 
     explicit SfxFrame_Impl()
-        :nType( 0 )
+        :mbHasTitle( false )
         ,pCurrentViewFrame( nullptr )
         ,pDescr( nullptr )
         ,bClosing(false)
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e6db9e2d4fee..e168ac8068bf 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1012,7 +1012,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl()
             m_xObjSh->DoClose();
         SfxObjectShellRef xDyingObjSh = m_xObjSh;
         m_xObjSh.clear();
-        if( ( GetFrameType() & SFXFRAME_HASTITLE ) && m_pImpl->nDocViewNo )
+        if( GetHasTitle() && m_pImpl->nDocViewNo )
             xDyingObjSh->GetNoSet_Impl().ReleaseIndex(m_pImpl->nDocViewNo-1);
         if ( m_pImpl->bObjLocked )
         {
@@ -1350,7 +1350,7 @@ SfxViewFrame::SfxViewFrame
 {
 
     rFrame.SetCurrentViewFrame_Impl( this );
-    rFrame.SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE );
+    rFrame.SetHasTitle( true );
     Construct_Impl( pObjShell );
 
     m_pImpl->pWindow = VclPtr<SfxFrameViewWindow_Impl>::Create( this, rFrame.GetWindow() );


More information about the Libreoffice-commits mailing list