[Libreoffice-commits] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri Aug 12 02:35:35 PDT 2011


 sw/source/ui/inc/wrtsh.hxx    |    1 -
 sw/source/ui/wrtsh/wrtsh1.cxx |   33 +++++++++------------------------
 sw/source/ui/wrtsh/wrtsh2.cxx |    6 +++---
 3 files changed, 12 insertions(+), 28 deletions(-)

New commits:
commit 616fa2e637852d31d61342625ce9c7d92834904d
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri Aug 12 11:31:56 2011 +0200

    sw: Removed SwWrtShell::_CanInsert(), that method only for a beep...
    
    Used SwWrtShell::CanInsert() instead as it's the one doing the job. The
    _CanInsert was just a wrapper to Beep() when the result was false. Yuk!

diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 634cd97..ef7337d 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -612,7 +612,6 @@ private:
     SW_DLLPRIVATE long  Ignore(const Point *, sal_Bool bProp=sal_False );
 
     SW_DLLPRIVATE void  LeaveExtSel() { bSelWrd = bSelLn = sal_False;}
-    SW_DLLPRIVATE sal_Bool  _CanInsert();
 
     SW_DLLPRIVATE sal_Bool  GoStart(sal_Bool KeepArea = sal_False, sal_Bool * = 0,
             sal_Bool bSelect = sal_False, sal_Bool bDontMoveRegion = sal_False);
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 97c1ca2..9a3a7d9 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -183,21 +183,6 @@ sal_Bool SwWrtShell::IsEndWrd()
 
 
 /*------------------------------------------------------------------------
- Beschreibung:  Abfrage, ob Einfuegen moeglich ist; gfs. Beep
-------------------------------------------------------------------------*/
-
-
-
-sal_Bool SwWrtShell::_CanInsert()
-{
-    if(!CanInsert())
-    {
-        Sound::Beep();
-        return sal_False;
-    }
-    return sal_True;
-}
-/*------------------------------------------------------------------------
  Beschreibung:  String einfuegen
 ------------------------------------------------------------------------*/
 
@@ -225,7 +210,7 @@ void SwWrtShell::InsertByWord( const String & rStr)
 void SwWrtShell::Insert( const String &rStr )
 {
     ResetCursorStack();
-    if( !_CanInsert() )
+    if( !CanInsert() )
         return;
 
     sal_Bool bStarted = sal_False, bHasSel = HasSelection(),
@@ -278,7 +263,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
                          sal_Bool bRule )
 {
     ResetCursorStack();
-    if ( !_CanInsert() )
+    if ( !CanInsert() )
         return;
 
     StartAllAction();
@@ -378,7 +363,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
                             sal_Bool bActivate, sal_uInt16 nSlotId )
 {
     ResetCursorStack();
-    if( !_CanInsert() )
+    if( !CanInsert() )
         return;
 
     if( !xRef.is() )
@@ -906,7 +891,7 @@ void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt,
 void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
 {
     ResetCursorStack();
-    if( _CanInsert() )
+    if( CanInsert() )
     {
         ACT_KONTEXT(this);
         StartUndo(UNDO_UI_INSERT_PAGE_BREAK);
@@ -942,7 +927,7 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
 void SwWrtShell::InsertLineBreak()
 {
     ResetCursorStack();
-    if( _CanInsert() )
+    if( CanInsert() )
     {
         if(HasSelection())
             DelRight();
@@ -965,7 +950,7 @@ void SwWrtShell::InsertColumnBreak()
 {
     ACT_KONTEXT(this);
     ResetCursorStack();
-    if( _CanInsert() )
+    if( CanInsert() )
     {
         StartUndo(UNDO_UI_INSERT_COLUMN_BREAK);
 
@@ -990,7 +975,7 @@ void SwWrtShell::InsertColumnBreak()
 void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool bEdit )
 {
     ResetCursorStack();
-    if( _CanInsert() )
+    if( CanInsert() )
     {
         if(HasSelection())
         {
@@ -1025,7 +1010,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool
 void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
 {
     ResetCursorStack();
-    if( _CanInsert() )
+    if( CanInsert() )
     {
         ACT_KONTEXT(this);
 
@@ -1675,7 +1660,7 @@ void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet )
 void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
 {
     ResetCursorStack();
-    if(_CanInsert())
+    if(CanInsert())
     {
         sal_Bool bStarted = sal_False;
         if(HasSelection())
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index d5612ca..172500c 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -77,7 +77,7 @@
 void SwWrtShell::Insert(SwField &rFld)
 {
     ResetCursorStack();
-    if(!_CanInsert())
+    if(!CanInsert())
         return;
     StartAllAction();
 
@@ -196,7 +196,7 @@ sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, By
 
 void SwWrtShell::InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
 {
-    if(!_CanInsert())
+    if(!CanInsert())
         return;
 
     if(HasSelection())
@@ -214,7 +214,7 @@ sal_Bool SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet
 {
     sal_Bool bResult = sal_False;
 
-    if(_CanInsert())
+    if(CanInsert())
     {
         bResult = SwEditShell::UpdateTableOf(rTOX, pSet);
 


More information about the Libreoffice-commits mailing list