LibreOffice Module basctl (master) 1
basides1.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <iderid.hxx>
22#include <strings.hrc>
23#include <helpids.h>
24
25#include "baside2.hxx"
26#include <baside3.hxx>
27#include <basidesh.hxx>
28#include <basobj.hxx>
29#include <docsignature.hxx>
30#include <iderdll.hxx>
31#include "iderdll2.hxx"
32#include <localizationmgr.hxx>
33#include <managelang.hxx>
34
35#include <basic/basmgr.hxx>
36#include <com/sun/star/script/ModuleType.hpp>
37#include <com/sun/star/script/XLibraryContainerPassword.hpp>
38#include <com/sun/star/script/XLibraryContainer2.hpp>
39#include <com/sun/star/frame/XLayoutManager.hpp>
40#include <svl/srchdefs.hxx>
41#include <sal/log.hxx>
42#include <osl/diagnose.h>
43#include <sfx2/app.hxx>
44#include <sfx2/bindings.hxx>
45#include <sfx2/childwin.hxx>
46#include <sfx2/dinfdlg.hxx>
47#include <sfx2/minfitem.hxx>
48#include <sfx2/request.hxx>
49#include <sfx2/viewfrm.hxx>
50#include <svx/svxids.hrc>
51#include <svl/eitem.hxx>
52#include <svl/intitem.hxx>
53#include <svl/visitem.hxx>
54#include <svl/whiter.hxx>
55#include <vcl/texteng.hxx>
56#include <vcl/textview.hxx>
57#include <vcl/svapp.hxx>
58#include <vcl/weld.hxx>
62
63constexpr sal_Int32 TAB_HEIGHT_MARGIN = 10;
64
65namespace basctl
66{
67
68using namespace ::com::sun::star;
69using namespace ::com::sun::star::uno;
70using namespace ::com::sun::star::frame;
71
72static void lcl_InvalidateZoomSlots(SfxBindings* pBindings)
73{
74 if (!pBindings)
75 return;
76
77 static sal_uInt16 const aInval[] = {
78 SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, 0
79 };
80 pBindings->Invalidate(aInval);
81}
82
84{
85 if ( !pCurWin )
86 return;
87
88 const SfxItemSet* pArgs = rReq.GetArgs();
89 sal_uInt16 nSlot = rReq.GetSlot();
90
91 // if searching has not been done before this time
92 if (nSlot == SID_BASICIDE_REPEAT_SEARCH && !mpSearchItem)
93 {
94 rReq.SetReturnValue(SfxBoolItem(nSlot, false));
95 nSlot = 0;
96 }
97
98 switch ( nSlot )
99 {
100 case SID_SEARCH_OPTIONS:
101 break;
102 case SID_SEARCH_ITEM:
103 mpSearchItem.reset(pArgs->Get(SID_SEARCH_ITEM).Clone());
104 break;
105 case FID_SEARCH_ON:
106 mbJustOpened = true;
107 GetViewFrame().GetBindings().Invalidate(SID_SEARCH_ITEM);
108 break;
109 case SID_BASICIDE_REPEAT_SEARCH:
110 case FID_SEARCH_NOW:
111 {
112 if (!pCurWin->HasActiveEditor())
113 break;
114
115 // If it is a repeat searching
116 if ( nSlot == SID_BASICIDE_REPEAT_SEARCH )
117 {
118 if( !mpSearchItem )
119 mpSearchItem.reset( new SvxSearchItem( SID_SEARCH_ITEM ));
120 }
121 else
122 {
123 // Get SearchItem from request if it is the first searching
124 if ( pArgs )
125 {
126 mpSearchItem.reset(pArgs->Get(SID_SEARCH_ITEM).Clone());
127 }
128 }
129
130 sal_Int32 nFound = 0;
131
132 if ( mpSearchItem->GetCommand() == SvxSearchCmd::REPLACE_ALL )
133 {
134 sal_uInt16 nActModWindows = 0;
135 for (auto const& window : aWindowTable)
136 {
137 BaseWindow* pWin = window.second;
138 if (pWin->HasActiveEditor())
139 nActModWindows++;
140 }
141
142 bool bAllModules = nActModWindows <= 1;
143 if (!bAllModules)
144 {
145 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pCurWin ? pCurWin->GetFrameWeld() : nullptr,
146 VclMessageType::Question, VclButtonsType::YesNo,
147 IDEResId(RID_STR_SEARCHALLMODULES)));
148 xQueryBox->set_default_response(RET_YES);
149 bAllModules = xQueryBox->run() == RET_YES;
150 }
151
152 if (bAllModules)
153 {
154 for (auto const& window : aWindowTable)
155 {
156 BaseWindow* pWin = window.second;
157 nFound += pWin->StartSearchAndReplace( *mpSearchItem );
158 }
159 }
160 else
161 nFound = pCurWin->StartSearchAndReplace( *mpSearchItem );
162
163 OUString aReplStr(IDEResId(RID_STR_SEARCHREPLACES));
164 aReplStr = aReplStr.replaceAll("XX", OUString::number(nFound));
165
166 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pCurWin->GetFrameWeld(),
167 VclMessageType::Info, VclButtonsType::Ok,
168 aReplStr));
169 xInfoBox->run();
170 }
171 else
172 {
173 bool bCanceled = false;
174 nFound = pCurWin->StartSearchAndReplace( *mpSearchItem );
175 if ( !nFound && !mpSearchItem->GetSelection() )
176 {
177 // search other modules...
178 bool bChangeCurWindow = false;
179 auto it = std::find_if(aWindowTable.cbegin(), aWindowTable.cend(),
180 [this](const WindowTable::value_type& item) { return item.second == pCurWin; });
181 if (it != aWindowTable.cend())
182 ++it;
183 BaseWindow* pWin = it != aWindowTable.cend() ? it->second.get() : nullptr;
184
185 bool bSearchedFromStart = false;
186 while ( !nFound && !bCanceled && ( pWin || !bSearchedFromStart ) )
187 {
188 if ( !pWin )
189 {
190 SfxViewFrame& rViewFrame = GetViewFrame();
191 SfxChildWindow* pChildWin = rViewFrame.GetChildWindow(SID_SEARCH_DLG);
192 auto xParent = pChildWin ? pChildWin->GetController() : nullptr;
193
194 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(xParent ? xParent->getDialog() : nullptr,
195 VclMessageType::Question, VclButtonsType::YesNo,
196 IDEResId(RID_STR_SEARCHFROMSTART)));
197 xQueryBox->set_default_response(RET_YES);
198 if (xQueryBox->run() == RET_YES)
199 {
200 it = aWindowTable.cbegin();
201 if ( it != aWindowTable.cend() )
202 pWin = it->second;
203 bSearchedFromStart = true;
204 }
205 else
206 bCanceled = true;
207 }
208
209 if (pWin && pWin->HasActiveEditor())
210 {
211 if ( pWin != pCurWin )
212 {
213 if ( pCurWin )
214 pWin->SetSizePixel( pCurWin->GetSizePixel() );
215 nFound = pWin->StartSearchAndReplace( *mpSearchItem, true );
216 }
217 if ( nFound )
218 {
219 bChangeCurWindow = true;
220 break;
221 }
222 }
223 if ( pWin && ( pWin != pCurWin ) )
224 {
225 if ( it != aWindowTable.cend() )
226 ++it;
227 pWin = it != aWindowTable.cend() ? it->second.get() : nullptr;
228 }
229 else
230 pWin = nullptr;
231 }
232 if ( !nFound && bSearchedFromStart )
233 nFound = pCurWin->StartSearchAndReplace( *mpSearchItem, true );
234 if ( bChangeCurWindow )
235 SetCurWindow( pWin, true );
236 }
237 if ( !nFound && !bCanceled )
238 {
239 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pCurWin->GetFrameWeld(),
240 VclMessageType::Info, VclButtonsType::Ok,
241 IDEResId(RID_STR_SEARCHNOTFOUND)));
242 xInfoBox->run();
243 }
244 }
245
246 rReq.Done();
247 break;
248 }
249 default:
250 pCurWin->ExecuteCommand( rReq );
251 }
252}
253
255{
256 if ( !pCurWin )
257 return;
258
259 switch ( rReq.GetSlot() )
260 {
261 case SID_BASICIDE_HIDECURPAGE:
262 {
263 pCurWin->StoreData();
264 RemoveWindow( pCurWin, false );
265 }
266 break;
267 case SID_BASICIDE_RENAMECURRENT:
268 {
269 pTabBar->StartEditMode( pTabBar->GetCurPageId() );
270 }
271 break;
272 case SID_UNDO:
273 case SID_REDO:
274 if ( GetUndoManager() && pCurWin->AllowUndo() )
275 GetViewFrame().ExecuteSlot( rReq );
276 break;
277 default:
278 pCurWin->ExecuteCommand( rReq );
279 }
280}
281
282// no matter who's at the top, influence on the shell:
284{
285 sal_uInt16 nSlot = rReq.GetSlot();
286 switch ( nSlot )
287 {
288 case SID_NEWDOCDIRECT:
289 {
290 // we do not have a new document factory,
291 // so just forward to a fallback method.
292 SfxGetpApp()->ExecuteSlot(rReq);
293 }
294 break;
295
296 case SID_BASICSTOP:
297 {
298 // maybe do not simply stop if on breakpoint!
299 if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
300 pMCurWin->BasicStop();
301 StopBasic();
302 }
303 break;
304
305 case SID_SAVEDOC:
306 {
307 if ( pCurWin )
308 {
309 // rewrite date into the BASIC
311
312 // document basic
313 ScriptDocument aDocument( pCurWin->GetDocument() );
314 if ( aDocument.isDocument() )
315 {
316 uno::Reference< task::XStatusIndicator > xStatusIndicator;
317
318 const SfxUnoAnyItem* pStatusIndicatorItem = rReq.GetArg<SfxUnoAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
319 if ( pStatusIndicatorItem )
320 OSL_VERIFY( pStatusIndicatorItem->GetValue() >>= xStatusIndicator );
321 else
322 {
323 // get statusindicator
324 SfxViewFrame *pFrame_ = GetFrame();
325 if ( pFrame_ )
326 {
327 uno::Reference< task::XStatusIndicatorFactory > xStatFactory(
328 pFrame_->GetFrame().GetFrameInterface(),
329 uno::UNO_QUERY );
330 if( xStatFactory.is() )
331 xStatusIndicator = xStatFactory->createStatusIndicator();
332 }
333
334 if ( xStatusIndicator.is() )
335 rReq.AppendItem( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, uno::Any( xStatusIndicator ) ) );
336 }
337
338 aDocument.saveDocument( xStatusIndicator );
339 }
340
341 if (SfxBindings* pBindings = GetBindingsPtr())
342 {
343 pBindings->Invalidate( SID_DOC_MODIFIED );
344 pBindings->Invalidate( SID_SAVEDOC );
345 pBindings->Invalidate( SID_SIGNATURE );
346 }
347 }
348 }
349 break;
350 case SID_BASICIDE_MODULEDLG:
351 {
352 if ( rReq.GetArgs() )
353 {
354 const SfxUInt16Item &rTabId = rReq.GetArgs()->Get(SID_BASICIDE_ARG_TABID );
355 Organize(rReq.GetFrameWeld(), nullptr, rTabId.GetValue());
356 }
357 else
358 Organize(rReq.GetFrameWeld(), nullptr, 0);
359 }
360 break;
361 case SID_BASICIDE_CHOOSEMACRO:
362 {
363 ChooseMacro(rReq.GetFrameWeld(), nullptr);
364 }
365 break;
366 case SID_BASICIDE_CREATEMACRO:
367 case SID_BASICIDE_EDITMACRO:
368 {
369 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
370 const SfxMacroInfoItem& rInfo = rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO );
371 BasicManager* pBasMgr = const_cast<BasicManager*>(rInfo.GetBasicManager());
372 DBG_ASSERT( pBasMgr, "Nothing selected in basic tree?" );
373
375
376 StartListening(*pBasMgr, DuplicateHandling::Prevent /* log on only once */);
377 OUString aLibName( rInfo.GetLib() );
378 if ( aLibName.isEmpty() )
379 aLibName = "Standard" ;
380 StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
381 if ( !pBasic )
382 {
383 // load module and dialog library (if not loaded)
384 aDocument.loadLibraryIfExists( E_SCRIPTS, aLibName );
385 aDocument.loadLibraryIfExists( E_DIALOGS, aLibName );
386
387 // get Basic
388 pBasic = pBasMgr->GetLib( aLibName );
389 }
390 DBG_ASSERT( pBasic, "No Basic!" );
391
392 SetCurLib( aDocument, aLibName );
393
394 if ( pBasic && rReq.GetSlot() == SID_BASICIDE_CREATEMACRO )
395 {
396 SbModule* pModule = pBasic->FindModule( rInfo.GetModule() );
397 if ( !pModule )
398 {
399 if ( !rInfo.GetModule().isEmpty() || pBasic->GetModules().empty() )
400 {
401 const OUString& aModName = rInfo.GetModule();
402
403 OUString sModuleCode;
404 if ( aDocument.createModule( aLibName, aModName, false, sModuleCode ) )
405 pModule = pBasic->FindModule( aModName );
406 }
407 else
408 pModule = pBasic->GetModules().front().get();
409 }
410 DBG_ASSERT( pModule, "No Module!" );
411 if ( pModule && !pModule->GetMethods()->Find( rInfo.GetMethod(), SbxClassType::Method ) )
412 CreateMacro( pModule, rInfo.GetMethod() );
413 }
414 SfxViewFrame& rViewFrame = GetViewFrame();
415 rViewFrame.ToTop();
416 VclPtr<ModulWindow> pWin = FindBasWin( aDocument, aLibName, rInfo.GetModule(), true );
417 DBG_ASSERT( pWin, "Edit/Create Macro: Window was not created/found!" );
418 SetCurWindow( pWin, true );
419 pWin->EditMacro( rInfo.GetMethod() );
420 }
421 break;
422
423 case SID_BASICIDE_OBJCAT:
424 // toggling object catalog
425 aObjectCatalog->Show(!aObjectCatalog->IsVisible());
426 if (pLayout)
427 pLayout->ArrangeWindows();
428 // refresh the button state
429 if (SfxBindings* pBindings = GetBindingsPtr())
430 pBindings->Invalidate(SID_BASICIDE_OBJCAT);
431 break;
432
433 case SID_BASICIDE_WATCH:
434 {
435 // Toggling the watch window can only be done from a ModulWindow
436 if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
437 return;
438
439 pModulLayout->ShowWatchWindow(!pModulLayout->IsWatchWindowVisible());
440 if (SfxBindings* pBindings = GetBindingsPtr())
441 pBindings->Invalidate(SID_BASICIDE_WATCH);
442 }
443 break;
444
445 case SID_BASICIDE_STACK:
446 {
447 // Toggling the stack window can only be done from a ModulWindow
448 if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
449 return;
450
451 pModulLayout->ShowStackWindow(!pModulLayout->IsStackWindowVisible());
452 if (SfxBindings* pBindings = GetBindingsPtr())
453 pBindings->Invalidate(SID_BASICIDE_STACK);
454 }
455 break;
456
457 case SID_BASICIDE_NAMECHANGEDONTAB:
458 {
459 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
460 const SfxUInt16Item &rTabId = rReq.GetArgs()->Get(SID_BASICIDE_ARG_TABID );
461 const SfxStringItem &rModName = rReq.GetArgs()->Get(SID_BASICIDE_ARG_MODULENAME );
462 if ( aWindowTable.find( rTabId.GetValue() ) != aWindowTable.end() )
463 {
464 VclPtr<BaseWindow> pWin = aWindowTable[ rTabId.GetValue() ];
465 const OUString& aNewName( rModName.GetValue() );
466 OUString aOldName( pWin->GetName() );
467 if ( aNewName != aOldName )
468 {
469 bool bRenameOk = false;
470 if (ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin.get()))
471 {
472 const OUString& aLibName = pModWin->GetLibName();
473 ScriptDocument aDocument( pWin->GetDocument() );
474
475 if (RenameModule(pModWin->GetFrameWeld(), aDocument, aLibName, aOldName, aNewName))
476 {
477 bRenameOk = true;
478 // Because we listen for container events for script
479 // modules, rename will delete the 'old' window
480 // pWin has been invalidated, restore now
481 pWin = FindBasWin( aDocument, aLibName, aNewName, true );
482 }
483
484 }
485 else if (DialogWindow* pDlgWin = dynamic_cast<DialogWindow*>(pWin.get()))
486 {
487 bRenameOk = pDlgWin->RenameDialog( aNewName );
488 }
489 if ( bRenameOk )
490 {
491 MarkDocumentModified( pWin->GetDocument() );
492 }
493 else
494 {
495 // set old name in TabWriter
496 sal_uInt16 nId = GetWindowId( pWin );
497 DBG_ASSERT( nId, "No entry in Tabbar!" );
498 if ( nId )
499 pTabBar->SetPageText( nId, aOldName );
500 }
501 }
502
503 // set focus to current window
504 pWin->GrabFocus();
505 }
506 }
507 break;
508 case SID_BASICIDE_STOREMODULESOURCE:
509 case SID_BASICIDE_UPDATEMODULESOURCE:
510 {
511 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
512 const SfxMacroInfoItem& rInfo = rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO );
513 BasicManager* pBasMgr = const_cast<BasicManager*>(rInfo.GetBasicManager());
514 DBG_ASSERT( pBasMgr, "Store source: No BasMgr?" );
516 VclPtr<ModulWindow> pWin = FindBasWin( aDocument, rInfo.GetLib(), rInfo.GetModule(), false, true );
517 if ( pWin )
518 {
519 if ( rReq.GetSlot() == SID_BASICIDE_STOREMODULESOURCE )
520 pWin->StoreData();
521 else
522 pWin->UpdateData();
523 }
524 }
525 break;
526 case SID_BASICIDE_STOREALLMODULESOURCES:
527 case SID_BASICIDE_UPDATEALLMODULESOURCES:
528 {
529 for (auto const& window : aWindowTable)
530 {
531 BaseWindow* pWin = window.second;
532 if (!pWin->IsSuspended() && dynamic_cast<ModulWindow*>(pWin))
533 {
534 if ( rReq.GetSlot() == SID_BASICIDE_STOREALLMODULESOURCES )
535 pWin->StoreData();
536 else
537 pWin->UpdateData();
538 }
539 }
540 }
541 break;
542 case SID_BASICIDE_LIBSELECTED:
543 case SID_BASICIDE_LIBREMOVED:
544 case SID_BASICIDE_LIBLOADED:
545 {
546 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
547 const SfxUnoAnyItem& rShellItem = rReq.GetArgs()->Get( SID_BASICIDE_ARG_DOCUMENT_MODEL );
548 uno::Reference< frame::XModel > xModel( rShellItem.GetValue(), UNO_QUERY );
550 const SfxStringItem& rLibNameItem = rReq.GetArgs()->Get( SID_BASICIDE_ARG_LIBNAME );
551 const OUString& aLibName( rLibNameItem.GetValue() );
552
553 if ( nSlot == SID_BASICIDE_LIBSELECTED )
554 {
555 // load module and dialog library (if not loaded)
556 aDocument.loadLibraryIfExists( E_SCRIPTS, aLibName );
557 aDocument.loadLibraryIfExists( E_DIALOGS, aLibName );
558
559 // check password, if library is password protected and not verified
560 bool bOK = true;
561 Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ) );
562 if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
563 {
564 Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
565 if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
566 {
567 OUString aPassword;
568 bOK = QueryPassword(rReq.GetFrameWeld(), xModLibContainer, aLibName, aPassword);
569 }
570 }
571
572 if ( bOK )
573 {
574 SetCurLib( aDocument, aLibName, true, false );
575 }
576 else
577 {
578 // adjust old value...
579 if (SfxBindings* pBindings = GetBindingsPtr())
580 pBindings->Invalidate(SID_BASICIDE_LIBSELECTOR, true);
581 }
582 }
583 else if ( nSlot == SID_BASICIDE_LIBREMOVED )
584 {
585 if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
586 {
587 RemoveWindows( aDocument, aLibName );
588 if ( aDocument == m_aCurDocument && aLibName == m_aCurLibName )
589 {
591 m_aCurLibName.clear();
592 // no UpdateWindows!
593 if (SfxBindings* pBindings = GetBindingsPtr())
594 pBindings->Invalidate( SID_BASICIDE_LIBSELECTOR );
595 }
596 }
597 }
598 else // Loaded...
600 }
601 break;
602 case SID_BASICIDE_NEWMODULE:
603 {
605 DBG_ASSERT( pWin, "New Module: Could not create window!" );
606 SetCurWindow( pWin, true );
607 }
608 break;
609 case SID_BASICIDE_NEWDIALOG:
610 {
612 DBG_ASSERT( pWin, "New Module: Could not create window!" );
613 SetCurWindow( pWin, true );
614 }
615 break;
616 case SID_BASICIDE_SBXRENAMED:
617 {
618 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
619 }
620 break;
621 case SID_BASICIDE_SBXINSERTED:
622 {
623 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
624 const SbxItem& rSbxItem = rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX );
625 const ScriptDocument& aDocument( rSbxItem.GetDocument() );
626 const OUString& aLibName( rSbxItem.GetLibName() );
627 const OUString& aName( rSbxItem.GetName() );
628 if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
629 {
630 if ( rSbxItem.GetType() == TYPE_MODULE )
631 FindBasWin( aDocument, aLibName, aName, true );
632 else if ( rSbxItem.GetType() == TYPE_DIALOG )
633 FindDlgWin( aDocument, aLibName, aName, true );
634 }
635 }
636 break;
637 case SID_BASICIDE_SBXDELETED:
638 {
639 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
640 const SbxItem& rSbxItem = rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX );
641 const ScriptDocument& aDocument( rSbxItem.GetDocument() );
642 VclPtr<BaseWindow> pWin = FindWindow( aDocument, rSbxItem.GetLibName(), rSbxItem.GetName(), rSbxItem.GetType(), true );
643 if ( pWin )
644 RemoveWindow( pWin, true );
645 }
646 break;
647 case SID_BASICIDE_SHOWSBX:
648 {
649 DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
650 const SbxItem& rSbxItem = rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX );
651 const ScriptDocument& aDocument( rSbxItem.GetDocument() );
652 const OUString& aLibName( rSbxItem.GetLibName() );
653 const OUString& aName( rSbxItem.GetName() );
654 SetCurLib( aDocument, aLibName );
655 BaseWindow* pWin = nullptr;
656 if ( rSbxItem.GetType() == TYPE_DIALOG )
657 {
658 pWin = FindDlgWin( aDocument, aLibName, aName, true );
659 }
660 else if ( rSbxItem.GetType() == TYPE_MODULE )
661 {
662 pWin = FindBasWin( aDocument, aLibName, aName, true );
663 }
664 else if ( rSbxItem.GetType() == TYPE_METHOD )
665 {
666 pWin = FindBasWin( aDocument, aLibName, aName, true );
667 static_cast<ModulWindow*>(pWin)->EditMacro( rSbxItem.GetMethodName() );
668 }
669 DBG_ASSERT( pWin, "Window was not created!" );
670 SetCurWindow( pWin, true );
671 pTabBar->MakeVisible( pTabBar->GetCurPageId() );
672 }
673 break;
674 case SID_BASICIDE_SHOWWINDOW:
675 {
676 std::unique_ptr< ScriptDocument > pDocument;
677
678 const SfxStringItem* pDocumentItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_DOCUMENT);
679 if ( pDocumentItem )
680 {
681 const OUString& sDocumentCaption = pDocumentItem->GetValue();
682 if ( !sDocumentCaption.isEmpty() )
683 pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) );
684 }
685
686 const SfxUnoAnyItem* pDocModelItem = rReq.GetArg<SfxUnoAnyItem>(SID_BASICIDE_ARG_DOCUMENT_MODEL);
687 if (!pDocument && pDocModelItem)
688 {
689 uno::Reference< frame::XModel > xModel( pDocModelItem->GetValue(), UNO_QUERY );
690 if ( xModel.is() )
691 pDocument.reset( new ScriptDocument( xModel ) );
692 }
693
694 if (!pDocument)
695 break;
696
697 const SfxStringItem* pLibNameItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_LIBNAME);
698 if ( !pLibNameItem )
699 break;
700
701 OUString aLibName( pLibNameItem->GetValue() );
702 pDocument->loadLibraryIfExists( E_SCRIPTS, aLibName );
703 SetCurLib( *pDocument, aLibName );
704 const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_NAME);
705 if ( pNameItem )
706 {
707 const OUString& aName( pNameItem->GetValue() );
708 OUString aModType( "Module" );
709 OUString aType( aModType );
710 const SfxStringItem* pTypeItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_TYPE);
711 if ( pTypeItem )
712 aType = pTypeItem->GetValue();
713
714 BaseWindow* pWin = nullptr;
715 if ( aType == aModType )
716 pWin = FindBasWin( *pDocument, aLibName, aName );
717 else if ( aType == "Dialog" )
718 pWin = FindDlgWin( *pDocument, aLibName, aName );
719
720 if ( pWin )
721 {
722 SetCurWindow( pWin, true );
723 if ( pTabBar )
724 pTabBar->MakeVisible( pTabBar->GetCurPageId() );
725
726 if (ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin))
727 {
728 const SfxUInt32Item* pLineItem = rReq.GetArg<SfxUInt32Item>(SID_BASICIDE_ARG_LINE);
729 if ( pLineItem )
730 {
731 pModWin->AssertValidEditEngine();
732 TextView* pTextView = pModWin->GetEditView();
733 if ( pTextView )
734 {
735 TextEngine* pTextEngine = pTextView->GetTextEngine();
736 if ( pTextEngine )
737 {
738 sal_uInt32 nLine = pLineItem->GetValue();
739 sal_uInt32 nLineCount = 0;
740 for ( sal_uInt32 i = 0, nCount = pTextEngine->GetParagraphCount(); i < nCount; ++i )
741 nLineCount += pTextEngine->GetLineCount( i );
742 if ( nLine > nLineCount )
743 nLine = nLineCount;
744 if ( nLine > 0 )
745 --nLine;
746
747 // scroll window and set selection
748 tools::Long nVisHeight = pModWin->GetOutputSizePixel().Height();
749 tools::Long nTextHeight = pTextEngine->GetTextHeight();
750 if ( nTextHeight > nVisHeight )
751 {
752 tools::Long nMaxY = nTextHeight - nVisHeight;
753 tools::Long nOldY = pTextView->GetStartDocPos().Y();
754 tools::Long nNewY = nLine * pTextEngine->GetCharHeight() - nVisHeight / 2;
755 nNewY = std::min( nNewY, nMaxY );
756 pTextView->Scroll( 0, -( nNewY - nOldY ) );
757 pTextView->ShowCursor( false );
758 pModWin->GetEditVScrollBar().SetThumbPos( pTextView->GetStartDocPos().Y() );
759 }
760 sal_uInt16 nCol1 = 0, nCol2 = 0;
761 const SfxUInt16Item* pCol1Item = rReq.GetArg<SfxUInt16Item>(SID_BASICIDE_ARG_COLUMN1);
762 if ( pCol1Item )
763 {
764 nCol1 = pCol1Item->GetValue();
765 if ( nCol1 > 0 )
766 --nCol1;
767 nCol2 = nCol1;
768 }
769 const SfxUInt16Item* pCol2Item = rReq.GetArg<SfxUInt16Item>(SID_BASICIDE_ARG_COLUMN2);
770 if ( pCol2Item )
771 {
772 nCol2 = pCol2Item->GetValue();
773 if ( nCol2 > 0 )
774 --nCol2;
775 }
776 TextSelection aSel( TextPaM( nLine, nCol1 ), TextPaM( nLine, nCol2 ) );
777 pTextView->SetSelection( aSel );
778 pTextView->ShowCursor();
779 vcl::Window* pWindow_ = pTextView->GetWindow();
780 if ( pWindow_ )
781 pWindow_->GrabFocus();
782 }
783 }
784 }
785 }
786 }
787 }
788 rReq.Done();
789 }
790 break;
791
792 case SID_BASICIDE_MANAGE_LANG:
793 {
794 auto pRequest = std::make_shared<SfxRequest>(rReq);
795 rReq.Ignore(); // the 'old' request is not relevant any more
796 auto xDlg = std::make_shared<ManageLanguageDialog>(pCurWin ? pCurWin->GetFrameWeld() : nullptr, m_pCurLocalizationMgr);
797 weld::DialogController::runAsync(xDlg, [=](sal_Int32 /*nResult*/){
798 pRequest->Done();
799 });
800 }
801 break;
802
803 case SID_ATTR_ZOOMSLIDER:
804 {
805 const SfxItemSet *pArgs = rReq.GetArgs();
806 const SfxPoolItem* pItem;
807
808 if (pArgs && pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem ) == SfxItemState::SET)
809 SetGlobalEditorZoomLevel(static_cast<const SvxZoomSliderItem*>(pItem)->GetValue());
810
812 }
813 break;
814
815 case SID_ZOOM_IN:
816 case SID_ZOOM_OUT:
817 {
818 const sal_uInt16 nOldZoom = GetCurrentZoomSliderValue();
819 sal_uInt16 nNewZoom;
820 if (nSlot == SID_ZOOM_IN)
821 nNewZoom = std::min<sal_uInt16>(GetMaxZoom(), basegfx::zoomtools::zoomIn(nOldZoom));
822 else
823 nNewZoom = std::max<sal_uInt16>(GetMinZoom(), basegfx::zoomtools::zoomOut(nOldZoom));
824 SetGlobalEditorZoomLevel(nNewZoom);
826 }
827 break;
828
829 default:
830 if (pLayout)
831 pLayout->ExecuteGlobal(rReq);
832 if (pCurWin)
833 pCurWin->ExecuteGlobal(rReq);
834 break;
835 }
836}
837
839{
840 SfxWhichIter aIter(rSet);
841 for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = aIter.NextWhich() )
842 {
843 switch ( nWh )
844 {
845 case SID_NEWDOCDIRECT:
846 {
847 // we do not have a new document factory,
848 // so just forward to a fallback method.
849 SfxGetpApp()->GetSlotState(nWh, nullptr, &rSet);
850 }
851 break;
852 case SID_DOCINFO:
853 {
854 rSet.DisableItem( nWh );
855 }
856 break;
857 case SID_SAVEDOC:
858 {
859 bool bDisable = false;
860
861 if ( pCurWin )
862 {
863 if ( !pCurWin->IsModified() )
864 {
865 ScriptDocument aDocument( pCurWin->GetDocument() );
866 bDisable = ( !aDocument.isAlive() )
867 || ( aDocument.isDocument() ? !aDocument.isDocumentModified() : !IsAppBasicModified() );
868 }
869 }
870 else
871 {
872 bDisable = true;
873 }
874
875 if ( bDisable )
876 rSet.DisableItem( nWh );
877 }
878 break;
879 case SID_NEWWINDOW:
880 case SID_SAVEASDOC:
881 {
882 rSet.DisableItem( nWh );
883 }
884 break;
885 case SID_SIGNATURE:
886 {
887 SignatureState nState = SignatureState::NOSIGNATURES;
888 if ( pCurWin )
889 {
890 DocumentSignature aSignature( pCurWin->GetDocument() );
891 nState = aSignature.getScriptingSignatureState();
892 }
893 rSet.Put( SfxUInt16Item( SID_SIGNATURE, static_cast<sal_uInt16>(nState) ) );
894 }
895 break;
896 case SID_BASICIDE_MODULEDLG:
897 {
898 if ( StarBASIC::IsRunning() )
899 rSet.DisableItem( nWh );
900 }
901 break;
902
903 case SID_BASICIDE_OBJCAT:
904 {
905 if (pLayout)
906 rSet.Put(SfxBoolItem(nWh, aObjectCatalog->IsVisible()));
907 else
908 rSet.Put(SfxVisibilityItem(nWh, false));
909 }
910 break;
911
912 case SID_BASICIDE_WATCH:
913 {
914 if (pLayout)
915 {
916 rSet.Put(SfxBoolItem(nWh, pModulLayout->IsWatchWindowVisible()));
917 // Disable command if the visible window is not a ModulWindow
918 if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
919 rSet.DisableItem(nWh);
920 }
921 else
922 rSet.Put(SfxVisibilityItem(nWh, false));
923 }
924 break;
925
926 case SID_BASICIDE_STACK:
927 {
928 if (pLayout)
929 {
930 rSet.Put(SfxBoolItem(nWh, pModulLayout->IsStackWindowVisible()));
931 // Disable command if the visible window is not a ModulWindow
932 if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
933 rSet.DisableItem(nWh);
934 }
935 else
936 rSet.Put(SfxVisibilityItem(nWh, false));
937 }
938 break;
939
940 case SID_BASICIDE_SHOWSBX:
941 case SID_BASICIDE_CREATEMACRO:
942 case SID_BASICIDE_EDITMACRO:
943 case SID_BASICIDE_NAMECHANGEDONTAB:
944 {
945 ;
946 }
947 break;
948
949 case SID_BASICIDE_ADDWATCH:
950 case SID_BASICIDE_REMOVEWATCH:
951 case SID_BASICLOAD:
952 case SID_BASICSAVEAS:
953 case SID_BASICIDE_MATCHGROUP:
954 {
955 if (!dynamic_cast<ModulWindow*>(pCurWin.get()))
956 rSet.DisableItem( nWh );
957 else if ( ( nWh == SID_BASICLOAD ) && ( StarBASIC::IsRunning() || ( pCurWin && pCurWin->IsReadOnly() ) ) )
958 rSet.DisableItem( nWh );
959 }
960 break;
961 case SID_BASICRUN:
962 case SID_BASICSTEPINTO:
963 case SID_BASICSTEPOVER:
964 case SID_BASICSTEPOUT:
965 case SID_BASICIDE_TOGGLEBRKPNT:
966 case SID_BASICIDE_MANAGEBRKPNTS:
967 {
968 if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
969 {
970 if (StarBASIC::IsRunning() && !pMCurWin->GetBasicStatus().bIsInReschedule)
971 rSet.DisableItem(nWh);
972 }
973 else
974 rSet.DisableItem( nWh );
975 }
976 break;
977 case SID_BASICCOMPILE:
978 {
979 if (StarBASIC::IsRunning() || !dynamic_cast<ModulWindow*>(pCurWin.get()))
980 rSet.DisableItem( nWh );
981 }
982 break;
983 case SID_BASICSTOP:
984 {
985 // stop is always possible when some Basic is running...
987 rSet.DisableItem( nWh );
988 }
989 break;
990 case SID_CHOOSE_CONTROLS:
991 case SID_DIALOG_TESTMODE:
992 case SID_INSERT_SELECT:
993 case SID_INSERT_PUSHBUTTON:
994 case SID_INSERT_RADIOBUTTON:
995 case SID_INSERT_CHECKBOX:
996 case SID_INSERT_LISTBOX:
997 case SID_INSERT_COMBOBOX:
998 case SID_INSERT_GROUPBOX:
999 case SID_INSERT_EDIT:
1000 case SID_INSERT_FIXEDTEXT:
1001 case SID_INSERT_IMAGECONTROL:
1002 case SID_INSERT_PROGRESSBAR:
1003 case SID_INSERT_HSCROLLBAR:
1004 case SID_INSERT_VSCROLLBAR:
1005 case SID_INSERT_HFIXEDLINE:
1006 case SID_INSERT_VFIXEDLINE:
1007 case SID_INSERT_DATEFIELD:
1008 case SID_INSERT_TIMEFIELD:
1009 case SID_INSERT_NUMERICFIELD:
1010 case SID_INSERT_CURRENCYFIELD:
1011 case SID_INSERT_FORMATTEDFIELD:
1012 case SID_INSERT_PATTERNFIELD:
1013 case SID_INSERT_FILECONTROL:
1014 case SID_INSERT_SPINBUTTON:
1015 case SID_INSERT_GRIDCONTROL:
1016 case SID_INSERT_HYPERLINKCONTROL:
1017 case SID_INSERT_TREECONTROL:
1018 case SID_INSERT_FORM_RADIO:
1019 case SID_INSERT_FORM_CHECK:
1020 case SID_INSERT_FORM_LIST:
1021 case SID_INSERT_FORM_COMBO:
1022 case SID_INSERT_FORM_VSCROLL:
1023 case SID_INSERT_FORM_HSCROLL:
1024 case SID_INSERT_FORM_SPIN:
1025 {
1026 if (!dynamic_cast<DialogWindow*>(pCurWin.get()))
1027 rSet.DisableItem( nWh );
1028 }
1029 break;
1030 case SID_SEARCH_OPTIONS:
1031 {
1032 SearchOptionFlags nOptions = SearchOptionFlags::NONE;
1033 if( pCurWin )
1034 nOptions = pCurWin->GetSearchOptions();
1035 rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, static_cast<sal_uInt16>(nOptions) ) );
1036 }
1037 break;
1038 case SID_BASICIDE_LIBSELECTOR:
1039 {
1040 OUString aName;
1041 if ( !m_aCurLibName.isEmpty() )
1042 {
1045 }
1046 SfxStringItem aItem( SID_BASICIDE_LIBSELECTOR, aName );
1047 rSet.Put( aItem );
1048 }
1049 break;
1050 case SID_SEARCH_ITEM:
1051 {
1052 if ( !mpSearchItem )
1053 {
1054 mpSearchItem.reset( new SvxSearchItem( SID_SEARCH_ITEM ));
1055 mpSearchItem->SetSearchString( GetSelectionText( true ));
1056 }
1057
1058 if ( mbJustOpened && HasSelection() )
1059 {
1060 OUString aText = GetSelectionText( true );
1061
1062 if ( !aText.isEmpty() )
1063 {
1064 mpSearchItem->SetSearchString( aText );
1065 mpSearchItem->SetSelection( false );
1066 }
1067 else
1068 mpSearchItem->SetSelection( true );
1069 }
1070
1071 mbJustOpened = false;
1072 rSet.Put( *mpSearchItem );
1073 }
1074 break;
1075 case SID_BASICIDE_STAT_DATE:
1076 {
1077 SfxStringItem aItem( SID_BASICIDE_STAT_DATE, "Datum?!" );
1078 rSet.Put( aItem );
1079 }
1080 break;
1081 case SID_DOC_MODIFIED:
1082 {
1083 bool bModified = false;
1084
1085 if ( pCurWin )
1086 {
1087 if ( pCurWin->IsModified() )
1088 bModified = true;
1089 else
1090 {
1091 ScriptDocument aDocument( pCurWin->GetDocument() );
1092 bModified = aDocument.isDocument() ? aDocument.isDocumentModified() : IsAppBasicModified();
1093 }
1094 }
1095
1096 SfxBoolItem aItem(SID_DOC_MODIFIED, bModified);
1097 rSet.Put( aItem );
1098 }
1099 break;
1100 case SID_BASICIDE_STAT_TITLE:
1101 {
1102 if ( pCurWin )
1103 {
1104 OUString aTitle = pCurWin->CreateQualifiedName();
1105 if (pCurWin->IsReadOnly())
1106 aTitle += " (" + IDEResId(RID_STR_READONLY) + ")";
1107 SfxStringItem aItem( SID_BASICIDE_STAT_TITLE, aTitle );
1108 rSet.Put( aItem );
1109 }
1110 }
1111 break;
1112 case SID_BASICIDE_CURRENT_ZOOM:
1113 {
1114 // The current zoom value is only visible in a module window
1115 ModulWindow* pModuleWindow = dynamic_cast<ModulWindow*>(pCurWin.get());
1116 if (pModuleWindow)
1117 {
1118 OUString sZoom;
1119 sZoom = OUString::number(m_nCurrentZoomSliderValue) + "%";
1120 SfxStringItem aItem( SID_BASICIDE_CURRENT_ZOOM, sZoom );
1121 rSet.Put( aItem );
1122 }
1123 }
1124 break;
1125 // are interpreted by the controller:
1126 case SID_ATTR_SIZE:
1127 case SID_ATTR_INSERT:
1128 break;
1129 case SID_UNDO:
1130 case SID_REDO:
1131 {
1132 if( GetUndoManager() ) // recursive GetState else
1133 GetViewFrame().GetSlotState( nWh, nullptr, &rSet );
1134 }
1135 break;
1136 case SID_BASICIDE_CURRENT_LANG:
1137 {
1138 if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
1139 rSet.DisableItem( nWh );
1140 else
1141 {
1142 OUString aItemStr;
1143 std::shared_ptr<LocalizationMgr> pCurMgr(GetCurLocalizationMgr());
1144 if ( pCurMgr->isLibraryLocalized() )
1145 {
1146 Sequence< lang::Locale > aLocaleSeq = pCurMgr->getStringResourceManager()->getLocales();
1147 const lang::Locale* pLocale = aLocaleSeq.getConstArray();
1148 sal_Int32 i, nCount = aLocaleSeq.getLength();
1149
1150 // Force different results for any combination of locales and default locale
1151 OUString aLangStr;
1152 for ( i = 0; i <= nCount; ++i )
1153 {
1154 lang::Locale aLocale;
1155 if( i < nCount )
1156 aLocale = pLocale[i];
1157 else
1158 aLocale = pCurMgr->getStringResourceManager()->getDefaultLocale();
1159
1160 aLangStr += aLocale.Language + aLocale.Country + aLocale.Variant;
1161 }
1162 aItemStr = aLangStr;
1163 }
1164 rSet.Put( SfxStringItem( nWh, aItemStr ) );
1165 }
1166 }
1167 break;
1168
1169 case SID_BASICIDE_MANAGE_LANG:
1170 {
1171 if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
1172 rSet.DisableItem( nWh );
1173 }
1174 break;
1175 case SID_GOTOLINE:
1176 {
1177 // if this is not a module window hide the
1178 // setting, doesn't make sense for example if the
1179 // dialog editor is open
1180 if (pCurWin && !dynamic_cast<ModulWindow*>(pCurWin.get()))
1181 {
1182 rSet.DisableItem( nWh );
1183 rSet.Put(SfxVisibilityItem(nWh, false));
1184 }
1185 break;
1186 }
1187 case SID_BASICIDE_HIDECURPAGE:
1188 {
1189 if (pTabBar->GetPageCount() == 0)
1190 rSet.DisableItem(nWh);
1191 }
1192 break;
1193 case SID_BASICIDE_DELETECURRENT:
1194 case SID_BASICIDE_RENAMECURRENT:
1195 {
1196 if (pTabBar->GetPageCount() == 0 || StarBASIC::IsRunning())
1197 rSet.DisableItem(nWh);
1198 else if (m_aCurDocument.isInVBAMode())
1199 {
1200 // disable to delete or rename object modules in IDE
1202 StarBASIC* pBasic = pBasMgr ? pBasMgr->GetLib(m_aCurLibName) : nullptr;
1203 if (pBasic && dynamic_cast<ModulWindow*>(pCurWin.get()))
1204 {
1205 SbModule* pActiveModule = pBasic->FindModule( pCurWin->GetName() );
1206 if ( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
1207 rSet.DisableItem(nWh);
1208 }
1209 }
1210 }
1211 [[fallthrough]];
1212
1213 case SID_BASICIDE_NEWMODULE:
1214 case SID_BASICIDE_NEWDIALOG:
1215 {
1218 if ( ( xModLibContainer.is() && xModLibContainer->hasByName( m_aCurLibName ) && xModLibContainer->isLibraryReadOnly( m_aCurLibName ) ) ||
1219 ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( m_aCurLibName ) && xDlgLibContainer->isLibraryReadOnly( m_aCurLibName ) ) )
1220 rSet.DisableItem(nWh);
1221 }
1222 break;
1223
1224 case SID_ZOOM_IN:
1225 case SID_ZOOM_OUT:
1226 {
1227 const sal_uInt16 nCurrentZoom = GetCurrentZoomSliderValue();
1228 if ((nWh == SID_ZOOM_IN && nCurrentZoom >= GetMaxZoom()) ||
1229 (nWh == SID_ZOOM_OUT && nCurrentZoom <= GetMinZoom()))
1230 rSet.DisableItem(nWh);
1231 }
1232 break;
1233
1234 case SID_ATTR_ZOOMSLIDER:
1235 {
1236 // The zoom slider is only visible in a module window
1237 ModulWindow* pModuleWindow = dynamic_cast<ModulWindow*>(pCurWin.get());
1238 if (pModuleWindow)
1239 {
1241 aZoomSliderItem.AddSnappingPoint(100);
1242 rSet.Put( aZoomSliderItem );
1243 }
1244 }
1245 break;
1246
1247 default:
1248 if (pLayout)
1249 pLayout->GetState(rSet, nWh);
1250 }
1251 }
1252 if ( pCurWin )
1253 pCurWin->GetState( rSet );
1254}
1255
1257{
1258 assert((nFeature & ~SfxShellFeature::BasicMask) == SfxShellFeature::NONE);
1259 bool bResult = false;
1260
1261 if (nFeature & SfxShellFeature::BasicShowBrowser)
1262 {
1263 // fade out (in) property browser in module (dialog) windows
1264 if (dynamic_cast<DialogWindow*>(pCurWin.get()) && !pCurWin->IsReadOnly())
1265 bResult = true;
1266 }
1267
1268 return bResult;
1269}
1270
1271void Shell::SetCurWindow( BaseWindow* pNewWin, bool bUpdateTabBar, bool bRememberAsCurrent )
1272{
1273 if ( pNewWin == pCurWin )
1274 return;
1275
1276 pCurWin = pNewWin;
1277 if (pLayout)
1278 pLayout->Deactivating();
1279 if (pCurWin)
1280 {
1281 if (pCurWin->GetType() == TYPE_MODULE)
1282 pLayout = pModulLayout.get();
1283 else
1284 pLayout = pDialogLayout.get();
1285 AdjustPosSizePixel(Point(0, 0), GetViewFrame().GetWindow().GetOutputSizePixel());
1286 pLayout->Activating(*pCurWin);
1287 GetViewFrame().GetWindow().SetHelpId(pCurWin->GetHid());
1288 if (bRememberAsCurrent)
1289 pCurWin->InsertLibInfo();
1290 if (GetViewFrame().GetWindow().IsVisible()) // SFX will do it later otherwise
1291 pCurWin->Show();
1292 pCurWin->Init();
1293 if (!GetExtraData()->ShellInCriticalSection())
1294 {
1295 vcl::Window* pFrameWindow = &GetViewFrame().GetWindow();
1296 vcl::Window* pFocusWindow = Application::GetFocusWindow();
1297 while ( pFocusWindow && ( pFocusWindow != pFrameWindow ) )
1298 pFocusWindow = pFocusWindow->GetParent();
1299 if ( pFocusWindow ) // Focus in BasicIDE
1300 pCurWin->GrabFocus();
1301 }
1302 }
1303 else
1304 {
1306 pLayout = nullptr;
1307 }
1308 if ( bUpdateTabBar )
1309 {
1310 sal_uInt16 nKey = GetWindowId( pCurWin );
1311 if ( pCurWin && ( pTabBar->GetPagePos( nKey ) == TabBar::PAGE_NOT_FOUND ) )
1312 pTabBar->InsertPage( nKey, pCurWin->GetTitle() ); // has just been faded in
1313 pTabBar->SetCurPageId( nKey );
1314 }
1315 if ( pCurWin && pCurWin->IsSuspended() ) // if the window is shown in the case of an error...
1316 pCurWin->SetStatus( pCurWin->GetStatus() & ~BASWIN_SUSPENDED );
1317 if ( pCurWin )
1318 {
1319 SetWindow( pCurWin );
1320 if ( pCurWin->GetDocument().isDocument() )
1321 SfxObjectShell::SetCurrentComponent( pCurWin->GetDocument().getDocument() );
1322 }
1323 else if (pLayout)
1324 {
1328 }
1329 aObjectCatalog->SetCurrentEntry(pCurWin);
1330 SetUndoManager( pCurWin ? pCurWin->GetUndoManager() : nullptr );
1333
1335 m_pCurLocalizationMgr->handleTranslationbar();
1336
1338
1339 // fade out (in) property browser in module (dialog) windows
1341}
1342
1344{
1345 static constexpr OUStringLiteral aMacroBarResName = u"private:resource/toolbar/macrobar";
1346 static constexpr OUStringLiteral aDialogBarResName = u"private:resource/toolbar/dialogbar";
1347 static constexpr OUStringLiteral aInsertControlsBarResName
1348 = u"private:resource/toolbar/insertcontrolsbar";
1349 static constexpr OUStringLiteral aFormControlsBarResName
1350 = u"private:resource/toolbar/formcontrolsbar";
1351
1352 if( !pCurWin )
1353 return;
1354
1356 ( GetViewFrame().GetFrame().GetFrameInterface(), uno::UNO_QUERY );
1357 if ( !xFrameProps.is() )
1358 return;
1359
1361 uno::Any a = xFrameProps->getPropertyValue( "LayoutManager" );
1362 a >>= xLayoutManager;
1363 if ( !xLayoutManager.is() )
1364 return;
1365
1366 xLayoutManager->lock();
1367 if (dynamic_cast<DialogWindow*>(pCurWin.get()))
1368 {
1369 xLayoutManager->destroyElement( aMacroBarResName );
1370
1371 xLayoutManager->requestElement( aDialogBarResName );
1372 xLayoutManager->requestElement( aInsertControlsBarResName );
1373 xLayoutManager->requestElement( aFormControlsBarResName );
1374 }
1375 else
1376 {
1377 xLayoutManager->destroyElement( aDialogBarResName );
1378 xLayoutManager->destroyElement( aInsertControlsBarResName );
1379 xLayoutManager->destroyElement( aFormControlsBarResName );
1380
1381 xLayoutManager->requestElement( aMacroBarResName );
1382 }
1383 xLayoutManager->unlock();
1384}
1385
1387{
1389}
1390
1392 ScriptDocument const& rDocument,
1393 std::u16string_view rLibName, std::u16string_view rName,
1394 ItemType eType, bool bFindSuspended
1395)
1396{
1397 for (auto const& window : aWindowTable)
1398 {
1399 BaseWindow* const pWin = window.second;
1400 if (pWin->Is(rDocument, rLibName, rName, eType, bFindSuspended))
1401 return pWin;
1402 }
1403 return nullptr;
1404}
1405
1407{
1408 VclPtr<ModulWindow> pModWin = ShowActiveModuleWindow( pBasic );
1409 if ( pModWin )
1410 pModWin->BasicErrorHdl( pBasic );
1411 return false;
1412}
1413
1415{
1416 BasicDebugFlags nRet = BasicDebugFlags::NONE;
1417 VclPtr<ModulWindow> pModWin = ShowActiveModuleWindow( pBasic );
1418 if ( pModWin )
1419 {
1420 bool bAppWindowDisabled, bDispatcherLocked;
1421 sal_uInt16 nWaitCount;
1422 SfxUInt16Item *pSWActionCount, *pSWLockViewCount;
1423 BasicStopped( &bAppWindowDisabled, &bDispatcherLocked,
1424 &nWaitCount, &pSWActionCount, &pSWLockViewCount );
1425
1426 nRet = pModWin->BasicBreakHdl();
1427
1428 if ( StarBASIC::IsRunning() ) // if cancelled...
1429 {
1430 if ( bAppWindowDisabled )
1432
1433 if ( nWaitCount )
1434 {
1435 Shell* pShell = GetShell();
1436 for ( sal_uInt16 n = 0; n < nWaitCount; n++ )
1437 pShell->GetViewFrame().GetWindow().EnterWait();
1438 }
1439 }
1440 }
1441 return nRet;
1442}
1443
1445{
1447
1448 SbModule* pActiveModule = StarBASIC::GetActiveModule();
1449 if (SbClassModuleObject* pCMO = dynamic_cast<SbClassModuleObject*>(pActiveModule))
1450 pActiveModule = pCMO->getClassModule();
1451
1452 DBG_ASSERT( pActiveModule, "No active module in ErrorHdl!?" );
1453 if ( pActiveModule )
1454 {
1456 SbxObject* pParent = pActiveModule->GetParent();
1457 if (StarBASIC* pLib = dynamic_cast<StarBASIC*>(pParent))
1458 {
1459 if (BasicManager* pBasMgr = FindBasicManager(pLib))
1460 {
1462 const OUString& aLibName = pLib->GetName();
1463 pWin = FindBasWin( aDocument, aLibName, pActiveModule->GetName(), true );
1464 DBG_ASSERT( pWin, "Error/Step-Hdl: Window was not created/found!" );
1465 SetCurLib( aDocument, aLibName );
1466 SetCurWindow( pWin, true );
1467 }
1468 }
1469 else
1470 SAL_WARN( "basctl.basicide", "No BASIC!");
1471 if (BasicManager* pBasicMgr = FindBasicManager(pBasic))
1472 StartListening(*pBasicMgr, DuplicateHandling::Prevent /* log on only once */);
1473 return pWin;
1474 }
1475 return nullptr;
1476}
1477
1478void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
1479{
1480 // not if iconified because the whole text would be displaced then at restore
1481 if ( GetViewFrame().GetWindow().GetOutputSizePixel().Height() == 0 )
1482 return;
1483
1484 Size aTabBarSize;
1486 aTabBarSize.setWidth( rSize.Width() );
1487
1488 Size aSz( rSize );
1489 auto nScrollBarSz(Application::GetSettings().GetStyleSettings().GetScrollBarSize());
1490 aSz.AdjustHeight(-aTabBarSize.Height());
1491
1492 Size aOutSz( aSz );
1493 aSz.AdjustWidth(-nScrollBarSz);
1494 aSz.AdjustHeight(-nScrollBarSz);
1495 aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( nScrollBarSz, aSz.Height() ) );
1496 aHScrollBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aOutSz.Width(), nScrollBarSz ) );
1497 pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y() + nScrollBarSz + aSz.Height()), aTabBarSize );
1498
1499 // The size to be applied depends on whether it is a DialogWindow or a ModulWindow
1500 if (pLayout)
1501 {
1502 if (dynamic_cast<DialogWindow*>(pCurWin.get()))
1503 {
1504 pCurWin->ShowShellScrollBars();
1505 pLayout->SetPosSizePixel(rPos, aSz);
1506 }
1507 else
1508 {
1509 pCurWin->ShowShellScrollBars(false);
1510 pLayout->SetPosSizePixel(rPos, aOutSz);
1511 }
1512 }
1513}
1514
1516{
1517 Reference< XModel > xDocument;
1518 if ( pCurWin && pCurWin->GetDocument().isDocument() )
1519 xDocument = pCurWin->GetDocument().getDocument();
1520 return xDocument;
1521}
1522
1523void Shell::Activate( bool bMDI )
1524{
1525 SfxViewShell::Activate( bMDI );
1526
1527 if ( bMDI )
1528 {
1529 if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
1530 pDCurWin->UpdateBrowser();
1531 }
1532}
1533
1534void Shell::Deactivate( bool bMDI )
1535{
1536 // bMDI == true means that another MDI has been activated; in case of a
1537 // deactivate due to a MessageBox bMDI is false
1538 if ( bMDI )
1539 {
1540 if (DialogWindow* pXDlgWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
1541 {
1542 pXDlgWin->DisableBrowser();
1543 if( pXDlgWin->IsModified() )
1544 MarkDocumentModified( pXDlgWin->GetDocument() );
1545 }
1546 }
1547}
1548
1549} // namespace basctl
1550
1551/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
constexpr sal_Int32 TAB_HEIGHT_MARGIN
Definition: basides1.cxx:63
ScriptDocument aDocument
Definition: basobj2.cxx:194
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static vcl::Window * GetFocusWindow()
static weld::Window * GetDefDialogParent()
StarBASIC * GetLib(sal_uInt16 nLib) const
sal_uInt16 GetValue() const
sal_uInt32 GetValue() const
const OUString & GetValue() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
SAL_DLLPRIVATE SbMethod * GetMethod(const OUString &, SbxDataType)
const SbxArrayRef & GetMethods() const
sal_Int32 GetModuleType() const
const SbxObject * GetParent() const
const OUString & GetName(SbxNameType=SbxNameType::NONE) const
void Invalidate(sal_uInt16 nId)
std::shared_ptr< SfxDialogController > & GetController()
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
static void SetCurrentComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
void Done(bool bRemove=false)
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
SfxViewFrame * GetFrame() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
void UIFeatureChanged()
const css::uno::Any & GetValue() const
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
virtual void Activate(bool IsMDIActivate) override
SfxViewFrame & GetViewFrame() const
void SetWindow(vcl::Window *pViewPort)
vcl::Window * GetWindow() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static bool IsRunning()
SbModules & GetModules()
static SbModule * GetActiveModule()
SbModule * FindModule(std::u16string_view)
void AddSnappingPoint(sal_Int32 nNew)
static const sal_uInt16 PAGE_NOT_FOUND
tools::Long GetTextHeight() const
sal_uInt16 GetLineCount(sal_uInt32 nParagraph) const
sal_uInt32 GetParagraphCount() const
tools::Long GetCharHeight() const
void SetSelection(const TextSelection &rNewSel)
void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll)
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true)
vcl::Window * GetWindow() const
TextEngine * GetTextEngine() const
const Point & GetStartDocPos() const
reference_type * get() const
virtual void UpdateData()
Definition: bastypes.cxx:204
virtual bool HasActiveEditor() const
Definition: bastypes.cxx:302
virtual void StoreData()
Definition: bastypes.cxx:195
bool IsSuspended() const
Definition: bastypes.hxx:229
virtual sal_uInt16 StartSearchAndReplace(SvxSearchItem const &, bool bFromStart=false)
Definition: bastypes.cxx:270
bool Is(ScriptDocument const &, std::u16string_view, std::u16string_view, ItemType, bool bFindSuspended)
Definition: bastypes.cxx:284
encapsulates (actions on) the signature/state of a document
SignatureState getScriptingSignatureState() const
retrieves the state of the signature of the scripting content inside the document
ScriptDocument const & GetDocument() const
Definition: sbxitem.hxx:53
OUString const & GetMethodName() const
Definition: sbxitem.hxx:56
ItemType GetType() const
Definition: sbxitem.hxx:57
OUString const & GetLibName() const
Definition: sbxitem.hxx:54
OUString const & GetName() const
Definition: sbxitem.hxx:55
encapsulates a document which contains Basic scripts and dialogs
OUString getTitle(LibraryLocation _eLocation, LibraryType _eType=LibraryType::All) const
returns the title for the document
css::uno::Reference< css::script::XLibraryContainer > getLibraryContainer(LibraryContainerType _eType) const
returns the Basic or Dialog library container of the document
BasicManager * getBasicManager() const
returns the BasicManager associated with this instance
static const ScriptDocument & getApplicationScriptDocument()
returns a reference to a shared ScriptDocument instance which operates on the application-wide script...
static ScriptDocument getDocumentForBasicManager(const BasicManager *_pManager)
returns a (newly created) ScriptDocument instance for the document to which a given BasicManager belo...
static ScriptDocument getDocumentWithURLOrCaption(std::u16string_view _rUrlOrCaption)
returns a (newly created) ScriptDocument instance for the document with a given caption or URL
LibraryLocation getLibraryLocation(const OUString &_rLibName) const
returns the location of a library given by name
virtual bool HasUIFeature(SfxShellFeature nFeature) const override
Definition: basides1.cxx:1256
bool CallBasicErrorHdl(StarBASIC const *pBasic)
Definition: basides1.cxx:1406
void RemoveWindow(BaseWindow *pWindow, bool bDestroy, bool bAllowChangeCurWindow=true)
Definition: basidesh.cxx:781
sal_uInt16 GetCurrentZoomSliderValue()
Definition: basidesh.hxx:175
static void InvalidateControlSlots()
Definition: basidesh.cxx:896
void ExecuteCurrent(SfxRequest &rReq)
Definition: basides1.cxx:254
std::shared_ptr< LocalizationMgr > m_pCurLocalizationMgr
Definition: basidesh.hxx:75
void SetCurLib(const ScriptDocument &rDocument, const OUString &aLibName, bool bUpdateWindows=true, bool bCheck=true)
Definition: basidesh.cxx:942
void SetGlobalEditorZoomLevel(sal_uInt16 nNewZoomLevel)
Definition: basidesh.cxx:385
VclPtr< ModulWindow > FindBasWin(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rModName, bool bCreateIfNotExist=false, bool bFindSuspended=false)
Definition: basides2.cxx:205
void ExecuteSearch(SfxRequest &rReq)
Definition: basides1.cxx:83
bool mbJustOpened
Definition: basidesh.hxx:92
virtual bool HasSelection(bool bText=true) const override
Definition: basides2.cxx:48
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const override
Definition: basides1.cxx:1515
VclPtr< BaseWindow > FindWindow(const ScriptDocument &rDocument, std::u16string_view rLibName, std::u16string_view rName, ItemType nType, bool bFindSuspended=false)
Definition: basides1.cxx:1391
sal_uInt16 GetWindowId(BaseWindow const *pWin) const
Definition: basides3.cxx:125
void ExecuteGlobal(SfxRequest &rReq)
Definition: basides1.cxx:283
bool IsAppBasicModified() const
Definition: basidesh.hxx:205
VclPtr< TabBar > pTabBar
Definition: basidesh.hxx:81
virtual void Activate(bool bMDI) override
Definition: basides1.cxx:1523
VclPtr< ModulWindow > ShowActiveModuleWindow(StarBASIC const *pBasic)
Definition: basides1.cxx:1444
VclPtr< ScrollAdaptor > aVScrollBar
Definition: basidesh.hxx:80
BasicDebugFlags CallBasicBreakHdl(StarBASIC const *pBasic)
Definition: basides1.cxx:1414
VclPtr< ModulWindowLayout > pModulLayout
Definition: basidesh.hxx:85
OUString m_aCurLibName
Definition: basidesh.hxx:74
static sal_uInt16 GetMinZoom()
Definition: basidesh.hxx:176
ScriptDocument m_aCurDocument
Definition: basidesh.hxx:73
void GetState(SfxItemSet &)
Definition: basides1.cxx:838
VclPtr< DialogWindow > FindDlgWin(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rName, bool bCreateIfNotExist=false, bool bFindSuspended=false)
Definition: basides3.cxx:114
const std::shared_ptr< LocalizationMgr > & GetCurLocalizationMgr() const
Definition: basidesh.hxx:164
VclPtr< BaseWindow > FindApplicationWindow()
Definition: basides1.cxx:1386
VclPtr< ModulWindow > CreateBasWin(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rModName)
Definition: basides2.cxx:131
VclPtr< DialogWindow > CreateDlgWin(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rDlgName)
Definition: basides3.cxx:42
void RemoveWindows(const ScriptDocument &rDocument, std::u16string_view rLibName)
Definition: basidesh.cxx:604
SfxUndoManager * GetUndoManager() override
Definition: basidesh.cxx:502
std::unique_ptr< SvxSearchItem > mpSearchItem
Definition: basidesh.hxx:98
void UpdateWindows()
Definition: basidesh.cxx:626
VclPtr< ObjectCatalog > aObjectCatalog
Definition: basidesh.hxx:89
VclPtr< Layout > pLayout
Definition: basidesh.hxx:87
VclPtr< ScrollAdaptor > aHScrollBar
Definition: basidesh.hxx:79
sal_uInt16 m_nCurrentZoomSliderValue
Definition: basidesh.hxx:78
virtual OUString GetSelectionText(bool bCompleteWords=false, bool bOnlyASample=false) override
Definition: basides2.cxx:59
OUString const & GetCurLibName() const
Definition: basidesh.hxx:163
VclPtr< BaseWindow > pCurWin
Definition: basidesh.hxx:72
WindowTable aWindowTable
Definition: basidesh.hxx:70
void SetCurWindow(BaseWindow *pNewWin, bool bUpdateTabBar=false, bool bRememberAsCurrent=true)
Definition: basides1.cxx:1271
void AdjustPosSizePixel(const Point &rPos, const Size &rSize)
Definition: basides1.cxx:1478
static sal_uInt16 GetMaxZoom()
Definition: basidesh.hxx:177
void StoreAllWindowData(bool bPersistent=true)
Definition: basidesh.cxx:407
virtual void Deactivate(bool bMDI) override
Definition: basides1.cxx:1534
void ManageToolbars()
Definition: basides1.cxx:1343
static void InvalidateBasicIDESlots()
Definition: basidesh.cxx:849
VclPtr< DialogWindowLayout > pDialogLayout
Definition: basidesh.hxx:86
vcl::Window * GetParent() const
virtual void SetSizePixel(const Size &rNewSize)
void GrabFocus()
void EnterWait()
void SetHelpId(const OUString &)
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
virtual void set_sensitive(bool sensitive)=0
int nCount
#define DBG_ASSERT(sCon, aError)
float u
sal_Int32 nState
DocumentType eType
constexpr OUStringLiteral HID_BASICIDE_MODULWINDOW
Definition: helpids.h:27
OUString aName
sal_Int64 n
uno_Any a
const char * pLib
const char * pLocale
#define SAL_WARN(area, stream)
size_t GetFontHeight()
OUString CreateMgrAndLibStr(std::u16string_view rMgrName, std::u16string_view rLibName)
Definition: bastype3.cxx:432
SfxBindings * GetBindingsPtr()
Definition: basobj3.cxx:426
void BasicStopped(bool *pbAppWindowDisabled, bool *pbDispatcherLocked, sal_uInt16 *pnWaitCount, SfxUInt16Item **ppSWActionCount, SfxUInt16Item **ppSWLockViewCount)
Definition: basobj3.cxx:300
bool QueryPassword(weld::Widget *pDialogParent, const Reference< script::XLibraryContainer > &xLibContainer, const OUString &rLibName, OUString &rPassword, bool bRepeat, bool bNewTitle)
Definition: bastypes.cxx:779
ExtraData * GetExtraData()
Definition: iderdll.cxx:101
OUString ChooseMacro(weld::Window *pParent, const uno::Reference< frame::XModel > &rxLimitToDocument, const uno::Reference< frame::XFrame > &xDocFrame, bool bChooseOnly)
Definition: basobj2.cxx:228
SbMethod * CreateMacro(SbModule *pModule, const OUString &rMacroName)
Definition: basobj3.cxx:63
void Organize(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &xDocFrame, sal_Int16 tabId)
Definition: basobj2.cxx:73
Shell * GetShell()
Definition: iderdll.cxx:80
void MarkDocumentModified(const ScriptDocument &rDocument)
Definition: basobj3.cxx:249
BasicManager * FindBasicManager(StarBASIC const *pLib)
Definition: basobj3.cxx:225
void StopBasic()
Definition: basobj3.cxx:283
@ BASWIN_SUSPENDED
Definition: bastypes.hxx:147
bool RenameModule(weld::Widget *pErrorParent, const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rOldName, const OUString &rNewName)
renames a module
Definition: basobj2.cxx:130
ItemType
Definition: sbxitem.hxx:28
@ TYPE_MODULE
Definition: sbxitem.hxx:32
@ TYPE_METHOD
Definition: sbxitem.hxx:34
@ TYPE_UNKNOWN
Definition: sbxitem.hxx:29
@ TYPE_DIALOG
Definition: sbxitem.hxx:33
OUString IDEResId(TranslateId aId)
Definition: iderdll.cxx:108
static void lcl_InvalidateZoomSlots(SfxBindings *pBindings)
Definition: basides1.cxx:72
sal_uInt16 zoomIn(sal_uInt16 nCurrent)
sal_uInt16 zoomOut(sal_uInt16 nCurrent)
int i
long Long
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
sal_Int16 nId
const char GetValue[]
BasicDebugFlags
static SfxItemSet & rSet
SfxShellFeature
SignatureState
SearchOptionFlags
Reference< XModel > xModel
RET_YES