summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/basicideoptionsdlg.cxx (renamed from basctl/source/basicide/codecompleteoptionsdlg.cxx)49
-rw-r--r--basctl/source/basicide/basicideoptionsdlg.hxx59
-rw-r--r--basctl/source/basicide/baside2.cxx8
-rw-r--r--basctl/source/basicide/baside2b.cxx5
4 files changed, 82 insertions, 39 deletions
diff --git a/basctl/source/basicide/codecompleteoptionsdlg.cxx b/basctl/source/basicide/basicideoptionsdlg.cxx
index e8537c616528..765cffa3ca84 100644
--- a/basctl/source/basicide/codecompleteoptionsdlg.cxx
+++ b/basctl/source/basicide/basicideoptionsdlg.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "codecompleteoptionsdlg.hxx"
+#include "basicideoptionsdlg.hxx"
#include <basic/codecompletecache.hxx>
#include <svtools/miscopt.hxx>
#include <basidesh.hrc>
@@ -28,8 +28,8 @@
namespace basctl
{
-CodeCompleteOptionsDlg::CodeCompleteOptionsDlg( Window* pWindow )
-: ModalDialog(pWindow, "CodeCompleteOptionsDialog", "modules/BasicIDE/ui/codecompleteoptionsdlg.ui")
+BasicIDEOptionsDlg::BasicIDEOptionsDlg( Window* pWindow )
+: ModalDialog(pWindow, "BasicIDEOptionsDlg", "modules/BasicIDE/ui/basicideoptionsdialog.ui")
{
get(pCancelBtn, "cancel");
get(pOkBtn, "ok");
@@ -38,78 +38,63 @@ CodeCompleteOptionsDlg::CodeCompleteOptionsDlg( Window* pWindow )
get(pAutocloseProcChk, "autoclose_proc");
get(pAutocloseParenChk, "autoclose_paren");
get(pAutocloseQuotesChk, "autoclose_quotes");
- get(pAutoCorrectSpellingChk, "autocorrect_spelling");
+ get(pAutoCorrectKeywordsChk, "autocorrect_keywords");
get(pUseExtendedTypesChk, "extendedtypes_enable");
- pOkBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, OkHdl ) );
- pCancelBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, CancelHdl ) );
-
- pCodeCompleteChk->SetToggleHdl( LINK(this, CodeCompleteOptionsDlg, CodeCompleteHdl) );
- pUseExtendedTypesChk->SetToggleHdl( LINK(this, CodeCompleteOptionsDlg, ExtendedTypesHdl) );
+ pOkBtn->SetClickHdl( LINK( this, BasicIDEOptionsDlg, OkHdl ) );
+ pCancelBtn->SetClickHdl( LINK( this, BasicIDEOptionsDlg, CancelHdl ) );
LoadConfig();
}
-CodeCompleteOptionsDlg::~CodeCompleteOptionsDlg()
+BasicIDEOptionsDlg::~BasicIDEOptionsDlg()
{
}
-IMPL_LINK_NOARG(CodeCompleteOptionsDlg, OkHdl)
+IMPL_LINK_NOARG(BasicIDEOptionsDlg, OkHdl)
{
CodeCompleteOptions::SetCodeCompleteOn( pCodeCompleteChk->IsChecked() );
CodeCompleteOptions::SetProcedureAutoCompleteOn( pAutocloseProcChk->IsChecked() );
CodeCompleteOptions::SetAutoCloseQuotesOn( pAutocloseQuotesChk->IsChecked() );
CodeCompleteOptions::SetAutoCloseParenthesisOn( pAutocloseParenChk->IsChecked() );
- CodeCompleteOptions::SetAutoCorrectSpellingOn( pAutoCorrectSpellingChk->IsChecked() );
- CodeCompleteOptions::SetExtendedTypeDeclaration( pAutoCorrectSpellingChk->IsChecked() );
+ CodeCompleteOptions::SetAutoCorrectKeywordsOn( pAutoCorrectKeywordsChk->IsChecked() );
+ CodeCompleteOptions::SetExtendedTypeDeclaration( pUseExtendedTypesChk->IsChecked() );
SaveConfig();
Close();
return 0;
}
-IMPL_LINK_NOARG(CodeCompleteOptionsDlg, CancelHdl)
+IMPL_LINK_NOARG(BasicIDEOptionsDlg, CancelHdl)
{
Close();
return 0;
}
-IMPL_LINK_NOARG(CodeCompleteOptionsDlg, ExtendedTypesHdl)
-{
- pCodeCompleteChk->Check( pUseExtendedTypesChk->IsChecked() );
- return 0;
-}
-
-IMPL_LINK_NOARG(CodeCompleteOptionsDlg, CodeCompleteHdl)
-{
- pUseExtendedTypesChk->Check( pCodeCompleteChk->IsChecked() );
- return 0;
-}
-
-short CodeCompleteOptionsDlg::Execute()
+short BasicIDEOptionsDlg::Execute()
{
return ModalDialog::Execute();
}
-void CodeCompleteOptionsDlg::LoadConfig()
+void BasicIDEOptionsDlg::LoadConfig()
{
bool bProcClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get();
bool bExtended = officecfg::Office::BasicIDE::Autocomplete::UseExtended::get();
bool bCodeCompleteOn = officecfg::Office::BasicIDE::Autocomplete::CodeComplete::get();
bool bParenClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::get();
bool bQuoteClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::get();
- bool bCorrect = officecfg::Office::BasicIDE::Autocomplete::AutoCorrectSpelling::get();
+ bool bCorrect = officecfg::Office::BasicIDE::Autocomplete::AutoCorrectKeywords::get();
pCodeCompleteChk->Check( bCodeCompleteOn );
pAutocloseProcChk->Check( bProcClose );
pAutocloseQuotesChk->Check( bQuoteClose );
pAutocloseParenChk->Check( bParenClose );
- pAutoCorrectSpellingChk->Check( bCorrect );
+ pAutoCorrectKeywordsChk->Check( bCorrect );
pUseExtendedTypesChk->Check( bExtended );
}
-void CodeCompleteOptionsDlg::SaveConfig()
+void BasicIDEOptionsDlg::SaveConfig()
{
boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::set( pAutocloseProcChk->IsChecked(), batch );
@@ -117,7 +102,7 @@ void CodeCompleteOptionsDlg::SaveConfig()
officecfg::Office::BasicIDE::Autocomplete::UseExtended::set( pUseExtendedTypesChk->IsChecked(), batch );
officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
- officecfg::Office::BasicIDE::Autocomplete::AutoCorrectSpelling::set( pAutoCorrectSpellingChk->IsChecked(), batch );
+ officecfg::Office::BasicIDE::Autocomplete::AutoCorrectKeywords::set( pAutoCorrectKeywordsChk->IsChecked(), batch );
batch->commit();
}
diff --git a/basctl/source/basicide/basicideoptionsdlg.hxx b/basctl/source/basicide/basicideoptionsdlg.hxx
new file mode 100644
index 000000000000..1d3970daa314
--- /dev/null
+++ b/basctl/source/basicide/basicideoptionsdlg.hxx
@@ -0,0 +1,59 @@
+/* -*- 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 BASCTL_BASICIDEOPTIONSDLG_HXX
+#define BASCTL_BASICIDEOPTIONSDLG_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+
+namespace basctl
+{
+
+class BasicIDEOptionsDlg: public ModalDialog
+{
+private:
+ CancelButton* pCancelBtn;
+ OKButton* pOkBtn;
+
+ CheckBox* pCodeCompleteChk;
+ CheckBox* pAutocloseProcChk;
+ CheckBox* pAutocloseParenChk;
+ CheckBox* pAutocloseQuotesChk;
+ CheckBox* pAutoCorrectKeywordsChk;
+ CheckBox* pUseExtendedTypesChk;
+
+ DECL_LINK(OkHdl, void*);
+ DECL_LINK(CancelHdl, void*);
+
+ void LoadConfig();
+ void SaveConfig();
+
+public:
+ BasicIDEOptionsDlg( Window* pWindow );
+ ~BasicIDEOptionsDlg();
+
+ virtual short Execute();
+};
+
+} // namespace basctl
+
+#endif //BASCTL_BASICIDEOPTIONSDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index ef7c5c9eb75b..ae17932dc48f 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -54,7 +54,7 @@
#include <cassert>
#include <basic/codecompletecache.hxx>
#include <svtools/miscopt.hxx>
-#include "codecompleteoptionsdlg.hxx"
+#include "basicideoptionsdlg.hxx"
namespace basctl
{
@@ -1012,9 +1012,9 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
rLayout.BasicRemoveWatch();
}
break;
- case SID_BASICIDE_CODECOMPLETITION:
+ case SID_BASICIDE_IDEOPTIONS:
{
- boost::scoped_ptr< CodeCompleteOptionsDlg > pDlg( new CodeCompleteOptionsDlg( this ) );
+ boost::scoped_ptr< BasicIDEOptionsDlg > pDlg( new BasicIDEOptionsDlg( this ) );
pDlg->Execute();
}
break;
@@ -1164,7 +1164,7 @@ void ModulWindow::GetState( SfxItemSet &rSet )
rSet.Put(SfxBoolItem(nWh, bSourceLinesEnabled));
break;
}
- case SID_BASICIDE_CODECOMPLETITION:
+ case SID_BASICIDE_IDEOPTIONS:
{
SvtMiscOptions aMiscOptions;
if( !aMiscOptions.IsExperimentalMode() )
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 7349e8649fc6..4cd4258dcc12 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -510,7 +510,7 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
if( (rKEvt.GetKeyCode().GetCode() == KEY_SPACE ||
rKEvt.GetKeyCode().GetCode() == KEY_TAB ||
- rKEvt.GetKeyCode().GetCode() == KEY_RETURN ) && CodeCompleteOptions::IsAutoCorrectSpellingOn() )
+ rKEvt.GetKeyCode().GetCode() == KEY_RETURN ) && CodeCompleteOptions::IsAutoCorrectKeywordsOn() )
{
TextSelection aSel = GetEditView()->GetSelection();
sal_uLong nLine = aSel.GetStart().GetPara();
@@ -611,7 +611,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
if( nLine+1 == pEditEngine->GetParagraphCount() )
{ //append to the end
OUString sText("\nEnd ");
- std::cerr << "sProcType: " << sProcType << std::endl;
if( sProcType.equalsIgnoreAsciiCase("function") )
sText += OUString( "Function\n" );
if( sProcType.equalsIgnoreAsciiCase("sub") )
@@ -686,7 +685,7 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
OUString sBaseName = aVect[0];//variable name
OUString sVarType = aCodeCompleteCache.GetVarType( sBaseName );
- if( !sVarType.isEmpty() && CodeCompleteOptions::IsAutoCorrectSpellingOn() )//correct variable name
+ if( !sVarType.isEmpty() && CodeCompleteOptions::IsAutoCorrectKeywordsOn() )//correct variable name
{
TextPaM aStart(nLine, aSel.GetStart().GetIndex() - sBaseName.getLength() );
TextSelection sTextSelection(aStart, TextPaM(nLine, aSel.GetStart().GetIndex()));