Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



Hi,

As Thomas Arnhold suggested, I've removed the following methods:
WinSalFrame::Beep
GtkSalFrame::Beep
X11SalFrame::Beep
SalDisplay::Beep
IosSalFrame::Beep
SvpSalFrame::Beep

I've also removed sndstyle.hxx and calls to MessageBeep().

I've done a complete build without warnings on modified files.

Thomas, if you know some similar tasks let me know.

Best regards

Mathieu


-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

From 8119da3d649364fb0d5864f0ef44803f3006d453 Mon Sep 17 00:00:00 2001
From: Mathieu Vonlanthen <mat_von@fastmail.fm>
Date: Mon, 30 Jul 2012 11:45:03 +0200
Subject: [PATCH] fdo#48549 System::Beep() removal

Change-Id: I402202e199dfc8c2462859d00529f2782f6228b0
---
 starmath/source/dialog.cxx          |    1 -
 tools/source/debug/debug.cxx        |   11 ----------
 vcl/Package_inc.mk                  |    1 -
 vcl/aqua/source/window/salframe.cxx |   15 -------------
 vcl/headless/svpframe.cxx           |    4 ----
 vcl/inc/aqua/salframe.h             |    1 -
 vcl/inc/headless/svpframe.hxx       |    1 -
 vcl/inc/ios/salframe.h              |    1 -
 vcl/inc/salframe.hxx                |    3 ---
 vcl/inc/unx/gtk/gtkframe.hxx        |    2 --
 vcl/inc/unx/saldisp.hxx             |    2 --
 vcl/inc/unx/salframe.h              |    1 -
 vcl/inc/vcl/sndstyle.hxx            |   40 -----------------------------------
 vcl/inc/win/salframe.h              |    1 -
 vcl/ios/source/window/salframe.cxx  |   15 -------------
 vcl/source/app/dbggui.cxx           |    2 --
 vcl/unx/generic/app/saldisp.cxx     |    7 ------
 vcl/unx/generic/window/salframe.cxx |   16 --------------
 vcl/unx/gtk/window/gtkframe.cxx     |   13 ------------
 vcl/win/source/window/salframe.cxx  |   18 ----------------
 20 files changed, 155 deletions(-)
 delete mode 100644 vcl/inc/vcl/sndstyle.hxx

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 0cec1b9..532ed8a 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -30,7 +30,6 @@
 #include <svtools/ctrltool.hxx>
 #include <sfx2/printer.hxx>
 #include <vcl/help.hxx>
-#include <vcl/sndstyle.hxx>
 #include <vcl/waitobj.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/wall.hxx>
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index cad812f..2d90389 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -631,15 +631,6 @@ static void DbgGetLogFileName( sal_Char* pStr )
 
 // -----------------------------------------------------------------------
 
-static void DbgDebugBeep()
-{
-#if defined( WNT )
-    MessageBeep( MB_ICONHAND );
-#endif
-}
-
-// -----------------------------------------------------------------------
-
 static DebugData* GetDebugData()
 {
     if ( !aDebugData.bInit )
@@ -1491,8 +1482,6 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, 
sa
     {
         nOut = pData->aDbgData.nErrorOut;
         pStr = "Error: ";
-        if ( pData->aDbgData.nErrorOut == DBG_OUT_FILE )
-            DbgDebugBeep();
     }
     else if ( nDbgOut == DBG_OUT_WARNING )
     {
diff --git a/vcl/Package_inc.mk b/vcl/Package_inc.mk
index 0da4b14..a01822f 100644
--- a/vcl/Package_inc.mk
+++ b/vcl/Package_inc.mk
@@ -131,7 +131,6 @@ $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/scrbar.hxx,vcl/scrbar.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/seleng.hxx,vcl/seleng.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/settings.hxx,vcl/settings.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/slider.hxx,vcl/slider.hxx))
-$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/sndstyle.hxx,vcl/sndstyle.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/solarmutex.hxx,vcl/solarmutex.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/spinfld.hxx,vcl/spinfld.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/spin.h,vcl/spin.h))
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 456bb91..a80ff4e 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -1344,21 +1344,6 @@ const SystemEnvData* AquaSalFrame::GetSystemData() const
 
 // -----------------------------------------------------------------------
 
