diff options
author | August Sodora <augsod@gmail.com> | 2011-11-16 14:50:26 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-11-17 18:41:20 -0600 |
commit | a4074e34039b0e570a3aa08cdffde1562892df17 (patch) | |
tree | cc65bb900517ad4a5408c31a0c7ddff110669052 /basctl | |
parent | deb6bcf8d91a14767ed4cd6c377e1ffe6b6a9521 (diff) |
Preparing to add option for line numbers in the basic ide
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/sdi/baside.sdi | 5 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 41 | ||||
-rw-r--r-- | basctl/source/inc/basidesh.hxx | 1 | ||||
-rw-r--r-- | basctl/uiconfig/basicide/menubar/menubar.xml | 1 |
4 files changed, 48 insertions, 0 deletions
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi index 37b2f08daf37..11a97fe62c99 100644 --- a/basctl/sdi/baside.sdi +++ b/basctl/sdi/baside.sdi @@ -39,6 +39,11 @@ shell BasicIDEShell // ======================================================== // Current, je nach aktuellem Fenster: // ======================================================== + SID_SHOWLINES + [ + StateMethod = GetState; + ExecMethod = ExecuteCurrent; + ] SID_BASICIDE_HIDECURPAGE [ ExecMethod = ExecuteCurrent; diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 234fad7fe7d2..d7caa9541352 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -85,6 +85,19 @@ using namespace ::com::sun::star::frame; class SvxSearchItem; +// until we have some configuration lets just keep +// persist this value for the process lifetime +bool& lcl_GetSourceLinesEnabledValue() +{ + static bool bSourceLinesEnabled(false); + return bSourceLinesEnabled; +} + +bool BasicIDEShell::SourceLinesDisplayed() +{ + return lcl_GetSourceLinesEnabledValue(); +} + void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq ) { if ( !pCurWin ) @@ -92,6 +105,20 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq ) switch ( rReq.GetSlot() ) { + case SID_SHOWLINES: + { + SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), sal_False); + bool bValue = false; + if ( pItem ) + bValue = pItem->GetValue(); + lcl_GetSourceLinesEnabledValue() = bValue; + if ( pCurWin && pCurWin->IsA( TYPE( ModulWindow ) ) ) + { +// (ModuleWindow*)(pCurWin)->SetLineNumberDisplay( bValue ); + } + } + break; + case SID_BASICIDE_HIDECURPAGE: { pCurWin->StoreData(); @@ -797,6 +824,20 @@ void BasicIDEShell::GetState(SfxItemSet &rSet) { switch ( nWh ) { + case SID_SHOWLINES: + { + // if this is not a module window hide the + // setting, doesn't make sense for example if the + // dialog editor is open + if( pCurWin && !pCurWin->IsA( TYPE( ModulWindow ) ) ) + { + rSet.DisableItem( nWh ); + rSet.Put(SfxVisibilityItem(nWh, sal_False)); + } + else + rSet.Put( SfxBoolItem( nWh, lcl_GetSourceLinesEnabledValue() ) ); + break; + } case SID_DOCINFO: { rSet.DisableItem( nWh ); diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index 15fd8f2779e6..9d66a6dfde8f 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -227,6 +227,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetCurrentDocument() const; + bool SourceLinesDisplayed(); }; diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml index d9174bf9218c..24322b8f2603 100644 --- a/basctl/uiconfig/basicide/menubar/menubar.xml +++ b/basctl/uiconfig/basicide/menubar/menubar.xml @@ -49,6 +49,7 @@ <menu:menuitem menu:id=".uno:StatusBarVisible"/> <menu:menuitem menu:id=".uno:ShowImeStatusWindow"/> <menu:menuitem menu:id=".uno:GotoLine"/> + <menu:menuitem menu:id=".uno:ShowLines"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:FullScreen"/> </menu:menupopup> |