GSOC work menu entry + code fix
Fixed the definition of GLOB_KEY, NOT_FOUND from const to static const. Added a new menu entry for code completition under View->Enable Code Completition. Change-Id: If8ac25ee43a7ba780ccdee2e5e909777115a1f27
This commit is contained in:
parent
1b8b4864c1
commit
3ce1f554de
@ -138,6 +138,12 @@ shell basctl_Shell
|
|||||||
StateMethod = GetState;
|
StateMethod = GetState;
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SID_BASICIDE_CODECOMPLETITION
|
||||||
|
[
|
||||||
|
ExecMethod = ExecuteCurrent;
|
||||||
|
StateMethod = GetState;
|
||||||
|
]
|
||||||
|
|
||||||
SID_BASICIDE_LIBSELECTED
|
SID_BASICIDE_LIBSELECTED
|
||||||
[
|
[
|
||||||
ExecMethod = ExecuteGlobal;
|
ExecMethod = ExecuteGlobal;
|
||||||
|
@ -1009,6 +1009,11 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
|
|||||||
rLayout.BasicRemoveWatch();
|
rLayout.BasicRemoveWatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SID_BASICIDE_CODECOMPLETITION:
|
||||||
|
{
|
||||||
|
std::cerr << "code completition enabled" << std::endl;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SID_CUT:
|
case SID_CUT:
|
||||||
{
|
{
|
||||||
if ( !IsReadOnly() )
|
if ( !IsReadOnly() )
|
||||||
|
@ -525,8 +525,8 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
|
|||||||
aVect.push_back( aLine.copy(r.nBegin, r.nEnd - r.nBegin) );
|
aVect.push_back( aLine.copy(r.nBegin, r.nEnd - r.nBegin) );
|
||||||
}
|
}
|
||||||
OUString sBaseName = aVect[0];//variable name
|
OUString sBaseName = aVect[0];//variable name
|
||||||
OUString sVarType = aCodeCompleteCache.GetVariableType(sBaseName, aCodeCompleteCache.GLOB_KEY);
|
OUString sVarType = aCodeCompleteCache.GetVariableType(sBaseName, CodeCompleteDataCache::GLOB_KEY);
|
||||||
if( sVarType == aCodeCompleteCache.NOT_FOUND )
|
if( sVarType == CodeCompleteDataCache::NOT_FOUND )
|
||||||
sVarType = aCodeCompleteCache.GetVariableType(sBaseName, sActSub);
|
sVarType = aCodeCompleteCache.GetVariableType(sBaseName, sActSub);
|
||||||
|
|
||||||
Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), UNO_SET_THROW );
|
Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), UNO_SET_THROW );
|
||||||
@ -575,7 +575,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ( !bDone && ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) )
|
if ( !bDone && ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) )
|
||||||
{
|
{
|
||||||
@ -884,7 +883,7 @@ OUString EditorWindow::GetActualSubName( sal_uLong nLine )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return aCodeCompleteCache.GLOB_KEY;
|
return CodeCompleteDataCache::GLOB_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorWindow::SetScrollBarRanges()
|
void EditorWindow::SetScrollBarRanges()
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
<menu:menuitem menu:id=".uno:StatusBarVisible"/>
|
<menu:menuitem menu:id=".uno:StatusBarVisible"/>
|
||||||
<menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
|
<menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
|
||||||
<menu:menuitem menu:id=".uno:ShowLines"/>
|
<menu:menuitem menu:id=".uno:ShowLines"/>
|
||||||
|
<menu:menuitem menu:id=".uno:BasicCodeCompletition"/>
|
||||||
<menu:menuitem menu:id=".uno:GotoLine"/>
|
<menu:menuitem menu:id=".uno:GotoLine"/>
|
||||||
<menu:menuseparator/>
|
<menu:menuseparator/>
|
||||||
<menu:menuitem menu:id=".uno:FullScreen"/>
|
<menu:menuitem menu:id=".uno:FullScreen"/>
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
#include <basic/codecompletecache.hxx>
|
#include <basic/codecompletecache.hxx>
|
||||||
|
|
||||||
|
const OUString CodeCompleteDataCache::GLOB_KEY = OUString("global key");
|
||||||
|
const OUString CodeCompleteDataCache::NOT_FOUND = OUString("not found");
|
||||||
|
|
||||||
std::ostream& operator<< (std::ostream& aStream, const CodeCompleteDataCache& aCache)
|
std::ostream& operator<< (std::ostream& aStream, const CodeCompleteDataCache& aCache)
|
||||||
{
|
{
|
||||||
for( CodeCompleteVarScopes::const_iterator aIt = aCache.aVarScopes.begin(); aIt != aCache.aVarScopes.end(); ++aIt )
|
for( CodeCompleteVarScopes::const_iterator aIt = aCache.aVarScopes.begin(); aIt != aCache.aVarScopes.end(); ++aIt )
|
||||||
@ -52,12 +55,12 @@ OUString CodeCompleteDataCache::GetVariableType( const OUString& sVarName, const
|
|||||||
{
|
{
|
||||||
CodeCompleteVarScopes::const_iterator aIt = aVarScopes.find( sProcName );
|
CodeCompleteVarScopes::const_iterator aIt = aVarScopes.find( sProcName );
|
||||||
if( aIt == aVarScopes.end() )//procedure does not exist
|
if( aIt == aVarScopes.end() )//procedure does not exist
|
||||||
return NOT_FOUND;
|
return CodeCompleteDataCache::NOT_FOUND;
|
||||||
|
|
||||||
CodeCompleteVarTypes aVarTypes = aIt->second;
|
CodeCompleteVarTypes aVarTypes = aIt->second;
|
||||||
CodeCompleteVarTypes::const_iterator aOtherIt = aVarTypes.find( sVarName );
|
CodeCompleteVarTypes::const_iterator aOtherIt = aVarTypes.find( sVarName );
|
||||||
if( aOtherIt == aVarTypes.end() )
|
if( aOtherIt == aVarTypes.end() )
|
||||||
return NOT_FOUND;
|
return CodeCompleteDataCache::NOT_FOUND;
|
||||||
else
|
else
|
||||||
return aOtherIt->second;
|
return aOtherIt->second;
|
||||||
}
|
}
|
||||||
|
@ -1821,7 +1821,7 @@ CodeCompleteDataCache SbModule::GetCodeCompleteDataFromParse()
|
|||||||
}
|
}
|
||||||
aCache.InsertProcedure( pSymDef->GetName(), aLocVarTypes );
|
aCache.InsertProcedure( pSymDef->GetName(), aLocVarTypes );
|
||||||
}
|
}
|
||||||
aCache.InsertProcedure( aCache.GLOB_KEY, aGlobVarTypes );
|
aCache.InsertProcedure( CodeCompleteDataCache::GLOB_KEY, aGlobVarTypes );
|
||||||
|
|
||||||
delete pParser;
|
delete pParser;
|
||||||
return aCache;
|
return aCache;
|
||||||
|
@ -42,8 +42,8 @@ private:
|
|||||||
CodeCompleteVarScopes aVarScopes;
|
CodeCompleteVarScopes aVarScopes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const OUString GLOB_KEY = OUString("global key");
|
static const OUString GLOB_KEY;
|
||||||
const OUString NOT_FOUND = OUString("not found");
|
static const OUString NOT_FOUND;
|
||||||
|
|
||||||
CodeCompleteDataCache(){}
|
CodeCompleteDataCache(){}
|
||||||
virtual ~CodeCompleteDataCache(){}
|
virtual ~CodeCompleteDataCache(){}
|
||||||
|
@ -671,6 +671,7 @@
|
|||||||
#define SID_BASICIDE_ARG_DOCUMENT_MODEL ( SID_BASICIDE_START + 51 )
|
#define SID_BASICIDE_ARG_DOCUMENT_MODEL ( SID_BASICIDE_START + 51 )
|
||||||
#define SID_BASICIDE_MANAGE_LANG ( SID_BASICIDE_START + 52 )
|
#define SID_BASICIDE_MANAGE_LANG ( SID_BASICIDE_START + 52 )
|
||||||
#define SID_BASICIDE_CURRENT_LANG ( SID_BASICIDE_START + 53 )
|
#define SID_BASICIDE_CURRENT_LANG ( SID_BASICIDE_START + 53 )
|
||||||
|
#define SID_BASICIDE_CODECOMPLETITION ( SID_BASICIDE_START + 54 )
|
||||||
|
|
||||||
// SlotIds for Apps --------------------------------------------------------
|
// SlotIds for Apps --------------------------------------------------------
|
||||||
#define FN_PARAM (SID_SW_START + 1100)
|
#define FN_PARAM (SID_SW_START + 1100)
|
||||||
|
@ -8,6 +8,11 @@
|
|||||||
<value xml:lang="en-US">Goto Line Number...</value>
|
<value xml:lang="en-US">Goto Line Number...</value>
|
||||||
</prop>
|
</prop>
|
||||||
</node>
|
</node>
|
||||||
|
<node oor:name=".uno:BasicCodeCompletition" oor:op="replace">
|
||||||
|
<prop oor:name="Label" oor:type="xs:string">
|
||||||
|
<value xml:lang="en-US">Enable Code Completition</value>
|
||||||
|
</prop>
|
||||||
|
</node>
|
||||||
<node oor:name=".uno:ShowLines" oor:op="replace">
|
<node oor:name=".uno:ShowLines" oor:op="replace">
|
||||||
<prop oor:name="Label" oor:type="xs:string">
|
<prop oor:name="Label" oor:type="xs:string">
|
||||||
<value xml:lang="en-US">Line Numbers</value>
|
<value xml:lang="en-US">Line Numbers</value>
|
||||||
|
@ -3819,6 +3819,30 @@ SfxVoidItem MatchGroup SID_BASICIDE_MATCHGROUP
|
|||||||
GroupId = GID_MACRO;
|
GroupId = GID_MACRO;
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SfxBoolItem BasicCodeCompletition SID_BASICIDE_CODECOMPLETITION
|
||||||
|
|
||||||
|
[
|
||||||
|
/* 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;
|
||||||
|
]
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
SfxBoolItem MenuBarVisible SID_TOGGLE_MENUBAR
|
SfxBoolItem MenuBarVisible SID_TOGGLE_MENUBAR
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user