-void AquaSalFrame::Beep( SoundType eSoundType )
-{
-    switch( eSoundType )
-    {
-    case SOUND_DISABLE:
-        // don't beep
-        break;
-    default:
-        NSBeep();
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------
-
 void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
 {
     if ( !mpWindow )
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 208313d..c6ca6c1 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -428,10 +428,6 @@ void SvpSalFrame::UpdateSettings( AllSettings& )
 {
 }
 
-void SvpSalFrame::Beep( SoundType )
-{
-}
-
 const SystemEnvData* SvpSalFrame::GetSystemData() const
 {
     return &m_aSystemChildData;
diff --git a/vcl/inc/aqua/salframe.h b/vcl/inc/aqua/salframe.h
index 50ec407..e51035a 100644
--- a/vcl/inc/aqua/salframe.h
+++ b/vcl/inc/aqua/salframe.h
@@ -147,7 +147,6 @@ public:
     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType 
aLangType, KeyCode& rKeyCode );
     virtual LanguageType        GetInputLanguage();
     virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual void                Beep( SoundType eSoundType );
     virtual const SystemEnvData*    GetSystemData() const;
     virtual SalPointerState     GetPointerState();
     virtual SalIndicatorState   GetIndicatorState();
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index ac8683f..e8613a8 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -115,7 +115,6 @@ public:
     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType 
aLangType, KeyCode& rKeyCode );
     virtual LanguageType        GetInputLanguage();
     virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual void                Beep( SoundType eSoundType );
     virtual const SystemEnvData*    GetSystemData() const;
     virtual SalPointerState     GetPointerState();
     virtual SalIndicatorState   GetIndicatorState();
diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h
index 46ff6fc..0c5c0b8 100644
--- a/vcl/inc/ios/salframe.h
+++ b/vcl/inc/ios/salframe.h
@@ -143,7 +143,6 @@ public:
     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType 
aLangType, KeyCode& rKeyCode );
     virtual LanguageType        GetInputLanguage();
     virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual void                Beep( SoundType eSoundType );
     virtual const SystemEnvData*    GetSystemData() const;
     virtual SalPointerState     GetPointerState();
     virtual SalIndicatorState   GetIndicatorState();
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index cd3f3b9..30608cd 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -35,7 +35,6 @@
 #ifdef __cplusplus
 
 #include <vcl/ptrstyle.hxx>
-#include <vcl/sndstyle.hxx>
 
 #endif // __cplusplus
 #include <salwtype.hxx>
@@ -215,8 +214,6 @@ public:
 
     virtual void                UpdateSettings( AllSettings& rSettings ) = 0;
 
-    virtual void                Beep( SoundType eSoundType ) = 0;
-
     // returns system data (most prominent: window handle)
     virtual const SystemEnvData*    GetSystemData() const = 0;
 
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 17d3e12..08ffa06 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -396,8 +396,6 @@ public:
 
     virtual void                UpdateSettings( AllSettings& rSettings );
 
-    virtual void                Beep( SoundType eSoundType );
-
     // returns system data (most prominent: window handle)
     virtual const SystemEnvData*    GetSystemData() const;
 
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 0df9886..96a51ca 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -330,8 +330,6 @@ public:
     void            DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const;
 #endif
 
-    void            Beep() const;
-
     void            ModifierMapping();
     void            SimulateKeyPress( sal_uInt16 nKeyCode );
     sal_uInt16          GetIndicatorState() const;
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index cced9d6..71b1f53 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -252,7 +252,6 @@ public:
     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType 
aLangType, KeyCode& rKeyCode );
     virtual LanguageType        GetInputLanguage();
     virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual void                Beep( SoundType eSoundType );
     virtual const SystemEnvData*    GetSystemData() const;
     virtual SalPointerState     GetPointerState();
     virtual SalIndicatorState   GetIndicatorState();
diff --git a/vcl/inc/vcl/sndstyle.hxx b/vcl/inc/vcl/sndstyle.hxx
deleted file mode 100644
index 38be8cd..0000000
--- a/vcl/inc/vcl/sndstyle.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SV_SNDSTYLE_HXX
-#define _SV_SNDSTYLE_HXX
-
-#include <tools/solar.h>
-
-// ---------------
-// - Sound-Types -
-// ---------------
-
-typedef sal_uInt16 SoundType;
-#define SOUND_DEFAULT                   ((SoundType)0)
-#define SOUND_INFO                      ((SoundType)1)
-#define SOUND_WARNING                   ((SoundType)2)
-#define SOUND_ERROR                     ((SoundType)3)
-#define SOUND_QUERY                     ((SoundType)4)
-
-#define SOUND_DISABLE                   ((SoundType)5)
-
-#endif // _SV_SNDSTYLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index 0d4e206..faaefbe 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -130,7 +130,6 @@ public:
     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType 
aLangType, KeyCode& rKeyCode );
     virtual LanguageType        GetInputLanguage();
     virtual void                UpdateSettings( AllSettings& rSettings );
