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 | |
parent | deb6bcf8d91a14767ed4cd6c377e1ffe6b6a9521 (diff) |
Preparing to add option for line numbers in the basic ide
-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 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu | 6 | ||||
-rwxr-xr-x | sfx2/inc/sfx2/sfxsids.hrc | 3 | ||||
-rwxr-xr-x | sfx2/sdi/sfx.sdi | 24 |
7 files changed, 80 insertions, 1 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> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu index e512d3c537b0..c7118082b4a2 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu @@ -8,6 +8,12 @@ <value xml:lang="en-US">Goto Line Number...</value> </prop> </node> + <node oor:name=".uno:ShowLines" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Display Source Line Number...</value> + </prop> + </node> + </node> <node oor:name="Popups"> </node> diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 568b21b94c10..da4c57bfff8d 100755 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -315,7 +315,8 @@ #define SID_ENCRYPTIONDATA (SID_SFX_START + 1722) #define SID_PASSWORDINTERACTION (SID_SFX_START + 1723) #define SID_GOTOLINE (SID_SFX_START + 1724) -#define SID_SFX_free_START (SID_SFX_START + 1725) +#define SID_SHOWLINES (SID_SFX_START + 1725) +#define SID_SFX_free_START (SID_SFX_START + 1726) #define SID_SFX_free_END (SID_SFX_START + 3999) #define SID_OPEN_NEW_VIEW (SID_SFX_START + 520) diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index b73f17a06a0b..47577eaf0048 100755 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3593,6 +3593,30 @@ SfxBoolItem ReccomendReadonly SID_RECOMMENDREADONLY GroupId = ; ] +//----------------------------------------------------FALSE +SfxBoolItem ShowLines SID_SHOWLINES + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = TRUE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_MACRO; +] //-------------------------------------------------------------------------- SfxVoidItem RunMacro SID_RUNMACRO |