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 <vcl/msgbox.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <sot/storinfo.hxx>
|
|
|
|
|
|
|
|
#include <moduldlg.hrc>
|
|
|
|
#include <moduldlg.hxx>
|
|
|
|
#include <basidesh.hrc>
|
2001-09-06 08:21:02 +00:00
|
|
|
#include <basidesh.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <bastypes.hxx>
|
|
|
|
#include <basobj.hxx>
|
|
|
|
#include <baside2.hrc>
|
|
|
|
#include <iderdll.hxx>
|
|
|
|
#include <iderdll2.hxx>
|
|
|
|
#include <svx/passwd.hxx>
|
|
|
|
#include <sbxitem.hxx>
|
2001-09-26 15:15:18 +00:00
|
|
|
#include <basdoc.hxx>
|
2006-04-07 07:44:22 +00:00
|
|
|
#include <ucbhelper/content.hxx>
|
|
|
|
#include "rtl/uri.hxx"
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <sfx2/dinfdlg.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2000-11-20 07:32:42 +00:00
|
|
|
#include <tools/urlobj.hxx>
|
2007-03-15 14:58:04 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2004-10-04 18:40:17 +00:00
|
|
|
#include <sot/storage.hxx>
|
2012-08-28 13:50:47 +02:00
|
|
|
#include <com/sun/star/io/Pipe.hpp>
|
2001-07-05 08:20:52 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
|
2006-04-07 07:44:22 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
|
2001-07-03 15:33:31 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
|
2001-07-05 08:20:52 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
|
2001-09-25 08:14:46 +00:00
|
|
|
#include <com/sun/star/script/XLibraryContainer2.hpp>
|
2001-11-02 12:45:10 +00:00
|
|
|
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
|
2006-04-07 07:44:22 +00:00
|
|
|
#include <com/sun/star/script/XLibraryContainerExport.hpp>
|
2012-05-29 17:17:28 +02:00
|
|
|
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
|
|
|
|
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
|
2006-04-07 07:44:22 +00:00
|
|
|
#include "com/sun/star/ucb/XCommandEnvironment.hpp"
|
|
|
|
#include <com/sun/star/ucb/NameClash.hpp>
|
|
|
|
#include "com/sun/star/packages/manifest/XManifestWriter.hpp"
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/pathoptions.hxx>
|
2012-08-28 13:50:47 +02:00
|
|
|
#include <comphelper/componentcontext.hxx>
|
2000-11-20 07:32:42 +00:00
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
|
2006-11-01 15:23:26 +00:00
|
|
|
#include <com/sun/star/util/VetoException.hpp>
|
|
|
|
#include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
2007-03-15 14:58:04 +00:00
|
|
|
using ::rtl::OUString;
|
2001-05-21 09:16:42 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::ucb;
|
2001-07-03 15:33:31 +00:00
|
|
|
using namespace ::com::sun::star::ui::dialogs;
|
2000-11-20 07:32:42 +00:00
|
|
|
|
|
|
|
|
2006-11-01 15:23:26 +00:00
|
|
|
typedef ::cppu::WeakImplHelper1< task::XInteractionHandler > HandlerImpl_BASE;
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
2006-11-01 15:23:26 +00:00
|
|
|
class DummyInteractionHandler : public HandlerImpl_BASE
|
|
|
|
{
|
|
|
|
Reference< task::XInteractionHandler > m_xHandler;
|
|
|
|
public:
|
|
|
|
DummyInteractionHandler( const Reference< task::XInteractionHandler >& xHandler ) : m_xHandler( xHandler ){}
|
|
|
|
|
|
|
|
virtual void SAL_CALL handle( const Reference< task::XInteractionRequest >& rRequest ) throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
if ( m_xHandler.is() )
|
|
|
|
{
|
|
|
|
script::ModuleSizeExceededRequest aModSizeException;
|
|
|
|
if ( rRequest->getRequest() >>= aModSizeException )
|
|
|
|
m_xHandler->handle( rRequest );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-11-07 09: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
|
|
|
// LibUserData
|
2001-11-07 09: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
|
|
|
class LibUserData
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
private:
|
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
|
|
|
ScriptDocument m_aDocument;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
public:
|
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
|
|
|
LibUserData (ScriptDocument const& rDocument) : m_aDocument(rDocument) { }
|
|
|
|
virtual ~LibUserData() {};
|
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
|
|
|
const ScriptDocument& GetDocument() const { return m_aDocument; }
|
2001-11-07 09:18:27 +00:00
|
|
|
};
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09: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
|
|
|
// LibLBoxString
|
2001-11-07 09:18:27 +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
|
|
|
class LibLBoxString : public SvLBoxString
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
LibLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
|
2001-11-07 09:18:27 +00:00
|
|
|
SvLBoxString( pEntry, nFlags, rTxt ) {}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry );
|
2001-11-07 09:18:27 +00:00
|
|
|
};
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09: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
|
|
|
void LibLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* pEntry )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2002-07-05 09:27:37 +00:00
|
|
|
// Change text color if library is read only:
|
|
|
|
bool bReadOnly = false;
|
|
|
|
if (pEntry && pEntry->GetUserData())
|
2001-08-29 11:29:09 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
ScriptDocument aDocument(
|
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<LibUserData*>(pEntry->GetUserData())->
|
2007-03-15 14:58:04 +00:00
|
|
|
GetDocument() );
|
|
|
|
|
2002-07-05 09:27:37 +00:00
|
|
|
rtl::OUString aLibName(
|
|
|
|
static_cast< SvLBoxString * >(pEntry->GetItem(1))->GetText());
|
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer(
|
2007-03-15 14:58:04 +00:00
|
|
|
aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY);
|
2002-07-05 09:27:37 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer(
|
2007-03-15 14:58:04 +00:00
|
|
|
aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY);
|
2002-07-05 09:27:37 +00:00
|
|
|
bReadOnly
|
|
|
|
= (xModLibContainer.is() && xModLibContainer->hasByName(aLibName)
|
|
|
|
&& xModLibContainer->isLibraryReadOnly(aLibName))
|
|
|
|
|| (xDlgLibContainer.is() && xDlgLibContainer->hasByName(aLibName)
|
|
|
|
&& xDlgLibContainer->isLibraryReadOnly(aLibName));
|
2001-08-29 11:29:09 +00:00
|
|
|
}
|
2002-07-05 09:27:37 +00:00
|
|
|
if (bReadOnly)
|
|
|
|
rDev.DrawCtrlText(rPos, GetText(), 0, STRING_LEN, TEXT_DRAW_DISABLE);
|
|
|
|
else
|
|
|
|
rDev.DrawText(rPos, GetText());
|
2001-08-29 11:29:09 +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
|
|
|
} // namespace
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09: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
|
|
|
// basctl::CheckBox
|
2001-11-07 09: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
|
|
|
CheckBox::CheckBox( Window* pParent, const ResId& rResId )
|
2004-07-23 11:05:59 +00:00
|
|
|
:SvTabListBox( pParent, rResId )
|
2007-03-15 14:58:04 +00:00
|
|
|
,m_aDocument( ScriptDocument::getApplicationScriptDocument() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-12-10 17:35:13 -05:00
|
|
|
nMode = NEWOBJECTMODE_MOD;
|
2011-08-22 11:39:37 +02:00
|
|
|
long aTabs_[] = { 1, 12 }; // TabPos needs at least one...
|
|
|
|
// 12 because of the CheckBox
|
2007-01-16 15:32:29 +00:00
|
|
|
SetTabs( aTabs_ );
|
2001-11-07 09:18:27 +00:00
|
|
|
Init();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +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
|
|
|
CheckBox::~CheckBox()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-14 21:45:02 +00:00
|
|
|
delete pCheckButton;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2002-01-22 08:06:37 +00:00
|
|
|
// delete user data
|
|
|
|
SvLBoxEntry* pEntry = First();
|
|
|
|
while ( pEntry )
|
|
|
|
{
|
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
|
|
|
delete static_cast<LibUserData*>(pEntry->GetUserData());
|
2002-01-22 08:06:37 +00:00
|
|
|
pEntry = Next( pEntry );
|
|
|
|
}
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09:18:27 +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
|
|
|
void CheckBox::Init()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2002-07-03 14:59:32 +00:00
|
|
|
pCheckButton = new SvLBoxButtonData(this);
|
2001-11-14 21:45:02 +00:00
|
|
|
|
|
|
|
if ( nMode == LIBMODE_CHOOSER )
|
|
|
|
EnableCheckButton( pCheckButton );
|
|
|
|
else
|
|
|
|
EnableCheckButton( 0 );
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
SetHighlightRange();
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09:18:27 +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
|
|
|
void CheckBox::SetMode( NewObjectMode n )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
nMode = n;
|
|
|
|
|
|
|
|
if ( nMode == LIBMODE_CHOOSER )
|
|
|
|
EnableCheckButton( pCheckButton );
|
|
|
|
else
|
|
|
|
EnableCheckButton( 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
|
|
|
SvLBoxEntry* CheckBox::DoInsertEntry( const String& rStr, sal_uLong nPos )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2006-06-19 12:16:10 +00:00
|
|
|
return SvTabListBox::InsertEntryToColumn( rStr, nPos, 0 );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09: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
|
|
|
SvLBoxEntry* CheckBox::FindEntry( const String& rName )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uLong nCount = GetEntryCount();
|
|
|
|
for ( sal_uLong i = 0; i < nCount; i++ )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
SvLBoxEntry* pEntry = GetEntry( i );
|
|
|
|
DBG_ASSERT( pEntry, "pEntry?!" );
|
|
|
|
if ( rName.CompareIgnoreCaseToAscii( GetEntryText( pEntry, 0 ) ) == COMPARE_EQUAL )
|
|
|
|
return pEntry;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2001-11-07 09:18:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2001-11-02 12:45:10 +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 CheckBox::CheckEntryPos( sal_uLong nPos )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
if ( nPos < GetEntryCount() )
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pEntry = GetEntry( nPos );
|
|
|
|
|
2012-08-08 11:37:42 +02:00
|
|
|
if ( GetCheckButtonState( pEntry ) != SV_BUTTON_CHECKED )
|
|
|
|
SetCheckButtonState( pEntry, SvButtonState(SV_BUTTON_CHECKED) );
|
2001-11-07 09: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
|
|
|
bool CheckBox::IsChecked( sal_uLong nPos ) const
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
if ( nPos < GetEntryCount() )
|
2012-08-07 08:36:40 +02:00
|
|
|
return GetCheckButtonState(GetEntry(nPos)) == SV_BUTTON_CHECKED;
|
|
|
|
return false;
|
2001-11-07 09: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
|
|
|
void CheckBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rTxt, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2006-12-20 13:15:28 +00:00
|
|
|
SvTabListBox::InitEntry( pEntry, rTxt, rImg1, rImg2, eButtonKind );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
2011-12-10 17:35:13 -05:00
|
|
|
if ( nMode == NEWOBJECTMODE_MOD )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2001-11-14 21:45:02 +00:00
|
|
|
// initialize all columns with own string class (column 0 == bitmap)
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nCount = pEntry->ItemCount();
|
|
|
|
for ( sal_uInt16 nCol = 1; nCol < nCount; ++nCol )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nCol );
|
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
|
|
|
LibLBoxString* pStr = new LibLBoxString( pEntry, 0, pCol->GetText() );
|
2001-11-14 21:45:02 +00:00
|
|
|
pEntry->ReplaceItem( pStr, nCol );
|
|
|
|
}
|
2001-11-07 09: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
|
|
|
sal_Bool CheckBox::EditingEntry( SvLBoxEntry* pEntry, Selection& )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2011-12-10 17:35:13 -05:00
|
|
|
if ( nMode != NEWOBJECTMODE_MOD )
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
DBG_ASSERT( pEntry, "Kein Eintrag?" );
|
|
|
|
|
|
|
|
// check, if Standard library
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName = GetEntryText( pEntry, 0 );
|
|
|
|
if ( aLibName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Standard" ) ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB) ).Execute();
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// check, if library is readonly
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBISREADONLY) ).Execute();
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
2004-11-15 12:41:16 +00:00
|
|
|
// i24094: Password verification necessary for renaming
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bOK = true;
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && !xModLibContainer->isLibraryLoaded( aLibName ) )
|
2004-11-15 12:41:16 +00:00
|
|
|
{
|
|
|
|
// check password
|
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
|
2004-11-15 12:41:16 +00:00
|
|
|
{
|
2011-12-09 00:50:03 -05:00
|
|
|
::rtl::OUString aPassword;
|
2004-11-15 12:41:16 +00:00
|
|
|
Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
|
|
|
|
bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
|
|
|
|
}
|
|
|
|
if ( !bOK )
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2004-11-15 12:41:16 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
// TODO: check if library is reference/link
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
return true;
|
2001-11-07 09: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
|
|
|
sal_Bool CheckBox::EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewName )
|
2001-11-07 09: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
|
|
|
bool bValid = rNewName.getLength() <= 30 && IsValidSbxName(rNewName);
|
2012-03-17 10:06:47 +00:00
|
|
|
rtl::OUString aOldName( GetEntryText( pEntry, 0 ) );
|
|
|
|
if ( bValid && ( aOldName != rNewName ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
2001-11-07 09:18:27 +00:00
|
|
|
if ( xModLibContainer.is() )
|
2012-03-17 10:06:47 +00:00
|
|
|
xModLibContainer->renameLibrary( aOldName, rNewName );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2001-11-07 09:18:27 +00:00
|
|
|
if ( xDlgLibContainer.is() )
|
2012-03-17 10:06:47 +00:00
|
|
|
xDlgLibContainer->renameLibrary( aOldName, rNewName );
|
2001-11-07 09: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
|
|
|
MarkDocumentModified( m_aDocument );
|
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2003-04-24 13:05:32 +00:00
|
|
|
{
|
|
|
|
pBindings->Invalidate( SID_BASICIDE_LIBSELECTOR );
|
|
|
|
pBindings->Update( SID_BASICIDE_LIBSELECTOR );
|
|
|
|
}
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch (const container::ElementExistException& )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED) ).Execute();
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch (const container::NoSuchElementException& )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2012-08-07 08:36:40 +02:00
|
|
|
return false;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bValid )
|
|
|
|
{
|
2012-03-17 10:06:47 +00:00
|
|
|
if ( rNewName.getLength() > 30 )
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBNAMETOLONG) ).Execute();
|
2001-11-07 09:18:27 +00:00
|
|
|
else
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) ).Execute();
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bValid;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// NewObjectDialog
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler)
|
2002-07-09 07:12:31 +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 (IsValidSbxName(aEdit.GetText()))
|
2002-07-09 07:12:31 +00:00
|
|
|
EndDialog(1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ErrorBox(this, WB_OK | WB_DEF_OK,
|
2012-04-29 23:36:57 +01:00
|
|
|
IDE_RESSTR(RID_STR_BADSBXNAME)).Execute();
|
2002-07-09 07:12:31 +00:00
|
|
|
aEdit.GrabFocus();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-12-10 17:35:13 -05:00
|
|
|
NewObjectDialog::NewObjectDialog(Window * pParent, NewObjectMode nMode,
|
2002-07-09 07:12:31 +00:00
|
|
|
bool bCheckName)
|
2001-11-07 09:18:27 +00:00
|
|
|
: ModalDialog( pParent, IDEResId( RID_DLG_NEWLIB ) ),
|
|
|
|
aText( this, IDEResId( RID_FT_NEWLIB ) ),
|
|
|
|
aEdit( this, IDEResId( RID_ED_LIBNAME ) ),
|
|
|
|
aOKButton( this, IDEResId( RID_PB_OK ) ),
|
|
|
|
aCancelButton( this, IDEResId( RID_PB_CANCEL ) )
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
aEdit.GrabFocus();
|
|
|
|
|
2011-12-10 17:35:13 -05:00
|
|
|
switch (nMode)
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2011-12-10 17:35:13 -05:00
|
|
|
case NEWOBJECTMODE_LIB:
|
2012-04-29 23:36:57 +01:00
|
|
|
SetText( IDE_RESSTR(RID_STR_NEWLIB) );
|
2011-12-10 17:35:13 -05:00
|
|
|
break;
|
|
|
|
case NEWOBJECTMODE_MOD:
|
2012-04-29 23:36:57 +01:00
|
|
|
SetText( IDE_RESSTR(RID_STR_NEWMOD) );
|
2011-12-10 17:35:13 -05:00
|
|
|
break;
|
|
|
|
case NEWOBJECTMODE_METH:
|
2012-04-29 23:36:57 +01:00
|
|
|
SetText( IDE_RESSTR(RID_STR_NEWMETH) );
|
2011-12-10 17:35:13 -05:00
|
|
|
break;
|
|
|
|
default:
|
2012-04-29 23:36:57 +01:00
|
|
|
SetText( IDE_RESSTR(RID_STR_NEWDLG) );
|
2011-12-10 17:35:13 -05:00
|
|
|
break;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2002-07-09 07:12:31 +00:00
|
|
|
|
|
|
|
if (bCheckName)
|
|
|
|
aOKButton.SetClickHdl(LINK(this, NewObjectDialog, OkButtonHandler));
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NewObjectDialog::~NewObjectDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-11-16 14:53:38 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// GotoLineDialog
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
GotoLineDialog::GotoLineDialog(Window * pParent )
|
|
|
|
: ModalDialog( pParent, IDEResId( RID_DLG_GOTOLINE ) ),
|
|
|
|
aText( this, IDEResId( RID_FT_LINE ) ),
|
|
|
|
aEdit( this, IDEResId( RID_ED_LINE ) ),
|
|
|
|
aOKButton( this, IDEResId( RID_PB_OK ) ),
|
|
|
|
aCancelButton( this, IDEResId( RID_PB_CANCEL ) )
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
aEdit.GrabFocus();
|
|
|
|
|
2012-04-29 23:36:57 +01:00
|
|
|
SetText( IDE_RESSTR(RID_STR_GETLINE) );
|
2011-11-16 14:53:38 +00:00
|
|
|
aOKButton.SetClickHdl(LINK(this, GotoLineDialog, OkButtonHandler));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 GotoLineDialog::GetLineNumber()
|
|
|
|
{
|
|
|
|
return rtl::OUString( aEdit.GetText() ).toInt32();
|
|
|
|
}
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(GotoLineDialog, OkButtonHandler)
|
2011-11-16 14:53:38 +00:00
|
|
|
{
|
|
|
|
if ( GetLineNumber() )
|
|
|
|
EndDialog(1);
|
|
|
|
else
|
|
|
|
aEdit.SetText( aEdit.GetText(), Selection(0, aEdit.GetText().Len() ));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-07 07:44:22 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// ExportDialog
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(ExportDialog, OkButtonHandler)
|
2006-04-07 07:44:22 +00:00
|
|
|
{
|
|
|
|
mbExportAsPackage = maExportAsPackageButton.IsChecked();
|
|
|
|
EndDialog(1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
ExportDialog::ExportDialog( Window * pParent )
|
|
|
|
: ModalDialog( pParent, IDEResId( RID_DLG_EXPORT ) ),
|
|
|
|
maExportAsPackageButton( this, IDEResId( RB_EXPORTASPACKAGE ) ),
|
|
|
|
maExportAsBasicButton( this, IDEResId( RB_EXPORTASBASIC ) ),
|
|
|
|
maOKButton( this, IDEResId( RID_PB_OK ) ),
|
|
|
|
maCancelButton( this, IDEResId( RID_PB_CANCEL ) )
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
maExportAsPackageButton.Check();
|
|
|
|
maOKButton.SetClickHdl(LINK(this, ExportDialog, OkButtonHandler));
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
ExportDialog::~ExportDialog()
|
|
|
|
{
|
|
|
|
}
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// LibPage
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
LibPage::LibPage( Window * pParent )
|
|
|
|
:TabPage( pParent, IDEResId( RID_TP_LIBS ) )
|
|
|
|
,aBasicsText( this, IDEResId( RID_STR_BASICS ) )
|
|
|
|
,aBasicsBox( this, IDEResId( RID_LB_BASICS ) )
|
|
|
|
,aLibText( this, IDEResId( RID_STR_LIB ) )
|
|
|
|
,aLibBox( this, IDEResId( RID_TRLBOX ) )
|
|
|
|
,aEditButton( this, IDEResId( RID_PB_EDIT ) )
|
|
|
|
,aCloseButton( this, IDEResId( RID_PB_CLOSE ) )
|
|
|
|
,aPasswordButton( this, IDEResId( RID_PB_PASSWORD ) )
|
|
|
|
,aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) )
|
|
|
|
,aInsertLibButton( this, IDEResId( RID_PB_APPEND ) )
|
2011-01-19 18:44:39 +01:00
|
|
|
,aExportButton( this, IDEResId( RID_PB_EXPORT ) )
|
2004-07-23 11:05:59 +00:00
|
|
|
,aDelButton( this, IDEResId( RID_PB_DELETE ) )
|
2007-03-15 14:58:04 +00:00
|
|
|
,m_aCurDocument( ScriptDocument::getApplicationScriptDocument() )
|
2004-07-23 11:05:59 +00:00
|
|
|
,m_eCurLocation( LIBRARY_LOCATION_UNKNOWN )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
pTabDlg = 0;
|
|
|
|
|
|
|
|
aEditButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
|
|
|
aNewLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
|
|
|
aPasswordButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
2006-04-07 07:44:22 +00:00
|
|
|
aExportButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
2001-11-07 09:18:27 +00:00
|
|
|
aInsertLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
|
|
|
aDelButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
|
|
|
aCloseButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
|
|
|
|
aLibBox.SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) );
|
|
|
|
|
|
|
|
aBasicsBox.SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) );
|
|
|
|
|
2011-12-10 17:35:13 -05:00
|
|
|
aLibBox.SetMode( NEWOBJECTMODE_MOD );
|
2012-08-07 08:36:40 +02:00
|
|
|
aLibBox.EnableInplaceEditing(true);
|
2010-09-03 17:53:47 +02:00
|
|
|
aLibBox.SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
|
2001-11-07 09:18:27 +00:00
|
|
|
aCloseButton.GrabFocus();
|
|
|
|
|
|
|
|
long aTabs[] = { 2, 30, 120 };
|
|
|
|
aLibBox.SetTabs( aTabs, MAP_PIXEL );
|
|
|
|
|
|
|
|
FillListBox();
|
|
|
|
aBasicsBox.SelectEntryPos( 0 );
|
|
|
|
SetCurLib();
|
|
|
|
|
|
|
|
CheckButtons();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
LibPage::~LibPage()
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nCount = aBasicsBox.GetEntryCount();
|
|
|
|
for ( sal_uInt16 i = 0; i < nCount; ++i )
|
2001-11-07 09: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
|
|
|
DocumentEntry* pEntry = (DocumentEntry*)aBasicsBox.GetEntryData( i );
|
2004-07-23 11:05:59 +00:00
|
|
|
delete pEntry;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2004-07-23 11:05:59 +00:00
|
|
|
}
|
2001-11-07 09:18:27 +00:00
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2001-11-07 09:18:27 +00:00
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
void LibPage::CheckButtons()
|
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
SvLBoxEntry* pCur = aLibBox.GetCurEntry();
|
|
|
|
if ( pCur )
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName = aLibBox.GetEntryText( pCur, 0 );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
if ( m_eCurLocation == LIBRARY_LOCATION_SHARE )
|
|
|
|
{
|
|
|
|
aPasswordButton.Disable();
|
|
|
|
aNewLibButton.Disable();
|
|
|
|
aInsertLibButton.Disable();
|
|
|
|
aDelButton.Disable();
|
|
|
|
}
|
2011-12-10 17:57:49 -05:00
|
|
|
else if ( aLibName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "Standard" ) ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
aPasswordButton.Disable();
|
2004-07-23 11:05:59 +00:00
|
|
|
aNewLibButton.Enable();
|
|
|
|
aInsertLibButton.Enable();
|
2006-04-07 07:44:22 +00:00
|
|
|
aExportButton.Disable();
|
2001-11-07 09:18:27 +00:00
|
|
|
aDelButton.Disable();
|
2002-04-25 13:56:47 +00:00
|
|
|
if ( !aLibBox.HasFocus() )
|
|
|
|
aCloseButton.GrabFocus();
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2011-12-10 17:57:49 -05:00
|
|
|
else if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
aPasswordButton.Disable();
|
2004-07-23 11:05:59 +00:00
|
|
|
aNewLibButton.Enable();
|
|
|
|
aInsertLibButton.Enable();
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
aDelButton.Disable();
|
|
|
|
else
|
|
|
|
aDelButton.Enable();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContainer.is() && !xModLibContainer->hasByName( aLibName ) )
|
2004-07-23 11:05:59 +00:00
|
|
|
aPasswordButton.Disable();
|
|
|
|
else
|
|
|
|
aPasswordButton.Enable();
|
|
|
|
|
|
|
|
aNewLibButton.Enable();
|
|
|
|
aInsertLibButton.Enable();
|
2006-04-07 07:44:22 +00:00
|
|
|
aExportButton.Enable();
|
2001-11-07 09:18:27 +00:00
|
|
|
aDelButton.Enable();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void LibPage::ActivatePage()
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
SetCurLib();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void LibPage::DeactivatePage()
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK_INLINE_START( LibPage, TreeListHighlightHdl, SvTreeListBox *, pBox )
|
|
|
|
{
|
|
|
|
if ( pBox->IsSelected( pBox->GetHdlEntry() ) )
|
|
|
|
CheckButtons();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
IMPL_LINK_INLINE_END( LibPage, TreeListHighlightHdl, SvTreeListBox *, pBox )
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK_INLINE_START( LibPage, BasicSelectHdl, ListBox *, pBox )
|
|
|
|
{
|
2007-01-16 15:32:29 +00:00
|
|
|
(void)pBox;
|
2001-11-07 09:18:27 +00:00
|
|
|
SetCurLib();
|
|
|
|
CheckButtons();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
IMPL_LINK_INLINE_END( LibPage, BasicSelectHdl, ListBox *, pBox )
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
|
|
|
|
{
|
|
|
|
if ( pButton == &aEditButton )
|
|
|
|
{
|
2004-10-04 18:40:17 +00:00
|
|
|
SfxAllItemSet aArgs( SFX_APP()->GetPool() );
|
|
|
|
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
|
|
|
|
SFX_APP()->ExecuteSlot( aRequest );
|
|
|
|
|
2007-03-15 14:58:04 +00:00
|
|
|
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) );
|
2001-11-07 09:18:27 +00:00
|
|
|
SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry();
|
|
|
|
DBG_ASSERT( pCurEntry, "Entry?!" );
|
2004-07-23 11:05:59 +00:00
|
|
|
String aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
|
|
|
|
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, 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
|
|
|
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
2001-11-07 09:18:27 +00:00
|
|
|
pDispatcher->Execute( SID_BASICIDE_LIBSELECTED,
|
2007-03-15 14:58:04 +00:00
|
|
|
SFX_CALLMODE_ASYNCHRON, &aDocItem, &aLibNameItem, 0L );
|
2001-11-07 09:18:27 +00:00
|
|
|
EndTabDialog( 1 );
|
2005-01-13 16:50:24 +00:00
|
|
|
return 0;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
else if ( pButton == &aNewLibButton )
|
|
|
|
NewLib();
|
|
|
|
else if ( pButton == &aInsertLibButton )
|
|
|
|
InsertLib();
|
2006-04-07 07:44:22 +00:00
|
|
|
else if ( pButton == &aExportButton )
|
|
|
|
Export();
|
2001-11-07 09:18:27 +00:00
|
|
|
else if ( pButton == &aDelButton )
|
|
|
|
DeleteCurrent();
|
|
|
|
else if ( pButton == &aCloseButton )
|
|
|
|
{
|
|
|
|
EndTabDialog( 0 );
|
2005-01-13 16:50:24 +00:00
|
|
|
return 0;
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
else if ( pButton == &aPasswordButton )
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry();
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
// load module library (if not loaded)
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer > xModLibContainer = m_aCurDocument.getLibraryContainer( E_SCRIPTS );
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && !xModLibContainer->isLibraryLoaded( aLibName ) )
|
2001-11-07 09: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
|
|
|
Shell* pShell = GetShell();
|
|
|
|
if (pShell)
|
|
|
|
pShell->GetViewFrame()->GetWindow().EnterWait();
|
2011-12-10 17:57:49 -05:00
|
|
|
xModLibContainer->loadLibrary( 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
|
|
|
if (pShell)
|
|
|
|
pShell->GetViewFrame()->GetWindow().LeaveWait();
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// load dialog library (if not loaded)
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer > xDlgLibContainer = m_aCurDocument.getLibraryContainer( E_DIALOGS );
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && !xDlgLibContainer->isLibraryLoaded( aLibName ) )
|
2001-11-07 09: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
|
|
|
Shell* pShell = GetShell();
|
|
|
|
if (pShell)
|
|
|
|
pShell->GetViewFrame()->GetWindow().EnterWait();
|
2011-12-10 17:57:49 -05:00
|
|
|
xDlgLibContainer->loadLibrary( 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
|
|
|
if (pShell)
|
|
|
|
pShell->GetViewFrame()->GetWindow().LeaveWait();
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// check, if library is password protected
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
|
|
|
if ( xPasswd.is() )
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool const bProtected = xPasswd->isLibraryPasswordProtected( aLibName );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
// change password dialog
|
2012-08-07 08:36:40 +02:00
|
|
|
SvxPasswordDialog* pDlg = new SvxPasswordDialog( this, true, !bProtected );
|
2001-11-07 09:18:27 +00:00
|
|
|
pDlg->SetCheckPasswordHdl( LINK( this, LibPage, CheckPasswordHdl ) );
|
|
|
|
|
|
|
|
if ( pDlg->Execute() == RET_OK )
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool const bNewProtected = xPasswd->isLibraryPasswordProtected( aLibName );
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
if ( bNewProtected != bProtected )
|
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uLong nPos = (sal_uLong)aLibBox.GetModel()->GetAbsPos( pCurEntry );
|
2001-11-07 09:18:27 +00:00
|
|
|
aLibBox.GetModel()->Remove( pCurEntry );
|
|
|
|
ImpInsertLibEntry( aLibName, nPos );
|
|
|
|
aLibBox.SetCurEntry( aLibBox.GetEntry( nPos ) );
|
|
|
|
}
|
2001-11-09 14:41:40 +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( m_aCurDocument );
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CheckButtons();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK_INLINE_START( LibPage, CheckPasswordHdl, SvxPasswordDialog *, pDlg )
|
|
|
|
{
|
|
|
|
long nRet = 0;
|
2001-11-02 12:45:10 +00:00
|
|
|
|
|
|
|
SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry();
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
2001-11-02 12:45:10 +00:00
|
|
|
|
|
|
|
if ( xPasswd.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aOldPassword( pDlg->GetOldPassword() );
|
|
|
|
::rtl::OUString aNewPassword( pDlg->GetNewPassword() );
|
|
|
|
xPasswd->changeLibraryPassword( aLibName, aOldPassword, aNewPassword );
|
2001-11-02 12:45:10 +00:00
|
|
|
nRet = 1;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
IMPL_LINK_INLINE_END( LibPage, CheckPasswordHdl, SvxPasswordDialog *, pDlg )
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2001-11-02 12:45:10 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
void LibPage::NewLib()
|
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
createLibImpl( static_cast<Window*>( this ), m_aCurDocument, &aLibBox, NULL);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
void LibPage::InsertLib()
|
|
|
|
{
|
2001-12-11 16:32:03 +00:00
|
|
|
// file open dialog
|
2001-05-21 09:16:42 +00:00
|
|
|
Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
|
|
|
|
Reference < XFilePicker > xFP;
|
|
|
|
if( xMSF.is() )
|
|
|
|
{
|
2001-07-05 08:20:52 +00:00
|
|
|
Sequence <Any> aServiceType(1);
|
|
|
|
aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
|
2001-05-21 09:16:42 +00:00
|
|
|
xFP = Reference< XFilePicker >( xMSF->createInstanceWithArguments(
|
2001-07-05 08:20:52 +00:00
|
|
|
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY );
|
2001-05-21 09:16:42 +00:00
|
|
|
}
|
|
|
|
xFP->setTitle( String( IDEResId( RID_STR_APPENDLIBS ) ) );
|
|
|
|
|
2001-12-11 16:32:03 +00:00
|
|
|
// filter
|
2005-04-13 08:51:52 +00:00
|
|
|
::rtl::OUString aTitle = String( IDEResId( RID_STR_BASIC ) );
|
2005-01-13 16:50:24 +00:00
|
|
|
::rtl::OUString aFilter;
|
2005-01-27 13:25:38 +00:00
|
|
|
aFilter = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.sbl;*.xlc;*.xlb" ) ); // library files
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sdw;*.sxw;*.odt" ) ); // text
|
2005-01-13 16:50:24 +00:00
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.vor;*.stw;*.ott" ) ); // text template
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sgl;*.sxg;*.odm" ) ); // master document
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.oth" ) ); // html document template
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sdc;*.sxc;*.ods" ) ); // spreadsheet
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.stc;*.ots" ) ); // spreadsheet template
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sda;*.sxd;*.odg" ) ); // drawing
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.std;*.otg" ) ); // drawing template
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sdd;*.sxi;*.odp" ) ); // presentation
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sti;*.otp" ) ); // presentation template
|
|
|
|
aFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";*.sxm;*.odf" ) ); // formula
|
2001-05-21 09:16:42 +00:00
|
|
|
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
|
2005-01-13 16:50:24 +00:00
|
|
|
xFltMgr->appendFilter( aTitle, aFilter );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-12-11 16:32:03 +00:00
|
|
|
// set display directory and filter
|
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
|
|
|
::rtl::OUString aPath(GetExtraData()->GetAddLibPath());
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( !aPath.isEmpty() )
|
2001-05-21 09:16:42 +00:00
|
|
|
xFP->setDisplayDirectory( aPath );
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
|
|
|
{
|
2000-11-14 13:25:01 +00:00
|
|
|
// macro path from configuration management
|
2001-12-11 16:32:03 +00:00
|
|
|
xFP->setDisplayDirectory( SvtPathOptions().GetWorkPath() );
|
2006-04-07 07:44:22 +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
|
|
|
rtl::OUString aLastFilter(GetExtraData()->GetAddLibFilter());
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( !aLastFilter.isEmpty() )
|
2006-04-07 07:44:22 +00:00
|
|
|
xFltMgr->setCurrentFilter( aLastFilter );
|
|
|
|
else
|
2012-04-29 23:36:57 +01:00
|
|
|
xFltMgr->setCurrentFilter( IDE_RESSTR(RID_STR_BASIC) );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2003-05-22 07:43:09 +00:00
|
|
|
if ( xFP->execute() == RET_OK )
|
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
|
|
|
GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
|
|
|
|
GetExtraData()->SetAddLibFilter( xFltMgr->getCurrentFilter() );
|
2000-11-20 07:32:42 +00:00
|
|
|
|
2003-05-22 07:43:09 +00:00
|
|
|
// library containers for import
|
|
|
|
Reference< script::XLibraryContainer2 > xModLibContImport;
|
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContImport;
|
|
|
|
|
2001-12-11 16:32:03 +00:00
|
|
|
// file URLs
|
|
|
|
Sequence< ::rtl::OUString > aFiles = xFP->getFiles();
|
|
|
|
INetURLObject aURLObj( aFiles[0] );
|
|
|
|
INetURLObject aModURLObj( aURLObj );
|
|
|
|
INetURLObject aDlgURLObj( aURLObj );
|
2000-11-20 07:32:42 +00:00
|
|
|
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aBase = aURLObj.getBase();
|
|
|
|
::rtl::OUString aModBase(RTL_CONSTASCII_USTRINGPARAM("script"));
|
|
|
|
::rtl::OUString aDlgBase(RTL_CONSTASCII_USTRINGPARAM("dialog"));
|
2003-05-22 07:43:09 +00:00
|
|
|
|
2001-12-11 16:32:03 +00:00
|
|
|
if ( aBase == aModBase || aBase == aDlgBase )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
2001-12-11 16:32:03 +00:00
|
|
|
aModURLObj.setBase( aModBase );
|
|
|
|
aDlgURLObj.setBase( aDlgBase );
|
2003-07-11 10:21:36 +00:00
|
|
|
}
|
2001-11-14 21:45:02 +00:00
|
|
|
|
2003-07-11 10:21:36 +00:00
|
|
|
if ( xMSF.is() )
|
|
|
|
{
|
2012-05-29 17:17:28 +02:00
|
|
|
Reference< XSimpleFileAccess2 > xSFA( SimpleFileAccess::create(comphelper::getProcessComponentContext()) );
|
2003-05-22 07:43:09 +00:00
|
|
|
|
2012-05-29 17:17:28 +02:00
|
|
|
::rtl::OUString aModURL( aModURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
|
|
|
|
if ( xSFA->exists( aModURL ) )
|
2003-05-22 07:43:09 +00:00
|
|
|
{
|
2012-05-29 17:17:28 +02:00
|
|
|
Sequence <Any> aSeqModURL(1);
|
|
|
|
aSeqModURL[0] <<= aModURL;
|
|
|
|
xModLibContImport = Reference< script::XLibraryContainer2 >( xMSF->createInstanceWithArguments(
|
|
|
|
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.DocumentScriptLibraryContainer" ) ), aSeqModURL ), UNO_QUERY );
|
|
|
|
}
|
2003-05-22 07:43:09 +00:00
|
|
|
|
2012-05-29 17:17:28 +02:00
|
|
|
::rtl::OUString aDlgURL( aDlgURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
|
|
|
|
if ( xSFA->exists( aDlgURL ) )
|
|
|
|
{
|
|
|
|
Sequence <Any> aSeqDlgURL(1);
|
|
|
|
aSeqDlgURL[0] <<= aDlgURL;
|
|
|
|
xDlgLibContImport = Reference< script::XLibraryContainer2 >( xMSF->createInstanceWithArguments(
|
|
|
|
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.DocumentDialogLibraryContainer" ) ), aSeqDlgURL ), UNO_QUERY );
|
2003-05-22 07:43:09 +00:00
|
|
|
}
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( xModLibContImport.is() || xDlgLibContImport.is() )
|
|
|
|
{
|
|
|
|
LibDialog* pLibDlg = 0;
|
|
|
|
|
|
|
|
Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, UNO_QUERY );
|
|
|
|
Reference< script::XLibraryContainer > xDlgLibContImp( xDlgLibContImport, UNO_QUERY );
|
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
|
|
|
Sequence< ::rtl::OUString > aLibNames = GetMergedLibraryNames( xModLibContImp, xDlgLibContImp );
|
2001-11-14 21:45:02 +00:00
|
|
|
sal_Int32 nLibCount = aLibNames.getLength();
|
|
|
|
const ::rtl::OUString* pLibNames = aLibNames.getConstArray();
|
|
|
|
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
|
|
|
|
{
|
2001-12-11 16:32:03 +00:00
|
|
|
// library import dialog
|
2001-11-14 21:45:02 +00:00
|
|
|
if ( !pLibDlg )
|
|
|
|
{
|
|
|
|
pLibDlg = new LibDialog( this );
|
2001-12-11 16:32:03 +00:00
|
|
|
pLibDlg->SetStorageName( aURLObj.getName() );
|
2011-12-10 17:35:13 -05:00
|
|
|
pLibDlg->GetLibBox().SetMode( NEWOBJECTMODE_LIB );
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
|
2001-12-11 16:32:03 +00:00
|
|
|
// libbox entries
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName( pLibNames[ i ] );
|
|
|
|
if ( !( ( xModLibContImport.is() && xModLibContImport->hasByName( aLibName ) && xModLibContImport->isLibraryLink( aLibName ) ) ||
|
|
|
|
( xDlgLibContImport.is() && xDlgLibContImport->hasByName( aLibName ) && xDlgLibContImport->isLibraryLink( aLibName ) ) ) )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
2007-01-16 15:32:29 +00:00
|
|
|
SvLBoxEntry* pEntry = pLibDlg->GetLibBox().DoInsertEntry( aLibName );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nPos = (sal_uInt16) pLibDlg->GetLibBox().GetModel()->GetAbsPos( pEntry );
|
2012-08-08 11:37:42 +02:00
|
|
|
pLibDlg->GetLibBox().CheckEntryPos(nPos);
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pLibDlg )
|
2012-04-29 23:36:57 +01:00
|
|
|
InfoBox( this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE) ).Execute();
|
2001-11-14 21:45:02 +00:00
|
|
|
else
|
|
|
|
{
|
2012-08-01 10:05:20 +09:00
|
|
|
bool bChanges = false;
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aExtension( aURLObj.getExtension() );
|
|
|
|
::rtl::OUString aLibExtension(RTL_CONSTASCII_USTRINGPARAM("xlb"));
|
|
|
|
::rtl::OUString aContExtension(RTL_CONSTASCII_USTRINGPARAM("xlc"));
|
2001-12-11 16:32:03 +00:00
|
|
|
|
|
|
|
// disable reference checkbox for documents and sbls
|
|
|
|
if ( aExtension != aLibExtension && aExtension != aContExtension )
|
2012-08-07 08:36:40 +02:00
|
|
|
pLibDlg->EnableReference(false);
|
2001-12-11 16:32:03 +00:00
|
|
|
|
2001-11-14 21:45:02 +00:00
|
|
|
if ( pLibDlg->Execute() )
|
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uLong nNewPos = aLibBox.GetEntryCount();
|
2012-08-01 10:05:20 +09:00
|
|
|
bool bRemove = false;
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bReplace = pLibDlg->IsReplace();
|
|
|
|
bool bReference = pLibDlg->IsReference();
|
2011-01-14 11:16:25 +01:00
|
|
|
for ( sal_uInt16 nLib = 0; nLib < pLibDlg->GetLibBox().GetEntryCount(); nLib++ )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
if ( pLibDlg->GetLibBox().IsChecked( nLib ) )
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pEntry = pLibDlg->GetLibBox().GetEntry( nLib );
|
|
|
|
DBG_ASSERT( pEntry, "Entry?!" );
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aLibName( pLibDlg->GetLibBox().GetEntryText( pEntry, 0 ) );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2001-11-14 21:45:02 +00:00
|
|
|
|
|
|
|
// check, if the library is already existing
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) ) )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
if ( bReplace )
|
|
|
|
{
|
|
|
|
// check, if the library is the Standard library
|
2012-04-06 14:28:18 +02:00
|
|
|
if ( aLibName == "Standard" )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_REPLACESTDLIB) ).Execute();
|
2001-11-14 21:45:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// check, if the library is readonly and not a link
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
::rtl::OUString aErrStr( IDE_RESSTR(RID_STR_REPLACELIB) );
|
2012-03-08 00:49:32 +01:00
|
|
|
aErrStr = aErrStr.replaceAll("XX", aLibName);
|
2011-12-10 17:57:49 -05:00
|
|
|
aErrStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"));
|
2012-04-29 23:36:57 +01:00
|
|
|
aErrStr += IDE_RESSTR(RID_STR_LIBISREADONLY);
|
2001-12-11 16:32:03 +00:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
|
2001-11-14 21:45:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2001-12-13 17:29:39 +00:00
|
|
|
// remove existing libraries
|
2012-08-01 10:05:20 +09:00
|
|
|
bRemove = true;
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aErrStr;
|
2001-11-14 21:45:02 +00:00
|
|
|
if ( bReference )
|
2012-04-29 23:36:57 +01:00
|
|
|
aErrStr = IDE_RESSTR(RID_STR_REFNOTPOSSIBLE);
|
2001-11-14 21:45:02 +00:00
|
|
|
else
|
2012-04-29 23:36:57 +01:00
|
|
|
aErrStr = IDE_RESSTR(RID_STR_IMPORTNOTPOSSIBLE);
|
2012-03-08 00:49:32 +01:00
|
|
|
aErrStr = aErrStr.replaceAll("XX", aLibName);
|
2011-12-10 17:57:49 -05:00
|
|
|
aErrStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"));
|
2012-04-29 23:36:57 +01:00
|
|
|
aErrStr += IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED);
|
2001-12-11 16:32:03 +00:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
|
|
|
|
continue;
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-13 17:29:39 +00:00
|
|
|
// check, if the library is password protected
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bOK = false;
|
2011-12-09 00:50:03 -05:00
|
|
|
::rtl::OUString aPassword;
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContImport.is() && xModLibContImport->hasByName( aLibName ) )
|
2001-12-13 17:29:39 +00:00
|
|
|
{
|
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContImport, UNO_QUERY );
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) && !bReference )
|
2001-12-13 17:29:39 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bOK = QueryPassword( xModLibContImp, aLibName, aPassword, true, true );
|
2001-12-13 17:29:39 +00:00
|
|
|
|
|
|
|
if ( !bOK )
|
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
::rtl::OUString aErrStr( IDE_RESSTR(RID_STR_NOIMPORT) );
|
2012-03-08 00:49:32 +01:00
|
|
|
aErrStr = aErrStr.replaceAll("XX", aLibName);
|
2001-12-13 17:29:39 +00:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// remove existing libraries
|
|
|
|
if ( bRemove )
|
|
|
|
{
|
|
|
|
// remove listbox entry
|
2007-01-16 15:32:29 +00:00
|
|
|
SvLBoxEntry* pEntry_ = aLibBox.FindEntry( aLibName );
|
|
|
|
if ( pEntry_ )
|
|
|
|
aLibBox.SvTreeListBox::GetModel()->Remove( pEntry_ );
|
2001-12-13 17:29:39 +00:00
|
|
|
|
|
|
|
// remove module library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
|
|
|
|
xModLibContainer->removeLibrary( aLibName );
|
2001-12-13 17:29:39 +00:00
|
|
|
|
|
|
|
// remove dialog library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) )
|
|
|
|
xDlgLibContainer->removeLibrary( aLibName );
|
2001-12-13 17:29:39 +00:00
|
|
|
}
|
|
|
|
|
2001-11-14 21:45:02 +00:00
|
|
|
// copy module library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xModLibContImport.is() && xModLibContImport->hasByName( aLibName ) && xModLibContainer.is() && !xModLibContainer->hasByName( aLibName ) )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
Reference< container::XNameContainer > xModLib;
|
|
|
|
if ( bReference )
|
|
|
|
{
|
2001-12-11 16:32:03 +00:00
|
|
|
// storage URL
|
2001-12-18 10:26:25 +00:00
|
|
|
INetURLObject aModStorageURLObj( aModURLObj );
|
2001-12-11 16:32:03 +00:00
|
|
|
if ( aExtension == aContExtension )
|
|
|
|
{
|
2001-12-18 10:26:25 +00:00
|
|
|
sal_Int32 nCount = aModStorageURLObj.getSegmentCount();
|
|
|
|
aModStorageURLObj.insertName( aLibName, false, nCount-1 );
|
|
|
|
aModStorageURLObj.setExtension( aLibExtension );
|
|
|
|
aModStorageURLObj.setFinalSlash();
|
2001-12-11 16:32:03 +00:00
|
|
|
}
|
2002-11-26 14:39:59 +00:00
|
|
|
::rtl::OUString aModStorageURL( aModStorageURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
|
2001-12-11 16:32:03 +00:00
|
|
|
|
2001-11-14 21:45:02 +00:00
|
|
|
// create library link
|
2012-08-07 08:36:40 +02:00
|
|
|
xModLib = Reference< container::XNameContainer >( xModLibContainer->createLibraryLink( aLibName, aModStorageURL, true ), UNO_QUERY);
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// create library
|
2011-12-10 17:57:49 -05:00
|
|
|
xModLib = xModLibContainer->createLibrary( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
if ( xModLib.is() )
|
|
|
|
{
|
|
|
|
// get import library
|
|
|
|
Reference< container::XNameContainer > xModLibImport;
|
2011-12-10 17:57:49 -05:00
|
|
|
Any aElement = xModLibContImport->getByName( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
aElement >>= xModLibImport;
|
|
|
|
|
|
|
|
if ( xModLibImport.is() )
|
|
|
|
{
|
|
|
|
// load library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( !xModLibContImport->isLibraryLoaded( aLibName ) )
|
|
|
|
xModLibContImport->loadLibrary( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
|
|
|
|
// copy all modules
|
|
|
|
Sequence< ::rtl::OUString > aModNames = xModLibImport->getElementNames();
|
|
|
|
sal_Int32 nModCount = aModNames.getLength();
|
|
|
|
const ::rtl::OUString* pModNames = aModNames.getConstArray();
|
|
|
|
for ( sal_Int32 i = 0 ; i < nModCount ; i++ )
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aModName( pModNames[ i ] );
|
|
|
|
Any aElement_ = xModLibImport->getByName( aModName );
|
|
|
|
xModLib->insertByName( aModName, aElement_ );
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
2001-12-18 10:26:25 +00:00
|
|
|
|
|
|
|
// set password
|
|
|
|
if ( bOK )
|
|
|
|
{
|
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
|
|
|
if ( xPasswd.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString _aPassword( aPassword );
|
|
|
|
xPasswd->changeLibraryPassword( aLibName, ::rtl::OUString(), _aPassword );
|
2001-12-18 10:26:25 +00:00
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// copy dialog library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( xDlgLibContImport.is() && xDlgLibContImport->hasByName( aLibName ) && xDlgLibContainer.is() && !xDlgLibContainer->hasByName( aLibName ) )
|
2001-11-14 21:45:02 +00:00
|
|
|
{
|
|
|
|
Reference< container::XNameContainer > xDlgLib;
|
|
|
|
if ( bReference )
|
|
|
|
{
|
2001-12-11 16:32:03 +00:00
|
|
|
// storage URL
|
2001-12-18 10:26:25 +00:00
|
|
|
INetURLObject aDlgStorageURLObj( aDlgURLObj );
|
2001-12-11 16:32:03 +00:00
|
|
|
if ( aExtension == aContExtension )
|
|
|
|
{
|
2001-12-18 10:26:25 +00:00
|
|
|
sal_Int32 nCount = aDlgStorageURLObj.getSegmentCount();
|
|
|
|
aDlgStorageURLObj.insertName( aLibName, false, nCount - 1 );
|
|
|
|
aDlgStorageURLObj.setExtension( aLibExtension );
|
|
|
|
aDlgStorageURLObj.setFinalSlash();
|
2001-12-11 16:32:03 +00:00
|
|
|
}
|
2002-11-26 14:39:59 +00:00
|
|
|
::rtl::OUString aDlgStorageURL( aDlgStorageURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
|
2001-12-11 16:32:03 +00:00
|
|
|
|
2001-11-14 21:45:02 +00:00
|
|
|
// create library link
|
2012-08-07 08:36:40 +02:00
|
|
|
xDlgLib = Reference< container::XNameContainer >( xDlgLibContainer->createLibraryLink( aLibName, aDlgStorageURL, true ), UNO_QUERY);
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// create library
|
2011-12-10 17:57:49 -05:00
|
|
|
xDlgLib = xDlgLibContainer->createLibrary( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
if ( xDlgLib.is() )
|
|
|
|
{
|
|
|
|
// get import library
|
|
|
|
Reference< container::XNameContainer > xDlgLibImport;
|
2011-12-10 17:57:49 -05:00
|
|
|
Any aElement = xDlgLibContImport->getByName( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
aElement >>= xDlgLibImport;
|
|
|
|
|
|
|
|
if ( xDlgLibImport.is() )
|
|
|
|
{
|
|
|
|
// load library
|
2011-12-10 17:57:49 -05:00
|
|
|
if ( !xDlgLibContImport->isLibraryLoaded( aLibName ) )
|
|
|
|
xDlgLibContImport->loadLibrary( aLibName );
|
2001-11-14 21:45:02 +00:00
|
|
|
|
|
|
|
// copy all dialogs
|
|
|
|
Sequence< ::rtl::OUString > aDlgNames = xDlgLibImport->getElementNames();
|
|
|
|
sal_Int32 nDlgCount = aDlgNames.getLength();
|
|
|
|
const ::rtl::OUString* pDlgNames = aDlgNames.getConstArray();
|
|
|
|
for ( sal_Int32 i = 0 ; i < nDlgCount ; i++ )
|
|
|
|
{
|
2011-12-10 17:57:49 -05:00
|
|
|
::rtl::OUString aDlgName( pDlgNames[ i ] );
|
|
|
|
Any aElement_ = xDlgLibImport->getByName( aDlgName );
|
|
|
|
xDlgLib->insertByName( aDlgName, aElement_ );
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// insert listbox entry
|
|
|
|
ImpInsertLibEntry( aLibName, aLibBox.GetEntryCount() );
|
2012-08-01 10:05:20 +09:00
|
|
|
bChanges = true;
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SvLBoxEntry* pFirstNew = aLibBox.GetEntry( nNewPos );
|
|
|
|
if ( pFirstNew )
|
|
|
|
aLibBox.SetCurEntry( pFirstNew );
|
|
|
|
}
|
|
|
|
|
|
|
|
delete pLibDlg;
|
|
|
|
if ( bChanges )
|
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( m_aCurDocument );
|
2001-11-14 21:45:02 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2006-04-07 07:44:22 +00:00
|
|
|
void LibPage::Export( void )
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry();
|
|
|
|
String aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
|
|
|
|
|
|
|
|
// Password verification
|
|
|
|
::rtl::OUString aOULibName( aLibName );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && !xModLibContainer->isLibraryLoaded( aOULibName ) )
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bOK = true;
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
// check password
|
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
|
|
|
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
|
|
|
|
{
|
2011-12-09 00:50:03 -05:00
|
|
|
::rtl::OUString aPassword;
|
2006-04-07 07:44:22 +00:00
|
|
|
Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
|
|
|
|
bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
|
|
|
|
}
|
|
|
|
if ( !bOK )
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Window* pWin = static_cast<Window*>( this );
|
|
|
|
std::auto_ptr< ExportDialog > xNewDlg( new ExportDialog( pWin ) );
|
|
|
|
|
|
|
|
if ( xNewDlg->Execute() == RET_OK )
|
|
|
|
{
|
2006-11-01 15:23:26 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if( xNewDlg->isExportAsPackage() )
|
|
|
|
ExportAsPackage( aLibName );
|
|
|
|
else
|
|
|
|
ExportAsBasic( aLibName );
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const util::VetoException& ) // user cancled operation
|
2006-11-01 15:23:26 +00:00
|
|
|
{
|
|
|
|
}
|
2006-04-07 07:44:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LibPage::implExportLib( const String& aLibName, const String& aTargetURL,
|
2006-11-01 15:23:26 +00:00
|
|
|
const Reference< task::XInteractionHandler >& Handler )
|
2006-04-07 07:44:22 +00:00
|
|
|
{
|
|
|
|
::rtl::OUString aOULibName( aLibName );
|
|
|
|
Reference< script::XLibraryContainerExport > xModLibContainerExport
|
2007-03-15 14:58:04 +00:00
|
|
|
( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
2006-04-07 07:44:22 +00:00
|
|
|
Reference< script::XLibraryContainerExport > xDlgLibContainerExport
|
2007-03-15 14:58:04 +00:00
|
|
|
( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2006-04-07 07:44:22 +00:00
|
|
|
if ( xModLibContainerExport.is() )
|
|
|
|
xModLibContainerExport->exportLibrary( aOULibName, aTargetURL, Handler );
|
|
|
|
|
|
|
|
if ( xDlgLibContainerExport.is() )
|
|
|
|
xDlgLibContainerExport->exportLibrary( aOULibName, aTargetURL, Handler );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
// Implementation XCommandEnvironment
|
|
|
|
|
|
|
|
typedef cppu::WeakImplHelper1< XCommandEnvironment > LibCommandEnvironmentHelper;
|
|
|
|
|
|
|
|
class OLibCommandEnvironment : public LibCommandEnvironmentHelper
|
|
|
|
{
|
|
|
|
Reference< task::XInteractionHandler > mxInteraction;
|
|
|
|
|
|
|
|
public:
|
|
|
|
OLibCommandEnvironment( Reference< task::XInteractionHandler > xInteraction )
|
|
|
|
: mxInteraction( xInteraction )
|
|
|
|
{}
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
virtual Reference< task::XInteractionHandler > SAL_CALL getInteractionHandler()
|
|
|
|
throw(RuntimeException);
|
|
|
|
virtual Reference< XProgressHandler > SAL_CALL getProgressHandler()
|
|
|
|
throw(RuntimeException);
|
|
|
|
};
|
|
|
|
|
|
|
|
Reference< task::XInteractionHandler > OLibCommandEnvironment::getInteractionHandler()
|
|
|
|
throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return mxInteraction;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XProgressHandler > OLibCommandEnvironment::getProgressHandler()
|
|
|
|
throw(RuntimeException)
|
|
|
|
{
|
|
|
|
Reference< XProgressHandler > xRet;
|
|
|
|
return xRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LibPage::ExportAsPackage( const String& aLibName )
|
|
|
|
{
|
|
|
|
// file open dialog
|
|
|
|
Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
|
|
|
|
Reference< task::XInteractionHandler > xHandler;
|
2012-05-29 17:17:28 +02:00
|
|
|
Reference< XSimpleFileAccess2 > xSFA;
|
2006-04-07 07:44:22 +00:00
|
|
|
Reference < XFilePicker > xFP;
|
|
|
|
if( xMSF.is() )
|
|
|
|
{
|
|
|
|
xHandler = Reference< task::XInteractionHandler >( xMSF->createInstance
|
|
|
|
( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), UNO_QUERY );
|
|
|
|
|
2012-05-29 17:17:28 +02:00
|
|
|
xSFA = SimpleFileAccess::create(comphelper::getProcessComponentContext());
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
Sequence <Any> aServiceType(1);
|
|
|
|
aServiceType[0] <<= TemplateDescription::FILESAVE_SIMPLE;
|
|
|
|
xFP = Reference< XFilePicker >( xMSF->createInstanceWithArguments(
|
|
|
|
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY );
|
|
|
|
}
|
|
|
|
xFP->setTitle( String( IDEResId( RID_STR_EXPORTPACKAGE ) ) );
|
|
|
|
|
|
|
|
// filter
|
|
|
|
::rtl::OUString aTitle = String( IDEResId( RID_STR_PACKAGE_BUNDLE ) );
|
|
|
|
::rtl::OUString aFilter;
|
2006-10-04 15:23:17 +00:00
|
|
|
aFilter = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.oxt" ) ); // library files
|
2006-04-07 07:44:22 +00:00
|
|
|
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
|
|
|
|
xFltMgr->appendFilter( aTitle, aFilter );
|
|
|
|
|
|
|
|
// set display directory and filter
|
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 aPath = GetExtraData()->GetAddLibPath();
|
2006-04-07 07:44:22 +00:00
|
|
|
if ( aPath.Len() )
|
|
|
|
{
|
|
|
|
xFP->setDisplayDirectory( aPath );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// macro path from configuration management
|
|
|
|
xFP->setDisplayDirectory( SvtPathOptions().GetWorkPath() );
|
|
|
|
}
|
|
|
|
xFltMgr->setCurrentFilter( aTitle );
|
|
|
|
|
|
|
|
if ( xFP->execute() == RET_OK )
|
|
|
|
{
|
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()->SetAddLibPath(xFP->getDisplayDirectory());
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
Sequence< ::rtl::OUString > aFiles = xFP->getFiles();
|
|
|
|
INetURLObject aURL( aFiles[0] );
|
2011-12-09 22:23:22 -02:00
|
|
|
if( aURL.getExtension().isEmpty() )
|
2006-10-04 15:23:17 +00:00
|
|
|
aURL.setExtension( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "oxt" ) ) );
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
::rtl::OUString aPackageURL( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
|
|
|
|
|
|
|
|
String aTmpPath = SvtPathOptions().GetTempPath();
|
|
|
|
INetURLObject aInetObj( aTmpPath );
|
2012-08-07 08:36:40 +02:00
|
|
|
aInetObj.insertName( aLibName, true, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL );
|
2006-04-07 07:44:22 +00:00
|
|
|
OUString aSourcePath = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
|
|
|
|
if( xSFA->exists( aSourcePath ) )
|
|
|
|
xSFA->kill( aSourcePath );
|
2006-11-01 15:23:26 +00:00
|
|
|
Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
|
2006-04-07 07:44:22 +00:00
|
|
|
implExportLib( aLibName, aTmpPath, xDummyHandler );
|
|
|
|
|
|
|
|
Reference< XCommandEnvironment > xCmdEnv =
|
|
|
|
static_cast<XCommandEnvironment*>( new OLibCommandEnvironment( xHandler ) );
|
|
|
|
|
2007-06-05 16:48:45 +00:00
|
|
|
::ucbhelper::Content sourceContent( aSourcePath, xCmdEnv );
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
::rtl::OUStringBuffer buf;
|
|
|
|
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") );
|
|
|
|
buf.append( ::rtl::Uri::encode( aPackageURL,
|
|
|
|
rtl_UriCharClassRegName,
|
|
|
|
rtl_UriEncodeIgnoreEscapes,
|
|
|
|
RTL_TEXTENCODING_UTF8 ) );
|
|
|
|
buf.append( static_cast<sal_Unicode>('/') );
|
|
|
|
OUString destFolder( buf.makeStringAndClear() );
|
|
|
|
|
|
|
|
if( xSFA->exists( aPackageURL ) )
|
|
|
|
xSFA->kill( aPackageURL );
|
|
|
|
|
2007-06-05 16:48:45 +00:00
|
|
|
::ucbhelper::Content destFolderContent( destFolder, xCmdEnv );
|
2006-04-07 07:44:22 +00:00
|
|
|
destFolderContent.transferContent(
|
2007-06-05 16:48:45 +00:00
|
|
|
sourceContent, ::ucbhelper::InsertOperation_COPY,
|
2006-04-07 07:44:22 +00:00
|
|
|
OUString(), NameClash::OVERWRITE );
|
|
|
|
|
|
|
|
INetURLObject aMetaInfInetObj( aTmpPath );
|
|
|
|
aMetaInfInetObj.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ),
|
2012-08-07 08:36:40 +02:00
|
|
|
true, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL );
|
2006-04-07 07:44:22 +00:00
|
|
|
OUString aMetaInfFolder = aMetaInfInetObj.GetMainURL( INetURLObject::NO_DECODE );
|
|
|
|
if( xSFA->exists( aMetaInfFolder ) )
|
|
|
|
xSFA->kill( aMetaInfFolder );
|
|
|
|
xSFA->createFolder( aMetaInfFolder );
|
|
|
|
|
|
|
|
::std::vector< Sequence<beans::PropertyValue> > manifest;
|
|
|
|
const OUString strMediaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) );
|
|
|
|
const OUString strFullPath = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FullPath" ) );
|
|
|
|
const OUString strBasicMediaType = ::rtl::OUString
|
|
|
|
( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.basic-library" ) );
|
|
|
|
|
|
|
|
Sequence<beans::PropertyValue> attribs( 2 );
|
|
|
|
beans::PropertyValue * pattribs = attribs.getArray();
|
|
|
|
pattribs[ 0 ].Name = strFullPath;
|
|
|
|
OUString fullPath = aLibName;
|
|
|
|
fullPath += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/") );
|
|
|
|
pattribs[ 0 ].Value <<= fullPath;
|
|
|
|
pattribs[ 1 ].Name = strMediaType;
|
|
|
|
pattribs[ 1 ].Value <<= strBasicMediaType;
|
|
|
|
manifest.push_back( attribs );
|
|
|
|
|
|
|
|
// write into pipe:
|
|
|
|
Reference<packages::manifest::XManifestWriter> xManifestWriter( xMSF->createInstance
|
|
|
|
( DEFINE_CONST_UNICODE("com.sun.star.packages.manifest.ManifestWriter") ), UNO_QUERY );
|
2012-09-03 14:20:24 +02:00
|
|
|
Reference<io::XOutputStream> xPipe( io::Pipe::create(comphelper::ComponentContext(xMSF).getUNOContext()), UNO_QUERY_THROW );
|
2006-04-07 07:44:22 +00:00
|
|
|
xManifestWriter->writeManifestSequence(
|
|
|
|
xPipe, Sequence< Sequence<beans::PropertyValue> >(
|
|
|
|
&manifest[ 0 ], manifest.size() ) );
|
|
|
|
|
|
|
|
aMetaInfInetObj.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "manifest.xml" ) ),
|
2012-08-07 08:36:40 +02:00
|
|
|
true, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL );
|
2006-04-07 07:44:22 +00:00
|
|
|
|
|
|
|
// write buffered pipe data to content:
|
2007-06-05 16:48:45 +00:00
|
|
|
::ucbhelper::Content manifestContent( aMetaInfInetObj.GetMainURL( INetURLObject::NO_DECODE ), xCmdEnv );
|
2006-04-07 07:44:22 +00:00
|
|
|
manifestContent.writeStream( Reference<io::XInputStream>( xPipe, UNO_QUERY_THROW ), true );
|
|
|
|
|
2007-06-05 16:48:45 +00:00
|
|
|
::ucbhelper::Content MetaInfContent( aMetaInfFolder, xCmdEnv );
|
2006-04-07 07:44:22 +00:00
|
|
|
destFolderContent.transferContent(
|
2007-06-05 16:48:45 +00:00
|
|
|
MetaInfContent, ::ucbhelper::InsertOperation_COPY,
|
2006-04-07 07:44:22 +00:00
|
|
|
OUString(), NameClash::OVERWRITE );
|
|
|
|
|
|
|
|
if( xSFA->exists( aSourcePath ) )
|
|
|
|
xSFA->kill( aSourcePath );
|
|
|
|
if( xSFA->exists( aMetaInfFolder ) )
|
|
|
|
xSFA->kill( aMetaInfFolder );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LibPage::ExportAsBasic( const String& aLibName )
|
|
|
|
{
|
|
|
|
// Folder picker
|
|
|
|
Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
|
|
|
|
Reference< XFolderPicker > xFolderPicker;
|
|
|
|
Reference< task::XInteractionHandler > xHandler;
|
|
|
|
if( xMSF.is() )
|
|
|
|
{
|
|
|
|
xFolderPicker = Reference< XFolderPicker >( xMSF->createInstance(
|
|
|
|
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ) ) ), UNO_QUERY );
|
|
|
|
|
|
|
|
xHandler = Reference< task::XInteractionHandler >( xMSF->createInstance
|
|
|
|
( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), UNO_QUERY );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( xFolderPicker.is() )
|
|
|
|
{
|
|
|
|
xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
|
|
|
|
|
|
|
|
// set display directory and filter
|
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 aPath =GetExtraData()->GetAddLibPath();
|
2006-04-07 07:44:22 +00:00
|
|
|
if( !aPath.Len() )
|
|
|
|
aPath = SvtPathOptions().GetWorkPath();
|
|
|
|
|
|
|
|
// INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
|
|
|
|
xFolderPicker->setDisplayDirectory( aPath );
|
|
|
|
short nRet = xFolderPicker->execute();
|
|
|
|
if( nRet == RET_OK )
|
|
|
|
{
|
|
|
|
String aTargetURL = xFolderPicker->getDirectory();
|
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()->SetAddLibPath(aTargetURL);
|
2006-04-07 07:44:22 +00:00
|
|
|
|
2006-11-01 15:23:26 +00:00
|
|
|
Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
|
2006-04-07 07:44:22 +00:00
|
|
|
implExportLib( aLibName, aTargetURL, xDummyHandler );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
void LibPage::DeleteCurrent()
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry();
|
|
|
|
String aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
|
2001-10-22 14:33:31 +00:00
|
|
|
|
|
|
|
// check, if library is link
|
2012-08-01 10:05:20 +09:00
|
|
|
bool bIsLibraryLink = false;
|
2001-10-22 14:33:31 +00:00
|
|
|
::rtl::OUString aOULibName( aLibName );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2001-11-29 15:04:45 +00:00
|
|
|
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryLink( aOULibName ) ) ||
|
|
|
|
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryLink( aOULibName ) ) )
|
2001-10-22 14:33:31 +00:00
|
|
|
{
|
2012-08-01 10:05:20 +09:00
|
|
|
bIsLibraryLink = true;
|
2001-10-22 14:33:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( QueryDelLib( aLibName, bIsLibraryLink, this ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-08-29 11:29:09 +00:00
|
|
|
// inform BasicIDE
|
2007-03-15 14:58:04 +00:00
|
|
|
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) );
|
2004-07-23 11:05:59 +00:00
|
|
|
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, 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
|
|
|
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
2000-09-29 10:02:42 +00:00
|
|
|
pDispatcher->Execute( SID_BASICIDE_LIBREMOVED,
|
2007-03-15 14:58:04 +00:00
|
|
|
SFX_CALLMODE_SYNCHRON, &aDocItem, &aLibNameItem, 0L );
|
2001-08-29 11:29:09 +00:00
|
|
|
|
|
|
|
// remove library from module and dialog library containers
|
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) )
|
|
|
|
xModLibContainer->removeLibrary( aOULibName );
|
|
|
|
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) )
|
|
|
|
xDlgLibContainer->removeLibrary( aOULibName );
|
|
|
|
|
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<SvLBox&>(aLibBox).GetModel()->Remove( pCurEntry );
|
|
|
|
MarkDocumentModified( m_aCurDocument );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
void LibPage::EndTabDialog( sal_uInt16 nRet )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( pTabDlg, "TabDlg nicht gesetzt!" );
|
|
|
|
if ( pTabDlg )
|
|
|
|
pTabDlg->EndDialog( nRet );
|
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
void LibPage::FillListBox()
|
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
InsertListBoxEntry( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_USER );
|
|
|
|
InsertListBoxEntry( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_SHARE );
|
|
|
|
|
2007-10-09 14:24:16 +00:00
|
|
|
ScriptDocuments aDocuments( ScriptDocument::getAllScriptDocuments( ScriptDocument::DocumentsSorted ) );
|
2007-03-15 14:58:04 +00:00
|
|
|
for ( ScriptDocuments::const_iterator doc = aDocuments.begin();
|
|
|
|
doc != aDocuments.end();
|
|
|
|
++doc
|
|
|
|
)
|
2004-07-23 11:05:59 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
InsertListBoxEntry( *doc, LIBRARY_LOCATION_DOCUMENT );
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2007-03-15 14:58:04 +00:00
|
|
|
void LibPage::InsertListBoxEntry( const ScriptDocument& rDocument, LibraryLocation eLocation )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
String aEntryText( rDocument.getTitle( eLocation ) );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nPos = aBasicsBox.InsertEntry( aEntryText, LISTBOX_APPEND );
|
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
|
|
|
aBasicsBox.SetEntryData( nPos, new DocumentEntry(rDocument, eLocation) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2001-11-07 09:18:27 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
void LibPage::SetCurLib()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nSelPos = aBasicsBox.GetSelectEntryPos();
|
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
|
|
|
DocumentEntry* pEntry = (DocumentEntry*)aBasicsBox.GetEntryData( nSelPos );
|
2004-07-23 11:05:59 +00:00
|
|
|
if ( pEntry )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
ScriptDocument aDocument( pEntry->GetDocument() );
|
2007-10-09 14:24:16 +00:00
|
|
|
DBG_ASSERT( aDocument.isAlive(), "LibPage::SetCurLib: no document, or document is dead!" );
|
|
|
|
if ( !aDocument.isAlive() )
|
2007-03-15 14:58:04 +00:00
|
|
|
return;
|
2004-07-23 11:05:59 +00:00
|
|
|
LibraryLocation eLocation = pEntry->GetLocation();
|
2007-03-15 14:58:04 +00:00
|
|
|
if ( aDocument != m_aCurDocument || eLocation != m_eCurLocation )
|
2001-11-07 09:18:27 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
m_aCurDocument = aDocument;
|
2004-07-23 11:05:59 +00:00
|
|
|
m_eCurLocation = eLocation;
|
2007-03-15 14:58:04 +00:00
|
|
|
aLibBox.SetDocument( aDocument );
|
2004-07-23 11:05:59 +00:00
|
|
|
aLibBox.Clear();
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2004-07-23 11:05:59 +00:00
|
|
|
// get a sorted list of library names
|
2007-03-15 14:58:04 +00:00
|
|
|
Sequence< ::rtl::OUString > aLibNames = aDocument.getLibraryNames();
|
2004-07-23 11:05:59 +00:00
|
|
|
sal_Int32 nLibCount = aLibNames.getLength();
|
|
|
|
const ::rtl::OUString* pLibNames = aLibNames.getConstArray();
|
|
|
|
|
|
|
|
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
|
|
|
|
{
|
|
|
|
String aLibName( pLibNames[ i ] );
|
2007-03-15 14:58:04 +00:00
|
|
|
if ( eLocation == aDocument.getLibraryLocation( aLibName ) )
|
2004-07-23 11:05:59 +00:00
|
|
|
ImpInsertLibEntry( aLibName, i );
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2004-07-23 11:05:59 +00:00
|
|
|
|
2012-07-02 16:02:38 +01:00
|
|
|
SvLBoxEntry* pEntry_ = aLibBox.FindEntry( rtl::OUString("Standard") );
|
2007-01-16 15:32:29 +00:00
|
|
|
if ( !pEntry_ )
|
|
|
|
pEntry_ = aLibBox.GetEntry( 0 );
|
|
|
|
aLibBox.SetCurEntry( pEntry_ );
|
2001-11-07 09:18:27 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
SvLBoxEntry* LibPage::ImpInsertLibEntry( const String& rLibName, sal_uLong nPos )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
// check, if library is password protected
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bProtected = false;
|
2001-11-07 09:18:27 +00:00
|
|
|
::rtl::OUString aOULibName( rLibName );
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
|
2001-11-07 09:18:27 +00:00
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
|
|
|
if ( xPasswd.is() )
|
|
|
|
{
|
|
|
|
bProtected = xPasswd->isLibraryPasswordProtected( aOULibName );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2007-01-16 15:32:29 +00:00
|
|
|
SvLBoxEntry* pNewEntry = aLibBox.DoInsertEntry( rLibName, nPos );
|
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
|
|
|
pNewEntry->SetUserData( new LibUserData(m_aCurDocument) );
|
2001-08-29 11:29:09 +00:00
|
|
|
|
2002-07-03 14:59:32 +00:00
|
|
|
if (bProtected)
|
|
|
|
{
|
|
|
|
Image aImage(IDEResId(RID_IMG_LOCKED));
|
2010-11-09 20:07:12 -08:00
|
|
|
aLibBox.SetExpandedEntryBmp(pNewEntry, aImage);
|
|
|
|
aLibBox.SetCollapsedEntryBmp(pNewEntry, aImage);
|
2002-07-03 14:59:32 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
// check, if library is link
|
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryLink( aOULibName ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-11-07 09:18:27 +00:00
|
|
|
String aLinkURL = xModLibContainer->getLibraryLinkURL( aOULibName );
|
|
|
|
aLibBox.SetEntryText( aLinkURL, pNewEntry, 1 );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
return pNewEntry;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 09:18:27 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2002-07-30 12:10:28 +00:00
|
|
|
|
|
|
|
// Helper function
|
2007-03-15 14:58:04 +00:00
|
|
|
void createLibImpl( Window* pWin, const ScriptDocument& rDocument,
|
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
|
|
|
CheckBox* pLibBox, TreeListBox* pBasicBox )
|
2002-07-30 12:10:28 +00:00
|
|
|
{
|
2007-10-09 14:24:16 +00:00
|
|
|
OSL_ENSURE( rDocument.isAlive(), "createLibImpl: invalid document!" );
|
|
|
|
if ( !rDocument.isAlive() )
|
2007-03-15 14:58:04 +00:00
|
|
|
return;
|
|
|
|
|
2002-07-30 12:10:28 +00:00
|
|
|
// create library name
|
|
|
|
String aLibName;
|
|
|
|
String aLibStdName( String( RTL_CONSTASCII_USTRINGPARAM( "Library" ) ) );
|
|
|
|
//String aLibStdName( IDEResId( RID_STR_STDLIBNAME ) );
|
2012-08-01 10:05:20 +09:00
|
|
|
bool bValid = false;
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 i = 1;
|
2002-07-30 12:10:28 +00:00
|
|
|
while ( !bValid )
|
|
|
|
{
|
|
|
|
aLibName = aLibStdName;
|
|
|
|
aLibName += String::CreateFromInt32( i );
|
2007-03-15 14:58:04 +00:00
|
|
|
if ( !rDocument.hasLibrary( E_SCRIPTS, aLibName ) && !rDocument.hasLibrary( E_DIALOGS, aLibName ) )
|
2012-08-01 10:05:20 +09:00
|
|
|
bValid = true;
|
2002-07-30 12:10:28 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::auto_ptr< NewObjectDialog > xNewDlg( new NewObjectDialog( pWin, NEWOBJECTMODE_LIB ) );
|
|
|
|
xNewDlg->SetObjectName( aLibName );
|
|
|
|
|
|
|
|
if ( xNewDlg->Execute() )
|
|
|
|
{
|
|
|
|
if ( xNewDlg->GetObjectName().Len() )
|
|
|
|
aLibName = xNewDlg->GetObjectName();
|
|
|
|
|
|
|
|
if ( aLibName.Len() > 30 )
|
|
|
|
{
|
|
|
|
ErrorBox( pWin, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_LIBNAMETOLONG ) ) ).Execute();
|
|
|
|
}
|
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 ( !IsValidSbxName( aLibName ) )
|
2002-07-30 12:10:28 +00:00
|
|
|
{
|
|
|
|
ErrorBox( pWin, WB_OK | WB_DEF_OK,
|
|
|
|
String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute();
|
|
|
|
}
|
2007-03-15 14:58:04 +00:00
|
|
|
else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) )
|
2002-07-30 12:10:28 +00:00
|
|
|
{
|
|
|
|
ErrorBox( pWin, WB_OK | WB_DEF_OK,
|
|
|
|
String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// create module and dialog library
|
2007-03-15 14:58:04 +00:00
|
|
|
Reference< container::XNameContainer > xModLib( rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ) );
|
|
|
|
Reference< container::XNameContainer > xDlgLib( rDocument.getOrCreateLibrary( E_DIALOGS, aLibName ) );
|
2002-07-30 12:10:28 +00:00
|
|
|
|
|
|
|
if( pLibBox )
|
|
|
|
{
|
2007-01-16 15:32:29 +00:00
|
|
|
SvLBoxEntry* pEntry = pLibBox->DoInsertEntry( 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
|
|
|
pEntry->SetUserData( new LibUserData( rDocument ) );
|
2002-07-30 12:10:28 +00:00
|
|
|
pLibBox->SetCurEntry( pEntry );
|
|
|
|
}
|
|
|
|
|
|
|
|
// create a module
|
2007-03-15 14:58:04 +00:00
|
|
|
String aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
|
|
|
|
::rtl::OUString sModuleCode;
|
2012-08-07 08:36:40 +02:00
|
|
|
if ( !rDocument.createModule( aLibName, aModName, true, sModuleCode ) )
|
2007-03-15 14:58:04 +00:00
|
|
|
throw Exception();
|
|
|
|
|
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
|
|
|
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
|
|
|
|
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
2002-07-30 12:10:28 +00:00
|
|
|
pDispatcher->Execute( SID_BASICIDE_SBXINSERTED,
|
|
|
|
SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L );
|
|
|
|
|
|
|
|
if( pBasicBox )
|
|
|
|
{
|
|
|
|
SvLBoxEntry* pEntry = pBasicBox->GetCurEntry();
|
|
|
|
SvLBoxEntry* pRootEntry = NULL;
|
|
|
|
while( pEntry )
|
|
|
|
{
|
|
|
|
pRootEntry = pEntry;
|
|
|
|
pEntry = pBasicBox->GetParent( pEntry );
|
|
|
|
}
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nMode = pBasicBox->GetMode();
|
2004-07-23 11:05:59 +00:00
|
|
|
bool bDlgMode = ( nMode & BROWSEMODE_DIALOGS ) && !( nMode & BROWSEMODE_MODULES );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nId = bDlgMode ? RID_IMG_DLGLIB : RID_IMG_MODLIB;
|
2004-07-23 11:05:59 +00:00
|
|
|
SvLBoxEntry* pNewLibEntry = pBasicBox->AddEntry(
|
|
|
|
aLibName,
|
|
|
|
Image( IDEResId( nId ) ),
|
|
|
|
pRootEntry, false,
|
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
|
|
|
std::auto_ptr<Entry>(new Entry(OBJ_TYPE_LIBRARY))
|
|
|
|
);
|
2002-07-30 12:10:28 +00:00
|
|
|
DBG_ASSERT( pNewLibEntry, "InsertEntry fehlgeschlagen!" );
|
|
|
|
|
|
|
|
if( pNewLibEntry )
|
|
|
|
{
|
2007-01-16 15:32:29 +00:00
|
|
|
SvLBoxEntry* pEntry_ = pBasicBox->AddEntry(
|
2004-07-23 11:05:59 +00:00
|
|
|
aModName,
|
|
|
|
Image( IDEResId( RID_IMG_MODULE ) ),
|
|
|
|
pNewLibEntry, false,
|
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
|
|
|
std::auto_ptr<Entry>(new Entry(OBJ_TYPE_MODULE))
|
|
|
|
);
|
2007-01-16 15:32:29 +00:00
|
|
|
DBG_ASSERT( pEntry_, "InsertEntry fehlgeschlagen!" );
|
|
|
|
pBasicBox->SetCurEntry( pEntry_ );
|
2002-07-30 12:10:28 +00:00
|
|
|
pBasicBox->Select( pBasicBox->GetCurEntry() ); // OV-Bug?!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch (const uno::Exception& )
|
2002-07-30 12:10:28 +00:00
|
|
|
{
|
2007-03-15 14:58:04 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2002-07-30 12:10:28 +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: */
|