2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-11-21 23:33:54 -05:00
|
|
|
#include "basidesh.hrc"
|
|
|
|
#include "helpid.hrc"
|
2001-11-02 12:45:10 +00:00
|
|
|
|
2011-11-21 23:33:54 -05:00
|
|
|
#include "baside2.hxx"
|
|
|
|
#include "baside3.hxx"
|
|
|
|
#include "docsignature.hxx"
|
|
|
|
#include "iderdll.hxx"
|
|
|
|
#include "iderdll2.hxx"
|
|
|
|
#include "localizationmgr.hxx"
|
|
|
|
#include "managelang.hxx"
|
2003-11-18 15:59:39 +00:00
|
|
|
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <basic/basmgr.hxx>
|
|
|
|
#include <basic/sbmeth.hxx>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
|
2014-11-19 08:53:14 +01:00
|
|
|
#include <com/sun/star/frame/XLayoutManager.hpp>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
#include <sfx2/docfac.hxx>
|
|
|
|
#include <sfx2/dinfdlg.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/minfitem.hxx>
|
|
|
|
#include <sfx2/printer.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <svl/aeitem.hxx>
|
|
|
|
#include <svl/intitem.hxx>
|
|
|
|
#include <svl/srchitem.hxx>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <svl/visitem.hxx>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <svl/whiter.hxx>
|
2012-08-06 20:52:37 +02:00
|
|
|
#include <vcl/xtextedt.hxx>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <vcl/msgbox.hxx>
|
2003-11-18 15:59:39 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
2007-10-09 14:21:36 +00:00
|
|
|
using namespace ::com::sun::star::frame;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::ExecuteCurrent( SfxRequest& rReq )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( !pCurWin )
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch ( rReq.GetSlot() )
|
|
|
|
{
|
|
|
|
case SID_BASICIDE_HIDECURPAGE:
|
|
|
|
{
|
|
|
|
pCurWin->StoreData();
|
2012-07-31 10:14:06 +09:00
|
|
|
RemoveWindow( pCurWin, false );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-08-17 07:29:20 +02:00
|
|
|
case SID_BASICIDE_RENAMECURRENT:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
pTabBar->StartEditMode( pTabBar->GetCurPageId() );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FID_SEARCH_NOW:
|
|
|
|
{
|
|
|
|
if (!pCurWin->HasActiveEditor())
|
|
|
|
break;
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
|
|
|
SfxItemSet const& rArgs = *rReq.GetArgs();
|
|
|
|
// unfortunately I don't know the ID:
|
|
|
|
sal_uInt16 nWhich = rArgs.GetWhichByPos( 0 );
|
2014-11-10 15:05:25 +01:00
|
|
|
DBG_ASSERT( nWhich, "Which for SearchItem?" );
|
2012-08-17 07:29:20 +02:00
|
|
|
SfxPoolItem const& rItem = rArgs.Get(nWhich);
|
|
|
|
DBG_ASSERT(dynamic_cast<SvxSearchItem const*>(&rItem), "no searchitem!");
|
|
|
|
SvxSearchItem const& rSearchItem = static_cast<SvxSearchItem const&>(rItem);
|
|
|
|
// memorize item because of the adjustments...
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
GetExtraData()->SetSearchItem(rSearchItem);
|
2012-08-17 07:29:20 +02:00
|
|
|
sal_Int32 nFound = 0;
|
2015-02-27 10:08:03 +02:00
|
|
|
if (rSearchItem.GetCommand() == SvxSearchCmd::REPLACE_ALL)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
sal_uInt16 nActModWindows = 0;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = it->second;
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pWin->HasActiveEditor())
|
|
|
|
nActModWindows++;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
|
2015-05-28 21:35:43 +01:00
|
|
|
if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtr<QueryBox>::Create( pCurWin, WB_YES_NO|WB_DEF_YES, IDEResId(RID_STR_SEARCHALLMODULES).toString() )->Execute() == RET_YES ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = it->second;
|
2012-08-17 07:29:20 +02:00
|
|
|
nFound += pWin->StartSearchAndReplace(rSearchItem);
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
else
|
|
|
|
nFound = pCurWin->StartSearchAndReplace(rSearchItem);
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aReplStr(IDE_RESSTR(RID_STR_SEARCHREPLACES));
|
2013-08-21 15:07:31 +02:00
|
|
|
aReplStr = aReplStr.replaceAll("XX", OUString::number(nFound));
|
2015-05-28 21:35:43 +01:00
|
|
|
ScopedVclPtr<InfoBox>::Create( pCurWin, aReplStr )->Execute();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
else
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2014-12-06 01:07:11 +01:00
|
|
|
bool bCanceled = false;
|
2012-08-17 07:29:20 +02:00
|
|
|
nFound = pCurWin->StartSearchAndReplace(rSearchItem);
|
|
|
|
if ( !nFound && !rSearchItem.GetSelection() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
// search other modules...
|
|
|
|
bool bChangeCurWindow = false;
|
|
|
|
WindowTableIt it;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2012-08-17 07:29:20 +02:00
|
|
|
if (it->second == pCurWin)
|
|
|
|
break;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (it != aWindowTable.end())
|
2012-08-17 07:29:20 +02:00
|
|
|
++it;
|
2015-03-09 14:29:30 +02:00
|
|
|
BaseWindow* pWin = it != aWindowTable.end() ? it->second.get() : 0;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
bool bSearchedFromStart = false;
|
|
|
|
while ( !nFound && !bCanceled && ( pWin || !bSearchedFromStart ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( !pWin )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
SfxViewFrame* pViewFrame = GetViewFrame();
|
|
|
|
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : NULL;
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : NULL;
|
2015-03-31 23:04:14 +01:00
|
|
|
ScopedVclPtrInstance< QueryBox > aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART));
|
2015-02-11 14:42:23 +02:00
|
|
|
if ( aQuery->Execute() == RET_YES )
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
it = aWindowTable.begin();
|
|
|
|
if ( it != aWindowTable.end() )
|
2012-08-17 07:29:20 +02:00
|
|
|
pWin = it->second;
|
|
|
|
bSearchedFromStart = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCanceled = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pWin && pWin->HasActiveEditor())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( pWin != pCurWin )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( pCurWin )
|
|
|
|
pWin->SetSizePixel( pCurWin->GetSizePixel() );
|
|
|
|
nFound = pWin->StartSearchAndReplace(rSearchItem, true);
|
|
|
|
}
|
|
|
|
if ( nFound )
|
|
|
|
{
|
|
|
|
bChangeCurWindow = true;
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( pWin && ( pWin != pCurWin ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if ( it != aWindowTable.end() )
|
2012-03-20 10:03:56 +02:00
|
|
|
++it;
|
2015-03-09 14:29:30 +02:00
|
|
|
pWin = it != aWindowTable.end() ? it->second.get() : 0;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
else
|
|
|
|
pWin = 0;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( !nFound && bSearchedFromStart )
|
|
|
|
nFound = pCurWin->StartSearchAndReplace(rSearchItem, true);
|
|
|
|
if ( bChangeCurWindow )
|
|
|
|
SetCurWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
if ( !nFound && !bCanceled )
|
2015-05-28 21:35:43 +01:00
|
|
|
ScopedVclPtr<InfoBox>::Create( pCurWin, IDEResId(RID_STR_SEARCHNOTFOUND).toString() )->Execute();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
rReq.Done();
|
2003-05-22 07:42:46 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_UNDO:
|
|
|
|
case SID_REDO:
|
|
|
|
if ( GetUndoManager() && pCurWin->AllowUndo() )
|
|
|
|
GetViewFrame()->ExecuteSlot( rReq );
|
2012-08-17 07:29:20 +02:00
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
default:
|
|
|
|
pCurWin->ExecuteCommand( rReq );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
// no matter who's at the top, influence on the shell:
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::ExecuteGlobal( SfxRequest& rReq )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
2000-09-29 10:02:42 +00:00
|
|
|
switch ( nSlot )
|
|
|
|
{
|
|
|
|
case SID_BASICSTOP:
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// maybe do not simply stop if on breakpoint!
|
2015-03-09 14:29:30 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
|
2012-08-07 14:33:56 +02:00
|
|
|
pMCurWin->BasicStop();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
StopBasic();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SAVEDOC:
|
|
|
|
{
|
|
|
|
if ( pCurWin )
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// rewrite date into the BASIC
|
2000-09-29 10:02:42 +00:00
|
|
|
StoreAllWindowData();
|
|
|
|
|
2001-09-25 08:14:46 +00:00
|
|
|
// document basic
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( pCurWin->GetDocument() );
|
|
|
|
if ( aDocument.isDocument() )
|
2005-02-24 15:58:30 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
uno::Reference< task::XStatusIndicator > xStatusIndicator;
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pStatusIndicatorItem, SfxUnoAnyItem,
|
|
|
|
SID_PROGRESS_STATUSBAR_CONTROL, false );
|
2007-03-15 14:53:21 +00:00
|
|
|
if ( pStatusIndicatorItem )
|
|
|
|
OSL_VERIFY( pStatusIndicatorItem->GetValue() >>= xStatusIndicator );
|
|
|
|
else
|
2005-03-18 10:19:11 +00:00
|
|
|
{
|
|
|
|
// get statusindicator
|
2007-01-16 15:29:22 +00:00
|
|
|
SfxViewFrame *pFrame_ = GetFrame();
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( pFrame_ )
|
2005-03-18 10:19:11 +00:00
|
|
|
{
|
|
|
|
uno::Reference< task::XStatusIndicatorFactory > xStatFactory(
|
2009-12-15 23:07:57 +01:00
|
|
|
pFrame_->GetFrame().GetFrameInterface(),
|
2005-03-18 10:19:11 +00:00
|
|
|
uno::UNO_QUERY );
|
|
|
|
if( xStatFactory.is() )
|
|
|
|
xStatusIndicator = xStatFactory->createStatusIndicator();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( xStatusIndicator.is() )
|
2007-03-15 14:53:21 +00:00
|
|
|
rReq.AppendItem( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, uno::makeAny( xStatusIndicator ) ) );
|
2005-03-18 10:19:11 +00:00
|
|
|
}
|
|
|
|
|
2007-03-15 14:53:21 +00:00
|
|
|
aDocument.saveDocument( xStatusIndicator );
|
2005-02-24 15:58:30 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:55 +00:00
|
|
|
{
|
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
|
|
|
pBindings->Invalidate( SID_SAVEDOC );
|
|
|
|
pBindings->Invalidate( SID_SIGNATURE );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_MODULEDLG:
|
|
|
|
{
|
2004-05-19 07:01:23 +00:00
|
|
|
if ( rReq.GetArgs() )
|
|
|
|
{
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxUInt16Item &rTabId = static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_TABID ));
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Organize( rTabId.GetValue() );
|
2004-05-19 07:01:23 +00:00
|
|
|
}
|
|
|
|
else
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Organize( 0 );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_CHOOSEMACRO:
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
ChooseMacro( NULL, false, OUString() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_CREATEMACRO:
|
|
|
|
case SID_BASICIDE_EDITMACRO:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxMacroInfoItem& rInfo = static_cast<const SfxMacroInfoItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO ));
|
2015-03-26 15:27:26 +01:00
|
|
|
BasicManager* pBasMgr = const_cast<BasicManager*>(rInfo.GetBasicManager());
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pBasMgr, "Nichts selektiert im Basic-Baum ?" );
|
2007-03-15 14:53:21 +00:00
|
|
|
|
|
|
|
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
StartListening( *pBasMgr, true /* log on only once */ );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( rInfo.GetLib() );
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( aLibName.isEmpty() )
|
2012-10-02 11:31:09 -03:00
|
|
|
aLibName = "Standard" ;
|
2001-09-03 10:56:10 +00:00
|
|
|
StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( !pBasic )
|
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
// load module and dialog library (if not loaded)
|
|
|
|
aDocument.loadLibraryIfExists( E_SCRIPTS, aLibName );
|
|
|
|
aDocument.loadLibraryIfExists( E_DIALOGS, aLibName );
|
2001-09-03 10:56:10 +00:00
|
|
|
|
|
|
|
// get Basic
|
|
|
|
pBasic = pBasMgr->GetLib( aLibName );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
DBG_ASSERT( pBasic, "No Basic!" );
|
2004-07-23 11:02:12 +00:00
|
|
|
|
2007-03-15 14:53:21 +00:00
|
|
|
SetCurLib( aDocument, aLibName );
|
2004-07-23 11:02:12 +00:00
|
|
|
|
2013-02-18 01:35:46 -06:00
|
|
|
if ( pBasic && rReq.GetSlot() == SID_BASICIDE_CREATEMACRO )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
SbModule* pModule = pBasic->FindModule( rInfo.GetModule() );
|
|
|
|
if ( !pModule )
|
|
|
|
{
|
2013-08-23 14:04:30 +02:00
|
|
|
if ( !rInfo.GetModule().isEmpty() || !pBasic->GetModules()->Count() )
|
2001-07-25 13:51:32 +00:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aModName = rInfo.GetModule();
|
2001-07-25 13:51:32 +00:00
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString sModuleCode;
|
2012-08-07 08:36:40 +02:00
|
|
|
if ( aDocument.createModule( aLibName, aModName, false, sModuleCode ) )
|
2001-07-25 13:51:32 +00:00
|
|
|
pModule = pBasic->FindModule( aModName );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
2014-10-21 09:12:47 +02:00
|
|
|
pModule = static_cast<SbModule*>( pBasic->GetModules()->Get(0) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
DBG_ASSERT( pModule, "Kein Modul!" );
|
2013-02-18 01:35:46 -06:00
|
|
|
if ( pModule && !pModule->GetMethods()->Find( rInfo.GetMethod(), SbxCLASS_METHOD ) )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
CreateMacro( pModule, rInfo.GetMethod() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2004-11-15 12:40:18 +00:00
|
|
|
SfxViewFrame* pViewFrame = GetViewFrame();
|
|
|
|
if ( pViewFrame )
|
|
|
|
pViewFrame->ToTop();
|
2012-07-27 10:35:28 +09:00
|
|
|
ModulWindow* pWin = FindBasWin( aDocument, aLibName, rInfo.GetModule(), true );
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pWin, "Edit/Create Macro: Fenster wurde nicht erzeugt/gefunden!" );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
pWin->EditMacro( rInfo.GetMethod() );
|
|
|
|
}
|
|
|
|
break;
|
2012-07-23 18:48:47 +02:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_BASICIDE_OBJCAT:
|
2012-08-17 07:29:20 +02:00
|
|
|
// toggling object catalog
|
2015-01-14 16:16:15 +02:00
|
|
|
aObjectCatalog->Show(!aObjectCatalog->IsVisible());
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pLayout)
|
|
|
|
pLayout->ArrangeWindows();
|
2012-08-06 14:28:28 +02:00
|
|
|
// refresh the button state
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2012-08-17 07:29:20 +02:00
|
|
|
pBindings->Invalidate(SID_BASICIDE_OBJCAT);
|
2012-07-23 18:48:47 +02:00
|
|
|
break;
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_BASICIDE_NAMECHANGEDONTAB:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxUInt16Item &rTabId = static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_TABID ));
|
|
|
|
const SfxStringItem &rModName = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_MODULENAME ));
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if ( aWindowTable.find( rTabId.GetValue() ) != aWindowTable.end() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = aWindowTable[ rTabId.GetValue() ];
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aNewName( rModName.GetValue() );
|
|
|
|
OUString aOldName( pWin->GetName() );
|
2003-11-05 11:38:26 +00:00
|
|
|
if ( aNewName != aOldName )
|
2001-06-28 14:26:41 +00:00
|
|
|
{
|
2010-04-30 10:46:23 +01:00
|
|
|
bool bRenameOk = false;
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin))
|
2010-04-30 10:46:23 +01:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName = pModWin->GetLibName();
|
2010-04-30 10:46:23 +01:00
|
|
|
ScriptDocument aDocument( pWin->GetDocument() );
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (RenameModule(pModWin, aDocument, aLibName, aOldName, aNewName))
|
2010-04-30 10:46:23 +01:00
|
|
|
{
|
|
|
|
bRenameOk = true;
|
|
|
|
// Because we listen for container events for script
|
|
|
|
// modules, rename will delete the 'old' window
|
|
|
|
// pWin has been invalidated, restore now
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( aDocument, aLibName, aNewName, true );
|
2010-04-30 10:46:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2012-08-07 14:33:56 +02:00
|
|
|
else if (DialogWindow* pDlgWin = dynamic_cast<DialogWindow*>(pWin))
|
2010-04-30 10:46:23 +01:00
|
|
|
{
|
|
|
|
bRenameOk = pDlgWin->RenameDialog( aNewName );
|
|
|
|
}
|
|
|
|
if ( bRenameOk )
|
2001-06-28 14:26:41 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
MarkDocumentModified( pWin->GetDocument() );
|
2001-06-28 14:26:41 +00:00
|
|
|
}
|
2003-11-05 11:38:26 +00:00
|
|
|
else
|
2001-06-20 08:27:37 +00:00
|
|
|
{
|
2003-11-05 11:38:26 +00:00
|
|
|
// set old name in TabWriter
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
sal_uInt16 nId = GetWindowId( pWin );
|
2003-11-05 11:38:26 +00:00
|
|
|
DBG_ASSERT( nId, "No entry in Tabbar!" );
|
|
|
|
if ( nId )
|
|
|
|
pTabBar->SetPageText( nId, aOldName );
|
2001-06-20 08:27:37 +00:00
|
|
|
}
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
2003-11-05 11:38:26 +00:00
|
|
|
|
|
|
|
// set focus to current window
|
|
|
|
pWin->GrabFocus();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_STOREMODULESOURCE:
|
|
|
|
case SID_BASICIDE_UPDATEMODULESOURCE:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxMacroInfoItem& rInfo = static_cast<const SfxMacroInfoItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO ));
|
2015-03-26 15:27:26 +01:00
|
|
|
BasicManager* pBasMgr = const_cast<BasicManager*>(rInfo.GetBasicManager());
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pBasMgr, "Store source: Kein BasMgr?" );
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
|
2012-07-27 10:35:28 +09:00
|
|
|
ModulWindow* pWin = FindBasWin( aDocument, rInfo.GetLib(), rInfo.GetModule(), false, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pWin )
|
|
|
|
{
|
|
|
|
if ( rReq.GetSlot() == SID_BASICIDE_STOREMODULESOURCE )
|
|
|
|
pWin->StoreData();
|
|
|
|
else
|
|
|
|
pWin->UpdateData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_STOREALLMODULESOURCES:
|
|
|
|
case SID_BASICIDE_UPDATEALLMODULESOURCES:
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = it->second;
|
2012-08-07 14:33:56 +02:00
|
|
|
if (!pWin->IsSuspended() && dynamic_cast<ModulWindow*>(pWin))
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( rReq.GetSlot() == SID_BASICIDE_STOREALLMODULESOURCES )
|
|
|
|
pWin->StoreData();
|
|
|
|
else
|
|
|
|
pWin->UpdateData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_LIBSELECTED:
|
|
|
|
case SID_BASICIDE_LIBREMOVED:
|
|
|
|
case SID_BASICIDE_LIBLOADED:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxUsrAnyItem& rShellItem = static_cast<const SfxUsrAnyItem&>(rReq.GetArgs()->Get( SID_BASICIDE_ARG_DOCUMENT_MODEL ));
|
2007-03-15 14:53:21 +00:00
|
|
|
uno::Reference< frame::XModel > xModel( rShellItem.GetValue(), UNO_QUERY );
|
|
|
|
ScriptDocument aDocument( xModel.is() ? ScriptDocument( xModel ) : ScriptDocument::getApplicationScriptDocument() );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SfxStringItem& rLibNameItem = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get( SID_BASICIDE_ARG_LIBNAME ));
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( rLibNameItem.GetValue() );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2004-07-23 11:02:12 +00:00
|
|
|
if ( nSlot == SID_BASICIDE_LIBSELECTED )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
// load module and dialog library (if not loaded)
|
|
|
|
aDocument.loadLibraryIfExists( E_SCRIPTS, aLibName );
|
|
|
|
aDocument.loadLibraryIfExists( E_DIALOGS, aLibName );
|
2001-09-03 10:56:10 +00:00
|
|
|
|
2004-07-23 11:02:12 +00:00
|
|
|
// check password, if library is password protected and not verified
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bOK = true;
|
2007-03-15 14:53:21 +00:00
|
|
|
Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ) );
|
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2004-07-23 11:02:12 +00:00
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
2007-03-15 14:53:21 +00:00
|
|
|
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aPassword;
|
2004-07-23 11:02:12 +00:00
|
|
|
bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
2001-11-02 12:45:10 +00:00
|
|
|
|
|
|
|
if ( bOK )
|
2004-07-23 11:02:12 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
SetCurLib( aDocument, aLibName, true, false );
|
2004-07-23 11:02:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// adjust old value...
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2012-08-07 08:36:40 +02:00
|
|
|
pBindings->Invalidate(SID_BASICIDE_LIBSELECTOR, true, false);
|
2004-07-23 11:02:12 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
else if ( nSlot == SID_BASICIDE_LIBREMOVED )
|
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-07-31 10:14:06 +09:00
|
|
|
RemoveWindows( aDocument, aLibName, true );
|
2007-03-15 14:53:21 +00:00
|
|
|
if ( aDocument == m_aCurDocument && aLibName == m_aCurLibName )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
m_aCurDocument = ScriptDocument::getApplicationScriptDocument();
|
2014-12-18 13:20:20 +01:00
|
|
|
m_aCurLibName.clear();
|
2011-08-22 11:39:37 +02:00
|
|
|
// no UpdateWindows!
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:55 +00:00
|
|
|
pBindings->Invalidate( SID_BASICIDE_LIBSELECTOR );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // Loaded...
|
|
|
|
UpdateWindows();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_NEWMODULE:
|
|
|
|
{
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<ModulWindow> pWin = CreateBasWin( m_aCurDocument, m_aCurLibName, OUString() );
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_NEWDIALOG:
|
|
|
|
{
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<DialogWindow> pWin = CreateDlgWin( m_aCurDocument, m_aCurLibName, OUString() );
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_SBXRENAMED:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_SBXINSERTED:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( rSbxItem.GetDocument() );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( rSbxItem.GetLibName() );
|
|
|
|
OUString aName( rSbxItem.GetName() );
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if ( rSbxItem.GetType() == TYPE_MODULE )
|
2012-07-27 10:35:28 +09:00
|
|
|
FindBasWin( aDocument, aLibName, aName, true );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
else if ( rSbxItem.GetType() == TYPE_DIALOG )
|
2012-07-27 10:35:28 +09:00
|
|
|
FindDlgWin( aDocument, aLibName, aName, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_SBXDELETED:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( rSbxItem.GetDocument() );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = FindWindow( aDocument, rSbxItem.GetLibName(), rSbxItem.GetName(), rSbxItem.GetType(), true );
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pWin )
|
2012-07-31 10:14:06 +09:00
|
|
|
RemoveWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_SHOWSBX:
|
|
|
|
{
|
|
|
|
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
2014-10-21 09:12:47 +02:00
|
|
|
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( rSbxItem.GetDocument() );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( rSbxItem.GetLibName() );
|
|
|
|
OUString aName( rSbxItem.GetName() );
|
2007-03-15 14:53:21 +00:00
|
|
|
SetCurLib( aDocument, aLibName );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = 0;
|
|
|
|
if ( rSbxItem.GetType() == TYPE_DIALOG )
|
2001-07-04 11:18:27 +00:00
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindDlgWin( aDocument, aLibName, aName, true );
|
2001-07-04 11:18:27 +00:00
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
else if ( rSbxItem.GetType() == TYPE_MODULE )
|
2001-07-04 11:18:27 +00:00
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( aDocument, aLibName, aName, true );
|
2001-07-04 11:18:27 +00:00
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
else if ( rSbxItem.GetType() == TYPE_METHOD )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( aDocument, aLibName, aName, true );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
static_cast<ModulWindow*>(pWin)->EditMacro( rSbxItem.GetMethodName() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
DBG_ASSERT( pWin, "Fenster wurde nicht erzeugt!" );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2001-06-20 08:27:37 +00:00
|
|
|
pTabBar->MakeVisible( pTabBar->GetCurPageId() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2003-11-18 15:59:39 +00:00
|
|
|
case SID_BASICIDE_SHOWWINDOW:
|
|
|
|
{
|
2014-02-07 15:42:03 +01:00
|
|
|
boost::scoped_ptr< ScriptDocument > pDocument;
|
2004-07-23 11:02:12 +00:00
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pDocumentItem, SfxStringItem, SID_BASICIDE_ARG_DOCUMENT, false );
|
2003-11-18 15:59:39 +00:00
|
|
|
if ( pDocumentItem )
|
2007-10-09 14:21:36 +00:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString sDocumentCaption = pDocumentItem->GetValue();
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( !sDocumentCaption.isEmpty() )
|
2007-10-09 14:21:36 +00:00
|
|
|
pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) );
|
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pDocModelItem, SfxUsrAnyItem, SID_BASICIDE_ARG_DOCUMENT_MODEL, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( !pDocument.get() && pDocModelItem )
|
|
|
|
{
|
|
|
|
uno::Reference< frame::XModel > xModel( pDocModelItem->GetValue(), UNO_QUERY );
|
|
|
|
if ( xModel.is() )
|
|
|
|
pDocument.reset( new ScriptDocument( xModel ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pDocument.get() )
|
|
|
|
break;
|
2003-11-18 15:59:39 +00:00
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pLibNameItem, SfxStringItem, SID_BASICIDE_ARG_LIBNAME, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( !pLibNameItem )
|
|
|
|
break;
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( pLibNameItem->GetValue() );
|
2007-10-09 14:21:36 +00:00
|
|
|
pDocument->loadLibraryIfExists( E_SCRIPTS, aLibName );
|
|
|
|
SetCurLib( *pDocument, aLibName );
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_BASICIDE_ARG_NAME, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pNameItem )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aName( pNameItem->GetValue() );
|
|
|
|
OUString aModType( "Module" );
|
|
|
|
OUString aDlgType( "Dialog" );
|
|
|
|
OUString aType( aModType );
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pTypeItem, SfxStringItem, SID_BASICIDE_ARG_TYPE, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pTypeItem )
|
|
|
|
aType = pTypeItem->GetValue();
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = 0;
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( aType == aModType )
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( *pDocument, aLibName, aName, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
else if ( aType == aDlgType )
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindDlgWin( *pDocument, aLibName, aName, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
|
|
|
|
if ( pWin )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pTabBar )
|
|
|
|
pTabBar->MakeVisible( pTabBar->GetCurPageId() );
|
2003-11-18 15:59:39 +00:00
|
|
|
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin))
|
2007-10-09 14:21:36 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pLineItem, SfxUInt32Item, SID_BASICIDE_ARG_LINE, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pLineItem )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2007-10-09 14:21:36 +00:00
|
|
|
pModWin->AssertValidEditEngine();
|
|
|
|
TextView* pTextView = pModWin->GetEditView();
|
|
|
|
if ( pTextView )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2007-10-09 14:21:36 +00:00
|
|
|
TextEngine* pTextEngine = pTextView->GetTextEngine();
|
|
|
|
if ( pTextEngine )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2007-10-09 14:21:36 +00:00
|
|
|
sal_uInt32 nLine = pLineItem->GetValue();
|
|
|
|
sal_uInt32 nLineCount = 0;
|
|
|
|
for ( sal_uInt32 i = 0, nCount = pTextEngine->GetParagraphCount(); i < nCount; ++i )
|
|
|
|
nLineCount += pTextEngine->GetLineCount( i );
|
|
|
|
if ( nLine > nLineCount )
|
|
|
|
nLine = nLineCount;
|
|
|
|
if ( nLine > 0 )
|
|
|
|
--nLine;
|
|
|
|
|
|
|
|
// scroll window and set selection
|
|
|
|
long nVisHeight = pModWin->GetOutputSizePixel().Height();
|
|
|
|
long nTextHeight = pTextEngine->GetTextHeight();
|
|
|
|
if ( nTextHeight > nVisHeight )
|
|
|
|
{
|
|
|
|
long nMaxY = nTextHeight - nVisHeight;
|
|
|
|
long nOldY = pTextView->GetStartDocPos().Y();
|
|
|
|
long nNewY = nLine * pTextEngine->GetCharHeight() - nVisHeight / 2;
|
|
|
|
nNewY = ::std::min( nNewY, nMaxY );
|
|
|
|
pTextView->Scroll( 0, -( nNewY - nOldY ) );
|
2012-08-07 08:36:40 +02:00
|
|
|
pTextView->ShowCursor( false, true );
|
2007-10-09 14:21:36 +00:00
|
|
|
pModWin->GetEditVScrollBar().SetThumbPos( pTextView->GetStartDocPos().Y() );
|
|
|
|
}
|
|
|
|
sal_uInt16 nCol1 = 0, nCol2 = 0;
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pCol1Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN1, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pCol1Item )
|
|
|
|
{
|
|
|
|
nCol1 = pCol1Item->GetValue();
|
|
|
|
if ( nCol1 > 0 )
|
|
|
|
--nCol1;
|
|
|
|
nCol2 = nCol1;
|
|
|
|
}
|
2012-08-07 08:36:40 +02:00
|
|
|
SFX_REQUEST_ARG( rReq, pCol2Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN2, false );
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pCol2Item )
|
2003-11-18 15:59:39 +00:00
|
|
|
{
|
2007-10-09 14:21:36 +00:00
|
|
|
nCol2 = pCol2Item->GetValue();
|
|
|
|
if ( nCol2 > 0 )
|
|
|
|
--nCol2;
|
2003-11-18 15:59:39 +00:00
|
|
|
}
|
2007-10-09 14:21:36 +00:00
|
|
|
TextSelection aSel( TextPaM( nLine, nCol1 ), TextPaM( nLine, nCol2 ) );
|
|
|
|
pTextView->SetSelection( aSel );
|
|
|
|
pTextView->ShowCursor();
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pWindow_ = pTextView->GetWindow();
|
2007-10-09 14:21:36 +00:00
|
|
|
if ( pWindow_ )
|
|
|
|
pWindow_->GrabFocus();
|
2003-11-18 15:59:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
2007-01-02 14:49:14 +00:00
|
|
|
|
|
|
|
case SID_BASICIDE_MANAGE_LANG:
|
|
|
|
{
|
2015-03-31 23:04:14 +01:00
|
|
|
ScopedVclPtrInstance< ManageLanguageDialog > aDlg(pCurWin, m_pCurLocalizationMgr);
|
2015-02-11 14:42:23 +02:00
|
|
|
aDlg->Execute();
|
2007-01-02 14:49:14 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
default:
|
2012-08-31 12:44:47 +02:00
|
|
|
if (pLayout)
|
|
|
|
pLayout->ExecuteGlobal(rReq);
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pCurWin)
|
|
|
|
pCurWin->ExecuteGlobal(rReq);
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::GetState(SfxItemSet &rSet)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
SfxWhichIter aIter(rSet);
|
2011-01-14 11:16:25 +01:00
|
|
|
for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
switch ( nWh )
|
|
|
|
{
|
|
|
|
case SID_DOCINFO:
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SAVEDOC:
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bDisable = false;
|
2001-09-25 08:14:46 +00:00
|
|
|
|
|
|
|
if ( pCurWin )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( !pCurWin->IsModified() )
|
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( pCurWin->GetDocument() );
|
2007-10-09 14:21:36 +00:00
|
|
|
bDisable = ( !aDocument.isAlive() )
|
|
|
|
|| ( aDocument.isDocument() ? !aDocument.isDocumentModified() : !IsAppBasicModified() );
|
2001-09-25 08:14:46 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2001-09-25 08:14:46 +00:00
|
|
|
else
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bDisable = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( bDisable )
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_NEWWINDOW:
|
|
|
|
case SID_SAVEASDOC:
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
2004-08-31 11:20:19 +00:00
|
|
|
case SID_SIGNATURE:
|
|
|
|
{
|
2015-04-13 13:21:04 +02:00
|
|
|
SignatureState nState = SignatureState::NOSIGNATURES;
|
2004-08-31 11:20:19 +00:00
|
|
|
if ( pCurWin )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
DocumentSignature aSignature( pCurWin->GetDocument() );
|
2007-10-09 14:21:36 +00:00
|
|
|
nState = aSignature.getScriptingSignatureState();
|
2004-08-31 11:20:19 +00:00
|
|
|
}
|
2015-04-13 13:21:04 +02:00
|
|
|
rSet.Put( SfxUInt16Item( SID_SIGNATURE, static_cast<sal_uInt16>(nState) ) );
|
2004-08-31 11:20:19 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_BASICIDE_MODULEDLG:
|
|
|
|
{
|
|
|
|
if ( StarBASIC::IsRunning() )
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_OBJCAT:
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pLayout)
|
2015-01-14 16:16:15 +02:00
|
|
|
rSet.Put(SfxBoolItem(nWh, aObjectCatalog->IsVisible()));
|
2012-03-11 21:40:02 +01:00
|
|
|
else
|
2012-08-17 07:29:20 +02:00
|
|
|
rSet.Put(SfxVisibilityItem(nWh, false));
|
2012-08-06 14:28:28 +02:00
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_BASICIDE_SHOWSBX:
|
|
|
|
case SID_BASICIDE_CREATEMACRO:
|
|
|
|
case SID_BASICIDE_EDITMACRO:
|
|
|
|
case SID_BASICIDE_NAMECHANGEDONTAB:
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_BASICIDE_ADDWATCH:
|
|
|
|
case SID_BASICIDE_REMOVEWATCH:
|
|
|
|
case SID_BASICLOAD:
|
|
|
|
case SID_BASICSAVEAS:
|
|
|
|
case SID_BASICIDE_MATCHGROUP:
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (!dynamic_cast<ModulWindow*>(pCurWin.get()))
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
2005-09-27 11:56:49 +00:00
|
|
|
else if ( ( nWh == SID_BASICLOAD ) && ( StarBASIC::IsRunning() || ( pCurWin && pCurWin->IsReadOnly() ) ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICRUN:
|
|
|
|
case SID_BASICSTEPINTO:
|
|
|
|
case SID_BASICSTEPOVER:
|
|
|
|
case SID_BASICSTEPOUT:
|
|
|
|
case SID_BASICIDE_TOGGLEBRKPNT:
|
2003-04-11 16:37:40 +00:00
|
|
|
case SID_BASICIDE_MANAGEBRKPNTS:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
|
2012-08-07 14:33:56 +02:00
|
|
|
{
|
|
|
|
if (StarBASIC::IsRunning() && !pMCurWin->GetBasicStatus().bIsInReschedule)
|
|
|
|
rSet.DisableItem(nWh);
|
|
|
|
}
|
|
|
|
else
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICCOMPILE:
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (StarBASIC::IsRunning() || !dynamic_cast<ModulWindow*>(pCurWin.get()))
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICSTOP:
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// stop is always possible when some Basic is running...
|
2012-08-07 14:33:56 +02:00
|
|
|
if (!StarBASIC::IsRunning())
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_CHOOSE_CONTROLS:
|
|
|
|
case SID_DIALOG_TESTMODE:
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_RADIO:
|
|
|
|
case SID_INSERT_FORM_CHECK:
|
|
|
|
case SID_INSERT_FORM_LIST:
|
|
|
|
case SID_INSERT_FORM_COMBO:
|
|
|
|
case SID_INSERT_FORM_VSCROLL:
|
|
|
|
case SID_INSERT_FORM_HSCROLL:
|
|
|
|
case SID_INSERT_FORM_SPIN:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (!dynamic_cast<DialogWindow*>(pCurWin.get()))
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SHOW_FORMS:
|
|
|
|
case SID_SHOW_HIDDEN:
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SEARCH_OPTIONS:
|
|
|
|
{
|
2015-04-16 13:44:05 +02:00
|
|
|
SearchOptionFlags nOptions = SearchOptionFlags::NONE;
|
2000-09-29 10:02:42 +00:00
|
|
|
if( pCurWin )
|
|
|
|
nOptions = pCurWin->GetSearchOptions();
|
2015-04-16 13:44:05 +02:00
|
|
|
rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, static_cast<sal_uInt16>(nOptions) ) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_LIBSELECTOR:
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aName;
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( !m_aCurLibName.isEmpty() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
LibraryLocation eLocation = m_aCurDocument.getLibraryLocation( m_aCurLibName );
|
|
|
|
aName = CreateMgrAndLibStr( m_aCurDocument.getTitle( eLocation ), m_aCurLibName );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2004-07-23 11:02:12 +00:00
|
|
|
SfxStringItem aItem( SID_BASICIDE_LIBSELECTOR, aName );
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SEARCH_ITEM:
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aSelected = GetSelectionText(true);
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
SvxSearchItem& rItem = GetExtraData()->GetSearchItem();
|
2000-09-29 10:02:42 +00:00
|
|
|
rItem.SetSearchString( aSelected );
|
|
|
|
rSet.Put( rItem );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_STAT_DATE:
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aDate( "Datum?!" );
|
2000-09-29 10:02:42 +00:00
|
|
|
SfxStringItem aItem( SID_BASICIDE_STAT_DATE, aDate );
|
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_DOC_MODIFIED:
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bModified = false;
|
2001-09-25 08:14:46 +00:00
|
|
|
|
|
|
|
if ( pCurWin )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( pCurWin->IsModified() )
|
2012-08-07 08:36:40 +02:00
|
|
|
bModified = true;
|
2001-09-25 08:14:46 +00:00
|
|
|
else
|
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( pCurWin->GetDocument() );
|
|
|
|
bModified = aDocument.isDocument() ? aDocument.isDocumentModified() : IsAppBasicModified();
|
2001-09-25 08:14:46 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2001-09-25 08:14:46 +00:00
|
|
|
|
2011-09-06 16:26:15 +01:00
|
|
|
SfxBoolItem aItem(SID_DOC_MODIFIED, bModified);
|
2000-09-29 10:02:42 +00:00
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_BASICIDE_STAT_TITLE:
|
|
|
|
{
|
|
|
|
if ( pCurWin )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aTitle = pCurWin->CreateQualifiedName();
|
2000-09-29 10:02:42 +00:00
|
|
|
SfxStringItem aItem( SID_BASICIDE_STAT_TITLE, aTitle );
|
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2011-08-22 11:39:37 +02:00
|
|
|
// are interpreted by the controller:
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_ATTR_SIZE:
|
|
|
|
case SID_ATTR_INSERT:
|
|
|
|
break;
|
|
|
|
case SID_UNDO:
|
|
|
|
case SID_REDO:
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
if( GetUndoManager() ) // recursive GetState else
|
2000-09-29 10:02:42 +00:00
|
|
|
GetViewFrame()->GetSlotState( nWh, NULL, &rSet );
|
|
|
|
}
|
|
|
|
break;
|
2007-01-02 14:49:14 +00:00
|
|
|
case SID_BASICIDE_CURRENT_LANG:
|
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
|
2007-01-02 14:49:14 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
else
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aItemStr;
|
2012-01-20 20:23:06 -05:00
|
|
|
boost::shared_ptr<LocalizationMgr> pCurMgr(GetCurLocalizationMgr());
|
2007-01-02 14:49:14 +00:00
|
|
|
if ( pCurMgr->isLibraryLocalized() )
|
|
|
|
{
|
|
|
|
Sequence< lang::Locale > aLocaleSeq = pCurMgr->getStringResourceManager()->getLocales();
|
|
|
|
const lang::Locale* pLocale = aLocaleSeq.getConstArray();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Int32 i, nCount = aLocaleSeq.getLength();
|
2007-01-02 14:49:14 +00:00
|
|
|
|
|
|
|
// Force different results for any combination of locales and default locale
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLangStr;
|
2007-01-02 14:49:14 +00:00
|
|
|
for ( i = 0; i <= nCount; ++i )
|
|
|
|
{
|
|
|
|
lang::Locale aLocale;
|
|
|
|
if( i < nCount )
|
|
|
|
aLocale = pLocale[i];
|
|
|
|
else
|
|
|
|
aLocale = pCurMgr->getStringResourceManager()->getDefaultLocale();
|
|
|
|
|
|
|
|
aLangStr += aLocale.Language;
|
|
|
|
aLangStr += aLocale.Country;
|
|
|
|
aLangStr += aLocale.Variant;
|
|
|
|
}
|
|
|
|
aItemStr = aLangStr;
|
|
|
|
}
|
|
|
|
rSet.Put( SfxStringItem( nWh, aItemStr ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_BASICIDE_MANAGE_LANG:
|
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
|
2007-01-02 14:49:14 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
2011-11-16 14:53:38 +00:00
|
|
|
case SID_GOTOLINE:
|
|
|
|
{
|
|
|
|
// if this is not a module window hide the
|
|
|
|
// setting, doesn't make sense for example if the
|
|
|
|
// dialog editor is open
|
2015-03-09 14:29:30 +02:00
|
|
|
if (pCurWin && !dynamic_cast<ModulWindow*>(pCurWin.get()))
|
2011-11-16 14:53:38 +00:00
|
|
|
{
|
|
|
|
rSet.DisableItem( nWh );
|
2012-08-07 08:36:40 +02:00
|
|
|
rSet.Put(SfxVisibilityItem(nWh, false));
|
2011-11-16 14:53:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
default:
|
|
|
|
if (pLayout)
|
|
|
|
pLayout->GetState(rSet, nWh);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pCurWin )
|
|
|
|
pCurWin->GetState( rSet );
|
|
|
|
}
|
|
|
|
|
2014-03-18 11:23:57 +02:00
|
|
|
bool Shell::HasUIFeature( sal_uInt32 nFeature )
|
2001-09-20 13:01:00 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bResult = false;
|
2001-09-20 13:01:00 +00:00
|
|
|
|
|
|
|
if ( (nFeature & BASICIDE_UI_FEATURE_SHOW_BROWSER) == BASICIDE_UI_FEATURE_SHOW_BROWSER )
|
|
|
|
{
|
|
|
|
// fade out (in) property browser in module (dialog) windows
|
2015-03-09 14:29:30 +02:00
|
|
|
if (dynamic_cast<DialogWindow*>(pCurWin.get()) && !pCurWin->IsReadOnly())
|
2012-08-07 08:36:40 +02:00
|
|
|
bResult = true;
|
2001-09-20 13:01:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bResult;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::SetCurWindow( BaseWindow* pNewWin, bool bUpdateTabBar, bool bRememberAsCurrent )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( pNewWin != pCurWin )
|
|
|
|
{
|
|
|
|
pCurWin = pNewWin;
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pLayout)
|
|
|
|
pLayout->Deactivating();
|
|
|
|
if (pCurWin)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (pCurWin->GetType() == TYPE_MODULE)
|
2012-08-17 07:29:20 +02:00
|
|
|
pLayout = pModulLayout.get();
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
2012-08-17 07:29:20 +02:00
|
|
|
pLayout = pDialogLayout.get();
|
|
|
|
AdjustPosSizePixel(Point(0, 0), GetViewFrame()->GetWindow().GetOutputSizePixel());
|
|
|
|
pLayout->Activating(*pCurWin);
|
|
|
|
GetViewFrame()->GetWindow().SetHelpId(pCurWin->GetHid());
|
|
|
|
if (bRememberAsCurrent)
|
|
|
|
pCurWin->InsertLibInfo();
|
|
|
|
if (GetViewFrame()->GetWindow().IsVisible()) // SFX will do it later otherwise
|
2000-09-29 10:02:42 +00:00
|
|
|
pCurWin->Show();
|
|
|
|
pCurWin->Init();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (!GetExtraData()->ShellInCriticalSection())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pFrameWindow = &GetViewFrame()->GetWindow();
|
|
|
|
vcl::Window* pFocusWindow = Application::GetFocusWindow();
|
2000-09-29 10:02:42 +00:00
|
|
|
while ( pFocusWindow && ( pFocusWindow != pFrameWindow ) )
|
|
|
|
pFocusWindow = pFocusWindow->GetParent();
|
|
|
|
if ( pFocusWindow ) // Focus in BasicIDE
|
2015-04-29 20:58:48 +01:00
|
|
|
pCurWin->GrabFocus();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
else
|
2013-09-12 21:37:42 +01:00
|
|
|
{
|
|
|
|
SetWindow(pLayout);
|
2012-08-17 07:29:20 +02:00
|
|
|
pLayout = 0;
|
2013-09-12 21:37:42 +01:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( bUpdateTabBar )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
sal_uLong nKey = GetWindowId( pCurWin );
|
2011-01-14 11:16:25 +01:00
|
|
|
if ( pCurWin && ( pTabBar->GetPagePos( (sal_uInt16)nKey ) == TAB_PAGE_NOTFOUND ) )
|
2011-08-22 11:39:37 +02:00
|
|
|
pTabBar->InsertPage( (sal_uInt16)nKey, pCurWin->GetTitle() ); // has just been faded in
|
2011-01-14 11:16:25 +01:00
|
|
|
pTabBar->SetCurPageId( (sal_uInt16)nKey );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2011-08-22 11:39:37 +02:00
|
|
|
if ( pCurWin && pCurWin->IsSuspended() ) // if the window is shown in the case of an error...
|
2000-09-29 10:02:42 +00:00
|
|
|
pCurWin->SetStatus( pCurWin->GetStatus() & ~BASWIN_SUSPENDED );
|
|
|
|
if ( pCurWin )
|
|
|
|
{
|
|
|
|
SetWindow( pCurWin );
|
2008-01-15 14:42:57 +00:00
|
|
|
if ( pCurWin->GetDocument().isDocument() )
|
2008-03-06 18:12:22 +00:00
|
|
|
SfxObjectShell::SetCurrentComponent( pCurWin->GetDocument().getDocument() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
else if (pLayout)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
SetWindow(pLayout);
|
2000-09-29 10:02:42 +00:00
|
|
|
GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_MODULWINDOW );
|
2012-08-17 07:29:20 +02:00
|
|
|
SfxObjectShell::SetCurrentComponent(0);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2015-01-14 16:16:15 +02:00
|
|
|
aObjectCatalog->SetCurrentEntry(pCurWin);
|
2000-09-29 10:02:42 +00:00
|
|
|
SetUndoManager( pCurWin ? pCurWin->GetUndoManager() : 0 );
|
|
|
|
InvalidateBasicIDESlots();
|
2015-03-09 14:29:30 +02:00
|
|
|
EnableScrollbars(pCurWin != nullptr);
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2007-06-26 15:51:47 +00:00
|
|
|
if ( m_pCurLocalizationMgr )
|
|
|
|
m_pCurLocalizationMgr->handleTranslationbar();
|
|
|
|
|
|
|
|
ManageToolbars();
|
|
|
|
|
2001-09-20 13:01:00 +00:00
|
|
|
// fade out (in) property browser in module (dialog) windows
|
|
|
|
UIFeatureChanged();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::ManageToolbars()
|
2007-06-26 15:51:47 +00:00
|
|
|
{
|
2014-11-03 14:03:54 +02:00
|
|
|
static const char aMacroBarResName[] = "private:resource/toolbar/macrobar";
|
|
|
|
static const char aDialogBarResName[] = "private:resource/toolbar/dialogbar";
|
|
|
|
static const char aInsertControlsBarResName[] = "private:resource/toolbar/insertcontrolsbar";
|
|
|
|
static const char aFormControlsBarResName[] = "private:resource/toolbar/formcontrolsbar";
|
2007-06-26 15:51:47 +00:00
|
|
|
|
|
|
|
if( !pCurWin )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Reference< beans::XPropertySet > xFrameProps
|
2009-12-15 23:07:57 +01:00
|
|
|
( GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY );
|
2007-06-26 15:51:47 +00:00
|
|
|
if ( xFrameProps.is() )
|
|
|
|
{
|
|
|
|
Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
|
2014-11-03 14:03:54 +02:00
|
|
|
uno::Any a = xFrameProps->getPropertyValue( "LayoutManager" );
|
2007-06-26 15:51:47 +00:00
|
|
|
a >>= xLayoutManager;
|
|
|
|
if ( xLayoutManager.is() )
|
|
|
|
{
|
|
|
|
xLayoutManager->lock();
|
2015-03-09 14:29:30 +02:00
|
|
|
if (dynamic_cast<DialogWindow*>(pCurWin.get()))
|
2007-06-26 15:51:47 +00:00
|
|
|
{
|
|
|
|
xLayoutManager->destroyElement( aMacroBarResName );
|
|
|
|
|
|
|
|
xLayoutManager->requestElement( aDialogBarResName );
|
|
|
|
xLayoutManager->requestElement( aInsertControlsBarResName );
|
2011-12-05 09:56:17 +00:00
|
|
|
xLayoutManager->requestElement( aFormControlsBarResName );
|
2007-06-26 15:51:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xLayoutManager->destroyElement( aDialogBarResName );
|
|
|
|
xLayoutManager->destroyElement( aInsertControlsBarResName );
|
2011-12-05 09:56:17 +00:00
|
|
|
xLayoutManager->destroyElement( aFormControlsBarResName );
|
2007-06-26 15:51:47 +00:00
|
|
|
|
|
|
|
xLayoutManager->requestElement( aMacroBarResName );
|
|
|
|
}
|
|
|
|
xLayoutManager->unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<BaseWindow> Shell::FindApplicationWindow()
|
2007-03-15 14:53:21 +00:00
|
|
|
{
|
|
|
|
return FindWindow( ScriptDocument::getApplicationScriptDocument() );
|
|
|
|
}
|
|
|
|
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<BaseWindow> Shell::FindWindow(
|
2012-08-17 07:29:20 +02:00
|
|
|
ScriptDocument const& rDocument,
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString const& rLibName, OUString const& rName,
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
ItemType eType, bool bFindSuspended
|
2012-08-17 07:29:20 +02:00
|
|
|
)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* const pWin = it->second;
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pWin->Is(rDocument, rLibName, rName, eType, bFindSuspended))
|
|
|
|
return pWin;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-01-17 16:28:40 +01:00
|
|
|
bool Shell::CallBasicErrorHdl( StarBASIC* pBasic )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2014-01-17 16:28:40 +01:00
|
|
|
bool nRet = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
ModulWindow* pModWin = ShowActiveModuleWindow( pBasic );
|
|
|
|
if ( pModWin )
|
|
|
|
nRet = pModWin->BasicErrorHdl( pBasic );
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
long Shell::CallBasicBreakHdl( StarBASIC* pBasic )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
long nRet = 0;
|
|
|
|
ModulWindow* pModWin = ShowActiveModuleWindow( pBasic );
|
|
|
|
if ( pModWin )
|
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
bool bAppWindowDisabled, bDispatcherLocked;
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nWaitCount;
|
2000-09-29 10:02:42 +00:00
|
|
|
SfxUInt16Item *pSWActionCount, *pSWLockViewCount;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BasicStopped( &bAppWindowDisabled, &bDispatcherLocked,
|
2000-09-29 10:02:42 +00:00
|
|
|
&nWaitCount, &pSWActionCount, &pSWLockViewCount );
|
|
|
|
|
|
|
|
nRet = pModWin->BasicBreakHdl( pBasic );
|
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
if ( StarBASIC::IsRunning() ) // if cancelled...
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( bAppWindowDisabled )
|
2012-08-07 08:36:40 +02:00
|
|
|
Application::GetDefDialogParent()->Enable(false);
|
2010-11-08 03:57:20 -05:00
|
|
|
|
2004-01-06 16:12:14 +00:00
|
|
|
if ( nWaitCount )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell* pShell = GetShell();
|
2011-01-14 11:16:25 +01:00
|
|
|
for ( sal_uInt16 n = 0; n < nWaitCount; n++ )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell->GetViewFrame()->GetWindow().EnterWait();
|
2004-01-06 16:12:14 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<ModulWindow> Shell::ShowActiveModuleWindow( StarBASIC* pBasic )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
SetCurLib( ScriptDocument::getApplicationScriptDocument(), OUString(), false );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
SbModule* pActiveModule = StarBASIC::GetActiveModule();
|
2012-08-07 14:33:56 +02:00
|
|
|
if (SbClassModuleObject* pCMO = dynamic_cast<SbClassModuleObject*>(pActiveModule))
|
|
|
|
pActiveModule = pCMO->getClassModule();
|
2004-11-02 11:00:08 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pActiveModule, "Kein aktives Modul im ErrorHdl?!" );
|
|
|
|
if ( pActiveModule )
|
|
|
|
{
|
2015-05-15 19:03:44 +01:00
|
|
|
VclPtr<ModulWindow> pWin;
|
2000-09-29 10:02:42 +00:00
|
|
|
SbxObject* pParent = pActiveModule->GetParent();
|
2012-08-07 14:33:56 +02:00
|
|
|
if (StarBASIC* pLib = dynamic_cast<StarBASIC*>(pParent))
|
2004-07-23 11:02:12 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (BasicManager* pBasMgr = FindBasicManager(pLib))
|
2004-07-23 11:02:12 +00:00
|
|
|
{
|
2007-03-15 14:53:21 +00:00
|
|
|
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName = pLib->GetName();
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( aDocument, aLibName, pActiveModule->GetName(), true );
|
2004-07-23 11:02:12 +00:00
|
|
|
DBG_ASSERT( pWin, "Error/Step-Hdl: Fenster wurde nicht erzeugt/gefunden!" );
|
2007-03-15 14:53:21 +00:00
|
|
|
SetCurLib( aDocument, aLibName );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2004-07-23 11:02:12 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-07 14:33:56 +02:00
|
|
|
else
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
DBG_ASSERT(false, "No BASIC!");
|
|
|
|
if (BasicManager* pBasicMgr = FindBasicManager(pBasic))
|
2012-08-07 08:36:40 +02:00
|
|
|
StartListening( *pBasicMgr, true /* log on only once */ );
|
2000-09-29 10:02:42 +00:00
|
|
|
return pWin;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// not if iconified because the whole text would be displaced then at restore
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( GetViewFrame()->GetWindow().GetOutputSizePixel().Height() == 0 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Size aSz( rSize );
|
2015-01-14 16:16:15 +02:00
|
|
|
Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() );
|
2000-09-29 10:02:42 +00:00
|
|
|
aSz.Height() -= aScrollBarBoxSz.Height();
|
2001-09-06 11:48:14 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
Size aOutSz( aSz );
|
|
|
|
aSz.Width() -= aScrollBarBoxSz.Width();
|
2015-01-14 16:16:15 +02:00
|
|
|
aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
|
|
|
|
aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( bTabBarSplitted )
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// SplitSize is 0 at a resize!
|
2000-09-29 10:02:42 +00:00
|
|
|
long nSplitPos = pTabBar->GetSizePixel().Width();
|
|
|
|
if ( nSplitPos > aSz.Width() )
|
|
|
|
nSplitPos = aSz.Width();
|
|
|
|
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( nSplitPos, aScrollBarBoxSz.Height() ) );
|
|
|
|
long nScrlStart = rPos.X() + nSplitPos;
|
2015-01-14 16:16:15 +02:00
|
|
|
aHScrollBar->SetPosSizePixel( Point( nScrlStart, rPos.Y()+aSz.Height() ), Size( aSz.Width() - nScrlStart + 1, aScrollBarBoxSz.Height() ) );
|
|
|
|
aHScrollBar->Update();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-01-14 16:16:15 +02:00
|
|
|
aHScrollBar->SetPosSizePixel( Point( rPos.X()+ aSz.Width()/2 - 1, rPos.Y()+aSz.Height() ), Size( aSz.Width()/2 + 2, aScrollBarBoxSz.Height() ) );
|
2000-09-29 10:02:42 +00:00
|
|
|
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width()/2, aScrollBarBoxSz.Height() ) );
|
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
if (pLayout)
|
2015-03-09 14:29:30 +02:00
|
|
|
pLayout->SetPosSizePixel(rPos, dynamic_cast<DialogWindow*>(pCurWin.get()) ? aSz : aOutSz);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Reference< XModel > Shell::GetCurrentDocument() const
|
2008-03-06 18:12:22 +00:00
|
|
|
{
|
|
|
|
Reference< XModel > xDocument;
|
|
|
|
if ( pCurWin && pCurWin->GetDocument().isDocument() )
|
|
|
|
xDocument = pCurWin->GetDocument().getDocument();
|
|
|
|
return xDocument;
|
|
|
|
}
|
|
|
|
|
2014-03-18 11:23:57 +02:00
|
|
|
void Shell::Activate( bool bMDI )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2008-03-06 18:12:22 +00:00
|
|
|
SfxViewShell::Activate( bMDI );
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( bMDI )
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
|
2012-08-07 14:33:56 +02:00
|
|
|
pDCurWin->UpdateBrowser();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-18 11:23:57 +02:00
|
|
|
void Shell::Deactivate( bool bMDI )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
// bMDI == true means that another MDI has been activated; in case of a
|
|
|
|
// deactivate due to a MessageBox bMDI is false
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( bMDI )
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if (DialogWindow* pXDlgWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
pXDlgWin->DisableBrowser();
|
|
|
|
if( pXDlgWin->IsModified() )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
MarkDocumentModified( pXDlgWin->GetDocument() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
// test CanClose to also test during deactivating the BasicIDE whether
|
|
|
|
// the sourcecode is too large in one of the modules...
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = it->second;
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( /* !pWin->IsSuspended() && */ !pWin->CanClose() )
|
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
|
2012-10-02 11:31:09 -03:00
|
|
|
SetCurLib( ScriptDocument::getApplicationScriptDocument(), OUString(), false );
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|