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

Stephan Bergmann sbergman at redhat.com
Mon Aug 12 07:42:16 PDT 2013


 sfx2/source/appl/appquit.cxx    |   18 +++++++++---------
 sfx2/source/dialog/templdlg.cxx |    4 ++--
 sfx2/source/doc/objxtor.cxx     |    4 ++--
 sfx2/source/inc/sfxtypes.hxx    |    5 +++--
 sfx2/source/inc/virtmenu.hxx    |    4 +---
 sfx2/source/menu/virtmenu.cxx   |   26 +-------------------------
 6 files changed, 18 insertions(+), 43 deletions(-)

New commits:
commit a8df509ca4e4e77e9ed684d627ee08d84805f534
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 12 16:41:30 2013 +0200

    error: dereferencing type-punned pointer will break strict-aliasing rules
    
    gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
    
    Change-Id: Id8f1828ae1dabc2f928d737d4fac8375dd73b5a2

diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 7a5daab..b94436a 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -131,15 +131,15 @@ void SfxApplication::Deinitialize()
     // from here no SvObjects have to exists
     DELETEZ(pAppData_Impl->pMatcher);
 
-    DELETEX(pAppData_Impl->pSlotPool);
-    DELETEX(pAppData_Impl->pFactArr);
-
-    DELETEX(pAppData_Impl->pTbxCtrlFac);
-    DELETEX(pAppData_Impl->pStbCtrlFac);
-    DELETEX(pAppData_Impl->pMenuCtrlFac);
-    DELETEX(pAppData_Impl->pViewFrames);
-    DELETEX(pAppData_Impl->pViewShells);
-    DELETEX(pAppData_Impl->pObjShells);
+    DELETEX(SfxSlotPool, pAppData_Impl->pSlotPool);
+    DELETEX(SfxChildWinFactArr_Impl, pAppData_Impl->pFactArr);
+
+    DELETEX(SfxTbxCtrlFactArr_Impl, pAppData_Impl->pTbxCtrlFac);
+    DELETEX(SfxStbCtrlFactArr_Impl, pAppData_Impl->pStbCtrlFac);
+    DELETEX(SfxMenuCtrlFactArr_Impl, pAppData_Impl->pMenuCtrlFac);
+    DELETEX(SfxViewFrameArr_Impl, pAppData_Impl->pViewFrames);
+    DELETEX(SfxViewShellArr_Impl, pAppData_Impl->pViewShells);
+    DELETEX(SfxObjectShellArr_Impl, pAppData_Impl->pObjShells);
 
     //TODO/CLEANTUP
     //ReleaseArgs could be used instead!
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 203f200..1dee9ac 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1013,10 +1013,10 @@ void SfxCommonTemplateDialog_Impl::ClearResource()
 
 void SfxCommonTemplateDialog_Impl::impl_clear()
 {
-    DELETEX(pStyleFamilies);
+    DELETEX(SfxStyleFamilies, pStyleFamilies);
     sal_uInt16 i;
     for ( i = 0; i < MAX_FAMILIES; ++i )
-        DELETEX(pFamilyState[i]);
+        DELETEX(SfxTemplateItem, pFamilyState[i]);
     for ( i = 0; i < COUNT_BOUND_FUNC; ++i )
         delete pBoundItems[i];
     pCurObjShell = NULL;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 2acf6c4..dcb4f1b 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -363,7 +363,7 @@ SfxObjectShell::~SfxObjectShell()
     SfxObjectShell::Close();
     pImp->pBaseModel.set( NULL );
 
-    DELETEX(pImp->pReloadTimer );
+    DELETEX(AutoReloadTimer_Impl, pImp->pReloadTimer );
 
     SfxApplication *pSfxApp = SFX_APP();
     if ( USHRT_MAX != pImp->nVisualDocumentNumber )
@@ -398,7 +398,7 @@ SfxObjectShell::~SfxObjectShell()
         if ( IsDocShared() )
             FreeSharedFile();
 #endif
-        DELETEX( pMedium );
+        DELETEX( SfxMedium, pMedium );
     }
 
     // The removing of the temporary file must be done as the latest step in the document destruction
diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx
index aa573a0..e12ed3b 100644
--- a/sfx2/source/inc/sfxtypes.hxx
+++ b/sfx2/source/inc/sfxtypes.hxx
@@ -34,9 +34,10 @@
 
 #ifndef DELETEX
 #ifdef DBG_UTIL
-#define DELETEX(pPtr) ( delete pPtr, (void*&) pPtr = (void*) 0xFFFFFFFF )
+#define DELETEX(T, pPtr) \
+    ( delete pPtr, pPtr = reinterpret_cast<T *>(sal_IntPtr(-1)) )
 #else
-#define DELETEX(pPtr) delete pPtr
+#define DELETEX(T, pPtr) delete pPtr
 #endif
 #endif
 