-    virtual void                Beep( SoundType eSoundType );
     virtual const SystemEnvData*    GetSystemData() const;
     virtual SalPointerState     GetPointerState();
     virtual SalIndicatorState   GetIndicatorState();
diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx
index c86aa7d..2748f0a 100644
--- a/vcl/ios/source/window/salframe.cxx
+++ b/vcl/ios/source/window/salframe.cxx
@@ -767,21 +767,6 @@ const SystemEnvData* IosSalFrame::GetSystemData() const
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::Beep( SoundType eSoundType )
-{
-    switch( eSoundType )
-    {
-    case SOUND_DISABLE:
-        // don't beep
-        break;
-    default:
-        // ???
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------
-
 void IosSalFrame::SetPosSize(long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/, 
sal_uInt16 nFlags)
 {
     if ( !mpWindow )
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 7f7ead5..d3b87da 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1618,7 +1618,6 @@ long SolarMessageBoxExecutor::doIt()
 #ifdef WNT
     sal_Bool bOldCallTimer = pSVData->mbNoCallTimer;
     pSVData->mbNoCallTimer = sal_True;
-    MessageBeep( MB_ICONHAND );
     nResult = MessageBoxW( 0, (LPWSTR)m_sDebugMessage.GetBuffer(), L"Debug Output",
                                      MB_TASKMODAL | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONSTOP );
     pSVData->mbNoCallTimer = bOldCallTimer;
@@ -1655,7 +1654,6 @@ void DbgPrintMsgBox( const char* pLine )
         // TODO: Shouldn't this be a IsDebuggerPresent()?
         if ( GetSystemMetrics( SM_DEBUG ) )
         {
-            MessageBeep( MB_ICONHAND );
             strcpy( aDbgOutBuf, pLine );
             strcat( aDbgOutBuf, "\r\n" );
             OutputDebugString( aDbgOutBuf );
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index e9b4ba0..a76d035 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -673,13 +673,6 @@ void SalX11Display::SetupInput( SalI18N_InputMethod *pInputMethod )
     SetKbdExtension( pKbdExtension );
 }
 
-// Sound
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::Beep() const
-{
-    XBell( pDisp_, 0 );
-}
-
 // Keyboard
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 0a76ff3..9d74444 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2633,22 +2633,6 @@ bool X11SalFrame::SetPluginParent( SystemParentData* pNewParent )
     return true;
 }
 
-// Sound
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported
-{
-    switch( eSoundType )
-    {
-        case SOUND_DEFAULT:
-        case SOUND_ERROR:
-            GetDisplay()->Beep();
-            break;
-        default:
-            // Excessive beeping averted
-            break;
-    }
-}
-
 // Event Handling
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 static sal_uInt16 sal_GetCode( int state )
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index d45a8f6..a6f8e0d 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2477,19 +2477,6 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings )
         ReleaseGraphics( pGraphics );
 }
 
-void GtkSalFrame::Beep( SoundType eType )
-{
-    switch( eType )
-    {
-        case SOUND_DEFAULT:
-        case SOUND_ERROR:
-            gdk_display_beep( getGdkDisplay() );
-            break;
-        default:
-            break;
-    }
-}
-
 const SystemEnvData* GtkSalFrame::GetSystemData() const
 {
     return &m_aSystemData;
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 2af53d3..938a710 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2931,23 +2931,6 @@ const SystemEnvData* WinSalFrame::GetSystemData() const
 
 // -----------------------------------------------------------------------
 
-void WinSalFrame::Beep( SoundType eSoundType )
-{
-    static UINT aImplSoundTab[5] =
-    {
-        0,                              // SOUND_DEFAULT
-        MB_ICONASTERISK,                // SOUND_INFO
-        MB_ICONEXCLAMATION,             // SOUND_WARNING
-        MB_ICONHAND,                    // SOUND_ERROR
-        MB_ICONQUESTION                 // SOUND_QUERY
-    };
-
-    if( eSoundType != SOUND_DISABLE ) // don't beep on disable
-        MessageBeep( aImplSoundTab[eSoundType] );
-}
-
-// -----------------------------------------------------------------------
-
 SalFrame::SalPointerState WinSalFrame::GetPointerState()
 {
     SalPointerState aState;
@@ -4980,7 +4963,6 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
              (!bMaximize && (nCommand == SC_MAXIMIZE)) ||
              (bMaximize && (nCommand == SC_RESTORE)) )
         {
-            MessageBeep( 0 );
             return TRUE;
         }
     }
-- 
1.7.9.5


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.