summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basctl/source/basicide/baside2.hxx3
-rw-r--r--basctl/source/basicide/baside2b.cxx14
-rw-r--r--basctl/source/basicide/baside3.cxx70
-rw-r--r--basctl/source/basicide/basobj2.cxx41
-rw-r--r--basctl/source/basicide/basobj3.cxx32
-rw-r--r--basctl/source/basicide/brkdlg.cxx6
-rw-r--r--basctl/source/basicide/macrodlg.cxx2
-rw-r--r--basctl/source/basicide/moduldl2.cxx3
-rw-r--r--basctl/source/basicide/moduldlg.hxx1
-rw-r--r--basctl/source/basicide/scriptdocument.cxx29
11 files changed, 100 insertions, 103 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index c7f99e8b8e03..52769276bacb 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/FilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <comphelper/SetFlagContextHelper.hxx>
#include <comphelper/string.hxx>
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index e59c148bc3b5..8d07cd81ddc1 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <memory>
+#include <mutex>
#include <layout.hxx>
#include "breakpoint.hxx"
#include "linenumberwindow.hxx"
@@ -73,7 +74,7 @@ private:
ModulWindow& rModulWindow;
rtl::Reference< ChangesListener > listener_;
- osl::Mutex mutex_;
+ std::mutex mutex_;
css::uno::Reference< css::beans::XMultiPropertySet >
notifier_;
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 9da55fa318a8..9671d149ca2b 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -202,7 +202,7 @@ private:
virtual void SAL_CALL disposing(lang::EventObject const &) override
{
- osl::MutexGuard g(editor_.mutex_);
+ std::unique_lock g(editor_.mutex_);
editor_.notifier_.clear();
}
@@ -255,7 +255,7 @@ EditorWindow::EditorWindow (vcl::Window* pParent, ModulWindow* pModulWindow) :
officecfg::Office::Common::Font::SourceViewFont::get(),
UNO_QUERY_THROW);
{
- osl::MutexGuard g(mutex_);
+ std::unique_lock g(mutex_);
notifier_ = n;
}
const Sequence<OUString> aPropertyNames{"FontHeight", "FontName"};
@@ -278,7 +278,7 @@ void EditorWindow::dispose()
Reference< beans::XMultiPropertySet > n;
{
- osl::MutexGuard g(mutex_);
+ std::unique_lock g(mutex_);
n = notifier_;
}
if (n.is()) {
@@ -2591,7 +2591,7 @@ void CodeCompleteWindow::SetMatchingEntries()
for (sal_Int32 i = 0, nEntryCount = m_xListBox->n_children(); i< nEntryCount; ++i)
{
OUString sEntry = m_xListBox->get_text(i);
- if (sEntry.startsWithIgnoreAsciiCase(aFuncBuffer.toString()))
+ if (sEntry.startsWithIgnoreAsciiCase(aFuncBuffer))
{
m_xListBox->select(i);
break;
@@ -2657,8 +2657,8 @@ bool CodeCompleteWindow::HandleKeyInput( const KeyEvent& rKeyEvt )
for (sal_Int32 i = nInd; i != nEntryCount; ++i)
{
OUString sEntry = m_xListBox->get_text(i);
- if( sEntry.startsWithIgnoreAsciiCase( aFuncBuffer.toString() )
- && (aFuncBuffer.toString() != sTypedText) && (i != nInd) )
+ if( sEntry.startsWithIgnoreAsciiCase( aFuncBuffer )
+ && (std::u16string_view(aFuncBuffer) != sTypedText) && (i != nInd) )
{
m_xListBox->select(i);
bFound = true;
@@ -2688,7 +2688,7 @@ bool CodeCompleteWindow::HandleKeyInput( const KeyEvent& rKeyEvt )
OUString aTabInsertedStr( GetParentEditView()->GetSelected() );
GetParentEditView()->SetSelection( aSel );
- if( !aTabInsertedStr.isEmpty() && aTabInsertedStr != aFuncBuffer.toString() )
+ if( !aTabInsertedStr.isEmpty() && aTabInsertedStr != std::u16string_view(aFuncBuffer) )
{
aFuncBuffer = aTabInsertedStr;
}
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 920e82da3d0a..6e20187055c9 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/FilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <comphelper/processfactory.hxx>
#include <sfx2/dispatch.hxx>
@@ -392,7 +392,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
void DialogWindow::ExecuteCommand( SfxRequest& rReq )
{
const sal_uInt16 nSlotId(rReq.GetSlot());
- SdrObjKind nInsertObj(OBJ_NONE);
+ SdrObjKind nInsertObj(SdrObjKind::NONE);
switch ( nSlotId )
{
@@ -425,100 +425,100 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq )
break;
case SID_INSERT_FORM_RADIO:
- nInsertObj = OBJ_DLG_FORMRADIO;
+ nInsertObj = SdrObjKind::BasicDialogFormRadio;
break;
case SID_INSERT_FORM_CHECK:
- nInsertObj = OBJ_DLG_FORMCHECK;
+ nInsertObj = SdrObjKind::BasicDialogFormCheck;
break;
case SID_INSERT_FORM_LIST:
- nInsertObj = OBJ_DLG_FORMLIST;
+ nInsertObj = SdrObjKind::BasicDialogFormList;
break;
case SID_INSERT_FORM_COMBO:
- nInsertObj = OBJ_DLG_FORMCOMBO;
+ nInsertObj = SdrObjKind::BasicDialogFormCombo;
break;
case SID_INSERT_FORM_SPIN:
- nInsertObj = OBJ_DLG_FORMSPIN;
+ nInsertObj = SdrObjKind::BasicDialogFormSpin;
break;
case SID_INSERT_FORM_VSCROLL:
- nInsertObj = OBJ_DLG_FORMVSCROLL;
+ nInsertObj = SdrObjKind::BasicDialogFormVerticalScroll;
break;
case SID_INSERT_FORM_HSCROLL:
- nInsertObj = OBJ_DLG_FORMHSCROLL;
+ nInsertObj = SdrObjKind::BasicDialogFormHorizontalScroll;
break;
case SID_INSERT_PUSHBUTTON:
- nInsertObj = OBJ_DLG_PUSHBUTTON;
+ nInsertObj = SdrObjKind::BasicDialogPushButton;
break;
case SID_INSERT_RADIOBUTTON:
- nInsertObj = OBJ_DLG_RADIOBUTTON;
+ nInsertObj = SdrObjKind::BasicDialogRadioButton;
break;
case SID_INSERT_CHECKBOX:
- nInsertObj = OBJ_DLG_CHECKBOX;
+ nInsertObj = SdrObjKind::BasicDialogCheckbox;
break;
case SID_INSERT_LISTBOX:
- nInsertObj = OBJ_DLG_LISTBOX;
+ nInsertObj = SdrObjKind::BasicDialogListbox;
break;
case SID_INSERT_COMBOBOX:
- nInsertObj = OBJ_DLG_COMBOBOX;
+ nInsertObj = SdrObjKind::BasicDialogCombobox;
break;
case SID_INSERT_GROUPBOX:
- nInsertObj = OBJ_DLG_GROUPBOX;
+ nInsertObj = SdrObjKind::BasicDialogGroupBox;
break;
case SID_INSERT_EDIT:
- nInsertObj = OBJ_DLG_EDIT;
+ nInsertObj = SdrObjKind::BasicDialogEdit;
break;
case SID_INSERT_FIXEDTEXT:
- nInsertObj = OBJ_DLG_FIXEDTEXT;
+ nInsertObj = SdrObjKind::BasicDialogFixedText;
break;
case SID_INSERT_IMAGECONTROL:
- nInsertObj = OBJ_DLG_IMAGECONTROL;
+ nInsertObj = SdrObjKind::BasicDialogImageControl;
break;
case SID_INSERT_PROGRESSBAR:
- nInsertObj = OBJ_DLG_PROGRESSBAR;
+ nInsertObj = SdrObjKind::BasicDialogProgressbar;
break;
case SID_INSERT_HSCROLLBAR:
- nInsertObj = OBJ_DLG_HSCROLLBAR;
+ nInsertObj = SdrObjKind::BasicDialogHorizontalScrollbar;
break;
case SID_INSERT_VSCROLLBAR:
- nInsertObj = OBJ_DLG_VSCROLLBAR;
+ nInsertObj = SdrObjKind::BasicDialogVerticalScrollbar;
break;
case SID_INSERT_HFIXEDLINE:
- nInsertObj = OBJ_DLG_HFIXEDLINE;
+ nInsertObj = SdrObjKind::BasicDialogHorizontalFixedLine;
break;
case SID_INSERT_VFIXEDLINE:
- nInsertObj = OBJ_DLG_VFIXEDLINE;
+ nInsertObj = SdrObjKind::BasicDialogVerticalFixedLine;
break;
case SID_INSERT_DATEFIELD:
- nInsertObj = OBJ_DLG_DATEFIELD;
+ nInsertObj = SdrObjKind::BasicDialogDateField;
break;
case SID_INSERT_TIMEFIELD:
- nInsertObj = OBJ_DLG_TIMEFIELD;
+ nInsertObj = SdrObjKind::BasicDialogTimeField;
break;
case SID_INSERT_NUMERICFIELD:
- nInsertObj = OBJ_DLG_NUMERICFIELD;
+ nInsertObj = SdrObjKind::BasicDialogNumericField;
break;
case SID_INSERT_CURRENCYFIELD:
- nInsertObj = OBJ_DLG_CURRENCYFIELD;
+ nInsertObj = SdrObjKind::BasicDialogCurencyField;
break;
case SID_INSERT_FORMATTEDFIELD:
- nInsertObj = OBJ_DLG_FORMATTEDFIELD;
+ nInsertObj = SdrObjKind::BasicDialogFormattedField;
break;
case SID_INSERT_PATTERNFIELD:
- nInsertObj = OBJ_DLG_PATTERNFIELD;
+ nInsertObj = SdrObjKind::BasicDialogPatternField;
break;
case SID_INSERT_FILECONTROL:
- nInsertObj = OBJ_DLG_FILECONTROL;
+ nInsertObj = SdrObjKind::BasicDialogFileControl;
break;
case SID_INSERT_SPINBUTTON:
- nInsertObj = OBJ_DLG_SPINBUTTON;
+ nInsertObj = SdrObjKind::BasicDialogSpinButton;
break;
case SID_INSERT_GRIDCONTROL:
- nInsertObj = OBJ_DLG_GRIDCONTROL;
+ nInsertObj = SdrObjKind::BasicDialogGridControl;
break;
case SID_INSERT_HYPERLINKCONTROL:
- nInsertObj = OBJ_DLG_HYPERLINKCONTROL;
+ nInsertObj = SdrObjKind::BasicDialogHyperlinkControl;
break;
case SID_INSERT_TREECONTROL:
- nInsertObj = OBJ_DLG_TREECONTROL;
+ nInsertObj = SdrObjKind::BasicDialogTreeControl;
break;
case SID_INSERT_SELECT:
m_nControlSlotId = nSlotId;
@@ -556,7 +556,7 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq )
break;
}
- if ( nInsertObj )
+ if ( nInsertObj != SdrObjKind::NONE )
{
m_nControlSlotId = nSlotId;
GetEditor().SetMode( DlgEditor::INSERT );
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index f14535cbd3f1..28c1acdb383f 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -160,27 +160,28 @@ bool RenameModule (
if ( !rDocument.renameModule( rLibName, rOldName, rNewName ) )
return false;
- if (Shell* pShell = GetShell())
+ Shell* pShell = GetShell();
+ if (!pShell)
+ return true;
+ VclPtr<ModulWindow> pWin = pShell->FindBasWin(rDocument, rLibName, rNewName, false, true);
+ if (!pWin)
+ return true;
+
+ // set new name in window
+ pWin->SetName( rNewName );
+
+ // set new module in module window
+ pWin->SetSbModule( pWin->GetBasic()->FindModule( rNewName ) );
+
+ // update tabwriter
+ sal_uInt16 nId = pShell->GetWindowId( pWin );
+ SAL_WARN_IF( nId == 0 , "basctl.basicide", "No entry in Tabbar!");
+ if ( nId )
{
- if (VclPtr<ModulWindow> pWin = pShell->FindBasWin(rDocument, rLibName, rNewName, false, true))
- {
- // set new name in window
- pWin->SetName( rNewName );
-
- // set new module in module window
- pWin->SetSbModule( pWin->GetBasic()->FindModule( rNewName ) );
-
- // update tabwriter
- sal_uInt16 nId = pShell->GetWindowId( pWin );
- SAL_WARN_IF( nId == 0 , "basctl.basicide", "No entry in Tabbar!");
- if ( nId )
- {
- TabBar& rTabBar = pShell->GetTabBar();
- rTabBar.SetPageText(nId, rNewName);
- rTabBar.Sort();
- rTabBar.MakeVisible(rTabBar.GetCurPageId());
- }
- }
+ TabBar& rTabBar = pShell->GetTabBar();
+ rTabBar.SetPageText(nId, rNewName);
+ rTabBar.Sort();
+ rTabBar.MakeVisible(rTabBar.GetCurPageId());
}
return true;
}
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 06f7c6a9e08c..26de81e35cb9 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -180,24 +180,24 @@ bool RenameDialog (
if ( !rDocument.renameDialog( rLibName, rOldName, rNewName, xExistingDialog ) )
return false;
- if (pWin && pShell)
- {
- // set new name in window
- pWin->SetName( rNewName );
+ if (!pWin || !pShell)
+ return true;
- // update property browser
- pWin->UpdateBrowser();
+ // set new name in window
+ pWin->SetName( rNewName );
- // update tabwriter
- sal_uInt16 nId = pShell->GetWindowId( pWin );
- DBG_ASSERT( nId, "No entry in Tabbar!" );
- if ( nId )
- {
- TabBar& rTabBar = pShell->GetTabBar();
- rTabBar.SetPageText( nId, rNewName );
- rTabBar.Sort();
- rTabBar.MakeVisible( rTabBar.GetCurPageId() );
- }
+ // update property browser
+ pWin->UpdateBrowser();
+
+ // update tabwriter
+ sal_uInt16 nId = pShell->GetWindowId( pWin );
+ DBG_ASSERT( nId, "No entry in Tabbar!" );
+ if ( nId )
+ {
+ TabBar& rTabBar = pShell->GetTabBar();
+ rTabBar.SetPageText( nId, rNewName );
+ rTabBar.Sort();
+ rTabBar.MakeVisible( rTabBar.GetCurPageId() );
}
return true;
}
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index 6a79d0e1da54..37ba1dbb60ae 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -125,16 +125,14 @@ void BreakPointDialog::CheckButtons()
m_xNewButton->set_sensitive(true);
m_xOKButton->set_sensitive(false);
m_xDelButton->set_sensitive(false);
- m_xDelButton->set_has_default(false);
- m_xNewButton->set_has_default(true);
+ m_xDialog->change_default_widget(m_xDelButton.get(), m_xNewButton.get());
}
else
{
m_xNewButton->set_sensitive(false);
m_xOKButton->set_sensitive(true);
m_xDelButton->set_sensitive(true);
- m_xNewButton->set_has_default(false);
- m_xDelButton->set_has_default(true);
+ m_xDialog->change_default_widget(m_xNewButton.get(), m_xDelButton.get());
}
}
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 511abf83591e..dbeaf396f3f3 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -31,7 +31,7 @@
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
#include <com/sun/star/script/XLibraryContainer2.hpp>
-
+#include <sal/log.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/frame.hxx>
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 7786ab408de4..2515cace9800 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -44,7 +44,7 @@
#include <com/sun/star/io/Pipe.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
-#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
#include <com/sun/star/script/DocumentDialogLibraryContainer.hpp>
@@ -65,7 +65,6 @@
#include <cppuhelper/implbase.hxx>
#include <cassert>
-#include <string_view>
namespace basctl
{
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index 63be9953a290..7dadebcc9ebb 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -24,7 +24,6 @@
#include <string_view>
#include <bastype2.hxx>
-#include <tools/solar.h>
#include <vcl/weld.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index fcef9e78802b..e23cfbe7a113 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -509,25 +509,24 @@ namespace basctl
bool ScriptDocument::Impl::removeModuleOrDialog( LibraryContainerType _eType, const OUString& _rLibName, const OUString& _rModuleName )
{
OSL_ENSURE( isValid(), "ScriptDocument::Impl::removeModuleOrDialog: invalid!" );
- if ( isValid() )
+ if ( !isValid() )
+ return false;
+ try
{
- try
- {
- Reference< XNameContainer > xLib( getLibrary( _eType, _rLibName, true ) );
- if ( xLib.is() )
- {
- xLib->removeByName( _rModuleName );
- Reference< XVBAModuleInfo > xVBAModuleInfo(xLib, UNO_QUERY);
- if(xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo(_rModuleName))
- xVBAModuleInfo->removeModuleInfo(_rModuleName);
- return true;
- }
- }
- catch( const Exception& )
+ Reference< XNameContainer > xLib( getLibrary( _eType, _rLibName, true ) );
+ if ( xLib.is() )
{
- DBG_UNHANDLED_EXCEPTION("basctl.basicide");
+ xLib->removeByName( _rModuleName );
+ Reference< XVBAModuleInfo > xVBAModuleInfo(xLib, UNO_QUERY);
+ if(xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo(_rModuleName))
+ xVBAModuleInfo->removeModuleInfo(_rModuleName);
+ return true;
}
}
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("basctl.basicide");
+ }
return false;
}