2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-11-21 23:33:54 -05:00
|
|
|
#include "basidesh.hrc"
|
|
|
|
#include "helpid.hrc"
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-11-21 23:33:54 -05:00
|
|
|
#include "accessibledialogwindow.hxx"
|
|
|
|
#include "baside3.hxx"
|
|
|
|
#include "basidesh.hxx"
|
|
|
|
#include "bastype2.hxx"
|
|
|
|
#include "dlged.hxx"
|
|
|
|
#include "dlgeddef.hxx"
|
|
|
|
#include "dlgedmod.hxx"
|
|
|
|
#include "dlgedview.hxx"
|
|
|
|
#include "iderdll.hxx"
|
|
|
|
#include "idetemp.hxx"
|
|
|
|
#include "localizationmgr.hxx"
|
|
|
|
#include "propbrw.hxx"
|
2012-08-17 07:29:20 +02:00
|
|
|
#include "objdlg.hxx"
|
2001-07-27 17:06:15 +00:00
|
|
|
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <basic/basmgr.hxx>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <com/sun/star/resource/StringResourceWithLocation.hpp>
|
2012-05-29 17:17:28 +02:00
|
|
|
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
|
|
|
|
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
|
2013-02-12 09:23:05 +02:00
|
|
|
#include <com/sun/star/ui/dialogs/FilePicker.hpp>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
|
|
|
|
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/dinfdlg.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <svl/aeitem.hxx>
|
2012-08-17 07:29:20 +02:00
|
|
|
#include <svl/visitem.hxx>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <svl/whiter.hxx>
|
2007-02-12 13:49:53 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2007-06-26 15:51:32 +00:00
|
|
|
#include <tools/urlobj.hxx>
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <vcl/msgbox.hxx>
|
2001-03-03 14:08:22 +00:00
|
|
|
#include <xmlscript/xmldlg_imexp.hxx>
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2001-03-03 14:08:22 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
2007-06-26 15:51:32 +00:00
|
|
|
using namespace ::com::sun::star::ucb;
|
2001-03-19 11:42:53 +00:00
|
|
|
using namespace ::com::sun::star::io;
|
2007-06-26 15:51:32 +00:00
|
|
|
using namespace ::com::sun::star::resource;
|
|
|
|
using namespace ::com::sun::star::ui::dialogs;
|
|
|
|
|
2010-06-30 09:48:27 +02:00
|
|
|
#if defined(UNX)
|
2012-09-02 16:21:08 +02:00
|
|
|
char const FilterMask_All[] = "*";
|
2007-06-26 15:51:32 +00:00
|
|
|
#else
|
2012-09-02 16:21:08 +02:00
|
|
|
char const FilterMask_All[] = "*.*";
|
2007-06-26 15:51:32 +00:00
|
|
|
#endif
|
2001-03-03 14:08:22 +00:00
|
|
|
|
2007-06-29 15:33:32 +00:00
|
|
|
DBG_NAME( DialogWindow )
|
|
|
|
|
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
|
|
|
TYPEINIT1( DialogWindow, BaseWindow );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
DialogWindow::DialogWindow (
|
|
|
|
DialogWindowLayout* pParent,
|
|
|
|
ScriptDocument const& rDocument,
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName, OUString aName,
|
2012-08-17 07:29:20 +02:00
|
|
|
com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> const& xDialogModel
|
|
|
|
) :
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow(pParent, rDocument, aLibName, aName),
|
2012-08-17 07:29:20 +02:00
|
|
|
rLayout(*pParent),
|
2012-09-02 16:21:08 +02:00
|
|
|
pEditor(new DlgEditor(*this, rLayout, rDocument.isDocument() ? rDocument.getDocument() : Reference<frame::XModel>(), xDialogModel)),
|
|
|
|
pUndoMgr(new SfxUndoManager)
|
2001-03-03 14:08:22 +00:00
|
|
|
{
|
2012-08-02 10:21:00 +09:00
|
|
|
InitSettings( true, true, true );
|
2001-03-03 14:08:22 +00:00
|
|
|
|
2012-09-02 16:21:08 +02:00
|
|
|
aOldNotifyUndoActionHdl = pEditor->GetModel().GetNotifyUndoActionHdl();
|
|
|
|
pEditor->GetModel().SetNotifyUndoActionHdl(
|
|
|
|
LINK(this, DialogWindow, NotifyUndoActionHdl)
|
|
|
|
);
|
2001-03-03 14:08:22 +00:00
|
|
|
|
|
|
|
SetHelpId( HID_BASICIDE_DIALOGWINDOW );
|
2001-11-12 21:39:49 +00:00
|
|
|
|
|
|
|
// set readonly mode for readonly libraries
|
2007-03-15 14:53:05 +00:00
|
|
|
Reference< script::XLibraryContainer2 > xDlgLibContainer( GetDocument().getLibraryContainer( E_DIALOGS ), UNO_QUERY );
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) )
|
2012-08-07 08:36:40 +02:00
|
|
|
SetReadOnly(true);
|
2001-11-12 21:39:49 +00:00
|
|
|
|
2007-03-15 14:53:05 +00:00
|
|
|
if ( rDocument.isDocument() && rDocument.isReadOnly() )
|
2012-08-07 08:36:40 +02:00
|
|
|
SetReadOnly(true);
|
2001-03-03 14:08:22 +00:00
|
|
|
}
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
DialogWindow::~DialogWindow()
|
2012-09-02 16:21:08 +02:00
|
|
|
{ }
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
void DialogWindow::LoseFocus()
|
|
|
|
{
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( IsModified() )
|
2001-06-15 07:45:19 +00:00
|
|
|
StoreData();
|
2001-09-25 08:14:46 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
Window::LoseFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::Paint( const Rectangle& rRect )
|
|
|
|
{
|
|
|
|
pEditor->Paint( rRect );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::Resize()
|
|
|
|
{
|
2001-02-26 10:14:44 +00:00
|
|
|
if ( GetHScrollBar() && GetVScrollBar() ) {
|
|
|
|
pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
pEditor->MouseButtonDown( rMEvt );
|
2001-11-14 09:53:42 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_SHOW_PROPERTYBROWSER );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
pEditor->MouseButtonUp( rMEvt );
|
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( (pEditor->GetMode() == DlgEditor::INSERT) && !pEditor->IsCreateOK() )
|
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
|
|
|
pEditor->SetMode( DlgEditor::SELECT );
|
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_CHOOSE_CONTROLS );
|
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
{
|
|
|
|
pBindings->Invalidate( SID_SHOW_PROPERTYBROWSER );
|
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
|
|
|
pBindings->Invalidate( SID_SAVEDOC );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::MouseMove( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
pEditor->MouseMove( rMEvt );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DialogWindow::KeyInput( const KeyEvent& rKEvt )
|
|
|
|
{
|
|
|
|
if( rKEvt.GetKeyCode() == KEY_BACKSPACE )
|
|
|
|
{
|
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_BACKSPACE );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (rKEvt.GetKeyCode() == KEY_TAB)
|
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
|
|
|
pBindings->Invalidate( SID_SHOW_PROPERTYBROWSER );
|
2008-01-28 13:03:36 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
if( !pEditor->KeyInput( rKEvt ) )
|
|
|
|
{
|
|
|
|
if( !SfxViewShell::Current()->KeyInput( rKEvt ) )
|
|
|
|
Window::KeyInput( rKEvt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindow::Command( const CommandEvent& rCEvt )
|
|
|
|
{
|
2010-11-13 00:33:43 -08:00
|
|
|
if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
|
|
|
|
( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
|
|
|
|
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
HandleScrollCommand( rCEvt, GetHScrollBar(), GetVScrollBar() );
|
|
|
|
}
|
2001-10-17 09:17:18 +00:00
|
|
|
else if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
|
|
|
|
{
|
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())
|
2002-11-05 07:59:43 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
SdrView& rView = GetView();
|
|
|
|
if( !rCEvt.IsMouseEvent() && rView.AreObjectsMarked() )
|
2002-11-05 07:59:43 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
Rectangle aMarkedRect( rView.GetMarkedRect() );
|
2002-11-05 07:59:43 +00:00
|
|
|
Point MarkedCenter( aMarkedRect.Center() );
|
|
|
|
Point PosPixel( LogicToPixel( MarkedCenter ) );
|
|
|
|
pDispatcher->ExecutePopup( IDEResId(RID_POPUP_DLGED), this, &PosPixel );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pDispatcher->ExecutePopup( IDEResId(RID_POPUP_DLGED) );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2001-10-17 09:17:18 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow::Command( rCEvt );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( DialogWindow, NotifyUndoActionHdl, SfxUndoAction *, pUndoAction )
|
|
|
|
{
|
2007-01-16 15:29:09 +00:00
|
|
|
(void)pUndoAction;
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void DialogWindow::DoInit()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
GetHScrollBar()->Show();
|
|
|
|
GetVScrollBar()->Show();
|
|
|
|
pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void DialogWindow::DoScroll( ScrollBar* pCurScrollBar )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
pEditor->DoScroll( pCurScrollBar );
|
|
|
|
}
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void DialogWindow::GetState( SfxItemSet& rSet )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
SfxWhichIter aIter(rSet);
|
2011-12-05 09:56:17 +00:00
|
|
|
bool bIsCalc = false;
|
|
|
|
if ( GetDocument().isDocument() )
|
|
|
|
{
|
|
|
|
Reference< frame::XModel > xModel= GetDocument().getDocument();
|
|
|
|
if ( xModel.is() )
|
|
|
|
{
|
|
|
|
Reference< lang::XServiceInfo > xServiceInfo ( xModel, UNO_QUERY );
|
2012-10-02 11:31:09 -03:00
|
|
|
if ( xServiceInfo.is() && xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
|
2011-12-05 09:56:17 +00:00
|
|
|
bIsCalc = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
switch ( nWh )
|
|
|
|
{
|
|
|
|
case SID_PASTE:
|
2001-10-17 09:17:18 +00:00
|
|
|
{
|
2001-11-12 21:39:49 +00:00
|
|
|
if ( !IsPasteAllowed() )
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
|
|
|
|
if ( IsReadOnly() )
|
2001-10-17 09:17:18 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
|
|
|
case SID_COPY:
|
2001-11-12 21:39:49 +00:00
|
|
|
{
|
|
|
|
// any object selected?
|
2012-09-02 16:21:08 +02:00
|
|
|
if ( !pEditor->GetView().AreObjectsMarked() )
|
2001-11-12 21:39:49 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_CUT:
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_DELETE:
|
|
|
|
case SID_BACKSPACE:
|
|
|
|
{
|
2001-10-17 09:17:18 +00:00
|
|
|
// any object selected?
|
2012-09-02 16:21:08 +02:00
|
|
|
if ( !pEditor->GetView().AreObjectsMarked() )
|
2001-10-17 09:17:18 +00:00
|
|
|
rSet.DisableItem( nWh );
|
2001-11-12 21:39:49 +00:00
|
|
|
|
|
|
|
if ( IsReadOnly() )
|
|
|
|
rSet.DisableItem( nWh );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_REDO:
|
|
|
|
{
|
|
|
|
if ( !pUndoMgr->GetUndoActionCount() )
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DIALOG_TESTMODE:
|
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// is the IDE still active?
|
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 const bBool = GetShell()->GetFrame() &&
|
|
|
|
pEditor->GetMode() == DlgEditor::TEST;
|
2012-08-07 08:36:40 +02:00
|
|
|
rSet.Put(SfxBoolItem(SID_DIALOG_TESTMODE, bBool));
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CHOOSE_CONTROLS:
|
|
|
|
{
|
2001-11-12 21:39:49 +00:00
|
|
|
if ( IsReadOnly() )
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
|
|
|
{
|
2001-11-12 21:39:49 +00:00
|
|
|
SfxAllEnumItem aItem( SID_CHOOSE_CONTROLS );
|
2012-09-02 16:21:08 +02:00
|
|
|
if ( GetEditor().GetMode() == DlgEditor::SELECT )
|
2001-11-12 21:39:49 +00:00
|
|
|
aItem.SetValue( SVX_SNAP_SELECT );
|
|
|
|
else
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nObj;
|
2001-11-12 21:39:49 +00:00
|
|
|
switch( pEditor->GetInsertObj() )
|
|
|
|
{
|
|
|
|
case OBJ_DLG_PUSHBUTTON: nObj = SVX_SNAP_PUSHBUTTON; break;
|
|
|
|
case OBJ_DLG_RADIOBUTTON: nObj = SVX_SNAP_RADIOBUTTON; break;
|
|
|
|
case OBJ_DLG_CHECKBOX: nObj = SVX_SNAP_CHECKBOX; break;
|
|
|
|
case OBJ_DLG_LISTBOX: nObj = SVX_SNAP_LISTBOX; break;
|
|
|
|
case OBJ_DLG_COMBOBOX: nObj = SVX_SNAP_COMBOBOX; break;
|
|
|
|
case OBJ_DLG_GROUPBOX: nObj = SVX_SNAP_GROUPBOX; break;
|
|
|
|
case OBJ_DLG_EDIT: nObj = SVX_SNAP_EDIT; break;
|
|
|
|
case OBJ_DLG_FIXEDTEXT: nObj = SVX_SNAP_FIXEDTEXT; break;
|
|
|
|
case OBJ_DLG_IMAGECONTROL: nObj = SVX_SNAP_IMAGECONTROL; break;
|
|
|
|
case OBJ_DLG_PROGRESSBAR: nObj = SVX_SNAP_PROGRESSBAR; break;
|
|
|
|
case OBJ_DLG_HSCROLLBAR: nObj = SVX_SNAP_HSCROLLBAR; break;
|
|
|
|
case OBJ_DLG_VSCROLLBAR: nObj = SVX_SNAP_VSCROLLBAR; break;
|
|
|
|
case OBJ_DLG_HFIXEDLINE: nObj = SVX_SNAP_HFIXEDLINE; break;
|
|
|
|
case OBJ_DLG_VFIXEDLINE: nObj = SVX_SNAP_VFIXEDLINE; break;
|
|
|
|
case OBJ_DLG_DATEFIELD: nObj = SVX_SNAP_DATEFIELD; break;
|
|
|
|
case OBJ_DLG_TIMEFIELD: nObj = SVX_SNAP_TIMEFIELD; break;
|
|
|
|
case OBJ_DLG_NUMERICFIELD: nObj = SVX_SNAP_NUMERICFIELD; break;
|
|
|
|
case OBJ_DLG_CURRENCYFIELD: nObj = SVX_SNAP_CURRENCYFIELD; break;
|
|
|
|
case OBJ_DLG_FORMATTEDFIELD: nObj = SVX_SNAP_FORMATTEDFIELD; break;
|
|
|
|
case OBJ_DLG_PATTERNFIELD: nObj = SVX_SNAP_PATTERNFIELD; break;
|
|
|
|
case OBJ_DLG_FILECONTROL: nObj = SVX_SNAP_FILECONTROL; break;
|
2011-11-29 10:26:33 +00:00
|
|
|
case OBJ_DLG_SPINBUTTON: nObj = SVX_SNAP_SPINBUTTON; break;
|
2007-07-03 12:02:16 +00:00
|
|
|
case OBJ_DLG_TREECONTROL: nObj = SVX_SNAP_TREECONTROL; break;
|
2001-11-12 21:39:49 +00:00
|
|
|
default: nObj = 0;
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
#ifdef DBG_UTIL
|
2001-11-12 21:39:49 +00:00
|
|
|
if( !nObj )
|
|
|
|
{
|
|
|
|
DBG_WARNING( "SID_CHOOSE_CONTROLS: Unbekannt!" );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
#endif
|
2001-11-12 21:39:49 +00:00
|
|
|
aItem.SetValue( nObj );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-11-12 21:39:49 +00:00
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-11-14 09:53:42 +00:00
|
|
|
|
|
|
|
case SID_SHOW_PROPERTYBROWSER:
|
|
|
|
{
|
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();
|
|
|
|
SfxViewFrame* pViewFrame = pShell ? pShell->GetViewFrame() : NULL;
|
2012-09-02 16:21:08 +02:00
|
|
|
if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) && !pEditor->GetView().AreObjectsMarked() )
|
2001-11-14 09:53:42 +00:00
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
|
|
|
|
if ( IsReadOnly() )
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_RADIO:
|
|
|
|
case SID_INSERT_FORM_CHECK:
|
|
|
|
case SID_INSERT_FORM_LIST:
|
|
|
|
case SID_INSERT_FORM_COMBO:
|
|
|
|
case SID_INSERT_FORM_VSCROLL:
|
|
|
|
case SID_INSERT_FORM_HSCROLL:
|
|
|
|
case SID_INSERT_FORM_SPIN:
|
2011-12-05 09:56:17 +00:00
|
|
|
{
|
|
|
|
if ( !bIsCalc || IsReadOnly() )
|
|
|
|
rSet.DisableItem( nWh );
|
|
|
|
}
|
|
|
|
break;
|
2012-08-17 07:29:20 +02:00
|
|
|
case SID_SHOWLINES:
|
|
|
|
{
|
|
|
|
// if this is not a module window hide the
|
|
|
|
// setting, doesn't make sense for example if the
|
|
|
|
// dialog editor is open
|
|
|
|
rSet.DisableItem(nWh);
|
|
|
|
rSet.Put(SfxVisibilityItem(nWh, false));
|
|
|
|
break;
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-11 22:45:31 +01:00
|
|
|
void DialogWindow::ExecuteCommand( SfxRequest& rReq )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
switch ( rReq.GetSlot() )
|
|
|
|
{
|
|
|
|
case SID_CUT:
|
2001-11-12 21:39:49 +00:00
|
|
|
if ( !IsReadOnly() )
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().Cut();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
|
|
|
case SID_DELETE:
|
2001-11-12 21:39:49 +00:00
|
|
|
if ( !IsReadOnly() )
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().Delete();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
|
|
|
case SID_COPY:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().Copy();
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
|
|
|
case SID_PASTE:
|
2001-11-12 21:39:49 +00:00
|
|
|
if ( !IsReadOnly() )
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().Paste();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_RADIO:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMRADIO );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_CHECK:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMCHECK );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_LIST:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMLIST );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_COMBO:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMCOMBO );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_SPIN:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMSPIN );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_VSCROLL:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMVSCROLL );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2012-01-06 09:43:42 +00:00
|
|
|
case SID_INSERT_FORM_HSCROLL:
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMHSCROLL );
|
2011-12-05 09:56:17 +00:00
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
case SID_CHOOSE_CONTROLS:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
DBG_ASSERT( pArgs, "Nix Args" );
|
|
|
|
|
|
|
|
const SfxAllEnumItem& rItem = (SfxAllEnumItem&)pArgs->Get( SID_CHOOSE_CONTROLS );
|
|
|
|
switch( rItem.GetValue() )
|
|
|
|
{
|
|
|
|
case SVX_SNAP_PUSHBUTTON:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_PUSHBUTTON );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_RADIOBUTTON:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_RADIOBUTTON );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_CHECKBOX:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_CHECKBOX);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_LISTBOX:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_LISTBOX );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_COMBOBOX:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_COMBOBOX );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_GROUPBOX:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_GROUPBOX );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_EDIT:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_EDIT );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_FIXEDTEXT:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FIXEDTEXT );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_IMAGECONTROL:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_IMAGECONTROL );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_PROGRESSBAR:
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_PROGRESSBAR );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_HSCROLLBAR:
|
2001-05-14 07:48:49 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_HSCROLLBAR );
|
2001-05-14 07:48:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_VSCROLLBAR:
|
2001-05-14 07:48:49 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_VSCROLLBAR );
|
2001-05-14 07:48:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_HFIXEDLINE:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_HFIXEDLINE );
|
2001-05-14 07:48:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_VFIXEDLINE:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_VFIXEDLINE );
|
2001-05-14 07:48:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-09-17 10:24:18 +00:00
|
|
|
case SVX_SNAP_DATEFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_DATEFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_TIMEFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_TIMEFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_NUMERICFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_NUMERICFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_CURRENCYFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_CURRENCYFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_FORMATTEDFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_PATTERNFIELD:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_PATTERNFIELD );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SVX_SNAP_FILECONTROL:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_FILECONTROL );
|
2001-09-17 10:24:18 +00:00
|
|
|
}
|
|
|
|
break;
|
2011-11-29 10:26:33 +00:00
|
|
|
case SVX_SNAP_SPINBUTTON:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_SPINBUTTON );
|
2011-11-29 10:26:33 +00:00
|
|
|
}
|
|
|
|
break;
|
2007-07-03 12:02:16 +00:00
|
|
|
case SVX_SNAP_TREECONTROL:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::INSERT );
|
|
|
|
GetEditor().SetInsertObj( OBJ_DLG_TREECONTROL );
|
2007-07-03 12:02:16 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-08-17 13:03:07 +00:00
|
|
|
case SVX_SNAP_SELECT:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
GetEditor().SetMode( DlgEditor::SELECT );
|
2001-08-17 13:03:07 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2002-04-24 13:52:16 +00:00
|
|
|
if ( rReq.GetModifier() & KEY_MOD1 )
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
if ( GetEditor().GetMode() == DlgEditor::INSERT )
|
|
|
|
GetEditor().CreateDefaultObject();
|
2002-04-24 13:52:16 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DIALOG_TESTMODE:
|
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
DlgEditor::Mode eOldMode = GetEditor().GetMode();
|
|
|
|
GetEditor().SetMode( DlgEditor::TEST );
|
|
|
|
GetEditor().SetMode( eOldMode );
|
2000-09-29 10:02:42 +00:00
|
|
|
rReq.Done();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2006-01-03 11:42:40 +00:00
|
|
|
pBindings->Invalidate( SID_DIALOG_TESTMODE );
|
2000-09-29 10:02:42 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-06-26 15:51:32 +00:00
|
|
|
case SID_EXPORT_DIALOG:
|
|
|
|
SaveDialog();
|
|
|
|
break;
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
case SID_IMPORT_DIALOG:
|
|
|
|
ImportDialog();
|
|
|
|
break;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
case SID_BASICIDE_DELETECURRENT:
|
|
|
|
if (QueryDelDialog(m_aName, this))
|
|
|
|
{
|
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 (RemoveDialog(m_aDocument, m_aLibName, m_aName))
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
MarkDocumentModified(m_aDocument);
|
|
|
|
GetShell()->RemoveWindow(this, true);
|
2012-08-17 07:29:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
Reference< container::XNameContainer > DialogWindow::GetDialog() const
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-06-15 07:45:19 +00:00
|
|
|
return pEditor->GetDialog();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
bool DialogWindow::RenameDialog( const OUString& rNewName )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if ( !basctl::RenameDialog( this, GetDocument(), GetLibName(), GetName(), rNewName ) )
|
2012-08-01 10:05:20 +09:00
|
|
|
return false;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2007-03-15 14:53:05 +00:00
|
|
|
pBindings->Invalidate( SID_DOC_MODIFIED );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2012-08-01 10:05:20 +09:00
|
|
|
return true;
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
void DialogWindow::DisableBrowser()
|
|
|
|
{
|
2012-09-05 19:41:42 +02:00
|
|
|
rLayout.DisablePropertyBrowser();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindow::UpdateBrowser()
|
|
|
|
{
|
2012-09-05 19:41:42 +02:00
|
|
|
rLayout.UpdatePropertyBrowser();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
static OUString aResourceResolverPropName( "ResourceResolver" );
|
2007-06-26 15:51:32 +00:00
|
|
|
|
2012-07-24 17:46:32 +09:00
|
|
|
bool DialogWindow::SaveDialog()
|
2007-06-26 15:51:32 +00:00
|
|
|
{
|
|
|
|
DBG_CHKTHIS( DialogWindow, 0 );
|
2012-07-24 17:46:32 +09:00
|
|
|
bool bDone = false;
|
2007-06-26 15:51:32 +00:00
|
|
|
|
2013-02-12 09:23:05 +02:00
|
|
|
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
|
|
|
|
Reference < XFilePicker3 > xFP = FilePicker::createWithMode(xContext, TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD);
|
2007-06-26 15:51:32 +00:00
|
|
|
|
|
|
|
Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY);
|
2012-08-07 08:36:40 +02:00
|
|
|
xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, false);
|
2007-06-26 15:51:32 +00:00
|
|
|
Any aValue;
|
2012-08-07 08:36:40 +02:00
|
|
|
aValue <<= sal_True;
|
2007-06-26 15:51:32 +00:00
|
|
|
xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
|
|
|
|
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( !aCurPath.isEmpty() )
|
2007-06-26 15:51:32 +00:00
|
|
|
xFP->setDisplayDirectory ( aCurPath );
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
xFP->setDefaultName( OUString( GetName() ) );
|
2007-06-26 15:51:32 +00:00
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aDialogStr(IDE_RESSTR(RID_STR_STDDIALOGNAME));
|
2013-02-12 09:23:05 +02:00
|
|
|
xFP->appendFilter( aDialogStr, String( "*.xdl" ) );
|
|
|
|
xFP->appendFilter( IDE_RESSTR(RID_STR_FILTER_ALLFILES), String( FilterMask_All ) );
|
|
|
|
xFP->setCurrentFilter( aDialogStr );
|
2007-06-26 15:51:32 +00:00
|
|
|
|
|
|
|
if( xFP->execute() == RET_OK )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
Sequence< OUString > aPaths = xFP->getFiles();
|
2007-06-26 15:51:32 +00:00
|
|
|
aCurPath = aPaths[0];
|
|
|
|
|
|
|
|
// export dialog model to xml
|
|
|
|
Reference< container::XNameContainer > xDialogModel = GetDialog();
|
2010-10-06 10:16:13 +01:00
|
|
|
Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
|
2007-06-26 15:51:32 +00:00
|
|
|
Reference< XInputStream > xInput( xISP->createInputStream() );
|
|
|
|
|
2013-02-12 09:23:05 +02:00
|
|
|
Reference< XSimpleFileAccess3 > xSFI( SimpleFileAccess::create(xContext) );
|
2007-06-26 15:51:32 +00:00
|
|
|
|
|
|
|
Reference< XOutputStream > xOutput;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if( xSFI->exists( aCurPath ) )
|
|
|
|
xSFI->kill( aCurPath );
|
|
|
|
xOutput = xSFI->openFileWrite( aCurPath );
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const Exception& )
|
2007-06-26 15:51:32 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
if( xOutput.is() )
|
|
|
|
{
|
|
|
|
Sequence< sal_Int8 > bytes;
|
|
|
|
sal_Int32 nRead = xInput->readBytes( bytes, xInput->available() );
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
if( nRead )
|
|
|
|
xOutput->writeBytes( bytes );
|
|
|
|
|
|
|
|
nRead = xInput->readBytes( bytes, 1024 );
|
|
|
|
if (! nRead)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
bDone = true;
|
|
|
|
|
|
|
|
// With resource?
|
|
|
|
Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
|
|
|
|
Reference< resource::XStringResourceResolver > xStringResourceResolver;
|
|
|
|
if( xDialogModelPropSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Any aResourceResolver = xDialogModelPropSet->getPropertyValue( aResourceResolverPropName );
|
|
|
|
aResourceResolver >>= xStringResourceResolver;
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const beans::UnknownPropertyException& )
|
2007-06-26 15:51:32 +00:00
|
|
|
{}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool bResource = false;
|
|
|
|
if( xStringResourceResolver.is() )
|
|
|
|
{
|
|
|
|
Sequence< lang::Locale > aLocaleSeq = xStringResourceResolver->getLocales();
|
|
|
|
sal_Int32 nLocaleCount = aLocaleSeq.getLength();
|
|
|
|
if( nLocaleCount > 0 )
|
|
|
|
bResource = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bResource )
|
|
|
|
{
|
|
|
|
INetURLObject aURLObj( aCurPath );
|
|
|
|
aURLObj.removeExtension();
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aDialogName( aURLObj.getName() );
|
2007-06-26 15:51:32 +00:00
|
|
|
aURLObj.removeSegment();
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
|
2012-08-07 08:36:40 +02:00
|
|
|
bool bReadOnly = false;
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aComment( "# " );
|
2007-06-26 15:51:32 +00:00
|
|
|
aComment += aDialogName;
|
2012-10-02 11:31:09 -03:00
|
|
|
aComment += " strings" ;
|
2007-06-26 15:51:32 +00:00
|
|
|
Reference< task::XInteractionHandler > xDummyHandler;
|
|
|
|
|
|
|
|
// Remove old properties files in case of overwriting Dialog files
|
|
|
|
if( xSFI->isFolder( aURL ) )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
Sequence< OUString > aContentSeq = xSFI->getFolderContents( aURL, false );
|
2007-06-26 15:51:32 +00:00
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aDialogName_( aDialogName );
|
|
|
|
aDialogName_ += "_" ;
|
2007-06-26 15:51:32 +00:00
|
|
|
sal_Int32 nCount = aContentSeq.getLength();
|
2012-10-02 11:31:09 -03:00
|
|
|
const OUString* pFiles = aContentSeq.getConstArray();
|
2007-06-26 15:51:32 +00:00
|
|
|
for( int i = 0 ; i < nCount ; i++ )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aCompleteName = pFiles[i];
|
|
|
|
OUString aPureName;
|
|
|
|
OUString aExtension;
|
2007-06-26 15:51:32 +00:00
|
|
|
sal_Int32 iDot = aCompleteName.lastIndexOf( '.' );
|
|
|
|
sal_Int32 iSlash = aCompleteName.lastIndexOf( '/' );
|
|
|
|
if( iDot != -1 )
|
|
|
|
{
|
|
|
|
sal_Int32 iCopyFrom = (iSlash != -1) ? iSlash + 1 : 0;
|
|
|
|
aPureName = aCompleteName.copy( iCopyFrom, iDot-iCopyFrom );
|
|
|
|
aExtension = aCompleteName.copy( iDot + 1 );
|
|
|
|
}
|
|
|
|
|
2012-04-06 19:49:53 +02:00
|
|
|
if( aExtension == "properties" || aExtension == "default" )
|
2007-06-26 15:51:32 +00:00
|
|
|
{
|
|
|
|
if( aPureName.indexOf( aDialogName_ ) == 0 )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
xSFI->kill( aCompleteName );
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const uno::Exception& )
|
2007-06-26 15:51:32 +00:00
|
|
|
{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XStringResourceWithLocation > xStringResourceWithLocation =
|
|
|
|
StringResourceWithLocation::create( xContext, aURL, bReadOnly,
|
|
|
|
xStringResourceResolver->getDefaultLocale(), aDialogName, aComment, xDummyHandler );
|
|
|
|
|
|
|
|
// Add locales
|
|
|
|
Sequence< lang::Locale > aLocaleSeq = xStringResourceResolver->getLocales();
|
|
|
|
const lang::Locale* pLocales = aLocaleSeq.getConstArray();
|
|
|
|
sal_Int32 nLocaleCount = aLocaleSeq.getLength();
|
|
|
|
for( sal_Int32 iLocale = 0 ; iLocale < nLocaleCount ; iLocale++ )
|
|
|
|
{
|
|
|
|
const lang::Locale& rLocale = pLocales[ iLocale ];
|
|
|
|
xStringResourceWithLocation->newLocale( rLocale );
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XStringResourceManager > xTargetStringResourceManager( xStringResourceWithLocation, uno::UNO_QUERY );
|
|
|
|
|
|
|
|
LocalizationMgr::copyResourceForDialog( xDialogModel,
|
|
|
|
xStringResourceResolver, xTargetStringResourceManager );
|
|
|
|
|
|
|
|
xStringResourceWithLocation->store();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_COULDNTWRITE)).Execute();
|
2007-06-26 15:51:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
|
2009-11-03 18:12:19 +01:00
|
|
|
extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
|
|
|
|
const ::com::sun::star::lang::Locale& rLocaleRight );
|
|
|
|
|
|
|
|
std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq
|
|
|
|
( Sequence< lang::Locale > aFirstSeq, Sequence< lang::Locale > aSecondSeq )
|
|
|
|
{
|
|
|
|
std::vector< lang::Locale > avRet;
|
|
|
|
|
|
|
|
const lang::Locale* pFirst = aFirstSeq.getConstArray();
|
|
|
|
const lang::Locale* pSecond = aSecondSeq.getConstArray();
|
|
|
|
sal_Int32 nFirstCount = aFirstSeq.getLength();
|
|
|
|
sal_Int32 nSecondCount = aSecondSeq.getLength();
|
|
|
|
|
|
|
|
for( sal_Int32 iFirst = 0 ; iFirst < nFirstCount ; iFirst++ )
|
|
|
|
{
|
|
|
|
const lang::Locale& rFirstLocale = pFirst[ iFirst ];
|
|
|
|
|
|
|
|
bool bAlsoContainedInSecondSeq = false;
|
|
|
|
for( sal_Int32 iSecond = 0 ; iSecond < nSecondCount ; iSecond++ )
|
|
|
|
{
|
|
|
|
const lang::Locale& rSecondLocale = pSecond[ iSecond ];
|
|
|
|
|
|
|
|
bool bMatch = localesAreEqual( rFirstLocale, rSecondLocale );
|
|
|
|
if( bMatch )
|
|
|
|
{
|
|
|
|
bAlsoContainedInSecondSeq = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !bAlsoContainedInSecondSeq )
|
|
|
|
avRet.push_back( rFirstLocale );
|
|
|
|
}
|
|
|
|
|
|
|
|
return avRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class NameClashQueryBox : public MessBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NameClashQueryBox( Window* pParent,
|
2013-03-28 22:08:26 +01:00
|
|
|
const OUString& rTitle, const OUString& rMessage );
|
2009-11-03 18:12:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
NameClashQueryBox::NameClashQueryBox( Window* pParent,
|
2013-03-28 22:08:26 +01:00
|
|
|
const OUString& rTitle, const OUString& rMessage )
|
2009-11-03 18:12:19 +01:00
|
|
|
: MessBox( pParent, 0, rTitle, rMessage )
|
|
|
|
{
|
2013-03-28 22:08:26 +01:00
|
|
|
if ( !rTitle.isEmpty() )
|
2009-11-03 18:12:19 +01:00
|
|
|
SetText( rTitle );
|
|
|
|
|
|
|
|
maMessText = rMessage;
|
|
|
|
|
2012-04-29 23:36:57 +01:00
|
|
|
AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_RENAME), RET_YES,
|
2009-11-03 18:12:19 +01:00
|
|
|
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
|
2012-04-29 23:36:57 +01:00
|
|
|
AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO, 0 );
|
2009-11-03 18:12:19 +01:00
|
|
|
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
|
|
|
|
|
2010-11-13 00:33:43 -08:00
|
|
|
SetImage( QueryBox::GetStandardImage() );
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class LanguageMismatchQueryBox : public MessBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LanguageMismatchQueryBox( Window* pParent,
|
2013-03-28 22:08:26 +01:00
|
|
|
const OUString& rTitle, const OUString& rMessage );
|
2009-11-03 18:12:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent,
|
2013-03-28 22:08:26 +01:00
|
|
|
const OUString& rTitle, const OUString& rMessage )
|
2009-11-03 18:12:19 +01:00
|
|
|
: MessBox( pParent, 0, rTitle, rMessage )
|
|
|
|
{
|
2013-03-28 22:08:26 +01:00
|
|
|
if ( !rTitle.isEmpty() )
|
2009-11-03 18:12:19 +01:00
|
|
|
SetText( rTitle );
|
|
|
|
|
|
|
|
maMessText = rMessage;
|
2012-04-29 23:36:57 +01:00
|
|
|
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_ADD), RET_YES,
|
2009-11-03 18:12:19 +01:00
|
|
|
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
|
2012-04-29 23:36:57 +01:00
|
|
|
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO, 0 );
|
2009-11-03 18:12:19 +01:00
|
|
|
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
|
2013-05-01 10:08:20 +01:00
|
|
|
AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
2010-11-13 00:33:43 -08:00
|
|
|
SetImage( QueryBox::GetStandardImage() );
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
bool implImportDialog( Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& aLibName )
|
2009-11-03 18:12:19 +01:00
|
|
|
{
|
2012-07-24 17:46:32 +09:00
|
|
|
bool bDone = false;
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
|
2013-02-12 09:23:05 +02:00
|
|
|
Reference< XComponentContext > xContext( comphelper::getComponentContext( xMSF ) );
|
|
|
|
Reference < XFilePicker3 > xFP = FilePicker::createWithMode(xContext, TemplateDescription::FILEOPEN_SIMPLE);
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY);
|
2012-08-07 08:36:40 +02:00
|
|
|
xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, false);
|
2009-11-03 18:12:19 +01:00
|
|
|
Any aValue;
|
2012-08-07 08:36:40 +02:00
|
|
|
aValue <<= sal_True;
|
2009-11-03 18:12:19 +01:00
|
|
|
xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aCurPath( rCurPath );
|
2011-12-09 01:58:49 -05:00
|
|
|
if ( !aCurPath.isEmpty() )
|
2009-11-03 18:12:19 +01:00
|
|
|
xFP->setDisplayDirectory ( aCurPath );
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aDialogStr(IDE_RESSTR(RID_STR_STDDIALOGNAME));
|
2013-02-12 09:23:05 +02:00
|
|
|
xFP->appendFilter( aDialogStr, String( "*.xdl" ) );
|
|
|
|
xFP->appendFilter( IDE_RESSTR(RID_STR_FILTER_ALLFILES), String( FilterMask_All ) );
|
|
|
|
xFP->setCurrentFilter( aDialogStr );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
if( xFP->execute() == RET_OK )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
Sequence< OUString > aPaths = xFP->getFiles();
|
2009-11-03 18:12:19 +01:00
|
|
|
aCurPath = aPaths[0];
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aBasePath;
|
|
|
|
OUString aOUCurPath( aCurPath );
|
2009-11-03 18:12:19 +01:00
|
|
|
sal_Int32 iSlash = aOUCurPath.lastIndexOf( '/' );
|
|
|
|
if( iSlash != -1 )
|
|
|
|
aBasePath = aOUCurPath.copy( 0, iSlash + 1 );
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// create dialog model
|
|
|
|
Reference< container::XNameContainer > xDialogModel( xMSF->createInstance
|
2012-10-02 11:31:09 -03:00
|
|
|
( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY_THROW );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
2012-11-02 17:46:30 +02:00
|
|
|
Reference< XSimpleFileAccess3 > xSFI( SimpleFileAccess::create(comphelper::getProcessComponentContext()) );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
Reference< XInputStream > xInput;
|
|
|
|
if( xSFI->exists( aCurPath ) )
|
|
|
|
xInput = xSFI->openFileRead( aCurPath );
|
|
|
|
|
2010-10-06 10:16:13 +01:00
|
|
|
::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aXmlDlgName;
|
2009-11-03 18:12:19 +01:00
|
|
|
Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
|
|
|
|
if( xDialogModelPropSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aOUXmlDialogName;
|
2009-11-03 18:12:19 +01:00
|
|
|
aXmlDialogNameAny >>= aOUXmlDialogName;
|
|
|
|
aXmlDlgName = aOUXmlDialogName;
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const beans::UnknownPropertyException& )
|
2009-11-03 18:12:19 +01:00
|
|
|
{}
|
|
|
|
}
|
2011-12-09 01:58:49 -05:00
|
|
|
bool bValidName = !aXmlDlgName.isEmpty();
|
2009-11-03 18:12:19 +01:00
|
|
|
OSL_ASSERT( bValidName );
|
|
|
|
if( !bValidName )
|
|
|
|
return bDone;
|
|
|
|
|
|
|
|
bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName );
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aNewDlgName = aXmlDlgName;
|
2009-11-03 18:12:19 +01:00
|
|
|
enum NameClashMode
|
|
|
|
{
|
|
|
|
NO_CLASH,
|
|
|
|
CLASH_OVERWRITE_DIALOG,
|
|
|
|
CLASH_RENAME_DIALOG,
|
|
|
|
};
|
|
|
|
NameClashMode eNameClashMode = NO_CLASH;
|
|
|
|
if( bDialogAlreadyExists )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aQueryBoxTitle(IDE_RESSTR(RID_STR_DLGIMP_CLASH_TITLE));
|
|
|
|
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_CLASH_TEXT));
|
2012-03-08 00:49:32 +01:00
|
|
|
aQueryBoxText = aQueryBoxText.replaceAll("$(ARG1)", aXmlDlgName);
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nRet = aQueryBox.Execute();
|
2009-11-03 18:12:19 +01:00
|
|
|
if( RET_YES == nRet )
|
|
|
|
{
|
|
|
|
// RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
|
|
|
|
eNameClashMode = CLASH_RENAME_DIALOG;
|
|
|
|
|
|
|
|
aNewDlgName = rDocument.createObjectName( E_DIALOGS, aLibName );
|
|
|
|
}
|
|
|
|
else if( RET_NO == nRet )
|
|
|
|
{
|
|
|
|
// RET_NO == Replace, see NameClashQueryBox::NameClashQueryBox
|
|
|
|
eNameClashMode = CLASH_OVERWRITE_DIALOG;
|
|
|
|
}
|
|
|
|
else if( RET_CANCEL == nRet )
|
|
|
|
{
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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)
|
2009-11-03 18:12:19 +01: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
|
|
|
OSL_ASSERT(pShell);
|
2009-11-03 18:12:19 +01:00
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Resource?
|
2012-11-22 12:26:52 +01:00
|
|
|
::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
|
2009-11-03 18:12:19 +01:00
|
|
|
Reference< task::XInteractionHandler > xDummyHandler;
|
|
|
|
bool bReadOnly = true;
|
|
|
|
Reference< XStringResourceWithLocation > xImportStringResource =
|
|
|
|
StringResourceWithLocation::create( xContext, aBasePath, bReadOnly,
|
2012-10-02 11:31:09 -03:00
|
|
|
aLocale, aXmlDlgName, OUString(), xDummyHandler );
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
Sequence< lang::Locale > aImportLocaleSeq = xImportStringResource->getLocales();
|
|
|
|
sal_Int32 nImportLocaleCount = aImportLocaleSeq.getLength();
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, true ) );
|
2009-11-03 18:12:19 +01:00
|
|
|
Reference< resource::XStringResourceManager > xLibStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
|
|
|
|
sal_Int32 nLibLocaleCount = 0;
|
|
|
|
Sequence< lang::Locale > aLibLocaleSeq;
|
|
|
|
if( xLibStringResourceManager.is() )
|
|
|
|
{
|
|
|
|
aLibLocaleSeq = xLibStringResourceManager->getLocales();
|
|
|
|
nLibLocaleCount = aLibLocaleSeq.getLength();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check language matches
|
|
|
|
std::vector< lang::Locale > aOnlyInImportLanguages =
|
|
|
|
implGetLanguagesOnlyContainedInFirstSeq( aImportLocaleSeq, aLibLocaleSeq );
|
|
|
|
int nOnlyInImportLanguageCount = aOnlyInImportLanguages.size();
|
|
|
|
|
|
|
|
// For now: Keep languages from lib
|
|
|
|
bool bLibLocalized = (nLibLocaleCount > 0);
|
|
|
|
bool bImportLocalized = (nImportLocaleCount > 0);
|
|
|
|
|
|
|
|
bool bAddDialogLanguagesToLib = false;
|
|
|
|
if( nOnlyInImportLanguageCount > 0 )
|
|
|
|
{
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aQueryBoxTitle(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TITLE));
|
|
|
|
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
|
2009-11-03 18:12:19 +01:00
|
|
|
LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nRet = aQueryBox.Execute();
|
2009-11-03 18:12:19 +01:00
|
|
|
if( RET_YES == nRet )
|
|
|
|
{
|
|
|
|
// RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
|
|
|
|
bAddDialogLanguagesToLib = true;
|
|
|
|
}
|
|
|
|
// RET_NO == Omit, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
|
|
|
|
// -> nothing to do here
|
|
|
|
//else if( RET_NO == nRet )
|
|
|
|
//{
|
|
|
|
//}
|
|
|
|
else if( RET_CANCEL == nRet )
|
|
|
|
{
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bImportLocalized )
|
|
|
|
{
|
|
|
|
bool bCopyResourcesForDialog = true;
|
|
|
|
if( bAddDialogLanguagesToLib )
|
|
|
|
{
|
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
|
|
|
boost::shared_ptr<LocalizationMgr> pCurMgr = pShell->GetCurLocalizationMgr();
|
2009-11-03 18:12:19 +01:00
|
|
|
|
|
|
|
lang::Locale aFirstLocale;
|
|
|
|
aFirstLocale = aOnlyInImportLanguages[0];
|
|
|
|
if( nOnlyInImportLanguageCount > 1 )
|
|
|
|
{
|
|
|
|
// Check if import default belongs to only import languages and use it then
|
|
|
|
lang::Locale aImportDefaultLocale = xImportStringResource->getDefaultLocale();
|
|
|
|
lang::Locale aTmpLocale;
|
|
|
|
for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
|
|
|
|
{
|
|
|
|
aTmpLocale = aOnlyInImportLanguages[i];
|
|
|
|
if( localesAreEqual( aImportDefaultLocale, aTmpLocale ) )
|
|
|
|
{
|
|
|
|
aFirstLocale = aImportDefaultLocale;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Sequence< lang::Locale > aFirstLocaleSeq( 1 );
|
|
|
|
aFirstLocaleSeq[0] = aFirstLocale;
|
|
|
|
pCurMgr->handleAddLocales( aFirstLocaleSeq );
|
|
|
|
|
|
|
|
if( nOnlyInImportLanguageCount > 1 )
|
|
|
|
{
|
|
|
|
Sequence< lang::Locale > aRemainingLocaleSeq( nOnlyInImportLanguageCount - 1 );
|
|
|
|
lang::Locale aTmpLocale;
|
|
|
|
int iSeq = 0;
|
|
|
|
for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
|
|
|
|
{
|
|
|
|
aTmpLocale = aOnlyInImportLanguages[i];
|
|
|
|
if( !localesAreEqual( aFirstLocale, aTmpLocale ) )
|
|
|
|
aRemainingLocaleSeq[iSeq++] = aTmpLocale;
|
|
|
|
}
|
|
|
|
pCurMgr->handleAddLocales( aRemainingLocaleSeq );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( !bLibLocalized )
|
|
|
|
{
|
|
|
|
Reference< resource::XStringResourceManager > xImportStringResourceManager( xImportStringResource, UNO_QUERY );
|
|
|
|
LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResourceManager );
|
|
|
|
bCopyResourcesForDialog = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bCopyResourcesForDialog )
|
|
|
|
{
|
|
|
|
Reference< resource::XStringResourceResolver > xImportStringResourceResolver( xImportStringResource, UNO_QUERY );
|
|
|
|
LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, aXmlDlgName,
|
|
|
|
xLibStringResourceManager, xImportStringResourceResolver );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( bLibLocalized )
|
|
|
|
{
|
|
|
|
LocalizationMgr::setResourceIDsForDialog( xDialogModel, xLibStringResourceManager );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LocalizationMgr::setStringResourceAtDialog( rDocument, aLibName, aNewDlgName, xDialogModel );
|
|
|
|
|
|
|
|
if( eNameClashMode == CLASH_OVERWRITE_DIALOG )
|
|
|
|
{
|
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 (basctl::RemoveDialog( rDocument, aLibName, aNewDlgName ) )
|
2009-11-03 18:12:19 +01:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pDlgWin = pShell->FindDlgWin( rDocument, aLibName, aNewDlgName, false, true );
|
2009-11-03 18:12:19 +01:00
|
|
|
if( pDlgWin != NULL )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell->RemoveWindow( pDlgWin, true );
|
|
|
|
MarkDocumentModified( rDocument );
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// TODO: Assertion?
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( eNameClashMode == CLASH_RENAME_DIALOG )
|
|
|
|
{
|
|
|
|
bool bRenamed = false;
|
|
|
|
if( xDialogModelPropSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Any aXmlDialogNameAny;
|
2012-10-02 11:31:09 -03:00
|
|
|
aXmlDialogNameAny <<= OUString( aNewDlgName );
|
2009-11-03 18:12:19 +01:00
|
|
|
xDialogModelPropSet->setPropertyValue( DLGED_PROP_NAME, aXmlDialogNameAny );
|
|
|
|
bRenamed = true;
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const beans::UnknownPropertyException& )
|
2009-11-03 18:12:19 +01:00
|
|
|
{}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( bRenamed )
|
|
|
|
{
|
|
|
|
LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// TODO: Assertion?
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-06 10:16:13 +01:00
|
|
|
Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
|
2009-11-03 18:12:19 +01:00
|
|
|
bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP );
|
|
|
|
if( bSuccess )
|
|
|
|
{
|
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
|
|
|
DialogWindow* pNewDlgWin = pShell->CreateDlgWin( rDocument, aLibName, aNewDlgName );
|
|
|
|
pShell->SetCurWindow( pNewDlgWin, true );
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
|
|
|
|
2012-07-24 17:46:32 +09:00
|
|
|
bDone = true;
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch(const Exception& )
|
2009-11-03 18:12:19 +01:00
|
|
|
{}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bDone;
|
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
|
2012-07-24 17:46:32 +09:00
|
|
|
bool DialogWindow::ImportDialog()
|
2009-11-03 18:12:19 +01:00
|
|
|
{
|
|
|
|
DBG_CHKTHIS( DialogWindow, 0 );
|
|
|
|
|
|
|
|
const ScriptDocument& rDocument = GetDocument();
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName = GetLibName();
|
2012-07-24 17:46:32 +09:00
|
|
|
return implImportDialog( this, aCurPath, rDocument, aLibName );
|
2009-11-03 18:12:19 +01:00
|
|
|
}
|
|
|
|
|
2012-09-02 16:21:08 +02:00
|
|
|
DlgEdModel& DialogWindow::GetModel() const
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pEditor->GetModel();
|
2003-03-26 11:48:08 +00:00
|
|
|
}
|
|
|
|
|
2012-09-02 16:21:08 +02:00
|
|
|
DlgEdPage& DialogWindow::GetPage() const
|
2003-03-26 11:48:08 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pEditor->GetPage();
|
2003-03-26 11:48:08 +00:00
|
|
|
}
|
|
|
|
|
2012-09-02 16:21:08 +02:00
|
|
|
DlgEdView& DialogWindow::GetView() const
|
2003-03-26 11:48:08 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pEditor->GetView();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
bool DialogWindow::IsModified()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-06-15 07:45:19 +00:00
|
|
|
return pEditor->IsModified();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2011-03-09 16:20:50 -06:00
|
|
|
::svl::IUndoManager* DialogWindow::GetUndoManager()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pUndoMgr.get();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString DialogWindow::GetTitle()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-09-25 08:14:46 +00:00
|
|
|
return GetName();
|
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
|
|
|
EntryDescriptor DialogWindow::CreateEntryDescriptor()
|
2004-07-23 11:01:59 +00:00
|
|
|
{
|
2007-03-15 14:53:05 +00:00
|
|
|
ScriptDocument aDocument( GetDocument() );
|
2012-10-02 11:31:09 -03:00
|
|
|
OUString aLibName( GetLibName() );
|
|
|
|
OUString aLibSubName;
|
2007-03-15 14:53:05 +00:00
|
|
|
LibraryLocation eLocation = aDocument.getLibraryLocation( 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
|
|
|
return EntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG );
|
2004-07-23 11:01:59 +00:00
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
void DialogWindow::SetReadOnly (bool bReadOnly)
|
2001-11-12 21:39:49 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
pEditor->SetMode(bReadOnly ? DlgEditor::READONLY : DlgEditor::SELECT);
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
bool DialogWindow::IsReadOnly ()
|
2001-11-12 21:39:49 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pEditor->GetMode() == DlgEditor::READONLY;
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
bool DialogWindow::IsPasteAllowed()
|
2001-11-12 21:39:49 +00:00
|
|
|
{
|
2012-09-02 16:21:08 +02:00
|
|
|
return pEditor->IsPasteAllowed();
|
2001-11-12 21:39:49 +00:00
|
|
|
}
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
void DialogWindow::StoreData()
|
|
|
|
{
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( IsModified() )
|
2001-03-03 14:08:22 +00:00
|
|
|
{
|
2001-06-15 07:45:19 +00:00
|
|
|
try
|
2001-03-03 14:08:22 +00:00
|
|
|
{
|
2007-03-15 14:53:05 +00:00
|
|
|
Reference< container::XNameContainer > xLib = GetDocument().getLibrary( E_DIALOGS, GetLibName(), true );
|
2001-03-03 14:08:22 +00:00
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
if( xLib.is() )
|
|
|
|
{
|
|
|
|
Reference< container::XNameContainer > xDialogModel = pEditor->GetDialog();
|
2001-03-03 14:08:22 +00:00
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
if( xDialogModel.is() )
|
|
|
|
{
|
2012-09-29 17:20:22 +02:00
|
|
|
Reference< XComponentContext > xContext(
|
|
|
|
comphelper::getProcessComponentContext() );
|
2010-10-06 10:16:13 +01:00
|
|
|
Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
|
2012-10-02 11:31:09 -03:00
|
|
|
xLib->replaceByName( OUString( GetName() ), makeAny( xISP ) );
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-08-24 11:22:56 +09:00
|
|
|
catch (const uno::Exception& )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
2007-02-12 13:49:53 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2001-03-03 14:08: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
|
|
|
MarkDocumentModified( GetDocument() );
|
2007-02-12 13:49:53 +00:00
|
|
|
pEditor->ClearModifyFlag();
|
2001-03-03 14:08:22 +00:00
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
void DialogWindow::Activating ()
|
|
|
|
{
|
|
|
|
UpdateBrowser();
|
|
|
|
Show();
|
|
|
|
}
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
void DialogWindow::Deactivating()
|
|
|
|
{
|
2012-08-17 07:29:20 +02:00
|
|
|
Hide();
|
2001-09-25 08:14:46 +00:00
|
|
|
if ( IsModified() )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
MarkDocumentModified( GetDocument() );
|
2012-08-17 07:29:20 +02:00
|
|
|
DisableBrowser();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2009-05-19 11:32:44 +00:00
|
|
|
sal_Int32 DialogWindow::countPages( Printer* pPrinter )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2009-05-19 11:32:44 +00:00
|
|
|
return pEditor->countPages( pPrinter );
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindow::printPage( sal_Int32 nPage, Printer* pPrinter )
|
|
|
|
{
|
|
|
|
pEditor->printPage( nPage, pPrinter, CreateQualifiedName() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindow::DataChanged( const DataChangedEvent& rDCEvt )
|
|
|
|
{
|
|
|
|
if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
|
|
|
|
{
|
2012-08-02 10:21:00 +09:00
|
|
|
InitSettings( true, true, true );
|
2000-09-29 10:02:42 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
else
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow::DataChanged( rDCEvt );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-08-02 10:21:00 +09:00
|
|
|
void DialogWindow::InitSettings(bool bFont, bool bForeground, bool bBackground)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
|
|
|
|
if( bFont )
|
|
|
|
{
|
|
|
|
Font aFont;
|
|
|
|
aFont = rStyleSettings.GetFieldFont();
|
|
|
|
SetPointFont( aFont );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bForeground || bFont )
|
|
|
|
{
|
|
|
|
SetTextColor( rStyleSettings.GetFieldTextColor() );
|
|
|
|
SetTextFillColor();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bBackground )
|
|
|
|
SetBackground( rStyleSettings.GetFieldColor() );
|
|
|
|
}
|
2003-03-26 11:48:08 +00:00
|
|
|
|
2003-04-24 17:19:40 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > DialogWindow::CreateAccessible()
|
2003-03-26 11:48:08 +00:00
|
|
|
{
|
2003-04-24 17:19:40 +00:00
|
|
|
return (::com::sun::star::accessibility::XAccessible*) new AccessibleDialogWindow( this );
|
2003-03-26 11:48:08 +00:00
|
|
|
}
|
2010-10-12 15:57:08 +02:00
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
char const* DialogWindow::GetHid () const
|
|
|
|
{
|
|
|
|
return HID_BASICIDE_DIALOGWINDOW;
|
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
ItemType DialogWindow::GetType () const
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
return TYPE_DIALOG;
|
2012-08-17 07:29:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// DialogWindowLayout
|
|
|
|
// ==================
|
|
|
|
//
|
|
|
|
|
|
|
|
DialogWindowLayout::DialogWindowLayout (Window* pParent, ObjectCatalog& rObjectCatalog_) :
|
|
|
|
Layout(pParent),
|
|
|
|
pChild(0),
|
2012-08-31 12:44:47 +02:00
|
|
|
rObjectCatalog(rObjectCatalog_),
|
2012-09-05 19:41:42 +02:00
|
|
|
pPropertyBrowser(0)
|
|
|
|
{
|
|
|
|
ShowPropertyBrowser();
|
|
|
|
}
|
|
|
|
|
2013-03-03 17:11:39 +01:00
|
|
|
// shows the property browser (and creates if necessary)
|
2012-09-05 19:41:42 +02:00
|
|
|
void DialogWindowLayout::ShowPropertyBrowser ()
|
|
|
|
{
|
|
|
|
// not exists?
|
|
|
|
if (!pPropertyBrowser)
|
|
|
|
{
|
|
|
|
// creating
|
|
|
|
pPropertyBrowser = new PropBrw(*this);
|
2012-09-07 10:01:42 +02:00
|
|
|
pPropertyBrowser->Show();
|
2012-09-05 19:41:42 +02:00
|
|
|
// after OnFirstSize():
|
|
|
|
if (HasSize())
|
|
|
|
AddPropertyBrowser();
|
2013-03-03 17:11:39 +01:00
|
|
|
// updating if necessary
|
2012-09-05 19:41:42 +02:00
|
|
|
UpdatePropertyBrowser();
|
|
|
|
}
|
2012-09-07 10:01:42 +02:00
|
|
|
else
|
|
|
|
pPropertyBrowser->Show();
|
2012-09-05 19:41:42 +02:00
|
|
|
// refreshing the button state
|
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
|
|
|
pBindings->Invalidate(SID_SHOW_PROPERTYBROWSER);
|
|
|
|
}
|
|
|
|
|
|
|
|
// disables the property browser
|
|
|
|
void DialogWindowLayout::DisablePropertyBrowser ()
|
|
|
|
{
|
|
|
|
if (pPropertyBrowser)
|
|
|
|
pPropertyBrowser->Update(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// updates the property browser
|
|
|
|
void DialogWindowLayout::UpdatePropertyBrowser ()
|
|
|
|
{
|
|
|
|
if (pPropertyBrowser)
|
|
|
|
pPropertyBrowser->Update(GetShell());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Removes the property browser from the layout.
|
|
|
|
// Called by PropBrw when closed. It'll destroy itself.
|
|
|
|
void DialogWindowLayout::RemovePropertyBrowser ()
|
|
|
|
{
|
|
|
|
if (pPropertyBrowser)
|
|
|
|
Remove(pPropertyBrowser);
|
|
|
|
pPropertyBrowser = 0;
|
|
|
|
// refreshing the button state
|
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
|
|
|
pBindings->Invalidate(SID_SHOW_PROPERTYBROWSER);
|
|
|
|
}
|
2012-08-17 07:29:20 +02:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void DialogWindowLayout::Activating (BaseWindow& rChild)
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
|
|
|
assert(dynamic_cast<DialogWindow*>(&rChild));
|
|
|
|
pChild = &static_cast<DialogWindow&>(rChild);
|
|
|
|
rObjectCatalog.SetLayoutWindow(this);
|
|
|
|
rObjectCatalog.UpdateEntries();
|
|
|
|
rObjectCatalog.Show();
|
2012-09-05 19:41:42 +02:00
|
|
|
if (pPropertyBrowser)
|
|
|
|
pPropertyBrowser->Show();
|
2012-08-17 07:29:20 +02:00
|
|
|
Layout::Activating(rChild);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindowLayout::Deactivating ()
|
|
|
|
{
|
|
|
|
Layout::Deactivating();
|
|
|
|
rObjectCatalog.Hide();
|
2012-09-05 19:41:42 +02:00
|
|
|
if (pPropertyBrowser)
|
|
|
|
pPropertyBrowser->Hide();
|
2012-08-17 07:29:20 +02:00
|
|
|
pChild = 0;
|
|
|
|
}
|
|
|
|
|
2012-08-31 12:44:47 +02:00
|
|
|
void DialogWindowLayout::ExecuteGlobal (SfxRequest& rReq)
|
|
|
|
{
|
|
|
|
switch (rReq.GetSlot())
|
|
|
|
{
|
|
|
|
case SID_SHOW_PROPERTYBROWSER:
|
|
|
|
// toggling property browser
|
2012-09-05 19:41:42 +02:00
|
|
|
if (pPropertyBrowser && pPropertyBrowser->IsVisible())
|
|
|
|
pPropertyBrowser->Hide();
|
|
|
|
else
|
|
|
|
ShowPropertyBrowser();
|
2012-08-31 12:44:47 +02:00
|
|
|
ArrangeWindows();
|
2012-09-05 19:41:42 +02:00
|
|
|
// refreshing the button state
|
2012-08-31 12:44:47 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
|
|
|
pBindings->Invalidate(SID_SHOW_PROPERTYBROWSER);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
void DialogWindowLayout::GetState (SfxItemSet& rSet, unsigned nWhich)
|
|
|
|
{
|
|
|
|
switch (nWhich)
|
|
|
|
{
|
2012-08-31 12:44:47 +02:00
|
|
|
case SID_SHOW_PROPERTYBROWSER:
|
2012-09-05 19:41:42 +02:00
|
|
|
rSet.Put(SfxBoolItem(nWhich, pPropertyBrowser && pPropertyBrowser->IsVisible()));
|
2012-08-31 12:44:47 +02:00
|
|
|
break;
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
case SID_BASICIDE_CHOOSEMACRO:
|
|
|
|
rSet.Put(SfxVisibilityItem(nWhich, false));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-07 10:31:53 +02:00
|
|
|
void DialogWindowLayout::OnFirstSize (long const nWidth, long const nHeight)
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
2012-09-05 19:41:42 +02:00
|
|
|
AddToLeft(&rObjectCatalog, Size(nWidth * 0.25, nHeight * 0.35));
|
|
|
|
if (pPropertyBrowser)
|
|
|
|
AddPropertyBrowser();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogWindowLayout::AddPropertyBrowser () {
|
|
|
|
Size const aSize = GetOutputSizePixel();
|
|
|
|
AddToLeft(pPropertyBrowser, Size(aSize.Width() * 0.25, aSize.Height() * 0.65));
|
2012-08-17 07:29:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|