diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-03-25 22:53:28 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-03-26 15:09:45 +0000 |
commit | 12c6caa84a61f23df996a0396432fa4b8d5c4785 (patch) | |
tree | 9cf31b38751281d60cd79635c2cc128a7d6053c2 /basctl | |
parent | 3bae306bcf23c4baae65b2b8a3617f0b697dfc6a (diff) |
Kill remaining PseudoSlots usage
Change-Id: I14a820b7c0baba8d8b17d07715bf17c42c73c8fb
TODO: Remove support code from idl and sfx2 modules
Reviewed-on: https://gerrit.libreoffice.org/35718
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/sdi/baside.sdi | 119 | ||||
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 364 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 25 | ||||
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 46 | ||||
-rw-r--r-- | basctl/source/basicide/idetemp.hxx | 57 | ||||
-rw-r--r-- | basctl/source/inc/baside3.hxx | 1 | ||||
-rw-r--r-- | basctl/source/inc/basidesh.hxx | 2 |
7 files changed, 330 insertions, 284 deletions
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi index e61f737e0e14..f4993919e5ae 100644 --- a/basctl/sdi/baside.sdi +++ b/basctl/sdi/baside.sdi @@ -409,6 +409,125 @@ shell basctl_Shell SID_CHOOSE_CONTROLS [ + StateMethod = GetState; + ] + SID_INSERT_PUSHBUTTON + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_CHECKBOX + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_RADIOBUTTON + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_SPINBUTTON + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_FIXEDTEXT + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_GROUPBOX + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_LISTBOX + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_COMBOBOX + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_EDIT + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_HSCROLLBAR + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_VSCROLLBAR + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_SELECT + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_IMAGECONTROL + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_PROGRESSBAR + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_HFIXEDLINE + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_VFIXEDLINE + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_DATEFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_TIMEFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_NUMERICFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_CURRENCYFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_FORMATTEDFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_PATTERNFIELD + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_FILECONTROL + [ + ExecMethod = ExecuteDialog; + StateMethod = GetState; + ] + SID_INSERT_TREECONTROL + [ ExecMethod = ExecuteDialog; StateMethod = GetState; ] diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 821c34176072..ffccb5e2f1cb 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -29,7 +29,6 @@ #include "dlgedmod.hxx" #include "dlgedview.hxx" #include "iderdll.hxx" -#include "idetemp.hxx" #include "localizationmgr.hxx" #include "managelang.hxx" @@ -79,6 +78,7 @@ DialogWindow::DialogWindow(DialogWindowLayout* pParent, ScriptDocument const& rD ? rDocument.getDocument() : Reference<frame::XModel>(), xDialogModel)) ,m_pUndoMgr(new SfxUndoManager) + ,m_nControlSlotId(SID_INSERT_SELECT) { InitSettings(); @@ -137,9 +137,9 @@ void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt ) m_pEditor->MouseButtonUp( rMEvt ); if( (m_pEditor->GetMode() == DlgEditor::INSERT) && !m_pEditor->IsCreateOK() ) { + m_nControlSlotId = SID_INSERT_SELECT; m_pEditor->SetMode( DlgEditor::SELECT ); - if (SfxBindings* pBindings = GetBindingsPtr()) - pBindings->Invalidate( SID_CHOOSE_CONTROLS ); + Shell::InvalidateControlSlots(); } if (SfxBindings* pBindings = GetBindingsPtr()) { @@ -304,50 +304,7 @@ void DialogWindow::GetState( SfxItemSet& rSet ) case SID_CHOOSE_CONTROLS: { if ( IsReadOnly() ) - { rSet.DisableItem( nWh ); - } - else - { - SfxAllEnumItem aItem( SID_CHOOSE_CONTROLS ); - if ( GetEditor().GetMode() == DlgEditor::SELECT ) - aItem.SetValue( SVX_SNAP_SELECT ); - else - { - sal_uInt16 nObj; - switch( m_pEditor->GetInsertObj() ) - { - case OBJ_DLG_PUSHBUTTON: nObj = SVX_SNAP_PUSHBUTTON; break; - case OBJ_DLG_RADIOBUTTON: nObj = SVX_SNAP_RADIOBUTTON; break; - case OBJ_DLG_CHECKBOX: nObj = SVX_SNAP_CHECKBOX; break; - case OBJ_DLG_LISTBOX: nObj = SVX_SNAP_LISTBOX; break; - case OBJ_DLG_COMBOBOX: nObj = SVX_SNAP_COMBOBOX; break; - case OBJ_DLG_GROUPBOX: nObj = SVX_SNAP_GROUPBOX; break; - case OBJ_DLG_EDIT: nObj = SVX_SNAP_EDIT; break; - case OBJ_DLG_FIXEDTEXT: nObj = SVX_SNAP_FIXEDTEXT; break; - case OBJ_DLG_IMAGECONTROL: nObj = SVX_SNAP_IMAGECONTROL; break; - case OBJ_DLG_PROGRESSBAR: nObj = SVX_SNAP_PROGRESSBAR; break; - case OBJ_DLG_HSCROLLBAR: nObj = SVX_SNAP_HSCROLLBAR; break; - case OBJ_DLG_VSCROLLBAR: nObj = SVX_SNAP_VSCROLLBAR; break; - case OBJ_DLG_HFIXEDLINE: nObj = SVX_SNAP_HFIXEDLINE; break; - case OBJ_DLG_VFIXEDLINE: nObj = SVX_SNAP_VFIXEDLINE; break; - case OBJ_DLG_DATEFIELD: nObj = SVX_SNAP_DATEFIELD; break; - case OBJ_DLG_TIMEFIELD: nObj = SVX_SNAP_TIMEFIELD; break; - case OBJ_DLG_NUMERICFIELD: nObj = SVX_SNAP_NUMERICFIELD; break; - case OBJ_DLG_CURRENCYFIELD: nObj = SVX_SNAP_CURRENCYFIELD; break; - case OBJ_DLG_FORMATTEDFIELD: nObj = SVX_SNAP_FORMATTEDFIELD; break; - case OBJ_DLG_PATTERNFIELD: nObj = SVX_SNAP_PATTERNFIELD; break; - case OBJ_DLG_FILECONTROL: nObj = SVX_SNAP_FILECONTROL; break; - case OBJ_DLG_SPINBUTTON: nObj = SVX_SNAP_SPINBUTTON; break; - case OBJ_DLG_TREECONTROL: nObj = SVX_SNAP_TREECONTROL; break; - default: nObj = 0; - } - SAL_INFO_IF( !nObj, "basctl.basicide", "SID_CHOOSE_CONTROLS: unknown" ); - aItem.SetValue( nObj ); - } - - rSet.Put( aItem ); - } } break; @@ -372,6 +329,40 @@ void DialogWindow::GetState( SfxItemSet& rSet ) { if ( !bIsCalc || IsReadOnly() ) rSet.DisableItem( nWh ); + else + rSet.Put( SfxBoolItem( nWh, m_nControlSlotId == nWh ) ); + } + break; + + case SID_INSERT_SELECT: + case SID_INSERT_PUSHBUTTON: + case SID_INSERT_RADIOBUTTON: + case SID_INSERT_CHECKBOX: + case SID_INSERT_LISTBOX: + case SID_INSERT_COMBOBOX: + case SID_INSERT_GROUPBOX: + case SID_INSERT_EDIT: + case SID_INSERT_FIXEDTEXT: + case SID_INSERT_IMAGECONTROL: + case SID_INSERT_PROGRESSBAR: + case SID_INSERT_HSCROLLBAR: + case SID_INSERT_VSCROLLBAR: + case SID_INSERT_HFIXEDLINE: + case SID_INSERT_VFIXEDLINE: + case SID_INSERT_DATEFIELD: + case SID_INSERT_TIMEFIELD: + case SID_INSERT_NUMERICFIELD: + case SID_INSERT_CURRENCYFIELD: + case SID_INSERT_FORMATTEDFIELD: + case SID_INSERT_PATTERNFIELD: + case SID_INSERT_FILECONTROL: + case SID_INSERT_SPINBUTTON: + case SID_INSERT_TREECONTROL: + { + if ( IsReadOnly() ) + rSet.DisableItem( nWh ); + else + rSet.Put( SfxBoolItem( nWh, m_nControlSlotId == nWh ) ); } break; case SID_SHOWLINES: @@ -394,7 +385,10 @@ void DialogWindow::GetState( SfxItemSet& rSet ) void DialogWindow::ExecuteCommand( SfxRequest& rReq ) { - switch ( rReq.GetSlot() ) + const sal_uInt16 nSlotId(rReq.GetSlot()); + sal_uInt16 nInsertObj(0); + + switch ( nSlotId ) { case SID_CUT: if ( !IsReadOnly() ) @@ -423,198 +417,102 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq ) pBindings->Invalidate( SID_DOC_MODIFIED ); } break; + case SID_INSERT_FORM_RADIO: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMRADIO ); + nInsertObj = OBJ_DLG_FORMRADIO; break; case SID_INSERT_FORM_CHECK: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMCHECK ); + nInsertObj = OBJ_DLG_FORMCHECK; break; case SID_INSERT_FORM_LIST: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMLIST ); + nInsertObj = OBJ_DLG_FORMLIST; break; case SID_INSERT_FORM_COMBO: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMCOMBO ); + nInsertObj = OBJ_DLG_FORMCOMBO; break; case SID_INSERT_FORM_SPIN: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMSPIN ); + nInsertObj = OBJ_DLG_FORMSPIN; break; case SID_INSERT_FORM_VSCROLL: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMVSCROLL ); + nInsertObj = OBJ_DLG_FORMVSCROLL; break; case SID_INSERT_FORM_HSCROLL: - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMHSCROLL ); + nInsertObj = OBJ_DLG_FORMHSCROLL; + break; + case SID_INSERT_PUSHBUTTON: + nInsertObj = OBJ_DLG_PUSHBUTTON; + break; + case SID_INSERT_RADIOBUTTON: + nInsertObj = OBJ_DLG_RADIOBUTTON; + break; + case SID_INSERT_CHECKBOX: + nInsertObj = OBJ_DLG_CHECKBOX; + break; + case SID_INSERT_LISTBOX: + nInsertObj = OBJ_DLG_LISTBOX; + break; + case SID_INSERT_COMBOBOX: + nInsertObj = OBJ_DLG_COMBOBOX; + break; + case SID_INSERT_GROUPBOX: + nInsertObj = OBJ_DLG_GROUPBOX; + break; + case SID_INSERT_EDIT: + nInsertObj = OBJ_DLG_EDIT; + break; + case SID_INSERT_FIXEDTEXT: + nInsertObj = OBJ_DLG_FIXEDTEXT; + break; + case SID_INSERT_IMAGECONTROL: + nInsertObj = OBJ_DLG_IMAGECONTROL; + break; + case SID_INSERT_PROGRESSBAR: + nInsertObj = OBJ_DLG_PROGRESSBAR; + break; + case SID_INSERT_HSCROLLBAR: + nInsertObj = OBJ_DLG_HSCROLLBAR; + break; + case SID_INSERT_VSCROLLBAR: + nInsertObj = OBJ_DLG_VSCROLLBAR; + break; + case SID_INSERT_HFIXEDLINE: + nInsertObj = OBJ_DLG_HFIXEDLINE; + break; + case SID_INSERT_VFIXEDLINE: + nInsertObj = OBJ_DLG_VFIXEDLINE; + break; + case SID_INSERT_DATEFIELD: + nInsertObj = OBJ_DLG_DATEFIELD; + break; + case SID_INSERT_TIMEFIELD: + nInsertObj = OBJ_DLG_TIMEFIELD; + break; + case SID_INSERT_NUMERICFIELD: + nInsertObj = OBJ_DLG_NUMERICFIELD; + break; + case SID_INSERT_CURRENCYFIELD: + nInsertObj = OBJ_DLG_CURRENCYFIELD; + break; + case SID_INSERT_FORMATTEDFIELD: + nInsertObj = OBJ_DLG_FORMATTEDFIELD; + break; + case SID_INSERT_PATTERNFIELD: + nInsertObj = OBJ_DLG_PATTERNFIELD; + break; + case SID_INSERT_FILECONTROL: + nInsertObj = OBJ_DLG_FILECONTROL; + break; + case SID_INSERT_SPINBUTTON: + nInsertObj = OBJ_DLG_SPINBUTTON; + break; + case SID_INSERT_TREECONTROL: + nInsertObj = OBJ_DLG_TREECONTROL; + break; + case SID_INSERT_SELECT: + m_nControlSlotId = nSlotId; + GetEditor().SetMode( DlgEditor::SELECT ); + Shell::InvalidateControlSlots(); break; - case SID_CHOOSE_CONTROLS: - { - const SfxItemSet* pArgs = rReq.GetArgs(); - assert(pArgs && "Nix Args"); - - const SfxAllEnumItem& rItem = static_cast<const SfxAllEnumItem&>(pArgs->Get( SID_CHOOSE_CONTROLS )); - switch( rItem.GetValue() ) - { - case SVX_SNAP_PUSHBUTTON: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_PUSHBUTTON ); - } - break; - case SVX_SNAP_RADIOBUTTON: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_RADIOBUTTON ); - } - break; - case SVX_SNAP_CHECKBOX: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_CHECKBOX); - } - break; - case SVX_SNAP_LISTBOX: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_LISTBOX ); - } - break; - case SVX_SNAP_COMBOBOX: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_COMBOBOX ); - } - break; - case SVX_SNAP_GROUPBOX: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_GROUPBOX ); - } - break; - case SVX_SNAP_EDIT: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_EDIT ); - } - break; - case SVX_SNAP_FIXEDTEXT: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FIXEDTEXT ); - } - break; - case SVX_SNAP_IMAGECONTROL: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_IMAGECONTROL ); - } - break; - case SVX_SNAP_PROGRESSBAR: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_PROGRESSBAR ); - } - break; - case SVX_SNAP_HSCROLLBAR: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_HSCROLLBAR ); - } - break; - case SVX_SNAP_VSCROLLBAR: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_VSCROLLBAR ); - } - break; - case SVX_SNAP_HFIXEDLINE: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_HFIXEDLINE ); - } - break; - case SVX_SNAP_VFIXEDLINE: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_VFIXEDLINE ); - } - break; - case SVX_SNAP_DATEFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_DATEFIELD ); - } - break; - case SVX_SNAP_TIMEFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_TIMEFIELD ); - } - break; - case SVX_SNAP_NUMERICFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_NUMERICFIELD ); - } - break; - case SVX_SNAP_CURRENCYFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_CURRENCYFIELD ); - } - break; - case SVX_SNAP_FORMATTEDFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FORMATTEDFIELD ); - } - break; - case SVX_SNAP_PATTERNFIELD: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_PATTERNFIELD ); - } - break; - case SVX_SNAP_FILECONTROL: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_FILECONTROL ); - } - break; - case SVX_SNAP_SPINBUTTON: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_SPINBUTTON ); - } - break; - case SVX_SNAP_TREECONTROL: - { - GetEditor().SetMode( DlgEditor::INSERT ); - GetEditor().SetInsertObj( OBJ_DLG_TREECONTROL ); - } - break; - - case SVX_SNAP_SELECT: - { - GetEditor().SetMode( DlgEditor::SELECT ); - } - break; - } - - if ( rReq.GetModifier() & KEY_MOD1 ) - { - if ( GetEditor().GetMode() == DlgEditor::INSERT ) - GetEditor().CreateDefaultObject(); - } - - if (SfxBindings* pBindings = GetBindingsPtr()) - pBindings->Invalidate( SID_DOC_MODIFIED ); - } - break; case SID_DIALOG_TESTMODE: { @@ -646,6 +544,22 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq ) break; } + if ( nInsertObj ) + { + m_nControlSlotId = nSlotId; + GetEditor().SetMode( DlgEditor::INSERT ); + GetEditor().SetInsertObj( nInsertObj ); + + if ( rReq.GetModifier() & KEY_MOD1 ) + { + GetEditor().CreateDefaultObject(); + if (SfxBindings* pBindings = GetBindingsPtr()) + pBindings->Invalidate( SID_DOC_MODIFIED ); + } + + Shell::InvalidateControlSlots(); + } + rReq.Done(); } diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 3202ce4dfe87..00962308c1d6 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -806,6 +806,30 @@ void Shell::GetState(SfxItemSet &rSet) break; case SID_CHOOSE_CONTROLS: case SID_DIALOG_TESTMODE: + case SID_INSERT_SELECT: + case SID_INSERT_PUSHBUTTON: + case SID_INSERT_RADIOBUTTON: + case SID_INSERT_CHECKBOX: + case SID_INSERT_LISTBOX: + case SID_INSERT_COMBOBOX: + case SID_INSERT_GROUPBOX: + case SID_INSERT_EDIT: + case SID_INSERT_FIXEDTEXT: + case SID_INSERT_IMAGECONTROL: + case SID_INSERT_PROGRESSBAR: + case SID_INSERT_HSCROLLBAR: + case SID_INSERT_VSCROLLBAR: + case SID_INSERT_HFIXEDLINE: + case SID_INSERT_VFIXEDLINE: + case SID_INSERT_DATEFIELD: + case SID_INSERT_TIMEFIELD: + case SID_INSERT_NUMERICFIELD: + case SID_INSERT_CURRENCYFIELD: + case SID_INSERT_FORMATTEDFIELD: + case SID_INSERT_PATTERNFIELD: + case SID_INSERT_FILECONTROL: + case SID_INSERT_SPINBUTTON: + case SID_INSERT_TREECONTROL: case SID_INSERT_FORM_RADIO: case SID_INSERT_FORM_CHECK: case SID_INSERT_FORM_LIST: @@ -1064,6 +1088,7 @@ void Shell::SetCurWindow( BaseWindow* pNewWin, bool bUpdateTabBar, bool bRemembe aObjectCatalog->SetCurrentEntry(pCurWin); SetUndoManager( pCurWin ? pCurWin->GetUndoManager() : nullptr ); InvalidateBasicIDESlots(); + InvalidateControlSlots(); EnableScrollbars(pCurWin != nullptr); if ( m_pCurLocalizationMgr ) diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index bea3e699a8d8..3ec5b45b374b 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -46,7 +46,6 @@ #define basctl_Shell #define SFX_TYPEMAP -#include <idetemp.hxx> #include <basslots.hxx> #ifdef DISABLE_DYNLOADING @@ -840,7 +839,7 @@ void Shell::InvalidateBasicIDESlots() pBindings->Invalidate( SID_BASICIDE_MANAGEBRKPNTS ); pBindings->Invalidate( SID_BASICIDE_ADDWATCH ); pBindings->Invalidate( SID_BASICIDE_REMOVEWATCH ); - pBindings->Invalidate( SID_CHOOSE_CONTROLS ); + pBindings->Invalidate( SID_PRINTDOC ); pBindings->Invalidate( SID_PRINTDOCDIRECT ); pBindings->Invalidate( SID_SETUPPRINTER ); @@ -855,6 +854,49 @@ void Shell::InvalidateBasicIDESlots() } } +void Shell::InvalidateControlSlots() +{ + if (GetShell()) + { + if (SfxBindings* pBindings = GetBindingsPtr()) + { + pBindings->Invalidate( SID_INSERT_FORM_RADIO ); + pBindings->Invalidate( SID_INSERT_FORM_CHECK ); + pBindings->Invalidate( SID_INSERT_FORM_LIST ); + pBindings->Invalidate( SID_INSERT_FORM_COMBO ); + pBindings->Invalidate( SID_INSERT_FORM_VSCROLL ); + pBindings->Invalidate( SID_INSERT_FORM_HSCROLL ); + pBindings->Invalidate( SID_INSERT_FORM_SPIN ); + + pBindings->Invalidate( SID_INSERT_SELECT ); + pBindings->Invalidate( SID_INSERT_PUSHBUTTON ); + pBindings->Invalidate( SID_INSERT_RADIOBUTTON ); + pBindings->Invalidate( SID_INSERT_CHECKBOX ); + pBindings->Invalidate( SID_INSERT_LISTBOX ); + pBindings->Invalidate( SID_INSERT_COMBOBOX ); + pBindings->Invalidate( SID_INSERT_GROUPBOX ); + pBindings->Invalidate( SID_INSERT_EDIT ); + pBindings->Invalidate( SID_INSERT_FIXEDTEXT ); + pBindings->Invalidate( SID_INSERT_IMAGECONTROL ); + pBindings->Invalidate( SID_INSERT_PROGRESSBAR ); + pBindings->Invalidate( SID_INSERT_HSCROLLBAR ); + pBindings->Invalidate( SID_INSERT_VSCROLLBAR ); + pBindings->Invalidate( SID_INSERT_HFIXEDLINE ); + pBindings->Invalidate( SID_INSERT_VFIXEDLINE ); + pBindings->Invalidate( SID_INSERT_DATEFIELD ); + pBindings->Invalidate( SID_INSERT_TIMEFIELD ); + pBindings->Invalidate( SID_INSERT_NUMERICFIELD ); + pBindings->Invalidate( SID_INSERT_CURRENCYFIELD ); + pBindings->Invalidate( SID_INSERT_FORMATTEDFIELD ); + pBindings->Invalidate( SID_INSERT_PATTERNFIELD ); + pBindings->Invalidate( SID_INSERT_FILECONTROL ); + pBindings->Invalidate( SID_INSERT_SPINBUTTON ); + pBindings->Invalidate( SID_INSERT_TREECONTROL ); + pBindings->Invalidate( SID_CHOOSE_CONTROLS ); + } + } +} + void Shell::EnableScrollbars( bool bEnable ) { aHScrollBar->Enable(bEnable); diff --git a/basctl/source/basicide/idetemp.hxx b/basctl/source/basicide/idetemp.hxx deleted file mode 100644 index 178c1e505fa0..000000000000 --- a/basctl/source/basicide/idetemp.hxx +++ /dev/null @@ -1,57 +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 INCLUDED_BASCTL_SOURCE_BASICIDE_IDETEMP_HXX -#define INCLUDED_BASCTL_SOURCE_BASICIDE_IDETEMP_HXX - - -enum SvxChooseControlEnum -{ - SVX_SNAP_PUSHBUTTON, - SVX_SNAP_CHECKBOX, - SVX_SNAP_RADIOBUTTON, - SVX_SNAP_SPINBUTTON, - SVX_SNAP_FIXEDTEXT, - SVX_SNAP_GROUPBOX, - SVX_SNAP_LISTBOX, - SVX_SNAP_COMBOBOX, - SVX_SNAP_EDIT, - SVX_SNAP_HSCROLLBAR, - SVX_SNAP_VSCROLLBAR, - SVX_SNAP_PREVIEW, - SVX_SNAP_SELECT, - SVX_SNAP_URLBUTTON, - SVX_SNAP_IMAGECONTROL, - SVX_SNAP_PROGRESSBAR, - SVX_SNAP_HFIXEDLINE, - SVX_SNAP_VFIXEDLINE, - SVX_SNAP_DATEFIELD, - SVX_SNAP_TIMEFIELD, - SVX_SNAP_NUMERICFIELD, - SVX_SNAP_CURRENCYFIELD, - SVX_SNAP_FORMATTEDFIELD, - SVX_SNAP_PATTERNFIELD, - SVX_SNAP_FILECONTROL, - SVX_SNAP_TREECONTROL, -}; - -#define SvxChooseControlItem SfxAllEnumItem - -#endif // INCLUDED_BASCTL_SOURCE_BASICIDE_IDETEMP_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx index 35c4161c5a89..c6510010b555 100644 --- a/basctl/source/inc/baside3.hxx +++ b/basctl/source/inc/baside3.hxx @@ -60,6 +60,7 @@ private: std::unique_ptr<DlgEditor> m_pEditor; std::unique_ptr<SfxUndoManager> m_pUndoMgr; // never nullptr OUString m_sCurPath; + sal_uInt16 m_nControlSlotId; protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override; diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index ceb52885ad54..63117788f8e0 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -195,6 +195,8 @@ public: const ScriptDocument& rSourceDoc, const OUString& rSourceLibName, const ScriptDocument& rDestDoc, const OUString& rDestLibName, const OUString& rDlgName ); + static void InvalidateControlSlots(); + virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const override; |