2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-05 20:18:35 +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-18 16:07:07 +00:00
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
#include <time.h>
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/sfxbasecontroller.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-03-27 10:29:38 +00:00
|
|
|
#include <com/sun/star/awt/KeyEvent.hpp>
|
|
|
|
#include <com/sun/star/awt/KeyModifier.hpp>
|
|
|
|
#include <com/sun/star/awt/MouseEvent.hpp>
|
|
|
|
#include <com/sun/star/awt/MouseButton.hpp>
|
2002-10-24 11:23:07 +00:00
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
|
|
|
#include <com/sun/star/util/XCloseBroadcaster.hpp>
|
|
|
|
#include <com/sun/star/util/XCloseListener.hpp>
|
|
|
|
#include <com/sun/star/util/CloseVetoException.hpp>
|
2012-10-09 17:52:40 +02:00
|
|
|
#include <com/sun/star/document/XCmisDocument.hpp>
|
2009-12-10 12:41:09 +01:00
|
|
|
#include <com/sun/star/document/XViewDataSupplier.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <cppuhelper/implbase1.hxx>
|
2002-07-10 12:32:22 +00:00
|
|
|
#include <cppuhelper/implbase2.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/frame/FrameActionEvent.hpp>
|
|
|
|
#include <com/sun/star/frame/FrameAction.hpp>
|
2004-11-16 14:29:19 +00:00
|
|
|
#include <com/sun/star/frame/CommandGroup.hpp>
|
2004-10-04 20:04:01 +00:00
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
|
|
|
#include <com/sun/star/frame/XBorderResizeListener.hpp>
|
2009-12-03 09:29:45 +01:00
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/lang/EventObject.hpp>
|
2002-07-10 12:32:22 +00:00
|
|
|
#include <com/sun/star/lang/XEventListener.hpp>
|
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
2009-12-10 12:41:09 +01:00
|
|
|
#include <com/sun/star/container/XIndexAccess.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <cppuhelper/interfacecontainer.hxx>
|
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
2003-05-15 09:54:37 +00:00
|
|
|
#include <basic/sbstar.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <uno/mapping.hxx>
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/viewsh.hxx>
|
2009-11-27 11:49:21 +01:00
|
|
|
#include <sfx2/docfac.hxx>
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#include <sfx2/objsh.hxx>
|
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <sfx2/msgpool.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2008-06-25 12:07:02 +00:00
|
|
|
#include <sfx2/userinputinterception.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <viewimp.hxx>
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/unoctitm.hxx>
|
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
#include <sfx2/sfxsids.hrc>
|
2012-10-09 17:52:40 +02:00
|
|
|
#include <sfx2/sfx.hrc>
|
|
|
|
#include <sfx2/sfxresid.hxx>
|
2001-03-30 14:58:20 +00:00
|
|
|
#include <workwin.hxx>
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/objface.hxx>
|
2012-10-11 14:14:48 +02:00
|
|
|
#include <sfx2/infobar.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <osl/mutex.hxx>
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2004-11-16 14:29:19 +00:00
|
|
|
#include <comphelper/sequence.hxx>
|
|
|
|
#include <rtl/ustrbuf.hxx>
|
2004-10-04 20:04:01 +00:00
|
|
|
#include <toolkit/helper/convert.hxx>
|
2008-04-04 13:22:36 +00:00
|
|
|
#include <framework/titlehelper.hxx>
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2012-10-17 17:17:27 +02:00
|
|
|
#include <vcl/msgbox.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2007-06-27 22:34:53 +00:00
|
|
|
#include <sfx2/event.hxx>
|
2013-11-11 22:11:22 -06:00
|
|
|
#include <sfx2/viewfac.hxx>
|
2014-06-25 14:57:44 +02:00
|
|
|
#include "sfxbasecontroller_internal.hxx"
|
2004-04-13 10:50:36 +00:00
|
|
|
|
2015-01-04 11:10:45 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2015-04-30 16:56:14 +02:00
|
|
|
#include <com/sun/star/ui/XSidebarProvider.hpp>
|
|
|
|
#include <sfx2/sidebar/UnoSidebar.hxx>
|
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
#define TIMEOUT_START_RESCHEDULE 10L /* 10th s */
|
|
|
|
|
2008-04-04 13:22:36 +00:00
|
|
|
using namespace ::com::sun::star;
|
2009-12-03 09:29:45 +01:00
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::uno::RuntimeException;
|
|
|
|
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
using ::com::sun::star::uno::UNO_SET_THROW;
|
2009-12-03 09:29:45 +01:00
|
|
|
using ::com::sun::star::lang::DisposedException;
|
|
|
|
using ::com::sun::star::awt::XWindow;
|
|
|
|
using ::com::sun::star::frame::XController;
|
|
|
|
using ::com::sun::star::frame::XDispatchProvider;
|
2009-12-10 12:41:09 +01:00
|
|
|
using ::com::sun::star::document::XViewDataSupplier;
|
|
|
|
using ::com::sun::star::container::XIndexAccess;
|
|
|
|
using ::com::sun::star::beans::PropertyValue;
|
|
|
|
using ::com::sun::star::uno::Sequence;
|
|
|
|
using ::com::sun::star::uno::UNO_QUERY;
|
|
|
|
using ::com::sun::star::uno::Exception;
|
2009-12-11 11:28:14 +01:00
|
|
|
using ::com::sun::star::frame::XFrame;
|
|
|
|
using ::com::sun::star::frame::XFrameActionListener;
|
|
|
|
using ::com::sun::star::util::XCloseListener;
|
|
|
|
using ::com::sun::star::task::XStatusIndicator;
|
|
|
|
using ::com::sun::star::frame::XTitle;
|
2015-04-30 16:56:14 +02:00
|
|
|
using ::com::sun::star::ui::XSidebarProvider;
|
|
|
|
|
2008-04-04 13:22:36 +00:00
|
|
|
|
2004-11-16 14:29:19 +00:00
|
|
|
struct GroupIDToCommandGroup
|
|
|
|
{
|
|
|
|
sal_Int16 nGroupID;
|
|
|
|
sal_Int16 nCommandGroup;
|
|
|
|
};
|
|
|
|
|
2013-08-22 12:05:18 +09:00
|
|
|
static bool bGroupIDMapInitialized = false;
|
2013-08-22 13:59:45 +09:00
|
|
|
static const GroupIDToCommandGroup GroupIDCommandGroupMap[] =
|
2004-11-16 14:29:19 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
{ GID_INTERN , frame::CommandGroup::INTERNAL },
|
|
|
|
{ GID_APPLICATION , frame::CommandGroup::APPLICATION },
|
|
|
|
{ GID_DOCUMENT , frame::CommandGroup::DOCUMENT },
|
|
|
|
{ GID_VIEW , frame::CommandGroup::VIEW },
|
|
|
|
{ GID_EDIT , frame::CommandGroup::EDIT },
|
|
|
|
{ GID_MACRO , frame::CommandGroup::MACRO },
|
|
|
|
{ GID_OPTIONS , frame::CommandGroup::OPTIONS },
|
|
|
|
{ GID_MATH , frame::CommandGroup::MATH },
|
|
|
|
{ GID_NAVIGATOR , frame::CommandGroup::NAVIGATOR },
|
|
|
|
{ GID_INSERT , frame::CommandGroup::INSERT },
|
|
|
|
{ GID_FORMAT , frame::CommandGroup::FORMAT },
|
|
|
|
{ GID_TEMPLATE , frame::CommandGroup::TEMPLATE },
|
|
|
|
{ GID_TEXT , frame::CommandGroup::TEXT },
|
|
|
|
{ GID_FRAME , frame::CommandGroup::FRAME },
|
|
|
|
{ GID_GRAPHIC , frame::CommandGroup::GRAPHIC },
|
|
|
|
{ GID_TABLE , frame::CommandGroup::TABLE },
|
|
|
|
{ GID_ENUMERATION , frame::CommandGroup::ENUMERATION },
|
|
|
|
{ GID_DATA , frame::CommandGroup::DATA },
|
|
|
|
{ GID_SPECIAL , frame::CommandGroup::SPECIAL },
|
|
|
|
{ GID_IMAGE , frame::CommandGroup::IMAGE },
|
|
|
|
{ GID_CHART , frame::CommandGroup::CHART },
|
|
|
|
{ GID_EXPLORER , frame::CommandGroup::EXPLORER },
|
|
|
|
{ GID_CONNECTOR , frame::CommandGroup::CONNECTOR },
|
|
|
|
{ GID_MODIFY , frame::CommandGroup::MODIFY },
|
|
|
|
{ GID_DRAWING , frame::CommandGroup::DRAWING },
|
|
|
|
{ GID_CONTROLS , frame::CommandGroup::CONTROLS },
|
2004-11-16 14:29:19 +00:00
|
|
|
{ 0 , 0 }
|
|
|
|
};
|
|
|
|
|
2015-01-04 11:10:45 +00:00
|
|
|
typedef std::unordered_map< sal_Int16, sal_Int16 > GroupHashMap;
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID )
|
|
|
|
{
|
|
|
|
static GroupHashMap mHashMap;
|
|
|
|
|
|
|
|
if ( !bGroupIDMapInitialized )
|
|
|
|
{
|
|
|
|
sal_Int32 i = 0;
|
|
|
|
while ( GroupIDCommandGroupMap[i].nGroupID != 0 )
|
|
|
|
{
|
|
|
|
mHashMap.insert( GroupHashMap::value_type(
|
|
|
|
GroupIDCommandGroupMap[i].nGroupID,
|
|
|
|
GroupIDCommandGroupMap[i].nCommandGroup ));
|
|
|
|
++i;
|
|
|
|
}
|
2013-08-22 12:05:18 +09:00
|
|
|
bGroupIDMapInitialized = true;
|
2004-11-16 14:29:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GroupHashMap::const_iterator pIter = mHashMap.find( nGroupID );
|
|
|
|
if ( pIter != mHashMap.end() )
|
|
|
|
return pIter->second;
|
|
|
|
else
|
2013-04-02 12:26:08 +02:00
|
|
|
return frame::CommandGroup::INTERNAL;
|
2004-11-16 14:29:19 +00:00
|
|
|
}
|
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
sal_uInt32 Get10ThSec()
|
|
|
|
{
|
|
|
|
sal_uInt32 n10Ticks = 10 * (sal_uInt32)clock();
|
|
|
|
return n10Ticks / CLOCKS_PER_SEC;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 m_nInReschedule = 0; /// static counter for rescheduling
|
|
|
|
|
|
|
|
void reschedule()
|
|
|
|
{
|
|
|
|
if ( m_nInReschedule == 0 )
|
|
|
|
{
|
|
|
|
++m_nInReschedule;
|
|
|
|
Application::Reschedule();
|
|
|
|
--m_nInReschedule;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
class SfxStatusIndicator : public ::cppu::WeakImplHelper2< task::XStatusIndicator, lang::XEventListener >
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
|
|
|
friend class SfxBaseController;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < XController > xOwner;
|
|
|
|
Reference < task::XStatusIndicator > xProgress;
|
2001-03-30 14:58:20 +00:00
|
|
|
SfxWorkWindow* pWorkWindow;
|
|
|
|
sal_Int32 _nRange;
|
|
|
|
sal_Int32 _nValue;
|
2001-12-03 16:46:38 +00:00
|
|
|
long _nStartTime;
|
2001-03-30 14:58:20 +00:00
|
|
|
public:
|
|
|
|
SfxStatusIndicator(SfxBaseController* pController, SfxWorkWindow* pWork)
|
2002-07-10 12:32:22 +00:00
|
|
|
: xOwner( pController )
|
2001-03-30 14:58:20 +00:00
|
|
|
, pWorkWindow( pWork )
|
2014-04-07 21:18:46 +01:00
|
|
|
, _nRange(0)
|
|
|
|
, _nValue(0)
|
|
|
|
, _nStartTime(0)
|
2002-07-10 12:32:22 +00:00
|
|
|
{
|
|
|
|
++m_refCount;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< lang::XComponent > xComponent(
|
|
|
|
(static_cast< ::cppu::OWeakObject* >(pController)), uno::UNO_QUERY );
|
2002-07-10 12:32:22 +00:00
|
|
|
if (xComponent.is())
|
|
|
|
xComponent->addEventListener(this);
|
|
|
|
--m_refCount;
|
|
|
|
}
|
2001-03-30 14:58:20 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void SAL_CALL start(const OUString& aText, sal_Int32 nRange) throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
2015-04-14 12:44:47 +02:00
|
|
|
virtual void SAL_CALL end() throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void SAL_CALL setText(const OUString& aText) throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
virtual void SAL_CALL setValue(sal_Int32 nValue) throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
virtual void SAL_CALL reset() throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
2002-07-10 12:32:22 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw(RuntimeException, std::exception) SAL_OVERRIDE;
|
2001-03-30 14:58:20 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxStatusIndicator::start(const OUString& aText, sal_Int32 nRange) throw(RuntimeException, std::exception)
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
if ( xOwner.is() )
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
|
|
|
_nRange = nRange;
|
|
|
|
_nValue = 0;
|
2004-09-09 15:52:01 +00:00
|
|
|
|
|
|
|
if ( !xProgress.is() )
|
|
|
|
xProgress = pWorkWindow->GetStatusIndicator();
|
|
|
|
|
|
|
|
if ( xProgress.is() )
|
|
|
|
xProgress->start( aText, nRange );
|
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
_nStartTime = Get10ThSec();
|
|
|
|
reschedule();
|
2001-03-30 14:58:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
void SAL_CALL SfxStatusIndicator::end() throw(RuntimeException, std::exception)
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
if ( xOwner.is() )
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2004-09-09 15:52:01 +00:00
|
|
|
if ( !xProgress.is() )
|
|
|
|
xProgress = pWorkWindow->GetStatusIndicator();
|
|
|
|
|
|
|
|
if ( xProgress.is() )
|
|
|
|
xProgress->end();
|
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
reschedule();
|
2001-03-30 14:58:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxStatusIndicator::setText(const OUString& aText) throw(RuntimeException, std::exception)
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
if ( xOwner.is() )
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2004-09-09 15:52:01 +00:00
|
|
|
if ( !xProgress.is() )
|
|
|
|
xProgress = pWorkWindow->GetStatusIndicator();
|
|
|
|
|
|
|
|
if ( xProgress.is() )
|
|
|
|
xProgress->setText( aText );
|
2001-12-03 16:46:38 +00:00
|
|
|
|
|
|
|
reschedule();
|
2001-03-30 14:58:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxStatusIndicator::setValue( sal_Int32 nValue ) throw(RuntimeException, std::exception)
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
if ( xOwner.is() )
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
|
|
|
_nValue = nValue;
|
2004-09-09 15:52:01 +00:00
|
|
|
|
|
|
|
if ( !xProgress.is() )
|
|
|
|
xProgress = pWorkWindow->GetStatusIndicator();
|
|
|
|
|
|
|
|
if ( xProgress.is() )
|
|
|
|
xProgress->setValue( nValue );
|
|
|
|
|
2013-08-22 12:05:18 +09:00
|
|
|
bool bReschedule = (( Get10ThSec() - _nStartTime ) > TIMEOUT_START_RESCHEDULE );
|
2001-12-03 16:46:38 +00:00
|
|
|
if ( bReschedule )
|
|
|
|
reschedule();
|
2001-03-30 14:58:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxStatusIndicator::reset() throw(RuntimeException, std::exception)
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
if ( xOwner.is() )
|
2001-03-30 14:58:20 +00:00
|
|
|
{
|
2004-09-09 15:52:01 +00:00
|
|
|
if ( !xProgress.is() )
|
|
|
|
xProgress = pWorkWindow->GetStatusIndicator();
|
|
|
|
|
|
|
|
if ( xProgress.is() )
|
|
|
|
xProgress->reset();
|
|
|
|
|
2001-12-03 16:46:38 +00:00
|
|
|
reschedule();
|
2001-03-30 14:58:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxStatusIndicator::disposing( const lang::EventObject& /*Source*/ ) throw(RuntimeException, std::exception)
|
2002-07-10 12:32:22 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-07-10 12:32:22 +00:00
|
|
|
xOwner = 0;
|
2004-09-09 15:52:01 +00:00
|
|
|
xProgress.clear();
|
2002-07-10 12:32:22 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// declaration IMPL_SfxBaseController_ListenerHelper
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
class IMPL_SfxBaseController_ListenerHelper : public ::cppu::WeakImplHelper1< frame::XFrameActionListener >
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-08-16 08:33:33 +02:00
|
|
|
IMPL_SfxBaseController_ListenerHelper( SfxBaseController* pController ) ;
|
2000-09-18 16:07:07 +00:00
|
|
|
virtual ~IMPL_SfxBaseController_ListenerHelper() ;
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void SAL_CALL frameAction( const frame::FrameActionEvent& aEvent ) throw (RuntimeException, std::exception) SAL_OVERRIDE ;
|
|
|
|
virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw (RuntimeException, std::exception) SAL_OVERRIDE ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
SfxBaseController* m_pController ;
|
|
|
|
|
|
|
|
} ; // class IMPL_SfxBaseController_ListenerContainer
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
class IMPL_SfxBaseController_CloseListenerHelper : public ::cppu::WeakImplHelper1< util::XCloseListener >
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-08-16 08:33:33 +02:00
|
|
|
IMPL_SfxBaseController_CloseListenerHelper( SfxBaseController* pController ) ;
|
2002-10-24 11:23:07 +00:00
|
|
|
virtual ~IMPL_SfxBaseController_CloseListenerHelper() ;
|
2013-04-02 12:26:08 +02:00
|
|
|
virtual void SAL_CALL queryClosing( const lang::EventObject& aEvent, sal_Bool bDeliverOwnership )
|
2014-03-27 18:12:18 +01:00
|
|
|
throw (RuntimeException, util::CloseVetoException, std::exception) SAL_OVERRIDE ;
|
|
|
|
virtual void SAL_CALL notifyClosing( const lang::EventObject& aEvent ) throw (RuntimeException, std::exception) SAL_OVERRIDE ;
|
|
|
|
virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw (RuntimeException, std::exception) SAL_OVERRIDE ;
|
2002-10-24 11:23:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
SfxBaseController* m_pController;
|
|
|
|
|
|
|
|
} ; // class IMPL_SfxBaseController_ListenerContainer
|
|
|
|
|
2012-08-16 08:33:33 +02:00
|
|
|
IMPL_SfxBaseController_CloseListenerHelper::IMPL_SfxBaseController_CloseListenerHelper( SfxBaseController* pController )
|
|
|
|
: m_pController ( pController )
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
IMPL_SfxBaseController_CloseListenerHelper::~IMPL_SfxBaseController_CloseListenerHelper()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::disposing( const lang::EventObject& /*aEvent*/ ) throw( RuntimeException, std::exception )
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const lang::EventObject& aEvent, sal_Bool bDeliverOwnership )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, util::CloseVetoException, std::exception)
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-11-17 14:35:09 +00:00
|
|
|
SfxViewShell* pShell = m_pController->GetViewShell_Impl();
|
2014-03-11 13:34:17 +00:00
|
|
|
if (pShell)
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
2014-03-19 09:01:06 +02:00
|
|
|
bool bCanClose = pShell->PrepareClose( false );
|
2002-10-24 11:23:07 +00:00
|
|
|
if ( !bCanClose )
|
|
|
|
{
|
2004-11-17 14:35:09 +00:00
|
|
|
if ( bDeliverOwnership && ( !pShell->GetWindow() || !pShell->GetWindow()->IsReallyVisible() ) )
|
|
|
|
{
|
2013-03-25 23:03:49 +02:00
|
|
|
// ignore Ownership in case of visible frame (will be closed by user)
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < frame::XModel > xModel( aEvent.Source, uno::UNO_QUERY );
|
2004-11-17 14:35:09 +00:00
|
|
|
if ( xModel.is() )
|
2013-03-25 23:03:49 +02:00
|
|
|
pShell->TakeOwnership_Impl();
|
2004-11-17 14:35:09 +00:00
|
|
|
else
|
2013-03-25 23:03:49 +02:00
|
|
|
pShell->TakeFrameOwnership_Impl();
|
2004-11-17 14:35:09 +00:00
|
|
|
}
|
|
|
|
|
2013-06-29 21:24:12 +02:00
|
|
|
throw util::CloseVetoException("Controller disagree ...",static_cast< ::cppu::OWeakObject*>(this));
|
2002-10-24 11:23:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::notifyClosing( const lang::EventObject& /*aEvent*/ ) throw (RuntimeException, std::exception)
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// declaration IMPL_SfxBaseController_DataContainer
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
struct IMPL_SfxBaseController_DataContainer
|
|
|
|
{
|
2009-12-11 11:28:14 +01:00
|
|
|
Reference< XFrame > m_xFrame ;
|
|
|
|
Reference< XFrameActionListener > m_xListener ;
|
|
|
|
Reference< XCloseListener > m_xCloseListener ;
|
2008-06-25 12:07:02 +00:00
|
|
|
::sfx2::UserInputInterception m_aUserInputInterception;
|
2013-04-02 12:26:08 +02:00
|
|
|
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ;
|
|
|
|
::cppu::OInterfaceContainerHelper m_aInterceptorContainer ;
|
2009-12-11 11:28:14 +01:00
|
|
|
Reference< XStatusIndicator > m_xIndicator ;
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxViewShell* m_pViewShell ;
|
|
|
|
SfxBaseController* m_pController ;
|
2013-08-22 12:05:18 +09:00
|
|
|
bool m_bDisposing ;
|
2014-03-17 14:34:01 +02:00
|
|
|
bool m_bSuspendState ;
|
2009-12-11 11:28:14 +01:00
|
|
|
Reference< XTitle > m_xTitleHelper ;
|
|
|
|
Sequence< PropertyValue > m_aCreationArgs ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
IMPL_SfxBaseController_DataContainer( ::osl::Mutex& aMutex ,
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxViewShell* pViewShell ,
|
|
|
|
SfxBaseController* pController )
|
2012-08-16 08:33:33 +02:00
|
|
|
: m_xListener ( new IMPL_SfxBaseController_ListenerHelper( pController ) )
|
|
|
|
, m_xCloseListener ( new IMPL_SfxBaseController_CloseListenerHelper( pController ) )
|
2008-06-25 12:07:02 +00:00
|
|
|
, m_aUserInputInterception ( *pController, aMutex )
|
2006-06-19 21:38:48 +00:00
|
|
|
, m_aListenerContainer ( aMutex )
|
|
|
|
, m_aInterceptorContainer ( aMutex )
|
2000-09-18 16:07:07 +00:00
|
|
|
, m_pViewShell ( pViewShell )
|
|
|
|
, m_pController ( pController )
|
2013-08-22 12:05:18 +09:00
|
|
|
, m_bDisposing ( false )
|
2014-03-17 14:34:01 +02:00
|
|
|
, m_bSuspendState ( false )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
} ; // struct IMPL_SfxBaseController_DataContainer
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// IMPL_SfxBaseController_ListenerHelper constructor
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2012-08-16 08:33:33 +02:00
|
|
|
IMPL_SfxBaseController_ListenerHelper::IMPL_SfxBaseController_ListenerHelper( SfxBaseController* pController )
|
|
|
|
: m_pController ( pController )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// IMPL_SfxBaseController_ListenerHelper destructor
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
IMPL_SfxBaseController_ListenerHelper::~IMPL_SfxBaseController_ListenerHelper()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL IMPL_SfxBaseController_ListenerHelper::frameAction( const frame::FrameActionEvent& aEvent ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
if (
|
2000-12-10 13:30:37 +00:00
|
|
|
( m_pController != NULL ) &&
|
|
|
|
( aEvent.Frame == m_pController->getFrame() ) &&
|
2000-09-18 16:07:07 +00:00
|
|
|
( m_pController->GetViewShell_Impl() && m_pController->GetViewShell_Impl()->GetWindow() != NULL )
|
|
|
|
)
|
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
if ( aEvent.Action == frame::FrameAction_FRAME_UI_ACTIVATED )
|
2000-12-10 13:30:37 +00:00
|
|
|
{
|
2007-01-23 06:14:52 +00:00
|
|
|
if ( !m_pController->GetViewShell_Impl()->GetUIActiveIPClient_Impl() )
|
2014-03-19 09:01:06 +02:00
|
|
|
m_pController->GetViewShell_Impl()->GetViewFrame()->MakeActive_Impl( false );
|
2000-12-10 13:30:37 +00:00
|
|
|
}
|
2013-04-02 12:26:08 +02:00
|
|
|
else if ( aEvent.Action == frame::FrameAction_CONTEXT_CHANGED )
|
2000-12-10 13:30:37 +00:00
|
|
|
{
|
2002-09-18 15:10:39 +00:00
|
|
|
m_pController->GetViewShell_Impl()->GetViewFrame()->GetBindings().ContextChanged_Impl();
|
2000-12-10 13:30:37 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// IMPL_SfxBaseController_ListenerHelper -> XEventListener
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing( const lang::EventObject& /*aEvent*/ ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2002-10-24 11:47:59 +00:00
|
|
|
if ( m_pController && m_pController->getFrame().is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
m_pController->getFrame()->removeFrameActionListener( this ) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxBaseController::SfxBaseController( SfxViewShell* pViewShell )
|
2009-12-03 09:29:45 +01:00
|
|
|
: m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this ))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
m_pData->m_pViewShell->SetController( this );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> destructor
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SfxBaseController::~SfxBaseController()
|
|
|
|
{
|
2000-12-06 12:30:02 +00:00
|
|
|
delete m_pData;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2009-12-03 09:29:45 +01:00
|
|
|
// SfxBaseController -> XController2
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (RuntimeException, std::exception)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2009-12-03 09:29:45 +01:00
|
|
|
if ( !m_pData->m_pViewShell )
|
|
|
|
throw DisposedException();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
return Reference< XWindow >( GetViewFrame_Impl().GetFrame().GetWindow().GetComponentInterface(), UNO_QUERY_THROW );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException, std::exception)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2009-12-10 15:36:53 +01:00
|
|
|
if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
|
2009-12-03 09:29:45 +01:00
|
|
|
throw DisposedException();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-10 15:36:53 +01:00
|
|
|
const SfxObjectFactory& rDocFac( m_pData->m_pViewShell->GetObjectShell()->GetFactory() );
|
2009-12-11 11:28:14 +01:00
|
|
|
sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl().GetCurViewId(), rDocFac.GetViewFactoryCount() );
|
2009-12-10 15:36:53 +01:00
|
|
|
OSL_ENSURE( nViewNo < rDocFac.GetViewFactoryCount(), "SfxBaseController::getViewControllerName: view ID not found in view factories!" );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sViewName;
|
2009-12-10 15:36:53 +01:00
|
|
|
if ( nViewNo < rDocFac.GetViewFactoryCount() )
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-10 15:36:53 +01:00
|
|
|
return sViewName;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Sequence< PropertyValue > SAL_CALL SfxBaseController::getCreationArguments() throw (RuntimeException, std::exception)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2009-12-11 11:28:14 +01:00
|
|
|
if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
|
|
|
|
throw DisposedException();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-11 11:28:14 +01:00
|
|
|
return m_pData->m_aCreationArgs;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-11 11:28:14 +01:00
|
|
|
void SfxBaseController::SetCreationArguments_Impl( const Sequence< PropertyValue >& i_rCreationArgs )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( m_pData->m_aCreationArgs.getLength() == 0, "SfxBaseController::SetCreationArguments_Impl: not intended to be called twice!" );
|
|
|
|
m_pData->m_aCreationArgs = i_rCreationArgs;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2009-12-11 11:28:14 +01:00
|
|
|
SfxViewFrame& SfxBaseController::GetViewFrame_Impl() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2009-12-03 09:29:45 +01:00
|
|
|
ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
|
|
|
|
SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame();
|
|
|
|
ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" );
|
2009-12-11 11:28:14 +01:00
|
|
|
return *pActFrame;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2015-04-30 16:56:14 +02:00
|
|
|
Reference<XSidebarProvider> SAL_CALL SfxBaseController::getSidebar() throw (RuntimeException, std::exception)
|
|
|
|
{
|
|
|
|
SfxViewFrame& rViewFrame = GetViewFrame_Impl();
|
|
|
|
SfxFrame& rFrame = rViewFrame.GetFrame();
|
|
|
|
|
|
|
|
Reference<XSidebarProvider> rSidebar = new SfxUnoSidebar(rFrame.GetFrameInterface());
|
|
|
|
return rSidebar;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-03 09:29:45 +01:00
|
|
|
// SfxBaseController -> XController2 -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::attachFrame( const Reference< frame::XFrame >& xFrame ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XFrame > xTemp( getFrame() ) ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( xTemp.is() )
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
xTemp->removeFrameActionListener( m_pData->m_xListener ) ;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < util::XCloseBroadcaster > xCloseable( xTemp, uno::UNO_QUERY );
|
2002-10-24 11:23:07 +00:00
|
|
|
if ( xCloseable.is() )
|
2002-10-24 11:47:59 +00:00
|
|
|
xCloseable->removeCloseListener( m_pData->m_xCloseListener );
|
2002-10-24 11:23:07 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
m_pData->m_xFrame = xFrame;
|
2002-10-24 11:47:59 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( xFrame.is() )
|
2002-10-24 11:47:59 +00:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
xFrame->addFrameActionListener( m_pData->m_xListener ) ;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < util::XCloseBroadcaster > xCloseable( xFrame, uno::UNO_QUERY );
|
2002-10-24 11:47:59 +00:00
|
|
|
if ( xCloseable.is() )
|
|
|
|
xCloseable->addCloseListener( m_pData->m_xCloseListener );
|
2004-04-21 11:20:07 +00:00
|
|
|
|
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
2009-12-07 14:33:16 +01:00
|
|
|
ConnectSfxFrame_Impl( E_CONNECT );
|
2012-10-09 17:52:40 +02:00
|
|
|
ShowInfoBars( );
|
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test
2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test
2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ...
2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in
2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs)
2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing
2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing
2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript
2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test
2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test
2009-11-03 14:25:44 +0000 fs r277324 : #i10000#
2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs
2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ...
2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM)
2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion
2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense
2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE
2009-10-21 07:08:35 +0000 fs r277075 : spare useless call
2009-10-20 21:26:31 +0000 fs r277072 : #i10000#
2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62)
2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch
2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks.
2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk)
2009-10-15 12:52:39 +0000 fs r276939 : #i10000#
2009-10-15 12:44:26 +0000 fs r276938 : #i10000#
2009-10-15 12:00:33 +0000 fs r276936 : #i10000#
2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg
2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const
2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#:
introduce an option to the layout manager to preserve, if possible, the size of the content window
when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing.
(the option is incompatible with in-place editing, anyway)
This is because such embedded objects couple the (content) window size to the VisAreaSize, in that
both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize,
and restores it upon next open. This, however, leads to different content window sizes when the
window is closed with another toolbar set than used during opening.
This patch here prevents those different content window sizes. Also, now the content window size
doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content
window size stays the same, and the container window size is adjusted.
2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows
2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable)
2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows
2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service
2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist
2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties
2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified
2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command
2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 12:59:17 +0000 fs r276754 : #i87693#
2009-10-07 11:19:22 +0000 fs r276752 : #i10000#
2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller)
2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for
issue #i105371#
2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion
2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol
2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release:
when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing
the ref count, again. This ensures that our adapter cannot create references to the dying object anymore.
(A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous
release/dispose/destroy pattern, namely WeakComponentImplHelperBase)
2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying
2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool)
2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked
2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails
2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet
revealed some inconsistencies, in whether the objects are cached by their URL, or by their
registration name. This has been changed to caching by registration name.
2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case
2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed
2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable
(timing-dependent) results/failures. Instead, every test sets up a new odb file.
Also, did some re-factoring, improved the cleanup code, and caught a few more errors.
2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now
2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose
2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now
2009-10-06 12:49:22 +0000 fs r276707 : typo
2009-10-06 12:49:03 +0000 fs r276706 : typo
2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class
2009-10-06 12:48:02 +0000 fs r276704 : typo
2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably
2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence
2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope
2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create
2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope
2009-10-05 09:46:17 +0000 fs r276671 : #i10000#
2009-10-05 08:43:58 +0000 fs r276664 : #i105505#
release: dispose the (base classes) weak connection point before disposing ourself,
and in particular before temporarily incrementing our ref count, again.
This way, we prevent that a separate thread re-surrects us (using the weak connection
point's queryAdapted) while we're in the process of destruction
2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release)
2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead
2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics
2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants
2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign
2009-10-04 19:53:30 +0000 fs r276657 : #105560#
remove unused code
thanks to cmc@openoffice.org for submitting the patch
2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc)
2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60)
2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ...
2009-10-02 10:52:24 +0000 fs r276634 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes
2009-10-01 09:12:20 +0000 fs r276582 : #i105505#
2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion
2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods
2009-09-30 06:35:59 +0000 fs r276538 : #i10000#
2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113#
2009-09-29 10:27:10 +0000 fs r276520 : #i105367#
2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles
2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc
2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE...
2009-09-28 20:53:36 +0000 fs r276503 : #i104117#
cleaned up the mess with help IDs in module extensions.
Formerly, extensions used to use help IDs which were declared in module svx, and vice versa.
Also, help ID ranges were not respected.
2009-09-28 11:25:36 +0000 fs r276489 : typo
2009-09-28 11:25:10 +0000 fs r276488 : #i105235#
2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar
2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-16 11:11:43 +0000 fs r276195 : #i105082#
consolidated the sub storage handling, by delegating more functionality into
the DocumentStorageAccess class. As a result, there won't be that many unnecessary
commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages
and DocumentStorageAccess::m_aExposedStorages) have been consolidated.
This is not really part of the fix of issue 105082, but it helped reducing the
calls to the storage/package implementation.
2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures)
2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved
2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error
2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS
2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models
2009-09-14 10:33:02 +0000 fs r276106 : removed dead file
2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor
2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text
2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
2009-11-27 12:39:32 +00:00
|
|
|
|
2009-12-10 12:41:09 +01:00
|
|
|
// attaching the frame to the controller is the last step in the creation of a new view, so notify this
|
2015-04-28 15:01:43 +02:00
|
|
|
SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
|
2014-06-27 10:26:55 +02:00
|
|
|
SfxGetpApp()->NotifyEvent( aHint );
|
2004-04-21 11:20:07 +00:00
|
|
|
}
|
2002-10-24 11:47:59 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
sal_Bool SAL_CALL SfxBaseController::attachModel( const Reference< frame::XModel >& xModel ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-03-27 10:29:38 +00:00
|
|
|
if ( m_pData->m_pViewShell && xModel.is() && xModel != m_pData->m_pViewShell->GetObjectShell()->GetModel() )
|
|
|
|
{
|
|
|
|
// don't allow to reattach a model!
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL("Can't reattach model!");
|
2003-03-27 10:29:38 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < util::XCloseBroadcaster > xCloseable( xModel, uno::UNO_QUERY );
|
2002-10-24 11:23:07 +00:00
|
|
|
if ( xCloseable.is() )
|
|
|
|
xCloseable->addCloseListener( m_pData->m_xCloseListener );
|
|
|
|
return sal_True;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2005-04-18 13:40:23 +00:00
|
|
|
|
2013-09-26 11:44:54 +02:00
|
|
|
// ignore dublicate calls, which doesn't change anything real
|
2015-04-27 16:08:24 +02:00
|
|
|
if (bool(bSuspend) == m_pData->m_bSuspendState)
|
2005-04-18 13:40:23 +00:00
|
|
|
return sal_True;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( bSuspend == sal_True )
|
|
|
|
{
|
|
|
|
if ( !m_pData->m_pViewShell )
|
2005-04-18 13:40:23 +00:00
|
|
|
{
|
2014-03-17 14:34:01 +02:00
|
|
|
m_pData->m_bSuspendState = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
return sal_True;
|
2005-04-18 13:40:23 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-04-21 11:20:07 +00:00
|
|
|
if ( !m_pData->m_pViewShell->PrepareClose() )
|
|
|
|
return sal_False;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-04-21 11:20:07 +00:00
|
|
|
if ( getFrame().is() )
|
|
|
|
getFrame()->removeFrameActionListener( m_pData->m_xListener ) ;
|
|
|
|
SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2011-03-11 15:39:32 +05:30
|
|
|
// More Views on the same document?
|
2004-04-21 11:20:07 +00:00
|
|
|
SfxObjectShell* pDocShell = m_pData->m_pViewShell->GetObjectShell() ;
|
2013-08-22 12:05:18 +09:00
|
|
|
bool bOther = false ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-04-21 11:20:07 +00:00
|
|
|
for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); !bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ) )
|
|
|
|
bOther = (pFrame != pActFrame);
|
|
|
|
|
2014-01-14 09:31:42 +01:00
|
|
|
bool bRet = bOther || pDocShell->PrepareClose();
|
2004-04-21 11:20:07 +00:00
|
|
|
if ( bRet )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2009-12-07 14:33:16 +01:00
|
|
|
ConnectSfxFrame_Impl( E_DISCONNECT );
|
2014-03-17 14:34:01 +02:00
|
|
|
m_pData->m_bSuspendState = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-04-21 11:20:07 +00:00
|
|
|
|
|
|
|
return bRet;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-24 12:06:11 +00:00
|
|
|
if ( getFrame().is() )
|
|
|
|
getFrame()->addFrameActionListener( m_pData->m_xListener ) ;
|
2004-04-21 11:20:07 +00:00
|
|
|
|
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
2009-12-07 14:33:16 +01:00
|
|
|
ConnectSfxFrame_Impl( E_RECONNECT );
|
2004-04-21 11:20:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 14:34:01 +02:00
|
|
|
m_pData->m_bSuspendState = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
return sal_True ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::Any SfxBaseController::getViewData() throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Any aAny;
|
2013-08-14 18:41:28 +04:00
|
|
|
OUString sData;
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
2013-08-14 18:41:28 +04:00
|
|
|
m_pData->m_pViewShell->WriteUserData( sData ) ;
|
2000-09-18 16:07:07 +00:00
|
|
|
aAny <<= sData ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return aAny ;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::restoreViewData( const uno::Any& aValue ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sData;
|
2000-09-18 16:07:07 +00:00
|
|
|
aValue >>= sData ;
|
|
|
|
m_pData->m_pViewShell->ReadUserData( sData ) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< frame::XFrame > SAL_CALL SfxBaseController::getFrame() throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2000-09-18 16:07:07 +00:00
|
|
|
return m_pData->m_xFrame;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XController
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< frame::XModel > SAL_CALL SfxBaseController::getModel() throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2013-04-02 12:26:08 +02:00
|
|
|
return m_pData->m_pViewShell ? m_pData->m_pViewShell->GetObjectShell()->GetModel() : Reference < frame::XModel > () ;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XDispatchProvider
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const util::URL& aURL ,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sTargetFrameName,
|
2014-02-25 21:31:58 +01:00
|
|
|
sal_Int32 eSearchFlags ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XDispatch > xDisp;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
SfxViewFrame* pAct = m_pData->m_pViewShell->GetViewFrame() ;
|
|
|
|
if ( !m_pData->m_bDisposing )
|
|
|
|
{
|
2012-04-06 15:05:52 +02:00
|
|
|
if ( sTargetFrameName == "_beamer" )
|
2000-10-23 11:06:48 +00:00
|
|
|
{
|
|
|
|
SfxViewFrame *pFrame = m_pData->m_pViewShell->GetViewFrame();
|
2013-04-02 12:26:08 +02:00
|
|
|
if ( eSearchFlags & ( frame::FrameSearchFlag::CREATE ))
|
2014-03-19 09:01:06 +02:00
|
|
|
pFrame->SetChildWindow( SID_BROWSER, true );
|
2000-12-18 08:09:08 +00:00
|
|
|
SfxChildWindow* pChildWin = pFrame->GetChildWindow( SID_BROWSER );
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < frame::XFrame > xFrame;
|
2001-02-14 12:05:50 +00:00
|
|
|
if ( pChildWin )
|
|
|
|
xFrame = ( pChildWin->GetFrame() );
|
2000-10-23 11:10:27 +00:00
|
|
|
if ( xFrame.is() )
|
|
|
|
xFrame->setName( sTargetFrameName );
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< XDispatchProvider > xProv( xFrame, uno::UNO_QUERY );
|
2000-10-23 11:06:48 +00:00
|
|
|
if ( xProv.is() )
|
2013-04-02 12:26:08 +02:00
|
|
|
return xProv->queryDispatch( aURL, sTargetFrameName, frame::FrameSearchFlag::SELF );
|
2000-10-23 11:06:48 +00:00
|
|
|
}
|
|
|
|
|
2012-04-06 15:05:52 +02:00
|
|
|
if ( aURL.Protocol == ".uno:" )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aMasterCommand = SfxOfficeDispatch::GetMasterUnoCommand( aURL );
|
2014-03-17 14:34:01 +02:00
|
|
|
bool bMasterCommand( !aMasterCommand.isEmpty() );
|
2004-10-12 17:04:16 +00:00
|
|
|
|
2004-10-04 20:04:01 +00:00
|
|
|
pAct = m_pData->m_pViewShell->GetViewFrame() ;
|
2006-05-02 16:05:45 +00:00
|
|
|
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct );
|
2004-10-12 17:04:16 +00:00
|
|
|
|
|
|
|
const SfxSlot* pSlot( 0 );
|
|
|
|
if ( bMasterCommand )
|
|
|
|
pSlot = rSlotPool.GetUnoSlot( aMasterCommand );
|
|
|
|
else
|
|
|
|
pSlot = rSlotPool.GetUnoSlot( aURL.Path );
|
2015-02-24 13:21:11 +02:00
|
|
|
if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SfxSlotMode::CONTAINER ) ) )
|
2005-01-18 15:20:17 +00:00
|
|
|
return pAct->GetBindings().GetDispatch( pSlot, aURL, bMasterCommand );
|
2004-10-04 20:04:01 +00:00
|
|
|
else
|
2004-02-25 14:48:36 +00:00
|
|
|
{
|
2004-10-04 20:04:01 +00:00
|
|
|
// try to find parent SfxViewFrame
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XFrame > xParentFrame;
|
|
|
|
Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
|
2004-10-04 20:04:01 +00:00
|
|
|
if ( xOwnFrame.is() )
|
2013-04-02 12:26:08 +02:00
|
|
|
xParentFrame = Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
|
2004-10-04 20:04:01 +00:00
|
|
|
|
|
|
|
if ( xParentFrame.is() )
|
2002-04-25 07:29:03 +00:00
|
|
|
{
|
2004-10-04 20:04:01 +00:00
|
|
|
// TODO/LATER: in future probably SfxViewFrame hirarchy should be the same as XFrame hirarchy
|
|
|
|
// SfxViewFrame* pParentFrame = pAct->GetParentViewFrame();
|
|
|
|
|
|
|
|
// search the related SfxViewFrame
|
|
|
|
SfxViewFrame* pParentFrame = NULL;
|
|
|
|
for ( SfxViewFrame* pFrame = SfxViewFrame::GetFirst();
|
|
|
|
pFrame;
|
|
|
|
pFrame = SfxViewFrame::GetNext( *pFrame ) )
|
|
|
|
{
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
|
|
|
pParentFrame = pFrame;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pParentFrame )
|
|
|
|
{
|
2006-06-19 21:38:48 +00:00
|
|
|
SfxSlotPool& rFrameSlotPool = SfxSlotPool::GetSlotPool( pParentFrame );
|
|
|
|
const SfxSlot* pSlot2( 0 );
|
2004-10-12 17:04:16 +00:00
|
|
|
if ( bMasterCommand )
|
2006-06-19 21:38:48 +00:00
|
|
|
pSlot2 = rFrameSlotPool.GetUnoSlot( aMasterCommand );
|
2004-10-12 17:04:16 +00:00
|
|
|
else
|
2006-06-19 21:38:48 +00:00
|
|
|
pSlot2 = rFrameSlotPool.GetUnoSlot( aURL.Path );
|
2004-10-12 17:04:16 +00:00
|
|
|
|
2006-06-19 21:38:48 +00:00
|
|
|
if ( pSlot2 )
|
|
|
|
return pParentFrame->GetBindings().GetDispatch( pSlot2, aURL, bMasterCommand );
|
2004-10-04 20:04:01 +00:00
|
|
|
}
|
2002-04-25 07:29:03 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2012-04-06 15:05:52 +02:00
|
|
|
else if ( aURL.Protocol == "slot:" )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-07 17:14:47 +01:00
|
|
|
sal_uInt16 nId = (sal_uInt16) aURL.Path.toInt32();
|
2004-10-04 20:04:01 +00:00
|
|
|
|
|
|
|
pAct = m_pData->m_pViewShell->GetViewFrame() ;
|
|
|
|
if (nId >= SID_VERB_START && nId <= SID_VERB_END)
|
2004-02-25 14:48:36 +00:00
|
|
|
{
|
2004-10-04 20:04:01 +00:00
|
|
|
const SfxSlot* pSlot = m_pData->m_pViewShell->GetVerbSlot_Impl(nId);
|
2004-07-06 12:40:29 +00:00
|
|
|
if ( pSlot )
|
2014-03-12 11:14:12 +02:00
|
|
|
return pAct->GetBindings().GetDispatch( pSlot, aURL, false );
|
2004-02-25 14:48:36 +00:00
|
|
|
}
|
|
|
|
|
2006-05-02 16:05:45 +00:00
|
|
|
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct );
|
2004-07-06 12:40:29 +00:00
|
|
|
const SfxSlot* pSlot = rSlotPool.GetSlot( nId );
|
2015-02-24 13:21:11 +02:00
|
|
|
if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SfxSlotMode::CONTAINER ) ) )
|
2014-03-12 11:14:12 +02:00
|
|
|
return pAct->GetBindings().GetDispatch( pSlot, aURL, false );
|
2004-10-04 20:04:01 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// try to find parent SfxViewFrame
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XFrame > xParentFrame;
|
|
|
|
Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
|
2004-10-04 20:04:01 +00:00
|
|
|
if ( xOwnFrame.is() )
|
2013-04-02 12:26:08 +02:00
|
|
|
xParentFrame = Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
|
2004-10-04 20:04:01 +00:00
|
|
|
|
|
|
|
if ( xParentFrame.is() )
|
|
|
|
{
|
|
|
|
// TODO/LATER: in future probably SfxViewFrame hirarchy should be the same as XFrame hirarchy
|
|
|
|
// SfxViewFrame* pParentFrame = pAct->GetParentViewFrame();
|
|
|
|
|
|
|
|
// search the related SfxViewFrame
|
|
|
|
SfxViewFrame* pParentFrame = NULL;
|
|
|
|
for ( SfxViewFrame* pFrame = SfxViewFrame::GetFirst();
|
|
|
|
pFrame;
|
|
|
|
pFrame = SfxViewFrame::GetNext( *pFrame ) )
|
|
|
|
{
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
|
|
|
pParentFrame = pFrame;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pParentFrame )
|
|
|
|
{
|
2006-06-19 21:38:48 +00:00
|
|
|
SfxSlotPool& rSlotPool2 = SfxSlotPool::GetSlotPool( pParentFrame );
|
|
|
|
const SfxSlot* pSlot2 = rSlotPool2.GetUnoSlot( aURL.Path );
|
|
|
|
if ( pSlot2 )
|
2014-03-12 11:14:12 +02:00
|
|
|
return pParentFrame->GetBindings().GetDispatch( pSlot2, aURL, false );
|
2004-10-04 20:04:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-01-21 15:53:55 +01:00
|
|
|
else if( sTargetFrameName == "_self" || sTargetFrameName.isEmpty() )
|
2001-11-29 10:06:45 +00:00
|
|
|
{
|
|
|
|
// check for already loaded URL ... but with additional jumpmark!
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XModel > xModel = getModel();
|
2012-01-10 17:54:51 -02:00
|
|
|
if( xModel.is() && !aURL.Mark.isEmpty() )
|
2001-11-29 10:06:45 +00:00
|
|
|
{
|
2006-05-02 16:05:45 +00:00
|
|
|
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct );
|
2005-01-18 15:20:17 +00:00
|
|
|
const SfxSlot* pSlot = rSlotPool.GetSlot( SID_JUMPTOMARK );
|
2012-01-10 17:54:51 -02:00
|
|
|
if( !aURL.Main.isEmpty() && aURL.Main == xModel->getURL() && pSlot )
|
2013-04-02 12:26:08 +02:00
|
|
|
return Reference< frame::XDispatch >( new SfxOfficeDispatch( pAct->GetBindings(), pAct->GetDispatcher(), pSlot, aURL) );
|
2001-11-29 10:06:45 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return xDisp;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XDispatchProvider
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::Sequence< Reference< frame::XDispatch > > SAL_CALL SfxBaseController::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& seqDescripts ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2002-07-08 11:00:14 +00:00
|
|
|
// Create return list - which must have same size then the given descriptor
|
|
|
|
// It's not allowed to pack it!
|
|
|
|
sal_Int32 nCount = seqDescripts.getLength();
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Sequence< Reference< frame::XDispatch > > lDispatcher( nCount );
|
2002-07-08 11:00:14 +00:00
|
|
|
|
|
|
|
for( sal_Int32 i=0; i<nCount; ++i )
|
|
|
|
{
|
|
|
|
lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL ,
|
|
|
|
seqDescripts[i].FrameName ,
|
|
|
|
seqDescripts[i].SearchFlags );
|
|
|
|
}
|
|
|
|
|
|
|
|
return lDispatcher;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 20:04:01 +00:00
|
|
|
// SfxBaseController -> XControllerBorder
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 20:04:01 +00:00
|
|
|
|
|
|
|
frame::BorderWidths SAL_CALL SfxBaseController::getBorder()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( RuntimeException, std::exception )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
|
|
|
frame::BorderWidths aResult;
|
|
|
|
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-10-04 20:04:01 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
SvBorder aBorder = m_pData->m_pViewShell->GetBorderPixel();
|
|
|
|
aResult.Left = aBorder.Left();
|
|
|
|
aResult.Top = aBorder.Top();
|
|
|
|
aResult.Right = aBorder.Right();
|
|
|
|
aResult.Bottom = aBorder.Bottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
return aResult;
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
void SAL_CALL SfxBaseController::addBorderResizeListener( const Reference< frame::XBorderResizeListener >& xListener )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( RuntimeException, std::exception )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
2014-05-20 23:29:28 +02:00
|
|
|
m_pData->m_aListenerContainer.addInterface( cppu::UnoType<frame::XBorderResizeListener>::get(),
|
2004-10-04 20:04:01 +00:00
|
|
|
xListener );
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
void SAL_CALL SfxBaseController::removeBorderResizeListener( const Reference< frame::XBorderResizeListener >& xListener )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( RuntimeException, std::exception )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
2014-05-20 23:29:28 +02:00
|
|
|
m_pData->m_aListenerContainer.removeInterface( cppu::UnoType<frame::XBorderResizeListener>::get(),
|
2004-10-04 20:04:01 +00:00
|
|
|
xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectangle& aPreliminaryRectangle )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( RuntimeException, std::exception )
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-10-04 20:04:01 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
Rectangle aTmpRect = VCLRectangle( aPreliminaryRectangle );
|
|
|
|
m_pData->m_pViewShell->QueryObjAreaPixel( aTmpRect );
|
|
|
|
return AWTRectangle( aTmpRect );
|
|
|
|
}
|
|
|
|
|
|
|
|
return aPreliminaryRectangle;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SfxBaseController::BorderWidthsChanged_Impl()
|
|
|
|
{
|
|
|
|
::cppu::OInterfaceContainerHelper* pContainer = m_pData->m_aListenerContainer.getContainer(
|
2014-05-20 23:29:28 +02:00
|
|
|
cppu::UnoType<frame::XBorderResizeListener>::get());
|
2004-10-04 20:04:01 +00:00
|
|
|
if ( pContainer )
|
|
|
|
{
|
|
|
|
frame::BorderWidths aBWidths = getBorder();
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< uno::XInterface > xThis( static_cast< ::cppu::OWeakObject* >(this), uno::UNO_QUERY );
|
2004-10-04 20:04:01 +00:00
|
|
|
|
|
|
|
::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
|
|
|
|
while (pIterator.hasMoreElements())
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2014-10-02 10:33:43 +02:00
|
|
|
static_cast<frame::XBorderResizeListener*>(pIterator.next())->borderWidthsChanged( xThis, aBWidths );
|
2004-10-04 20:04:01 +00:00
|
|
|
}
|
2013-04-02 12:26:08 +02:00
|
|
|
catch (const RuntimeException&)
|
2004-10-04 20:04:01 +00:00
|
|
|
{
|
|
|
|
pIterator.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XComponent
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::dispose() throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2009-12-03 09:29:45 +01:00
|
|
|
Reference< XController > xTmp( this );
|
2013-08-22 12:05:18 +09:00
|
|
|
m_pData->m_bDisposing = true ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
lang::EventObject aEventObject;
|
2009-12-03 09:29:45 +01:00
|
|
|
aEventObject.Source = *this ;
|
2006-06-19 21:38:48 +00:00
|
|
|
m_pData->m_aListenerContainer.disposeAndClear( aEventObject ) ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-10-24 12:06:11 +00:00
|
|
|
if ( m_pData->m_pController && m_pData->m_pController->getFrame().is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
m_pData->m_pController->getFrame()->removeFrameActionListener( m_pData->m_xListener ) ;
|
|
|
|
|
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
SfxViewFrame* pFrame = m_pData->m_pViewShell->GetViewFrame() ;
|
2009-11-27 11:49:21 +01:00
|
|
|
if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell )
|
2009-12-15 23:07:57 +01:00
|
|
|
pFrame->GetFrame().SetIsClosing_Impl();
|
2009-11-27 11:49:21 +01:00
|
|
|
m_pData->m_pViewShell->DiscardClients_Impl();
|
2010-09-30 16:12:43 +02:00
|
|
|
m_pData->m_pViewShell->pImp->m_bControllerSet = false;
|
2004-06-03 10:50:10 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pFrame )
|
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
lang::EventObject aObject;
|
2009-12-03 09:29:45 +01:00
|
|
|
aObject.Source = *this ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SfxObjectShell* pDoc = pFrame->GetObjectShell() ;
|
2004-04-13 10:50:36 +00:00
|
|
|
SfxViewFrame *pView = SfxViewFrame::GetFirst(pDoc);
|
|
|
|
while( pView )
|
|
|
|
{
|
2005-11-03 11:06:14 +00:00
|
|
|
// if there is another ViewFrame or currently the ViewShell in my ViewFrame is switched (PagePreview)
|
|
|
|
if ( pView != pFrame || pView->GetViewShell() != m_pData->m_pViewShell )
|
2004-04-13 10:50:36 +00:00
|
|
|
break;
|
|
|
|
pView = SfxViewFrame::GetNext( *pView, pDoc );
|
|
|
|
}
|
|
|
|
|
2015-04-28 15:01:43 +02:00
|
|
|
SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
|
2009-11-27 11:49:21 +01:00
|
|
|
if ( !pView )
|
2015-04-28 15:01:43 +02:00
|
|
|
SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), pDoc) );
|
2004-04-13 10:50:36 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XModel > xModel = pDoc->GetModel();
|
|
|
|
Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY );
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( xModel.is() )
|
2002-10-24 11:23:07 +00:00
|
|
|
{
|
2001-09-27 09:44:57 +00:00
|
|
|
xModel->disconnectController( this );
|
2002-10-24 11:23:07 +00:00
|
|
|
if ( xCloseable.is() )
|
|
|
|
xCloseable->removeCloseListener( m_pData->m_xCloseListener );
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < frame::XFrame > aXFrame;
|
2002-10-24 11:23:07 +00:00
|
|
|
attachFrame( aXFrame );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
m_pData->m_xListener->disposing( aObject );
|
|
|
|
SfxViewShell *pShell = m_pData->m_pViewShell;
|
|
|
|
m_pData->m_pViewShell = NULL;
|
2009-11-27 11:49:21 +01:00
|
|
|
if ( pFrame->GetViewShell() == pShell )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-03-09 09:08:49 +00:00
|
|
|
// Enter registrations only allowed if we are the owner!
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( pFrame->GetFrame().OwnsBindings_Impl() )
|
2004-03-09 09:08:49 +00:00
|
|
|
pFrame->GetBindings().ENTERREGISTRATIONS();
|
2009-12-15 23:07:57 +01:00
|
|
|
pFrame->GetFrame().SetFrameInterface_Impl( aXFrame );
|
|
|
|
pFrame->GetFrame().DoClose_Impl();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XComponent
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::addEventListener( const Reference< lang::XEventListener >& aListener ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-20 23:29:28 +02:00
|
|
|
m_pData->m_aListenerContainer.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// SfxBaseController -> XComponent
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::removeEventListener( const Reference< lang::XEventListener >& aListener ) throw( RuntimeException, std::exception )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-20 23:29:28 +02:00
|
|
|
m_pData->m_aListenerContainer.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SfxBaseController::ReleaseShell_Impl()
|
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2001-09-27 09:44:57 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
SfxObjectShell* pDoc = m_pData->m_pViewShell->GetObjectShell() ;
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XModel > xModel = pDoc->GetModel();
|
|
|
|
Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY );
|
2001-09-27 09:44:57 +00:00
|
|
|
if ( xModel.is() )
|
2003-04-24 12:16:28 +00:00
|
|
|
{
|
2001-09-27 09:44:57 +00:00
|
|
|
xModel->disconnectController( this );
|
2003-04-24 12:16:28 +00:00
|
|
|
if ( xCloseable.is() )
|
|
|
|
xCloseable->removeCloseListener( m_pData->m_xCloseListener );
|
|
|
|
}
|
2001-09-27 09:44:57 +00:00
|
|
|
m_pData->m_pViewShell = 0;
|
2002-10-24 12:06:11 +00:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference < frame::XFrame > aXFrame;
|
2002-10-24 12:06:11 +00:00
|
|
|
attachFrame( aXFrame );
|
2001-09-27 09:44:57 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SfxViewShell* SfxBaseController::GetViewShell_Impl() const
|
|
|
|
{
|
|
|
|
return m_pData->m_pViewShell;
|
|
|
|
}
|
2001-03-28 15:54:34 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< task::XStatusIndicator > SAL_CALL SfxBaseController::getStatusIndicator( ) throw (RuntimeException, std::exception)
|
2001-03-28 15:54:34 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2001-03-30 14:58:20 +00:00
|
|
|
if ( m_pData->m_pViewShell && !m_pData->m_xIndicator.is() )
|
2009-12-15 23:07:57 +01:00
|
|
|
m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame().GetWorkWindow_Impl() );
|
2001-03-30 14:58:20 +00:00
|
|
|
return m_pData->m_xIndicator;
|
2001-03-28 15:54:34 +00:00
|
|
|
}
|
2001-03-30 14:58:20 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::registerContextMenuInterceptor( const Reference< ui::XContextMenuInterceptor >& xInterceptor ) throw( RuntimeException, std::exception )
|
2003-03-27 10:29:38 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
m_pData->m_aInterceptorContainer.addInterface( xInterceptor );
|
|
|
|
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2003-03-27 10:29:38 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
m_pData->m_pViewShell->AddContextMenuInterceptor_Impl( xInterceptor );
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::releaseContextMenuInterceptor( const Reference< ui::XContextMenuInterceptor >& xInterceptor ) throw( RuntimeException, std::exception )
|
2003-03-27 10:29:38 +00:00
|
|
|
|
2001-05-07 10:47:43 +00:00
|
|
|
{
|
2003-03-27 10:29:38 +00:00
|
|
|
m_pData->m_aInterceptorContainer.removeInterface( xInterceptor );
|
|
|
|
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2001-05-07 10:47:43 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
2003-03-27 10:29:38 +00:00
|
|
|
m_pData->m_pViewShell->RemoveContextMenuInterceptor_Impl( xInterceptor );
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::addKeyHandler( const Reference< awt::XKeyHandler >& xHandler ) throw (RuntimeException, std::exception)
|
2003-03-27 10:29:38 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2008-06-25 12:07:02 +00:00
|
|
|
m_pData->m_aUserInputInterception.addKeyHandler( xHandler );
|
2003-03-27 10:29:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::removeKeyHandler( const Reference< awt::XKeyHandler >& xHandler ) throw (RuntimeException, std::exception)
|
2003-03-27 10:29:38 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2008-06-25 12:07:02 +00:00
|
|
|
m_pData->m_aUserInputInterception.removeKeyHandler( xHandler );
|
2003-03-27 10:29:38 +00:00
|
|
|
}
|
2001-05-07 10:47:43 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::addMouseClickHandler( const Reference< awt::XMouseClickHandler >& xHandler ) throw (RuntimeException, std::exception)
|
2003-03-27 10:29:38 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2008-06-25 12:07:02 +00:00
|
|
|
m_pData->m_aUserInputInterception.addMouseClickHandler( xHandler );
|
2001-05-07 10:47:43 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SfxBaseController::removeMouseClickHandler( const Reference< awt::XMouseClickHandler >& xHandler ) throw (RuntimeException, std::exception)
|
2001-05-07 10:47:43 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2008-06-25 12:07:02 +00:00
|
|
|
m_pData->m_aUserInputInterception.removeMouseClickHandler( xHandler );
|
2001-05-07 10:47:43 +00:00
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Sequence< sal_Int16 > SAL_CALL SfxBaseController::getSupportedCommandGroups()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2004-11-16 14:29:19 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
std::list< sal_Int16 > aGroupList;
|
|
|
|
SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() );
|
2006-05-02 16:05:45 +00:00
|
|
|
SfxSlotPool* pPool = &SfxSlotPool::GetSlotPool( pViewFrame );
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL();
|
2015-02-24 13:21:11 +02:00
|
|
|
const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
|
2004-11-16 14:29:19 +00:00
|
|
|
|
2011-03-11 15:39:32 +05:30
|
|
|
// Select Group ( Group 0 is internal )
|
2011-01-07 17:14:47 +01:00
|
|
|
for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ )
|
2004-11-16 14:29:19 +00:00
|
|
|
{
|
2013-03-04 15:25:02 +01:00
|
|
|
pSlotPool->SeekGroup( i );
|
2004-11-16 14:29:19 +00:00
|
|
|
const SfxSlot* pSfxSlot = pSlotPool->FirstSlot();
|
|
|
|
while ( pSfxSlot )
|
|
|
|
{
|
|
|
|
if ( pSfxSlot->GetMode() & nMode )
|
|
|
|
{
|
|
|
|
sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
|
|
|
|
aGroupList.push_back( nCommandGroup );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pSfxSlot = pSlotPool->NextSlot();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Sequence< sal_Int16 > aSeq =
|
2004-11-29 12:35:17 +00:00
|
|
|
comphelper::containerToSequence< sal_Int16 >( aGroupList );
|
2004-11-16 14:29:19 +00:00
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfigurableDispatchInformation( sal_Int16 nCmdGroup )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2004-11-16 14:29:19 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
std::list< frame::DispatchInformation > aCmdList;
|
2004-11-16 14:29:19 +00:00
|
|
|
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-11-16 14:29:19 +00:00
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
2015-02-24 13:21:11 +02:00
|
|
|
const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() );
|
2006-05-02 16:05:45 +00:00
|
|
|
SfxSlotPool* pPool( &SfxSlotPool::GetSlotPool( pViewFrame ));
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aCmdPrefix( ".uno:" );
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL();
|
2011-01-07 17:14:47 +01:00
|
|
|
for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ )
|
2004-11-16 14:29:19 +00:00
|
|
|
{
|
2013-03-04 15:25:02 +01:00
|
|
|
pSlotPool->SeekGroup( i );
|
2004-11-16 14:29:19 +00:00
|
|
|
const SfxSlot* pSfxSlot = pSlotPool->FirstSlot();
|
|
|
|
if ( pSfxSlot )
|
|
|
|
{
|
|
|
|
sal_Int16 nCommandGroup = MapGroupIDToCommandGroup( pSfxSlot->GetGroupId() );
|
|
|
|
if ( nCommandGroup == nCmdGroup )
|
|
|
|
{
|
|
|
|
while ( pSfxSlot )
|
|
|
|
{
|
|
|
|
if ( pSfxSlot->GetMode() & nMode )
|
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
frame::DispatchInformation aCmdInfo;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringBuffer aBuf( aCmdPrefix );
|
2004-11-16 14:29:19 +00:00
|
|
|
aBuf.appendAscii( pSfxSlot->GetUnoName() );
|
|
|
|
aCmdInfo.Command = aBuf.makeStringAndClear();
|
|
|
|
aCmdInfo.GroupId = nCommandGroup;
|
|
|
|
aCmdList.push_back( aCmdInfo );
|
|
|
|
}
|
|
|
|
pSfxSlot = pSlotPool->NextSlot();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
uno::Sequence< frame::DispatchInformation > aSeq =
|
|
|
|
comphelper::containerToSequence< frame::DispatchInformation, std::list< frame::DispatchInformation > >( aCmdList );
|
2004-11-16 14:29:19 +00:00
|
|
|
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
2014-03-17 14:34:01 +02:00
|
|
|
bool SfxBaseController::HandleEvent_Impl( NotifyEvent& rEvent )
|
2001-12-07 13:48:17 +00:00
|
|
|
{
|
2008-06-25 12:07:02 +00:00
|
|
|
return m_pData->m_aUserInputInterception.handleNotifyEvent( rEvent );
|
2001-12-07 13:48:17 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 14:34:01 +02:00
|
|
|
bool SfxBaseController::HasKeyListeners_Impl()
|
2001-12-07 13:48:17 +00:00
|
|
|
{
|
2008-06-25 12:07:02 +00:00
|
|
|
return m_pData->m_aUserInputInterception.hasKeyHandlers();
|
2001-12-07 13:48:17 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 14:34:01 +02:00
|
|
|
bool SfxBaseController::HasMouseClickListeners_Impl()
|
2003-03-27 10:29:38 +00:00
|
|
|
{
|
2008-06-25 12:07:02 +00:00
|
|
|
return m_pData->m_aUserInputInterception.hasMouseClickListeners();
|
2003-03-27 10:29:38 +00:00
|
|
|
}
|
2008-04-04 13:22:36 +00:00
|
|
|
|
2009-12-07 14:33:16 +01:00
|
|
|
void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
|
2009-11-27 11:49:21 +01:00
|
|
|
{
|
|
|
|
ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
|
2009-12-10 12:41:09 +01:00
|
|
|
SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
|
|
|
|
ENSURE_OR_THROW( pViewFrame, "a view shell without a view frame is pretty pathological" );
|
2009-11-27 11:49:21 +01:00
|
|
|
|
2009-12-07 14:33:16 +01:00
|
|
|
const bool bConnect = ( i_eConnect != E_DISCONNECT );
|
|
|
|
|
2009-11-27 11:49:21 +01:00
|
|
|
// disable window and dispatcher
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->Enable( bConnect );
|
|
|
|
pViewFrame->GetDispatcher()->Lock( !bConnect );
|
2009-11-27 11:49:21 +01:00
|
|
|
|
2009-12-07 14:33:16 +01:00
|
|
|
if ( bConnect )
|
2009-11-27 11:49:21 +01:00
|
|
|
{
|
2010-01-08 22:50:33 +01:00
|
|
|
if ( i_eConnect == E_CONNECT )
|
|
|
|
{
|
|
|
|
if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL )
|
2015-04-09 15:24:21 +02:00
|
|
|
&& ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
|
2010-01-08 22:50:33 +01:00
|
|
|
)
|
|
|
|
{
|
|
|
|
SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame();
|
|
|
|
if ( !pViewFrm->GetFrame().IsInPlace() )
|
|
|
|
{
|
|
|
|
// for outplace embedded objects, we want the layout manager to keep the content window
|
|
|
|
// size constant, if possible
|
|
|
|
try
|
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW );
|
|
|
|
Reference< beans::XPropertySet > xLayouterProps(
|
2013-06-29 21:24:12 +02:00
|
|
|
xFrameProps->getPropertyValue("LayoutManager"), uno::UNO_QUERY_THROW );
|
|
|
|
xLayouterProps->setPropertyValue("PreserveContentSize", uno::makeAny( sal_True ) );
|
2010-01-08 22:50:33 +01:00
|
|
|
}
|
2011-12-21 23:27:48 +00:00
|
|
|
catch (const uno::Exception&)
|
2010-01-08 22:50:33 +01:00
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-07 14:33:16 +01:00
|
|
|
// upon DISCONNECT, we did *not* pop the shells from the stack (this is done elsewhere), so upon
|
|
|
|
// RECONNECT, we're not allowed to push them
|
|
|
|
if ( i_eConnect != E_RECONNECT )
|
|
|
|
{
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell );
|
2009-12-07 14:33:16 +01:00
|
|
|
if ( m_pData->m_pViewShell->GetSubShell() )
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() );
|
2009-12-07 14:33:16 +01:00
|
|
|
m_pData->m_pViewShell->PushSubShells_Impl();
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->GetDispatcher()->Flush();
|
2009-12-07 14:33:16 +01:00
|
|
|
}
|
2009-11-27 11:49:21 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pEditWin = m_pData->m_pViewShell->GetWindow();
|
2009-11-27 11:49:21 +01:00
|
|
|
if ( pEditWin && m_pData->m_pViewShell->IsShowView_Impl() )
|
|
|
|
pEditWin->Show();
|
|
|
|
|
2009-12-10 12:41:09 +01:00
|
|
|
if ( SfxViewFrame::Current() == pViewFrame )
|
2014-03-13 10:22:49 +02:00
|
|
|
pViewFrame->GetDispatcher()->Update_Impl( true );
|
2009-12-03 09:29:06 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pFrameWin = &pViewFrame->GetWindow();
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( pFrameWin != &pViewFrame->GetFrame().GetWindow() )
|
2009-12-03 09:29:06 +01:00
|
|
|
pFrameWin->Show();
|
2009-12-10 12:41:09 +01:00
|
|
|
|
|
|
|
if ( i_eConnect == E_CONNECT )
|
|
|
|
{
|
|
|
|
::comphelper::NamedValueCollection aDocumentArgs( getModel()->getArgs() );
|
|
|
|
|
|
|
|
const sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
|
|
|
|
const bool bHasPluginMode = ( nPluginMode != 0 );
|
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
SfxFrame& rFrame = pViewFrame->GetFrame();
|
2009-12-10 12:41:09 +01:00
|
|
|
SfxObjectShell& rDoc = *m_pData->m_pViewShell->GetObjectShell();
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( !rFrame.IsMarkedHidden_Impl() )
|
2009-12-10 12:41:09 +01:00
|
|
|
{
|
|
|
|
if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) )
|
2014-03-13 10:22:49 +02:00
|
|
|
pViewFrame->GetDispatcher()->HideUI( true );
|
2009-12-10 12:41:09 +01:00
|
|
|
else
|
2014-03-13 10:22:49 +02:00
|
|
|
pViewFrame->GetDispatcher()->HideUI( false );
|
2009-12-10 12:41:09 +01:00
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( rFrame.IsInPlace() )
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->LockAdjustPosSizePixel();
|
|
|
|
|
|
|
|
if ( nPluginMode == 3 )
|
2014-04-07 09:15:28 +02:00
|
|
|
rFrame.GetWorkWindow_Impl()->SetInternalDockingAllowed( false );
|
2009-12-10 12:41:09 +01:00
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( !rFrame.IsInPlace() )
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->GetDispatcher()->Update_Impl();
|
|
|
|
pViewFrame->Show();
|
2009-12-15 23:07:57 +01:00
|
|
|
rFrame.GetWindow().Show();
|
|
|
|
if ( !rFrame.IsInPlace() || ( nPluginMode == 3 ) )
|
|
|
|
pViewFrame->MakeActive_Impl( rFrame.GetFrameInterface()->isActive() );
|
2009-12-10 12:41:09 +01:00
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( rFrame.IsInPlace() )
|
2009-12-10 12:41:09 +01:00
|
|
|
{
|
|
|
|
pViewFrame->UnlockAdjustPosSizePixel();
|
|
|
|
// force resize for OLE server to fix layout problems of writer and math
|
|
|
|
// see i53651
|
|
|
|
if ( nPluginMode == 3 )
|
2014-03-19 09:01:06 +02:00
|
|
|
pViewFrame->Resize( true );
|
2009-12-10 12:41:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-12-15 23:07:57 +01:00
|
|
|
DBG_ASSERT( !rFrame.IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" );
|
|
|
|
rFrame.GetWindow().Show();
|
2009-12-10 12:41:09 +01:00
|
|
|
}
|
|
|
|
|
2011-03-11 15:39:32 +05:30
|
|
|
// UpdateTitle now, hidden TopFrames have otherwise no Name!
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->UpdateTitle();
|
|
|
|
|
2009-12-15 23:07:57 +01:00
|
|
|
if ( !rFrame.IsInPlace() )
|
2014-03-19 09:01:06 +02:00
|
|
|
pViewFrame->Resize( true );
|
2009-12-10 12:41:09 +01:00
|
|
|
|
|
|
|
// if there's a JumpMark given, then, well, jump to it
|
2009-12-11 11:28:14 +01:00
|
|
|
::comphelper::NamedValueCollection aViewArgs( getCreationArguments() );
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sJumpMark = aViewArgs.getOrDefault( "JumpMark", OUString() );
|
2012-01-10 17:54:51 -02:00
|
|
|
const bool bHasJumpMark = !sJumpMark.isEmpty();
|
2009-12-10 12:41:09 +01:00
|
|
|
OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() )
|
2012-01-10 17:54:51 -02:00
|
|
|
|| ( sJumpMark.isEmpty() ),
|
2009-12-10 12:41:09 +01:00
|
|
|
"SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" );
|
|
|
|
// Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time
|
|
|
|
// (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method
|
|
|
|
// here is never called before the load process finished. At least not with a non-empty jump mark
|
2012-01-10 17:54:51 -02:00
|
|
|
if ( !sJumpMark.isEmpty() )
|
2009-12-10 12:41:09 +01:00
|
|
|
m_pData->m_pViewShell->JumpToMark( sJumpMark );
|
|
|
|
|
|
|
|
// if no plugin mode and no jump mark was supplied, check whether the document itself can provide view data, and
|
|
|
|
// if so, forward it to the view/shell.
|
|
|
|
if ( !bHasPluginMode && !bHasJumpMark )
|
|
|
|
{
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
// Note that this might not be the ideal place here. Restoring view data should, IMO, be the
|
2014-04-29 19:25:03 +00:00
|
|
|
// responsibility of the loader, not an implementation detail buried here deep within the controller's
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
// implementation.
|
|
|
|
// What I think should be done to replace the below code:
|
|
|
|
// - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts
|
|
|
|
// a string only), and forward it to its ViewShell's ReadUserDataSequence
|
|
|
|
// - change the frame loader so that when a new document is loaded (as opposed to an existing
|
|
|
|
// document being loaded into a new frame), the model's view data is examine the very same
|
|
|
|
// way as below, and the proper view data is set via XController::restoreViewData
|
|
|
|
// - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview
|
|
|
|
// view is exchanged, and sets the old view's data at the model. It should also care for the other
|
|
|
|
// way, were the PrintPreview view is left: in this case, the new view should also be initialized
|
|
|
|
// with the model's view data
|
2009-12-10 12:41:09 +01:00
|
|
|
try
|
|
|
|
{
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
|
2010-09-24 11:31:52 +02:00
|
|
|
Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData() );
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
|
|
|
|
// find the view data item whose ViewId matches the ID of the view we're just connecting to
|
|
|
|
const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
|
2010-09-24 11:31:52 +02:00
|
|
|
const sal_Int32 nCount = xViewData.is() ? xViewData->getCount() : 0;
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
sal_Int32 nViewDataIndex = 0;
|
|
|
|
for ( sal_Int32 i=0; i<nCount; ++i )
|
2009-12-10 12:41:09 +01:00
|
|
|
{
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sViewId( aViewData.getOrDefault( "ViewId", OUString() ) );
|
2012-01-10 17:54:51 -02:00
|
|
|
if ( sViewId.isEmpty() )
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
|
|
|
|
if ( pViewFactory == NULL )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() )
|
2009-12-10 12:41:09 +01:00
|
|
|
{
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
nViewDataIndex = i;
|
|
|
|
break;
|
2009-12-10 12:41:09 +01:00
|
|
|
}
|
|
|
|
}
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
if ( nViewDataIndex < nCount )
|
|
|
|
{
|
|
|
|
Sequence< PropertyValue > aViewData;
|
|
|
|
OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData );
|
|
|
|
if ( aViewData.getLength() > 0 )
|
2014-03-19 09:01:06 +02:00
|
|
|
m_pData->m_pViewShell->ReadUserDataSequence( aViewData, true );
|
dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
print preview and back, to SFX
In particular, the following changes have been applied
- the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
- the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
factories for such named views
- SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
is exchanged with another view. In this case, it preserves the view's view data at the model
- Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
the print preview, has been removed completely.
What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
view names would be speaking then, instead of the current "view<number>" names.
2010-09-01 13:39:49 +02:00
|
|
|
}
|
2009-12-10 12:41:09 +01:00
|
|
|
}
|
2011-12-21 23:27:48 +00:00
|
|
|
catch (const Exception&)
|
2009-12-10 12:41:09 +01:00
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-11-27 11:49:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// invalidate slot corresponding to the view shell
|
2009-12-10 12:41:09 +01:00
|
|
|
const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pViewFrame->GetCurViewId(), USHRT_MAX );
|
2009-11-27 11:49:21 +01:00
|
|
|
DBG_ASSERT( nViewNo != USHRT_MAX, "view shell id not found" );
|
|
|
|
if ( nViewNo != USHRT_MAX )
|
2009-12-10 12:41:09 +01:00
|
|
|
pViewFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 );
|
2009-11-27 11:49:21 +01:00
|
|
|
}
|
|
|
|
|
2012-10-09 17:52:40 +02:00
|
|
|
void SfxBaseController::ShowInfoBars( )
|
|
|
|
{
|
|
|
|
if ( m_pData->m_pViewShell )
|
|
|
|
{
|
|
|
|
// CMIS verifications
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY );
|
2013-02-14 10:27:21 +01:00
|
|
|
if ( xCmisDoc.is( ) && xCmisDoc->canCheckOut( ) )
|
2012-10-09 17:52:40 +02:00
|
|
|
{
|
2013-06-18 14:00:48 +02:00
|
|
|
uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( );
|
2012-10-31 11:21:50 +01:00
|
|
|
|
|
|
|
if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
|
2012-10-09 17:52:40 +02:00
|
|
|
{
|
2012-10-31 11:21:50 +01:00
|
|
|
// Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut
|
2013-09-27 21:42:14 +02:00
|
|
|
// and find if it is a Google Drive file.
|
|
|
|
bool bIsGoogleFile = false;
|
2014-03-17 14:34:01 +02:00
|
|
|
bool bCheckedOut = false;
|
2013-09-27 21:42:14 +02:00
|
|
|
for ( sal_Int32 i = 0; i < aCmisProperties.getLength(); ++i )
|
2012-10-09 17:52:40 +02:00
|
|
|
{
|
2013-09-27 21:42:14 +02:00
|
|
|
if ( aCmisProperties[i].Id == "cmis:isVersionSeriesCheckedOut" ) {
|
|
|
|
uno::Sequence< sal_Bool > bTmp;
|
|
|
|
aCmisProperties[i].Value >>= bTmp;
|
|
|
|
bCheckedOut = bTmp[0];
|
2012-10-31 11:21:50 +01:00
|
|
|
}
|
2013-09-27 21:42:14 +02:00
|
|
|
// if it is a Google Drive file, we don't need the checkout bar,
|
|
|
|
// still need the checkout feature for the version dialog.
|
|
|
|
if ( aCmisProperties[i].Name == "title" )
|
|
|
|
bIsGoogleFile = true;
|
2012-10-09 17:52:40 +02:00
|
|
|
}
|
|
|
|
|
2013-09-27 21:42:14 +02:00
|
|
|
if ( !bCheckedOut && !bIsGoogleFile )
|
2012-10-31 11:21:50 +01:00
|
|
|
{
|
|
|
|
// Get the Frame and show the InfoBar if not checked out
|
|
|
|
SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
|
2015-01-13 21:43:27 +09:00
|
|
|
SfxInfoBarWindow* pInfoBar = pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ) );
|
2015-01-21 09:25:19 +00:00
|
|
|
if (pInfoBar)
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtrInstance<PushButton> pBtn( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) );
|
2015-01-21 09:25:19 +00:00
|
|
|
pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) );
|
|
|
|
pInfoBar->addButton(pBtn);
|
|
|
|
}
|
2012-10-31 11:21:50 +01:00
|
|
|
}
|
2012-10-09 17:52:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-30 11:06:18 +01:00
|
|
|
IMPL_LINK_NOARG ( SfxBaseController, CheckOutHandler )
|
2012-10-11 14:14:48 +02:00
|
|
|
{
|
|
|
|
if ( m_pData->m_pViewShell )
|
2012-10-20 09:42:35 -07:00
|
|
|
m_pData->m_pViewShell->GetObjectShell()->CheckOut( );
|
2012-10-11 14:14:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-10-09 17:52:40 +02:00
|
|
|
|
2014-02-25 20:34:55 +01:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XTitle > SfxBaseController::impl_getTitleHelper ()
|
2008-04-04 13:22:36 +00:00
|
|
|
{
|
2010-10-13 02:47:36 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2008-04-04 13:22:36 +00:00
|
|
|
|
|
|
|
if ( ! m_pData->m_xTitleHelper.is ())
|
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XModel > xModel = getModel ();
|
|
|
|
Reference< frame::XUntitledNumbers > xUntitledProvider(xModel , uno::UNO_QUERY );
|
|
|
|
Reference< frame::XController > xThis (static_cast< frame::XController* >(this), uno::UNO_QUERY_THROW);
|
2008-04-04 13:22:36 +00:00
|
|
|
|
2012-10-16 11:10:43 +02:00
|
|
|
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext());
|
2013-04-02 12:26:08 +02:00
|
|
|
m_pData->m_xTitleHelper = Reference< frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
|
2008-04-04 13:22:36 +00:00
|
|
|
|
|
|
|
pHelper->setOwner (xThis );
|
|
|
|
pHelper->connectWithUntitledNumbers (xUntitledProvider);
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_pData->m_xTitleHelper;
|
|
|
|
}
|
|
|
|
|
2014-02-25 20:34:55 +01:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
// frame::XTitle
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SAL_CALL SfxBaseController::getTitle()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2008-04-04 13:22:36 +00:00
|
|
|
{
|
|
|
|
return impl_getTitleHelper()->getTitle ();
|
|
|
|
}
|
|
|
|
|
2014-02-25 20:34:55 +01:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
// frame::XTitle
|
2013-04-07 12:06:47 +02:00
|
|
|
void SAL_CALL SfxBaseController::setTitle(const OUString& sTitle)
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2008-04-04 13:22:36 +00:00
|
|
|
{
|
|
|
|
impl_getTitleHelper()->setTitle (sTitle);
|
|
|
|
}
|
|
|
|
|
2014-02-25 20:34:55 +01:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
// frame::XTitleChangeBroadcaster
|
|
|
|
void SAL_CALL SfxBaseController::addTitleChangeListener(const Reference< frame::XTitleChangeListener >& xListener)
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2008-04-04 13:22:36 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), uno::UNO_QUERY);
|
2008-04-04 13:22:36 +00:00
|
|
|
if (xBroadcaster.is ())
|
|
|
|
xBroadcaster->addTitleChangeListener (xListener);
|
|
|
|
}
|
|
|
|
|
2014-02-25 20:34:55 +01:00
|
|
|
|
2013-04-02 12:26:08 +02:00
|
|
|
// frame::XTitleChangeBroadcaster
|
|
|
|
void SAL_CALL SfxBaseController::removeTitleChangeListener(const Reference< frame::XTitleChangeListener >& xListener)
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (RuntimeException, std::exception)
|
2008-04-04 13:22:36 +00:00
|
|
|
{
|
2013-04-02 12:26:08 +02:00
|
|
|
Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), uno::UNO_QUERY);
|
2008-04-04 13:22:36 +00:00
|
|
|
if (xBroadcaster.is ())
|
|
|
|
xBroadcaster->removeTitleChangeListener (xListener);
|
|
|
|
}
|
2010-10-12 15:53:47 +02:00
|
|
|
|
2014-05-27 08:11:10 +02:00
|
|
|
void SfxBaseController::initialize( const css::uno::Sequence< css::uno::Any >& /*aArguments*/ ) throw (css::uno::RuntimeException, std::exception)
|
2014-05-19 16:00:39 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|