commit f91d4f156b4fdb6e6a8a755714fd384bfa275e3d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 12 16:34:42 2013 +0200

    Unused pAutoDeactivate, is never non-null
    
    ...and was like that already in fd069bee7e57ad529c3c0974559fd2d84ec3151a
    "initial import."
    
    TODO: Menu::Highlight in vcl/source/window/menu.cxx makes it look like the now
    almost empty IMPL_LINK_NOARG(SfxVirtualMenu,Highlight) returning sal_True makes
    a difference compared to having no handler set (in which case aHighlightHdl.Call
    returns 0), so I left it in; but that may just be overcautious and the handler
    could really go for good.
    
    Change-Id: I0cb28ddb1a5f747000b5749ed080502ae83c5575

diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
index 10e971d..0bf4152 100644
--- a/sfx2/source/inc/virtmenu.hxx
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -24,7 +24,6 @@
 #include <sfx2/mnuitem.hxx>
 
 class SfxBindings;
-class Timer;
 class SfxMenuImageControl_Impl;
 
 typedef ::boost::ptr_vector<SfxMenuControl> SfxMenuCtrlArr_Impl;
@@ -44,7 +43,6 @@ private:
     PopupMenu*      pWindowMenu;
     PopupMenu*      pPickMenu;
     PopupMenu*      pAddonsMenu;
-    Timer*          pAutoDeactivate; // Hack for QAP-Bug
     sal_uInt16          nVisibleItems;
     sal_uInt16          nId;
     sal_uInt16          nCount;
@@ -71,7 +69,7 @@ protected:
                         SfxBindings &rBind, sal_Bool bOLEServer=sal_False, sal_Bool bRes=sal_False, sal_Bool bIsAddonMenu=sal_False );
 
     void            CreateFromSVMenu();
-    DECL_LINK( Highlight, Menu * );
+    DECL_LINK( Highlight, void * );
     DECL_LINK( Activate, Menu * );
     DECL_LINK( Deactivate, Menu * );
     DECL_LINK( SettingsChanged, void* );
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 005a140..d58fc65 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -174,7 +174,6 @@ SfxVirtualMenu::SfxVirtualMenu( sal_uInt16 nOwnId,
        pImageControl(0),
     pBindings(&rBindings),
     pResMgr(0),
-    pAutoDeactivate(0),
     nLocks(0),
     bHelpInitialized( bWithHelp ),
     bIsAddonPopupMenu( bIsAddonMenu )
@@ -208,7 +207,6 @@ SfxVirtualMenu::SfxVirtualMenu( Menu *pStarViewMenu, sal_Bool bWithHelp,
        pImageControl(0),
     pBindings(&rBindings),
     pResMgr(0),
-    pAutoDeactivate(0),
     nLocks(0),
     bHelpInitialized( bWithHelp ),
     bIsAddonPopupMenu( bIsAddonMenu )
@@ -252,14 +250,6 @@ SfxVirtualMenu::~SfxVirtualMenu()
         pBindings->LEAVEREGISTRATIONS(); --nLocks; bIsActive = sal_False;
     }
 
-    // QAP-Hack
-    if ( pAutoDeactivate )
-    {
-        if ( pAutoDeactivate->IsActive() )
-            Deactivate(0);
-        DELETEX(pAutoDeactivate);
-    }
-
     if (pItems)
     {
         delete [] pItems;
@@ -502,18 +492,10 @@ void SfxVirtualMenu::CreateFromSVMenu()
 
 // called on activation of the SV-Menu
 
-IMPL_LINK( SfxVirtualMenu, Highlight, Menu *, pMenu )
+IMPL_LINK_NOARG( SfxVirtualMenu, Highlight )
 {
     DBG_CHKTHIS(SfxVirtualMenu, 0);
 
-    // own StarView-Menu
-    if ( pMenu == pSVMenu )
-    {
-        // AutoDeactivate is not necessary anymore
-        if ( pAutoDeactivate )
-            pAutoDeactivate->Stop();
-    }
-
     return sal_True;
 }
 
@@ -920,9 +902,6 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu )
         // Supress the Status updates until Deactivate
         pBindings->ENTERREGISTRATIONS(); ++nLocks; bIsActive = sal_True;
 
-        if ( pAutoDeactivate ) // QAP-Hack
-            pAutoDeactivate->Start();
-
         return sal_True;
     }
     else
@@ -945,9 +924,6 @@ IMPL_LINK( SfxVirtualMenu, Deactivate, Menu *, pMenu )
     DBG_OUTF( ("SfxVirtualMenu %lx deactivated %lx, own %lx", this, pMenu, pSVMenu) );
     if ( bIsActive && ( 0 == pMenu || pMenu == pSVMenu ) )
     {
-        if ( pAutoDeactivate )
-            pAutoDeactivate->Stop();
-
         // All controllers can be unbinded all the way up to the Menubar,
         // when the menu is disabled (= closed)
         if ( pParent )


More information about the Libreoffice-commits mailing list