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
|
|
|
|
2007-10-09 14:21:50 +00:00
|
|
|
#include "docsignature.hxx"
|
|
|
|
|
2005-04-13 08:50:08 +00:00
|
|
|
#include <basic/sbx.hxx>
|
2009-05-19 11:32:44 +00:00
|
|
|
#include "basicrenderable.hxx"
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2008-04-04 13:04:52 +00:00
|
|
|
#include <com/sun/star/frame/XTitle.hpp>
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <basidesh.hxx>
|
2004-11-17 09:26:41 +00:00
|
|
|
#include <basidesh.hrc>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <baside2.hxx>
|
|
|
|
#include <basdoc.hxx>
|
|
|
|
#include <basobj.hxx>
|
2012-08-06 20:52:37 +02:00
|
|
|
#include <vcl/texteng.hxx>
|
|
|
|
#include <vcl/textview.hxx>
|
|
|
|
#include <vcl/xtextedt.hxx>
|
2007-03-15 14:53:39 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <sfx2/sfxdefs.hxx>
|
2007-11-21 15:37:21 +00:00
|
|
|
#include <sfx2/signaturestate.hxx>
|
2010-03-02 12:39:31 +00:00
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
|
|
|
#include <com/sun/star/container/XNamed.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
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
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2001-06-28 14:26:41 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
2008-04-04 13:04:52 +00:00
|
|
|
namespace css = ::com::sun::star;
|
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
|
|
|
Reference< view::XRenderable > Shell::GetRenderable()
|
2009-05-19 11:32:44 +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
|
|
|
return Reference<view::XRenderable>( new Renderable(pCurWin) );
|
2009-05-19 11:32:44 +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
|
|
|
sal_Bool Shell::HasSelection( sal_Bool /* bText */ ) const
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
TextView* pEditView = pMCurWin->GetEditView();
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pEditView && pEditView->HasSelection() )
|
2012-08-07 14:33:56 +02:00
|
|
|
return true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-08-07 14:33:56 +02:00
|
|
|
return false;
|
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
|
|
|
String Shell::GetSelectionText( sal_Bool bWholeWord )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
String aText;
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
if (TextView* pEditView = pMCurWin->GetEditView())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( bWholeWord && !pEditView->HasSelection() )
|
|
|
|
{
|
|
|
|
aText = pEditView->GetTextEngine()->GetWord( pEditView->GetSelection().GetEnd() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TextSelection aSel = pEditView->GetSelection();
|
|
|
|
if ( !bWholeWord || ( aSel.GetStart().GetPara() == aSel.GetEnd().GetPara() ) )
|
|
|
|
aText = pEditView->GetSelected();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aText;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
SfxPrinter* Shell::GetPrinter( sal_Bool bCreate )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
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
|
|
|
DocShell* pDocShell = (DocShell*)GetViewFrame()->GetObjectShell();
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pDocShell, "DocShell ?!" );
|
|
|
|
return pDocShell->GetPrinter( bCreate );
|
|
|
|
}
|
|
|
|
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
|
|
|
sal_uInt16 Shell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-01-16 15:29:35 +00:00
|
|
|
(void)nDiffFlags;
|
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
|
|
|
DocShell* pDocShell = (DocShell*)GetViewFrame()->GetObjectShell();
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( pDocShell, "DocShell ?!" );
|
|
|
|
pDocShell->SetPrinter( pNewPrinter );
|
|
|
|
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::SetMDITitle()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
::rtl::OUStringBuffer aTitleBuf;
|
|
|
|
if ( !m_aCurLibName.isEmpty() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:53:39 +00:00
|
|
|
LibraryLocation eLocation = m_aCurDocument.getLibraryLocation( m_aCurLibName );
|
2011-12-09 01:58:49 -05:00
|
|
|
aTitleBuf.append(m_aCurDocument.getTitle(eLocation));
|
|
|
|
aTitleBuf.append('.');
|
|
|
|
aTitleBuf.append(m_aCurLibName);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2004-11-17 09:26:41 +00:00
|
|
|
else
|
2012-04-29 23:36:57 +01:00
|
|
|
aTitleBuf.append(IDE_RESSTR(RID_STR_ALL));
|
2004-07-23 11:02:25 +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
|
|
|
DocumentSignature aCurSignature( m_aCurDocument );
|
2007-10-09 14:21:50 +00:00
|
|
|
if ( aCurSignature.getScriptingSignatureState() == SIGNATURESTATE_SIGNATURES_OK )
|
2005-03-10 16:59:06 +00:00
|
|
|
{
|
2011-12-09 01:58:49 -05:00
|
|
|
aTitleBuf.append(' ');
|
2012-04-29 23:36:57 +01:00
|
|
|
aTitleBuf.append(IDE_RESSTR(RID_STR_SIGNED));
|
2011-12-09 01:58:49 -05:00
|
|
|
aTitleBuf.append(' ');
|
2005-03-10 16:59:06 +00:00
|
|
|
}
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aTitle(aTitleBuf.makeStringAndClear());
|
2005-03-10 16:59:06 +00:00
|
|
|
|
2004-11-17 09:26:41 +00:00
|
|
|
SfxViewFrame* pViewFrame = GetViewFrame();
|
|
|
|
if ( pViewFrame )
|
|
|
|
{
|
|
|
|
SfxObjectShell* pShell = pViewFrame->GetObjectShell();
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( pShell && !pShell->GetTitle( SFX_TITLE_CAPTION ).Equals(aTitle) )
|
2004-11-17 09:26:41 +00:00
|
|
|
{
|
|
|
|
pShell->SetTitle( aTitle );
|
2012-08-07 08:36:40 +02:00
|
|
|
pShell->SetModified(false);
|
2004-11-17 09:26:41 +00:00
|
|
|
}
|
2008-04-04 13:04:52 +00:00
|
|
|
|
|
|
|
css::uno::Reference< css::frame::XController > xController = GetController ();
|
|
|
|
css::uno::Reference< css::frame::XTitle > xTitle (xController, css::uno::UNO_QUERY);
|
|
|
|
if (xTitle.is ())
|
|
|
|
xTitle->setTitle (aTitle);
|
2004-11-17 09:26:41 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
ModulWindow* Shell::CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-02 10:21:00 +09:00
|
|
|
bCreatingWindow = true;
|
2001-06-28 14:26:41 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uLong nKey = 0;
|
2000-09-29 10:02:42 +00:00
|
|
|
ModulWindow* pWin = 0;
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aLibName( rLibName );
|
|
|
|
OUString aModName( rModName );
|
2004-07-23 11:02:25 +00:00
|
|
|
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( aLibName.isEmpty() )
|
2012-10-05 01:25:41 -03:00
|
|
|
aLibName = "Standard" ;
|
2004-07-23 11:02:25 +00:00
|
|
|
|
2010-03-02 12:39:31 +00:00
|
|
|
uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
|
2004-07-23 11:02:25 +00:00
|
|
|
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( aModName.isEmpty() )
|
2007-03-15 14:53:39 +00:00
|
|
|
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
|
2004-07-23 11:02:25 +00:00
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
// maybe there's an suspended one?
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( rDocument, aLibName, aModName, false, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
if ( !pWin )
|
|
|
|
{
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aModule;
|
2007-03-15 14:53:39 +00:00
|
|
|
bool bSuccess = false;
|
|
|
|
if ( rDocument.hasModule( aLibName, aModName ) )
|
|
|
|
bSuccess = rDocument.getModule( aLibName, aModName, aModule );
|
|
|
|
else
|
2012-08-07 08:36:40 +02:00
|
|
|
bSuccess = rDocument.createModule( aLibName, aModName, true, aModule );
|
2007-03-15 14:53:39 +00:00
|
|
|
|
|
|
|
if ( bSuccess )
|
2001-06-28 14:26:41 +00:00
|
|
|
{
|
2012-07-27 10:35:28 +09:00
|
|
|
pWin = FindBasWin( rDocument, aLibName, aModName, false, true );
|
2010-03-02 12:39:31 +00:00
|
|
|
if( !pWin )
|
2010-05-05 11:41:41 +01:00
|
|
|
{
|
|
|
|
// new module window
|
2012-08-17 07:29:20 +02:00
|
|
|
if (!pModulLayout)
|
|
|
|
pModulLayout.reset(new ModulWindowLayout(&GetViewFrame()->GetWindow(), aObjectCatalog));
|
|
|
|
pWin = new ModulWindow(pModulLayout.get(), rDocument, aLibName, aModName, aModule);
|
2010-05-05 11:41:41 +01:00
|
|
|
nKey = InsertWindowInTable( pWin );
|
|
|
|
}
|
|
|
|
else // we've gotten called recursively ( via listener from createModule above ), get outta here
|
|
|
|
return pWin;
|
2004-07-23 11:02:25 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pWin->SetStatus( pWin->GetStatus() & ~BASWIN_SUSPENDED );
|
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
|
|
|
nKey = GetWindowId( pWin );
|
2000-09-29 10:02:42 +00:00
|
|
|
DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
|
|
|
|
}
|
2010-03-03 16:12:54 +00:00
|
|
|
if( nKey && xLib.is() && rDocument.isInVBAMode() )
|
2010-03-02 12:39:31 +00:00
|
|
|
{
|
2010-03-03 16:12:54 +00:00
|
|
|
// display a nice friendly name in the ObjectModule tab,
|
|
|
|
// combining the objectname and module name, e.g. Sheet1 ( Financials )
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString sObjName;
|
2010-04-20 10:31:03 +01:00
|
|
|
ModuleInfoHelper::getObjectName( xLib, rModName, sObjName );
|
2011-11-22 00:20:15 -05:00
|
|
|
if( !sObjName.isEmpty() )
|
2010-03-02 12:39:31 +00:00
|
|
|
{
|
2012-10-05 01:25:41 -03:00
|
|
|
OUStringBuffer aModNameBuf(aModName);
|
2011-12-09 01:58:49 -05:00
|
|
|
aModNameBuf.append(' ');
|
|
|
|
aModNameBuf.append('(');
|
|
|
|
aModNameBuf.append(sObjName);
|
|
|
|
aModNameBuf.append(')');
|
|
|
|
aModName = aModNameBuf.makeStringAndClear();
|
2010-03-02 12:39:31 +00:00
|
|
|
}
|
|
|
|
}
|
2011-01-14 11:16:25 +01:00
|
|
|
pTabBar->InsertPage( (sal_uInt16)nKey, aModName );
|
2001-06-20 08:27:37 +00:00
|
|
|
pTabBar->Sort();
|
2000-09-29 10:02:42 +00:00
|
|
|
pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
|
|
|
|
if ( !pCurWin )
|
2012-07-27 10:35:28 +09:00
|
|
|
SetCurWindow( pWin, false, false );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2012-08-02 10:21:00 +09:00
|
|
|
bCreatingWindow = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
return pWin;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
ModulWindow* Shell::FindBasWin (
|
2012-08-17 07:29:20 +02:00
|
|
|
ScriptDocument const& rDocument,
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString const& rLibName, OUString const& rName,
|
2012-08-17 07:29:20 +02:00
|
|
|
bool bCreateIfNotExist, bool bFindSuspended
|
|
|
|
)
|
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 (BaseWindow* pWin = FindWindow(rDocument, rLibName, rName, TYPE_MODULE, bFindSuspended))
|
2012-08-17 07:29:20 +02:00
|
|
|
return static_cast<ModulWindow*>(pWin);
|
|
|
|
return bCreateIfNotExist ? CreateBasWin(rDocument, rLibName, rName) : 0;
|
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::Move()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
|
|
|
|
pMCurWin->FrameWindowMoved();
|
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::ShowCursor( bool bOn )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
|
|
|
|
pMCurWin->ShowCursor(bOn);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
// only if basic window above:
|
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::ExecuteBasic( SfxRequest& rReq )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
if (dynamic_cast<ModulWindow*>(pCurWin))
|
|
|
|
{
|
|
|
|
pCurWin->ExecuteCommand( rReq );
|
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 (nShellCount)
|
2012-08-17 07:29:20 +02:00
|
|
|
CheckWindows();
|
|
|
|
}
|
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
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|