diff options
-rw-r--r-- | svtools/inc/svtools/svlbox.hxx | 28 | ||||
-rw-r--r-- | svtools/inc/svtools/svtreebx.hxx | 1 | ||||
-rw-r--r-- | svtools/source/contnr/svlbox.cxx | 139 | ||||
-rwxr-xr-x | unusedcode.easy | 2 |
4 files changed, 0 insertions, 170 deletions
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx index 9fde1c6d395f..b4f33c172386 100644 --- a/svtools/inc/svtools/svlbox.hxx +++ b/svtools/inc/svtools/svlbox.hxx @@ -54,7 +54,6 @@ class SvLBox; class SvLBoxEntry; class SvViewDataItem; class SvViewDataEntry; -class SvInplaceEdit; class SvInplaceEdit2; class SvLBoxString; class SvLBoxButton; @@ -581,33 +580,6 @@ struct SvLBoxDDInfo sal_uLong nRes1,nRes2,nRes3,nRes4; }; -class SvInplaceEdit : public Edit -{ - Link aCallBackHdl; - Accelerator aAccReturn; - Accelerator aAccEscape; - Timer aTimer; - sal_Bool bCanceled; - sal_Bool bAlreadyInCallBack; - - void CallCallBackHdl_Impl(); - DECL_LINK( Timeout_Impl, Timer * ); - DECL_LINK( ReturnHdl_Impl, Accelerator * ); - DECL_LINK( EscapeHdl_Impl, Accelerator * ); - -public: - SvInplaceEdit( Window* pParent, const Point& rPos, const Size& rSize, - const String& rData, const Link& rNotifyEditEnd, - const Selection& ); - ~SvInplaceEdit(); - - virtual void KeyInput( const KeyEvent& rKEvt ); - virtual void LoseFocus(); - sal_Bool EditingCanceled() const { return bCanceled; } - String GetText() const { return Edit::GetText(); } - void StopEditing( sal_Bool bCancel = sal_False ); -}; - class SvInplaceEdit2 { Link aCallBackHdl; diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index eab00e7c4368..0b45b0556305 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -36,7 +36,6 @@ // forward and defines --------------------------------------------------- class SvImpLBox; -class SvInplaceEdit; class TabBar; #define SV_TAB_BORDER 8 diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index 0809368e0aab..1ecfcf0f61cc 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -54,150 +54,11 @@ using namespace ::com::sun::star::accessibility; static SvLBox* pDDSource = NULL; static SvLBox* pDDTarget = NULL; -DBG_NAME(SvInplaceEdit) DBG_NAME(SvInplaceEdit2) #define SVLBOX_ACC_RETURN 1 #define SVLBOX_ACC_ESCAPE 2 -SvInplaceEdit::SvInplaceEdit -( - Window* pParent, - const Point& rPos, - const Size& rSize, - const String& rData, - const Link& rNotifyEditEnd, - const Selection& rSelection -) : - - Edit( pParent, WB_LEFT ), - - aCallBackHdl ( rNotifyEditEnd ), - bCanceled ( sal_False ), - bAlreadyInCallBack ( sal_False ) - -{ - DBG_CTOR(SvInplaceEdit,0); - - Font aFont( pParent->GetFont() ); - aFont.SetTransparent( sal_False ); - Color aColor( pParent->GetBackground().GetColor() ); - aFont.SetFillColor(aColor ); - SetFont( aFont ); - SetBackground( pParent->GetBackground() ); - SetPosPixel( rPos ); - SetSizePixel( rSize ); - SetText( rData ); - SetSelection( rSelection ); - SaveValue(); - - aAccReturn.InsertItem( SVLBOX_ACC_RETURN, KeyCode(KEY_RETURN) ); - aAccEscape.InsertItem( SVLBOX_ACC_ESCAPE, KeyCode(KEY_ESCAPE) ); - - aAccReturn.SetActivateHdl( LINK( this, SvInplaceEdit, ReturnHdl_Impl) ); - aAccEscape.SetActivateHdl( LINK( this, SvInplaceEdit, EscapeHdl_Impl) ); - GetpApp()->InsertAccel( &aAccReturn ); - GetpApp()->InsertAccel( &aAccEscape ); - - Show(); - GrabFocus(); -} - -SvInplaceEdit::~SvInplaceEdit() -{ - DBG_DTOR(SvInplaceEdit,0); - if( !bAlreadyInCallBack ) - { - GetpApp()->RemoveAccel( &aAccReturn ); - GetpApp()->RemoveAccel( &aAccEscape ); - } -} - -IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) -{ - DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = sal_False; - CallCallBackHdl_Impl(); - return 1; -} -IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) - -IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) -{ - DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = sal_True; - CallCallBackHdl_Impl(); - return 1; -} -IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) - -void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt ) -{ - DBG_CHKTHIS(SvInplaceEdit,0); - sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); - switch ( nCode ) - { - case KEY_ESCAPE: - bCanceled = sal_True; - CallCallBackHdl_Impl(); - break; - - case KEY_RETURN: - bCanceled = sal_False; - CallCallBackHdl_Impl(); - break; - - default: - Edit::KeyInput( rKEvt ); - } -} - -void SvInplaceEdit::StopEditing( sal_Bool bCancel ) -{ - DBG_CHKTHIS(SvInplaceEdit,0); - if ( !bAlreadyInCallBack ) - { - bCanceled = bCancel; - CallCallBackHdl_Impl(); - } -} - -void SvInplaceEdit::LoseFocus() -{ - DBG_CHKTHIS(SvInplaceEdit,0); - if ( !bAlreadyInCallBack ) - { - bCanceled = sal_False; - aTimer.SetTimeout(10); - aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl)); - aTimer.Start(); - } -} - -IMPL_LINK_INLINE_START( SvInplaceEdit, Timeout_Impl, Timer *, EMPTYARG ) -{ - DBG_CHKTHIS(SvInplaceEdit,0); - CallCallBackHdl_Impl(); - return 0; -} -IMPL_LINK_INLINE_END( SvInplaceEdit, Timeout_Impl, Timer *, EMPTYARG ) - -void SvInplaceEdit::CallCallBackHdl_Impl() -{ - DBG_CHKTHIS(SvInplaceEdit,0); - aTimer.Stop(); - if ( !bAlreadyInCallBack ) - { - bAlreadyInCallBack = sal_True; - GetpApp()->RemoveAccel( &aAccReturn ); - GetpApp()->RemoveAccel( &aAccEscape ); - Hide(); - aCallBackHdl.Call( this ); - // bAlreadyInCallBack = sal_False; - } -} - - // *************************************************************** class MyEdit_Impl : public Edit diff --git a/unusedcode.easy b/unusedcode.easy index 329509ac1a98..e6668ad34556 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -181,8 +181,6 @@ SvI18NMap_Impl::Insert(SvI18NMapEntry_Impl* const*, unsigned short) SvI18NMap_Impl::Insert(SvI18NMap_Impl const*, unsigned short, unsigned short) SvI18NMap_Impl::Remove(SvI18NMapEntry_Impl* const&, unsigned short) SvI18NMap_Impl::Remove(unsigned short, unsigned short) -SvInplaceEdit::StopEditing(unsigned char) -SvInplaceEdit::SvInplaceEdit(Window*, Point const&, Size const&, String const&, Link const&, Selection const&) SvLBoxBmp::SvLBoxBmp(SvLBoxEntry*, unsigned short, Image) SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, unsigned char) SvLBoxButtonData::SvLBoxButtonData() |