2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-27 13:52:10 +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 .
|
|
|
|
*/
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2005-01-31 07:31:21 +00:00
|
|
|
#include <com/sun/star/embed/Aspects.hpp>
|
2013-01-07 17:46:55 +02:00
|
|
|
#include <com/sun/star/frame/TaskCreator.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/frame/XComponentLoader.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/util/XCloseBroadcaster.hpp>
|
2003-10-29 07:14:39 +00:00
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
2007-07-06 09:08:49 +00:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
2007-04-16 15:50:44 +00:00
|
|
|
#include <com/sun/star/beans/NamedValue.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/frame/XModel.hpp>
|
2012-12-14 12:58:00 +02:00
|
|
|
#include <com/sun/star/frame/Desktop.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/frame/XDispatchHelper.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/frame/FrameSearchFlag.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/frame/XControllerBorder.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/util/XModifyBroadcaster.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
|
2012-10-17 10:52:52 +02:00
|
|
|
#include <com/sun/star/awt/Toolkit.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/awt/XTopWindow.hpp>
|
|
|
|
#include <com/sun/star/awt/PosSize.hpp>
|
|
|
|
#include <com/sun/star/awt/XView.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/awt/WindowAttribute.hpp>
|
|
|
|
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/bridge/XBridgeSupplier2.hpp>
|
|
|
|
#include <com/sun/star/bridge/ModelDependent.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/embed/XHatchWindow.hpp>
|
2013-01-02 14:43:43 +02:00
|
|
|
#include <com/sun/star/embed/HatchWindowFactory.hpp>
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <com/sun/star/embed/XInplaceClient.hpp>
|
2005-03-01 18:52:56 +00:00
|
|
|
#include <com/sun/star/frame/XLayoutManager.hpp>
|
|
|
|
#include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp>
|
2012-09-04 14:56:48 +02:00
|
|
|
#include <com/sun/star/frame/ModuleManager.hpp>
|
2005-03-01 18:52:56 +00:00
|
|
|
#include <com/sun/star/ui/XDockingAreaAcceptor.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIElementSettings.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
|
2014-01-29 18:58:18 +01:00
|
|
|
#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
|
2006-11-01 17:20:30 +00:00
|
|
|
#include <com/sun/star/embed/StateChangeInProgressException.hpp>
|
|
|
|
|
|
|
|
#include <com/sun/star/embed/EmbedMisc.hpp>
|
|
|
|
#include <com/sun/star/embed/EmbedStates.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <osl/diagnose.h>
|
|
|
|
#include <rtl/process.h>
|
2012-12-11 14:59:39 +02:00
|
|
|
#include <vcl/svapp.hxx>
|
2014-08-11 09:54:20 +02:00
|
|
|
#include <svtools/embedhlp.hxx>
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
#include <comphelper/processfactory.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 <comphelper/namedvaluecollection.hxx>
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
#include "docholder.hxx"
|
|
|
|
#include "commonembobj.hxx"
|
|
|
|
#include "intercept.hxx"
|
|
|
|
|
2014-08-11 17:53:31 +02:00
|
|
|
#define HATCH_BORDER_WIDTH (((m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE) && \
|
2014-08-11 09:54:20 +02:00
|
|
|
m_pEmbedObj->getCurrentState()!=embed::EmbedStates::UI_ACTIVE) ? 0 : 4 )
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2014-02-25 18:24:45 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
class IntCounterGuard {
|
|
|
|
sal_Int32& m_nFlag;
|
|
|
|
public:
|
|
|
|
IntCounterGuard( sal_Int32& nFlag )
|
|
|
|
: m_nFlag( nFlag )
|
|
|
|
{
|
|
|
|
m_nFlag++;
|
|
|
|
}
|
|
|
|
|
|
|
|
~IntCounterGuard()
|
|
|
|
{
|
|
|
|
if ( m_nFlag )
|
|
|
|
m_nFlag--;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-02-25 18:24:45 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2005-03-23 13:19:59 +00:00
|
|
|
static void InsertMenu_Impl( const uno::Reference< container::XIndexContainer >& xTargetMenu,
|
|
|
|
sal_Int32 nTargetIndex,
|
|
|
|
const uno::Reference< container::XIndexAccess >& xSourceMenu,
|
|
|
|
sal_Int32 nSourceIndex,
|
2014-03-06 15:29:08 +02:00
|
|
|
const OUString& aContModuleName,
|
2007-04-16 15:50:44 +00:00
|
|
|
const uno::Reference< frame::XDispatchProvider >& xSourceDisp )
|
2005-03-23 13:19:59 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nInd = 0;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aModuleIdentPropName( "ModuleIdentifier" );
|
|
|
|
OUString aDispProvPropName( "DispatchProvider" );
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bModuleNameSet = false;
|
|
|
|
bool bDispProvSet = false;
|
2005-03-23 13:19:59 +00:00
|
|
|
|
|
|
|
uno::Sequence< beans::PropertyValue > aSourceProps;
|
|
|
|
xSourceMenu->getByIndex( nSourceIndex ) >>= aSourceProps;
|
|
|
|
uno::Sequence< beans::PropertyValue > aTargetProps( aSourceProps.getLength() );
|
|
|
|
for ( nInd = 0; nInd < aSourceProps.getLength(); nInd++ )
|
|
|
|
{
|
|
|
|
aTargetProps[nInd].Name = aSourceProps[nInd].Name;
|
2011-12-21 19:54:11 -02:00
|
|
|
if ( !aContModuleName.isEmpty() && aTargetProps[nInd].Name.equals( aModuleIdentPropName ) )
|
2005-03-23 13:19:59 +00:00
|
|
|
{
|
|
|
|
aTargetProps[nInd].Value <<= aContModuleName;
|
2014-04-17 11:39:18 +02:00
|
|
|
bModuleNameSet = true;
|
2005-03-23 13:19:59 +00:00
|
|
|
}
|
2007-04-16 15:50:44 +00:00
|
|
|
else if ( aTargetProps[nInd].Name.equals( aDispProvPropName ) )
|
|
|
|
{
|
|
|
|
aTargetProps[nInd].Value <<= xSourceDisp;
|
2014-04-17 11:39:18 +02:00
|
|
|
bDispProvSet = true;
|
2007-04-16 15:50:44 +00:00
|
|
|
}
|
2005-03-23 13:19:59 +00:00
|
|
|
else
|
|
|
|
aTargetProps[nInd].Value = aSourceProps[nInd].Value;
|
|
|
|
}
|
|
|
|
|
2011-12-21 19:54:11 -02:00
|
|
|
if ( !bModuleNameSet && !aContModuleName.isEmpty() )
|
2005-03-23 13:19:59 +00:00
|
|
|
{
|
2007-04-16 15:50:44 +00:00
|
|
|
aTargetProps.realloc( ++nInd );
|
|
|
|
aTargetProps[nInd-1].Name = aModuleIdentPropName;
|
|
|
|
aTargetProps[nInd-1].Value <<= aContModuleName;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bDispProvSet && xSourceDisp.is() )
|
|
|
|
{
|
|
|
|
aTargetProps.realloc( ++nInd );
|
|
|
|
aTargetProps[nInd-1].Name = aDispProvPropName;
|
|
|
|
aTargetProps[nInd-1].Value <<= xSourceDisp;
|
2005-03-23 13:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xTargetMenu->insertByIndex( nTargetIndex, uno::makeAny( aTargetProps ) );
|
|
|
|
}
|
|
|
|
|
2014-02-25 18:24:45 +01:00
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& xContext,
|
2003-10-27 12:05:38 +00:00
|
|
|
OCommonEmbeddedObject* pEmbObj )
|
2006-06-19 23:29:40 +00:00
|
|
|
: m_pEmbedObj( pEmbObj ),
|
2003-10-27 12:05:38 +00:00
|
|
|
m_pInterceptor( NULL ),
|
2013-01-02 14:43:43 +02:00
|
|
|
m_xContext( xContext ),
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bReadOnly( false ),
|
|
|
|
m_bWaitForClose( false ),
|
|
|
|
m_bAllowClosing( false ),
|
|
|
|
m_bDesktopTerminated( false ),
|
2006-12-19 13:03:57 +00:00
|
|
|
m_nNoBorderResizeReact( 0 ),
|
|
|
|
m_nNoResizeReact( 0 )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2008-07-08 07:25:04 +00:00
|
|
|
m_aOutplaceFrameProps.realloc( 3 );
|
2007-04-16 15:50:44 +00:00
|
|
|
beans::NamedValue aArg;
|
|
|
|
|
2013-11-04 11:59:34 +02:00
|
|
|
aArg.Name = "TopWindow";
|
2007-04-16 15:50:44 +00:00
|
|
|
aArg.Value <<= sal_True;
|
|
|
|
m_aOutplaceFrameProps[0] <<= aArg;
|
|
|
|
|
2013-11-04 11:59:34 +02:00
|
|
|
aArg.Name = "MakeVisible";
|
2008-07-08 07:25:04 +00:00
|
|
|
aArg.Value <<= sal_False;
|
|
|
|
m_aOutplaceFrameProps[1] <<= aArg;
|
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( m_xContext );
|
2012-12-14 12:58:00 +02:00
|
|
|
m_refCount++;
|
|
|
|
try
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2012-12-14 12:58:00 +02:00
|
|
|
xDesktop->addTerminateListener( this );
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2012-12-14 12:58:00 +02:00
|
|
|
catch ( const uno::Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
m_refCount--;
|
|
|
|
|
2013-11-04 11:59:34 +02:00
|
|
|
aArg.Name = "ParentFrame";
|
2012-12-14 12:58:00 +02:00
|
|
|
aArg.Value <<= xDesktop; //TODO/LATER: should use parent document frame
|
|
|
|
m_aOutplaceFrameProps[2] <<= aArg;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
DocumentHolder::~DocumentHolder()
|
|
|
|
{
|
2003-12-01 09:16:41 +00:00
|
|
|
m_refCount++; // to allow deregistration as a listener
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
if( m_xFrame.is() )
|
|
|
|
CloseFrame();
|
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
|
|
|
try {
|
2014-04-17 11:39:18 +02:00
|
|
|
CloseDocument( true, false );
|
2011-12-09 02:56:30 +09:00
|
|
|
} catch( const uno::Exception& ) {}
|
2003-11-18 11:47:08 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
if ( m_pInterceptor )
|
|
|
|
{
|
|
|
|
m_pInterceptor->DisconnectDocHolder();
|
|
|
|
m_pInterceptor->release();
|
|
|
|
}
|
2003-11-18 11:47:08 +00:00
|
|
|
|
2004-11-26 15:15:51 +00:00
|
|
|
if ( !m_bDesktopTerminated )
|
|
|
|
FreeOffice();
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void DocumentHolder::CloseFrame()
|
|
|
|
{
|
|
|
|
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
|
|
|
|
if ( xCloseBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xCloseBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
uno::Reference<util::XCloseable> xCloseable(
|
|
|
|
m_xFrame,uno::UNO_QUERY );
|
|
|
|
if( xCloseable.is() )
|
|
|
|
try {
|
|
|
|
xCloseable->close( sal_True );
|
|
|
|
}
|
|
|
|
catch( const uno::Exception& ) {
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uno::Reference<lang::XComponent> xComp( m_xFrame,uno::UNO_QUERY );
|
|
|
|
if( xComp.is() )
|
|
|
|
xComp->dispose();
|
|
|
|
}
|
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< lang::XComponent > xComp( m_xHatchWindow, uno::UNO_QUERY );
|
|
|
|
if ( xComp.is() )
|
|
|
|
xComp->dispose();
|
|
|
|
|
|
|
|
m_xHatchWindow = uno::Reference< awt::XWindow >();
|
|
|
|
m_xOwnWindow = uno::Reference< awt::XWindow >();
|
2003-10-27 12:05:38 +00:00
|
|
|
m_xFrame = uno::Reference< frame::XFrame >();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void DocumentHolder::FreeOffice()
|
|
|
|
{
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( m_xContext );
|
2012-12-14 12:58:00 +02:00
|
|
|
xDesktop->removeTerminateListener( this );
|
2005-09-23 14:44:51 +00:00
|
|
|
|
2012-12-14 12:58:00 +02:00
|
|
|
// the following code is commented out since for now there is still no completely correct way to detect
|
|
|
|
// whether the office can be terminated, so it is better to have unnecessary process running than
|
2014-05-14 14:15:38 -04:00
|
|
|
// to lose any data
|
2005-09-23 14:44:51 +00:00
|
|
|
|
2005-04-18 11:12:15 +00:00
|
|
|
// uno::Reference< frame::XFramesSupplier > xFramesSupplier( xDesktop, uno::UNO_QUERY );
|
|
|
|
// if ( xFramesSupplier.is() )
|
|
|
|
// {
|
|
|
|
// uno::Reference< frame::XFrames > xFrames = xFramesSupplier->getFrames();
|
|
|
|
// if ( xFrames.is() && !xFrames->hasElements() )
|
|
|
|
// {
|
|
|
|
// try
|
|
|
|
// {
|
|
|
|
// xDesktop->terminate();
|
|
|
|
// }
|
|
|
|
// catch( uno::Exception & )
|
|
|
|
// {}
|
|
|
|
// }
|
|
|
|
// }
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
void DocumentHolder::CloseDocument( bool bDeliverOwnership, bool bWaitForClose )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xComponent, uno::UNO_QUERY );
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( xBroadcaster.is() )
|
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY );
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( xEventBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xEventBroadcaster->removeEventListener( static_cast<document::XEventListener*>(this) );
|
2007-05-22 18:35:56 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// the object does not support document::XEventBroadcaster interface
|
|
|
|
// use the workaround, register for modified events
|
|
|
|
uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY );
|
|
|
|
if ( xModifyBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xModifyBroadcaster->removeModifyListener( static_cast<util::XModifyListener*>(this) );
|
2007-05-22 18:35:56 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
uno::Reference< util::XCloseable > xCloseable( xBroadcaster, uno::UNO_QUERY );
|
|
|
|
if ( xCloseable.is() )
|
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bAllowClosing = true;
|
2003-11-18 11:47:08 +00:00
|
|
|
m_bWaitForClose = bWaitForClose;
|
|
|
|
xCloseable->close( bDeliverOwnership );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
m_xComponent = 0;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void DocumentHolder::PlaceFrame( const awt::Rectangle& aNewRect )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( m_xFrame.is() && m_xOwnWindow.is(),
|
|
|
|
"The object does not have windows required for inplace mode!" );
|
|
|
|
|
|
|
|
//TODO: may need mutex locking???
|
|
|
|
if ( m_xFrame.is() && m_xOwnWindow.is() )
|
|
|
|
{
|
|
|
|
// the frame can be replaced only in inplace mode
|
|
|
|
frame::BorderWidths aOldWidths;
|
|
|
|
IntCounterGuard aGuard( m_nNoBorderResizeReact );
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
aOldWidths = m_aBorderWidths;
|
|
|
|
|
|
|
|
awt::Rectangle aHatchRect = AddBorderToArea( aNewRect );
|
|
|
|
|
|
|
|
ResizeWindows_Impl( aHatchRect );
|
2006-12-19 13:03:57 +00:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
} while ( aOldWidths.Left != m_aBorderWidths.Left
|
|
|
|
|| aOldWidths.Top != m_aBorderWidths.Top
|
|
|
|
|| aOldWidths.Right != m_aBorderWidths.Right
|
|
|
|
|| aOldWidths.Bottom != m_aBorderWidths.Bottom );
|
|
|
|
|
|
|
|
m_aObjRect = aNewRect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void DocumentHolder::ResizeWindows_Impl( const awt::Rectangle& aHatchRect )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( m_xFrame.is() && m_xOwnWindow.is() /*&& m_xHatchWindow.is()*/,
|
|
|
|
"The object does not have windows required for inplace mode!" );
|
|
|
|
if ( m_xHatchWindow.is() )
|
|
|
|
{
|
|
|
|
m_xOwnWindow->setPosSize( HATCH_BORDER_WIDTH,
|
|
|
|
HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRect.Width - 2*HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRect.Height - 2*HATCH_BORDER_WIDTH,
|
|
|
|
awt::PosSize::POSSIZE );
|
|
|
|
|
|
|
|
|
|
|
|
m_xHatchWindow->setPosSize( aHatchRect.X,
|
|
|
|
aHatchRect.Y,
|
|
|
|
aHatchRect.Width,
|
|
|
|
aHatchRect.Height,
|
|
|
|
awt::PosSize::POSSIZE );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
m_xOwnWindow->setPosSize( aHatchRect.X + HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRect.Y + HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRect.Width - 2*HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRect.Height - 2*HATCH_BORDER_WIDTH,
|
|
|
|
awt::PosSize::POSSIZE );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::SetFrameLMVisibility( const uno::Reference< frame::XFrame >& xFrame, bool bVisible )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bResult = false;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY_THROW );
|
2013-06-29 21:24:12 +02:00
|
|
|
xPropSet->getPropertyValue("LayoutManager") >>= xLayoutManager;
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( xLayoutManager.is() )
|
|
|
|
{
|
|
|
|
xLayoutManager->setVisible( bVisible );
|
|
|
|
|
|
|
|
// MBA: locking is done only on the container LM, because it is not about hiding windows, it's about
|
|
|
|
// giving up control over the component window (and stopping to listen for resize events of the container window)
|
2006-11-01 17:20:30 +00:00
|
|
|
if ( bVisible )
|
|
|
|
xLayoutManager->unlock();
|
|
|
|
else
|
|
|
|
xLayoutManager->lock();
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bResult = true;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
return bResult;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xParent,
|
2004-10-04 18:52:40 +00:00
|
|
|
const awt::Rectangle& aRectangleToShow,
|
|
|
|
const uno::Reference< frame::XDispatchProvider >& xContDisp )
|
|
|
|
{
|
|
|
|
OSL_ENSURE( !m_xFrame.is(), "A frame exists already!" );
|
|
|
|
|
|
|
|
if ( !m_xFrame.is() )
|
|
|
|
{
|
|
|
|
uno::Reference < frame::XModel > xModel( GetComponent(), uno::UNO_QUERY );
|
|
|
|
awt::Rectangle aHatchRectangle = AddBorderToArea( aRectangleToShow );
|
|
|
|
|
|
|
|
awt::Rectangle aOwnRectangle( HATCH_BORDER_WIDTH,
|
|
|
|
HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRectangle.Width - 2*HATCH_BORDER_WIDTH,
|
|
|
|
aHatchRectangle.Height - 2*HATCH_BORDER_WIDTH );
|
|
|
|
uno::Reference< awt::XWindow > xHWindow;
|
|
|
|
uno::Reference< awt::XWindowPeer > xMyParent( xParent );
|
|
|
|
|
|
|
|
if ( xModel.is() )
|
|
|
|
{
|
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< embed::XHatchWindowFactory > xHatchFactory =
|
|
|
|
embed::HatchWindowFactory::create(m_xContext);
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
uno::Reference< embed::XHatchWindow > xHatchWindow =
|
|
|
|
xHatchFactory->createHatchWindowInstance( xParent,
|
|
|
|
aHatchRectangle,
|
|
|
|
awt::Size( HATCH_BORDER_WIDTH, HATCH_BORDER_WIDTH ) );
|
|
|
|
|
|
|
|
uno::Reference< awt::XWindowPeer > xHatchWinPeer( xHatchWindow, uno::UNO_QUERY );
|
|
|
|
xHWindow = uno::Reference< awt::XWindow >( xHatchWinPeer, uno::UNO_QUERY );
|
|
|
|
if ( !xHWindow.is() )
|
|
|
|
throw uno::RuntimeException(); // TODO: can not create own window
|
|
|
|
|
|
|
|
xHatchWindow->setController( uno::Reference< embed::XHatchWindowController >(
|
|
|
|
static_cast< embed::XHatchWindowController* >( this ) ) );
|
|
|
|
|
|
|
|
xMyParent = xHatchWinPeer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aOwnRectangle.X += aHatchRectangle.X;
|
|
|
|
aOwnRectangle.Y += aHatchRectangle.Y;
|
|
|
|
}
|
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
awt::WindowDescriptor aOwnWinDescriptor( awt::WindowClass_TOP,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString("dockingwindow"),
|
2004-10-04 18:52:40 +00:00
|
|
|
xMyParent,
|
|
|
|
0,
|
|
|
|
awt::Rectangle(),//aOwnRectangle,
|
|
|
|
awt::WindowAttribute::SHOW | awt::VclWindowPeerAttribute::CLIPCHILDREN );
|
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create(m_xContext);
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
uno::Reference< awt::XWindowPeer > xNewWinPeer = xToolkit->createWindow( aOwnWinDescriptor );
|
|
|
|
uno::Reference< awt::XWindow > xOwnWindow( xNewWinPeer, uno::UNO_QUERY );
|
|
|
|
if ( !xOwnWindow.is() )
|
|
|
|
throw uno::RuntimeException(); // TODO: can not create own window
|
|
|
|
|
|
|
|
// create a frame based on the specified window
|
2013-01-07 17:46:55 +02:00
|
|
|
uno::Reference< lang::XSingleServiceFactory > xFrameFact = frame::TaskCreator::create(m_xContext);
|
2007-04-16 15:50:44 +00:00
|
|
|
|
|
|
|
uno::Sequence< uno::Any > aArgs( 2 );
|
|
|
|
beans::NamedValue aArg;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2013-11-04 11:59:34 +02:00
|
|
|
aArg.Name = "ContainerWindow";
|
2007-04-16 15:50:44 +00:00
|
|
|
aArg.Value <<= xOwnWindow;
|
|
|
|
aArgs[0] <<= aArg;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2007-04-16 15:50:44 +00:00
|
|
|
uno::Reference< frame::XFrame > xContFrame( xContDisp, uno::UNO_QUERY );
|
|
|
|
if ( xContFrame.is() )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2013-11-04 11:59:34 +02:00
|
|
|
aArg.Name = "ParentFrame";
|
2007-04-16 15:50:44 +00:00
|
|
|
aArg.Value <<= xContFrame;
|
|
|
|
aArgs[1] <<= aArg;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2007-04-16 15:50:44 +00:00
|
|
|
else
|
|
|
|
aArgs.realloc( 1 );
|
|
|
|
|
|
|
|
// the call will create, initialize the frame, and register it in the parent
|
|
|
|
m_xFrame.set( xFrameFact->createInstanceWithArguments( aArgs ), uno::UNO_QUERY_THROW );
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
m_xHatchWindow = xHWindow;
|
|
|
|
m_xOwnWindow = xOwnWindow;
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
if ( !SetFrameLMVisibility( m_xFrame, false ) )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
OSL_FAIL( "Can't deactivate LayoutManager!\n" );
|
2004-10-04 18:52:40 +00:00
|
|
|
// TODO/LATER: error handling?
|
|
|
|
}
|
|
|
|
|
|
|
|
// m_bIsInplace = sal_True; TODO: ?
|
|
|
|
|
|
|
|
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
|
|
|
|
if ( xCloseBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xCloseBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
// TODO: some listeners to the frame and the window ( resize for example )
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( m_xComponent.is() )
|
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
if ( !LoadDocToFrame( true ) )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
CloseFrame();
|
2014-04-17 11:39:18 +02:00
|
|
|
return false;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< frame::XControllerBorder > xControllerBorder( m_xFrame->getController(), uno::UNO_QUERY );
|
|
|
|
if ( xControllerBorder.is() )
|
|
|
|
{
|
|
|
|
m_aBorderWidths = xControllerBorder->getBorder();
|
2015-06-08 16:24:55 +02:00
|
|
|
xControllerBorder->addBorderResizeListener( static_cast<frame::XBorderResizeListener*>(this) );
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PlaceFrame( aRectangleToShow );
|
|
|
|
|
|
|
|
if ( m_xHatchWindow.is() )
|
|
|
|
m_xHatchWindow->setVisible( sal_True );
|
2006-12-19 13:03:57 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return true;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return false;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< container::XIndexAccess > DocumentHolder::RetrieveOwnMenu_Impl()
|
|
|
|
{
|
|
|
|
uno::Reference< container::XIndexAccess > xResult;
|
|
|
|
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::ui::XUIConfigurationManagerSupplier > xUIConfSupplier(
|
2004-10-04 18:52:40 +00:00
|
|
|
m_xComponent,
|
2007-04-16 15:50:44 +00:00
|
|
|
uno::UNO_QUERY );
|
|
|
|
uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > xUIConfigManager;
|
|
|
|
if( xUIConfSupplier.is())
|
|
|
|
{
|
|
|
|
xUIConfigManager.set(
|
|
|
|
xUIConfSupplier->getUIConfigurationManager(),
|
|
|
|
uno::UNO_QUERY_THROW );
|
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2007-04-16 15:50:44 +00:00
|
|
|
if( xUIConfigManager.is())
|
|
|
|
{
|
|
|
|
xResult = xUIConfigManager->getSettings(
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString( "private:resource/menubar/menubar" ),
|
2004-10-04 18:52:40 +00:00
|
|
|
sal_False );
|
2007-04-16 15:50:44 +00:00
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
if ( !xResult.is() )
|
|
|
|
{
|
|
|
|
// no internal document configuration, use the one from the module
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< frame::XModuleManager2 > xModuleMan = frame::ModuleManager::create(m_xContext);
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aModuleIdent =
|
2004-10-04 18:52:40 +00:00
|
|
|
xModuleMan->identify( uno::Reference< uno::XInterface >( m_xComponent, uno::UNO_QUERY ) );
|
|
|
|
|
2011-12-21 19:54:11 -02:00
|
|
|
if ( !aModuleIdent.isEmpty() )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2013-01-02 14:43:43 +02:00
|
|
|
uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModConfSupplier =
|
2014-01-29 18:58:18 +01:00
|
|
|
ui::theModuleUIConfigurationManagerSupplier::get(m_xContext);
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > xModUIConfMan(
|
2004-10-04 18:52:40 +00:00
|
|
|
xModConfSupplier->getUIConfigurationManager( aModuleIdent ),
|
|
|
|
uno::UNO_QUERY_THROW );
|
|
|
|
xResult = xModUIConfMan->getSettings(
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString( "private:resource/menubar/menubar" ),
|
2004-10-04 18:52:40 +00:00
|
|
|
sal_False );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !xResult.is() )
|
|
|
|
throw uno::RuntimeException();
|
|
|
|
|
|
|
|
return xResult;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void DocumentHolder::FindConnectPoints(
|
|
|
|
const uno::Reference< container::XIndexAccess >& xMenu,
|
|
|
|
sal_Int32 nConnectPoints[2] )
|
|
|
|
throw ( uno::Exception )
|
|
|
|
{
|
|
|
|
nConnectPoints[0] = -1;
|
|
|
|
nConnectPoints[1] = -1;
|
|
|
|
for ( sal_Int32 nInd = 0; nInd < xMenu->getCount(); nInd++ )
|
|
|
|
{
|
|
|
|
uno::Sequence< beans::PropertyValue > aProps;
|
|
|
|
xMenu->getByIndex( nInd ) >>= aProps;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aCommand;
|
2004-10-04 18:52:40 +00:00
|
|
|
for ( sal_Int32 nSeqInd = 0; nSeqInd < aProps.getLength(); nSeqInd++ )
|
2012-04-06 14:28:18 +02:00
|
|
|
if ( aProps[nSeqInd].Name == "CommandURL" )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
aProps[nSeqInd].Value >>= aCommand;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-12-21 19:54:11 -02:00
|
|
|
if ( aCommand.isEmpty() )
|
2004-10-04 18:52:40 +00:00
|
|
|
throw uno::RuntimeException();
|
|
|
|
|
2012-04-06 14:28:18 +02:00
|
|
|
if ( aCommand == ".uno:PickList" )
|
2004-10-04 18:52:40 +00:00
|
|
|
nConnectPoints[0] = nInd;
|
2012-04-06 14:28:18 +02:00
|
|
|
else if ( aCommand == ".uno:WindowList" )
|
2004-10-04 18:52:40 +00:00
|
|
|
nConnectPoints[1] = nInd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-02-21 12:32:16 +01:00
|
|
|
uno::Reference< container::XIndexAccess > DocumentHolder::MergeMenusForInplace(
|
2004-10-04 18:52:40 +00:00
|
|
|
const uno::Reference< container::XIndexAccess >& xContMenu,
|
2007-04-16 15:50:44 +00:00
|
|
|
const uno::Reference< frame::XDispatchProvider >& xContDisp,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName,
|
2004-10-04 18:52:40 +00:00
|
|
|
const uno::Reference< container::XIndexAccess >& xOwnMenu,
|
2007-04-16 15:50:44 +00:00
|
|
|
const uno::Reference< frame::XDispatchProvider >& xOwnDisp )
|
2004-10-04 18:52:40 +00:00
|
|
|
throw ( uno::Exception )
|
|
|
|
{
|
|
|
|
// TODO/LATER: use dispatch providers on merge
|
|
|
|
|
|
|
|
sal_Int32 nContPoints[2];
|
|
|
|
sal_Int32 nOwnPoints[2];
|
|
|
|
|
|
|
|
uno::Reference< lang::XSingleComponentFactory > xIndAccessFact( xContMenu, uno::UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
uno::Reference< container::XIndexContainer > xMergedMenu(
|
2012-09-29 17:20:22 +02:00
|
|
|
xIndAccessFact->createInstanceWithContext(
|
|
|
|
comphelper::getProcessComponentContext() ),
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
FindConnectPoints( xContMenu, nContPoints );
|
|
|
|
FindConnectPoints( xOwnMenu, nOwnPoints );
|
|
|
|
|
|
|
|
for ( sal_Int32 nInd = 0; nInd < xOwnMenu->getCount(); nInd++ )
|
|
|
|
{
|
|
|
|
if ( nOwnPoints[0] == nInd )
|
|
|
|
{
|
|
|
|
if ( nContPoints[0] >= 0 && nContPoints[0] < xContMenu->getCount() )
|
2005-03-23 13:19:59 +00:00
|
|
|
{
|
2007-04-16 15:50:44 +00:00
|
|
|
InsertMenu_Impl( xMergedMenu, nInd, xContMenu, nContPoints[0], aContModuleName, xContDisp );
|
2005-03-23 13:19:59 +00:00
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
else if ( nOwnPoints[1] == nInd )
|
|
|
|
{
|
|
|
|
if ( nContPoints[1] >= 0 && nContPoints[1] < xContMenu->getCount() )
|
2005-03-23 13:19:59 +00:00
|
|
|
{
|
2007-04-16 15:50:44 +00:00
|
|
|
InsertMenu_Impl( xMergedMenu, nInd, xContMenu, nContPoints[1], aContModuleName, xContDisp );
|
2005-03-23 13:19:59 +00:00
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
else
|
2013-04-07 12:06:47 +02:00
|
|
|
InsertMenu_Impl( xMergedMenu, nInd, xOwnMenu, nInd, OUString(), xOwnDisp );
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return uno::Reference< container::XIndexAccess >( xMergedMenu, uno::UNO_QUERY_THROW );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::MergeMenus_Impl( const uno::Reference< ::com::sun::star::frame::XLayoutManager >& xOwnLM,
|
2005-03-01 18:52:56 +00:00
|
|
|
const uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContLM,
|
2005-03-23 13:19:59 +00:00
|
|
|
const uno::Reference< frame::XDispatchProvider >& xContDisp,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bMenuMerged = false;
|
2004-10-04 18:52:40 +00:00
|
|
|
try
|
|
|
|
{
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::ui::XUIElementSettings > xUISettings(
|
2004-10-04 18:52:40 +00:00
|
|
|
xContLM->getElement(
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString( "private:resource/menubar/menubar" ) ),
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::UNO_QUERY_THROW );
|
|
|
|
uno::Reference< container::XIndexAccess > xContMenu = xUISettings->getSettings( sal_True );
|
|
|
|
if ( !xContMenu.is() )
|
|
|
|
throw uno::RuntimeException();
|
|
|
|
|
|
|
|
uno::Reference< container::XIndexAccess > xOwnMenu = RetrieveOwnMenu_Impl();
|
|
|
|
uno::Reference< frame::XDispatchProvider > xOwnDisp( m_xFrame, uno::UNO_QUERY_THROW );
|
|
|
|
|
2013-02-21 12:32:16 +01:00
|
|
|
uno::Reference< container::XIndexAccess > xMergedMenu = MergeMenusForInplace( xContMenu, xContDisp, aContModuleName, xOwnMenu, xOwnDisp );
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::frame::XMenuBarMergingAcceptor > xMerge( xOwnLM,
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::UNO_QUERY_THROW );
|
|
|
|
bMenuMerged = xMerge->setMergedMenuBar( xMergedMenu );
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
return bMenuMerged;
|
|
|
|
}
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM,
|
2005-03-23 13:19:59 +00:00
|
|
|
const uno::Reference< frame::XDispatchProvider >& xContainerDP,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bResult = false;
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( xContainerLM.is() )
|
|
|
|
{
|
2006-11-01 17:20:30 +00:00
|
|
|
// the LM of the embedded frame and its current DockingAreaAcceptor
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::frame::XLayoutManager > xOwnLM;
|
|
|
|
uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > xDocAreaAcc;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
try
|
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( m_xFrame, uno::UNO_QUERY_THROW );
|
2013-06-29 21:24:12 +02:00
|
|
|
xPropSet->getPropertyValue("LayoutManager") >>= xOwnLM;
|
2004-10-04 18:52:40 +00:00
|
|
|
xDocAreaAcc = xContainerLM->getDockingAreaAcceptor();
|
2006-11-01 17:20:30 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& ){}
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
if ( xOwnLM.is() && xDocAreaAcc.is() )
|
|
|
|
{
|
2014-12-12 19:07:13 +01:00
|
|
|
// make sure that lock state of LM is correct even if an exception is thrown in between
|
|
|
|
bool bUnlock = false;
|
|
|
|
bool bLock = false;
|
2004-10-04 18:52:40 +00:00
|
|
|
try
|
|
|
|
{
|
2006-11-01 17:20:30 +00:00
|
|
|
// take over the control over the containers window
|
|
|
|
// as long as the LM is invisible and locked an empty tool space will be used on resizing
|
2004-10-04 18:52:40 +00:00
|
|
|
xOwnLM->setDockingAreaAcceptor( xDocAreaAcc );
|
|
|
|
|
2011-12-06 23:04:19 -08:00
|
|
|
// try to merge menus; don't do anything else if it fails
|
2013-02-21 12:32:16 +01:00
|
|
|
if ( MergeMenus_Impl( xOwnLM, xContainerLM, xContainerDP, aContModuleName ) )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2006-11-01 17:20:30 +00:00
|
|
|
// make sure that the container LM does not control the size of the containers window anymore
|
2011-12-06 23:04:19 -08:00
|
|
|
// this must be done after merging menus as we won't get the container menu otherwise
|
2006-11-01 17:20:30 +00:00
|
|
|
xContainerLM->setDockingAreaAcceptor( uno::Reference < ui::XDockingAreaAcceptor >() );
|
|
|
|
|
|
|
|
// prevent further changes at this LM
|
|
|
|
xContainerLM->setVisible( sal_False );
|
2004-10-04 18:52:40 +00:00
|
|
|
xContainerLM->lock();
|
2014-04-17 11:39:18 +02:00
|
|
|
bUnlock = true;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
// by unlocking the LM each layout change will now resize the containers window; pending layouts will be processed now
|
|
|
|
xOwnLM->setVisible( sal_True );
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
uno::Reference< frame::XFramesSupplier > xSupp( m_xFrame->getCreator(), uno::UNO_QUERY );
|
|
|
|
if ( xSupp.is() )
|
|
|
|
xSupp->setActiveFrame( m_xFrame );
|
2004-11-09 14:11:20 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
xOwnLM->unlock();
|
2014-04-17 11:39:18 +02:00
|
|
|
bLock = true;
|
|
|
|
bResult = true;
|
2005-09-30 09:14:53 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
// TODO/LATER: The following action should be done only if the window is not hidden
|
2013-12-20 11:25:37 +01:00
|
|
|
// otherwise the activation must fail, unfortunately currently it is not possible
|
2006-11-01 17:20:30 +00:00
|
|
|
// to detect whether the window is hidden using UNO API
|
|
|
|
m_xOwnWindow->setFocus();
|
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2006-11-01 17:20:30 +00:00
|
|
|
// activation failed; reestablish old state
|
|
|
|
try
|
|
|
|
{
|
|
|
|
uno::Reference< frame::XFramesSupplier > xSupp( m_xFrame->getCreator(), uno::UNO_QUERY );
|
|
|
|
if ( xSupp.is() )
|
|
|
|
xSupp->setActiveFrame( 0 );
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
// remove control about containers window from own LM
|
|
|
|
if ( bLock )
|
|
|
|
xOwnLM->lock();
|
2004-10-04 18:52:40 +00:00
|
|
|
xOwnLM->setVisible( sal_False );
|
2006-11-01 17:20:30 +00:00
|
|
|
xOwnLM->setDockingAreaAcceptor( uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor >() );
|
|
|
|
|
|
|
|
// unmerge menu
|
|
|
|
uno::Reference< ::com::sun::star::frame::XMenuBarMergingAcceptor > xMerge( xOwnLM, uno::UNO_QUERY_THROW );
|
2004-10-04 18:52:40 +00:00
|
|
|
xMerge->removeMergedMenuBar();
|
2006-11-01 17:20:30 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& ) {}
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
// reestablish control of containers window
|
|
|
|
xContainerLM->setDockingAreaAcceptor( xDocAreaAcc );
|
2004-10-04 18:52:40 +00:00
|
|
|
xContainerLM->setVisible( sal_True );
|
2006-11-01 17:20:30 +00:00
|
|
|
if ( bUnlock )
|
|
|
|
xContainerLM->unlock();
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& ) {}
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bResult;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::HideUI( const uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bResult = false;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
if ( xContainerLM.is() )
|
|
|
|
{
|
2005-03-01 18:52:56 +00:00
|
|
|
uno::Reference< ::com::sun::star::frame::XLayoutManager > xOwnLM;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( m_xFrame, uno::UNO_QUERY_THROW );
|
2013-06-29 21:24:12 +02:00
|
|
|
xPropSet->getPropertyValue("LayoutManager") >>= xOwnLM;
|
2011-12-09 02:56:30 +09:00
|
|
|
} catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
if ( xOwnLM.is() )
|
|
|
|
{
|
|
|
|
try {
|
2006-11-01 17:20:30 +00:00
|
|
|
uno::Reference< frame::XFramesSupplier > xSupp( m_xFrame->getCreator(), uno::UNO_QUERY );
|
2004-11-09 14:11:20 +00:00
|
|
|
if ( xSupp.is() )
|
|
|
|
xSupp->setActiveFrame( 0 );
|
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > xDocAreaAcc = xOwnLM->getDockingAreaAcceptor();
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2006-11-01 17:20:30 +00:00
|
|
|
xOwnLM->setDockingAreaAcceptor( uno::Reference < ui::XDockingAreaAcceptor >() );
|
|
|
|
xOwnLM->lock();
|
2004-10-04 18:52:40 +00:00
|
|
|
xOwnLM->setVisible( sal_False );
|
2006-11-01 17:20:30 +00:00
|
|
|
|
|
|
|
uno::Reference< ::com::sun::star::frame::XMenuBarMergingAcceptor > xMerge( xOwnLM, uno::UNO_QUERY_THROW );
|
|
|
|
xMerge->removeMergedMenuBar();
|
|
|
|
|
|
|
|
xContainerLM->setDockingAreaAcceptor( xDocAreaAcc );
|
2004-10-04 18:52:40 +00:00
|
|
|
xContainerLM->setVisible( sal_True );
|
2006-11-01 17:20:30 +00:00
|
|
|
xContainerLM->unlock();
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
xContainerLM->doLayout();
|
2014-04-17 11:39:18 +02:00
|
|
|
bResult = true;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
SetFrameLMVisibility( m_xFrame, true );
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bResult;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
|
|
|
|
{
|
2004-05-10 16:52:09 +00:00
|
|
|
// the frame for outplace activation
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( !m_xFrame.is() )
|
|
|
|
{
|
2013-01-07 17:46:55 +02:00
|
|
|
uno::Reference< lang::XSingleServiceFactory > xFrameFact = frame::TaskCreator::create(m_xContext);
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2007-04-16 15:50:44 +00:00
|
|
|
m_xFrame.set(xFrameFact->createInstanceWithArguments( m_aOutplaceFrameProps ), uno::UNO_QUERY_THROW);
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
uno::Reference< frame::XDispatchProviderInterception > xInterception( m_xFrame, uno::UNO_QUERY );
|
|
|
|
if ( xInterception.is() )
|
|
|
|
{
|
|
|
|
if ( m_pInterceptor )
|
|
|
|
{
|
|
|
|
m_pInterceptor->DisconnectDocHolder();
|
|
|
|
m_pInterceptor->release();
|
|
|
|
m_pInterceptor = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pInterceptor = new Interceptor( this );
|
|
|
|
m_pInterceptor->acquire();
|
|
|
|
|
2004-05-10 16:52:09 +00:00
|
|
|
// register interceptor from outside
|
|
|
|
if ( m_xOutplaceInterceptor.is() )
|
|
|
|
xInterception->registerDispatchProviderInterceptor( m_xOutplaceInterceptor );
|
2004-08-02 16:44:44 +00:00
|
|
|
|
|
|
|
xInterception->registerDispatchProviderInterceptor( m_pInterceptor );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
|
|
|
|
if ( xCloseBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xCloseBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() )
|
2005-01-31 07:31:21 +00:00
|
|
|
{
|
2005-03-16 12:05:27 +00:00
|
|
|
uno::Reference< ::com::sun::star::frame::XLayoutManager > xOwnLM;
|
2005-03-15 10:38:03 +00:00
|
|
|
try {
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( m_xFrame, uno::UNO_QUERY_THROW );
|
2013-06-29 21:24:12 +02:00
|
|
|
xPropSet->getPropertyValue("LayoutManager") >>= xOwnLM;
|
2011-12-09 02:56:30 +09:00
|
|
|
} catch( const uno::Exception& )
|
2005-03-15 10:38:03 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
if ( xOwnLM.is() )
|
|
|
|
xOwnLM->lock();
|
|
|
|
|
2005-01-31 07:31:21 +00:00
|
|
|
// TODO/LATER: get it for the real aspect
|
|
|
|
awt::Size aSize;
|
|
|
|
GetExtent( embed::Aspects::MSOLE_CONTENT, &aSize );
|
2014-04-17 11:39:18 +02:00
|
|
|
LoadDocToFrame(false);
|
2005-03-15 10:38:03 +00:00
|
|
|
|
|
|
|
if ( xOwnLM.is() )
|
|
|
|
{
|
|
|
|
xOwnLM->unlock();
|
|
|
|
xOwnLM->lock();
|
|
|
|
}
|
|
|
|
|
2005-01-31 07:31:21 +00:00
|
|
|
SetExtent( embed::Aspects::MSOLE_CONTENT, aSize );
|
2005-03-15 10:38:03 +00:00
|
|
|
|
|
|
|
if ( xOwnLM.is() )
|
|
|
|
xOwnLM->unlock();
|
2005-01-31 07:31:21 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2008-07-08 07:25:04 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
uno::Reference< awt::XWindow > xHWindow = m_xFrame->getContainerWindow();
|
|
|
|
|
|
|
|
if( xHWindow.is() )
|
|
|
|
{
|
2012-12-11 14:59:39 +02:00
|
|
|
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
|
|
|
|
|
2013-07-19 08:20:14 +02:00
|
|
|
Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
|
2008-07-08 07:25:04 +00:00
|
|
|
awt::Rectangle aWindowRect = xHWindow->getPosSize();
|
|
|
|
|
2012-12-11 14:59:39 +02:00
|
|
|
if (( aWindowRect.Width < aWorkRect.GetWidth()) && ( aWindowRect.Height < aWorkRect.GetHeight() ))
|
2008-07-08 07:25:04 +00:00
|
|
|
{
|
2012-12-11 14:59:39 +02:00
|
|
|
int OffsetX = ( aWorkRect.GetWidth() - aWindowRect.Width ) / 2 + aWorkRect.Left();
|
|
|
|
int OffsetY = ( aWorkRect.GetHeight() - aWindowRect.Height ) /2 + aWorkRect.Top();
|
2008-07-08 07:25:04 +00:00
|
|
|
xHWindow->setPosSize( OffsetX, OffsetY, aWindowRect.Width, aWindowRect.Height, awt::PosSize::POS );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-11 14:59:39 +02:00
|
|
|
xHWindow->setPosSize( aWorkRect.Left(), aWorkRect.Top(), aWorkRect.GetWidth(), aWorkRect.GetHeight(), awt::PosSize::POSSIZE );
|
2008-07-08 07:25:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xHWindow->setVisible( sal_True );
|
|
|
|
}
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch ( const uno::Exception& )
|
2008-07-08 07:25:04 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
return m_xFrame;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
void DocumentHolder::SetComponent( const uno::Reference< util::XCloseable >& xDoc, bool bReadOnly )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
|
|
|
// May be should be improved
|
|
|
|
try {
|
2014-04-17 11:39:18 +02:00
|
|
|
CloseDocument( true, false );
|
2011-12-09 02:56:30 +09:00
|
|
|
} catch( const uno::Exception& )
|
2003-11-18 11:47:08 +00:00
|
|
|
{}
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
m_xComponent = xDoc;
|
2005-04-04 07:08:26 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
m_bReadOnly = bReadOnly;
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bAllowClosing = false;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xComponent, uno::UNO_QUERY );
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( xBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY );
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( xEventBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xEventBroadcaster->addEventListener( static_cast<document::XEventListener*>(this) );
|
2007-05-22 18:35:56 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// the object does not support document::XEventBroadcaster interface
|
|
|
|
// use the workaround, register for modified events
|
|
|
|
uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY );
|
|
|
|
if ( xModifyBroadcaster.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xModifyBroadcaster->addModifyListener( static_cast<util::XModifyListener*>(this) );
|
2007-05-22 18:35:56 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
if ( m_xFrame.is() )
|
2014-04-17 11:39:18 +02:00
|
|
|
LoadDocToFrame(false);
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::LoadDocToFrame( bool bInPlace )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xFrame.is() && m_xComponent.is() )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2006-06-19 23:29:40 +00:00
|
|
|
uno::Reference < frame::XModel > xDoc( m_xComponent, uno::UNO_QUERY );
|
|
|
|
if ( xDoc.is() )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
// load new document in to the frame
|
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
|
|
|
uno::Reference< frame::XComponentLoader > xComponentLoader( m_xFrame, uno::UNO_QUERY_THROW );
|
2004-10-04 18:52:40 +00:00
|
|
|
|
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
|
|
|
::comphelper::NamedValueCollection aArgs;
|
|
|
|
aArgs.put( "Model", m_xComponent );
|
|
|
|
aArgs.put( "ReadOnly", m_bReadOnly );
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( bInPlace )
|
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
|
|
|
aArgs.put( "PluginMode", sal_Int16(1) );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sUrl;
|
2007-07-06 09:08:49 +00:00
|
|
|
uno::Reference< lang::XServiceInfo> xServiceInfo(xDoc,uno::UNO_QUERY);
|
|
|
|
if ( xServiceInfo.is()
|
2013-06-29 21:24:12 +02:00
|
|
|
&& xServiceInfo->supportsService("com.sun.star.report.ReportDefinition") )
|
2007-05-22 18:35:56 +00:00
|
|
|
{
|
2013-11-04 11:59:34 +02:00
|
|
|
sUrl = ".component:DB/ReportDesign";
|
2007-05-22 18:35:56 +00:00
|
|
|
}
|
2007-07-06 09:08:49 +00:00
|
|
|
else if( xServiceInfo.is()
|
2013-06-29 21:24:12 +02:00
|
|
|
&& xServiceInfo->supportsService("com.sun.star.chart2.ChartDocument"))
|
2013-11-04 11:59:34 +02:00
|
|
|
sUrl = "private:factory/schart";
|
2007-05-22 18:35:56 +00:00
|
|
|
else
|
2013-11-04 11:59:34 +02:00
|
|
|
sUrl = "private:object";
|
2007-07-06 09:08:49 +00:00
|
|
|
|
|
|
|
xComponentLoader->loadComponentFromURL( sUrl,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString( "_self" ),
|
2007-05-22 18:35:56 +00:00
|
|
|
0,
|
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
|
|
|
aArgs.getPropertyValues() );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return true;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
uno::Reference < frame::XSynchronousFrameLoader > xLoader( m_xComponent, uno::UNO_QUERY );
|
|
|
|
if ( xLoader.is() )
|
|
|
|
return xLoader->load( uno::Sequence < beans::PropertyValue >(), m_xFrame );
|
|
|
|
else
|
2014-04-17 11:39:18 +02:00
|
|
|
return false;
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
2004-10-04 18:52:40 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return true;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void DocumentHolder::Show()
|
|
|
|
{
|
|
|
|
if( m_xFrame.is() )
|
|
|
|
{
|
|
|
|
m_xFrame->activate();
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference<awt::XTopWindow> xTopWindow( m_xFrame->getContainerWindow(), uno::UNO_QUERY );
|
2003-10-27 12:05:38 +00:00
|
|
|
if( xTopWindow.is() )
|
|
|
|
xTopWindow->toFront();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
GetDocFrame();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::SetExtent( sal_Int64 nAspect, const awt::Size& aSize )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< embed::XVisualObject > xDocVis( m_xComponent, uno::UNO_QUERY );
|
2004-05-10 16:52:09 +00:00
|
|
|
if ( xDocVis.is() )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-05-10 16:52:09 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
xDocVis->setVisualAreaSize( nAspect, aSize );
|
2014-04-17 11:39:18 +02:00
|
|
|
return true;
|
2004-05-10 16:52:09 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-05-10 16:52:09 +00:00
|
|
|
{
|
|
|
|
// TODO: Error handling
|
|
|
|
}
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return false;
|
2004-05-10 16:52:09 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool DocumentHolder::GetExtent( sal_Int64 nAspect, awt::Size *pSize )
|
2004-05-10 16:52:09 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< embed::XVisualObject > xDocVis( m_xComponent, uno::UNO_QUERY );
|
2004-05-10 16:52:09 +00:00
|
|
|
if ( pSize && xDocVis.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
*pSize = xDocVis->getVisualAreaSize( nAspect );
|
2014-04-17 11:39:18 +02:00
|
|
|
return true;
|
2004-05-10 16:52:09 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-05-10 16:52:09 +00:00
|
|
|
{
|
|
|
|
// TODO: Error handling
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
return false;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
sal_Int32 DocumentHolder::GetMapUnit( sal_Int64 nAspect )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
uno::Reference< embed::XVisualObject > xDocVis( m_xComponent, uno::UNO_QUERY );
|
2004-05-10 16:52:09 +00:00
|
|
|
if ( xDocVis.is() )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-05-10 16:52:09 +00:00
|
|
|
try
|
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
return xDocVis->getMapUnit( nAspect );
|
2004-05-10 16:52:09 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2004-05-10 16:52:09 +00:00
|
|
|
{
|
|
|
|
// TODO: Error handling
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2004-05-10 16:52:09 +00:00
|
|
|
return 0;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
awt::Rectangle DocumentHolder::CalculateBorderedArea( const awt::Rectangle& aRect )
|
|
|
|
{
|
|
|
|
return awt::Rectangle( aRect.X + m_aBorderWidths.Left + HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Y + m_aBorderWidths.Top + HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Width - m_aBorderWidths.Left - m_aBorderWidths.Right - 2*HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Height - m_aBorderWidths.Top - m_aBorderWidths.Bottom - 2*HATCH_BORDER_WIDTH );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
awt::Rectangle DocumentHolder::AddBorderToArea( const awt::Rectangle& aRect )
|
|
|
|
{
|
|
|
|
return awt::Rectangle( aRect.X - m_aBorderWidths.Left - HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Y - m_aBorderWidths.Top - HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Width + m_aBorderWidths.Left + m_aBorderWidths.Right + 2*HATCH_BORDER_WIDTH,
|
|
|
|
aRect.Height + m_aBorderWidths.Top + m_aBorderWidths.Bottom + 2*HATCH_BORDER_WIDTH );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void SAL_CALL DocumentHolder::disposing( const com::sun::star::lang::EventObject& aSource )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() && m_xComponent == aSource.Source )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
m_xComponent = 0;
|
2003-11-18 11:47:08 +00:00
|
|
|
if ( m_bWaitForClose )
|
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bWaitForClose = false;
|
2003-11-18 11:47:08 +00:00
|
|
|
FreeOffice();
|
|
|
|
}
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
if( m_xFrame.is() && m_xFrame == aSource.Source )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
m_xHatchWindow = uno::Reference< awt::XWindow >();
|
|
|
|
m_xOwnWindow = uno::Reference< awt::XWindow >();
|
2003-10-27 12:05:38 +00:00
|
|
|
m_xFrame = uno::Reference< frame::XFrame >();
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-06-19 23:29:40 +00:00
|
|
|
void SAL_CALL DocumentHolder::queryClosing( const lang::EventObject& aSource, sal_Bool /*bGetsOwnership*/ )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (util::CloseVetoException, uno::RuntimeException, std::exception)
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() && m_xComponent == aSource.Source && !m_bAllowClosing )
|
2003-10-27 12:05:38 +00:00
|
|
|
throw util::CloseVetoException();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void SAL_CALL DocumentHolder::notifyClosing( const lang::EventObject& aSource )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if ( m_xComponent.is() && m_xComponent == aSource.Source )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
m_xComponent = 0;
|
2003-11-18 11:47:08 +00:00
|
|
|
if ( m_bWaitForClose )
|
|
|
|
{
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bWaitForClose = false;
|
2003-11-18 11:47:08 +00:00
|
|
|
FreeOffice();
|
|
|
|
}
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
if( m_xFrame.is() && m_xFrame == aSource.Source )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
m_xHatchWindow = uno::Reference< awt::XWindow >();
|
|
|
|
m_xOwnWindow = uno::Reference< awt::XWindow >();
|
2003-10-27 12:05:38 +00:00
|
|
|
m_xFrame = uno::Reference< frame::XFrame >();
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-06-19 23:29:40 +00:00
|
|
|
void SAL_CALL DocumentHolder::queryTermination( const lang::EventObject& )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (frame::TerminationVetoException, uno::RuntimeException, std::exception)
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2003-11-18 11:47:08 +00:00
|
|
|
if ( m_bWaitForClose )
|
2003-10-27 12:05:38 +00:00
|
|
|
throw frame::TerminationVetoException();
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void SAL_CALL DocumentHolder::notifyTermination( const lang::EventObject& aSource )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
OSL_ENSURE( !m_xComponent.is(), "Just a disaster..." );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
uno::Reference< frame::XDesktop > xDesktop( aSource.Source, uno::UNO_QUERY );
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bDesktopTerminated = true;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( xDesktop.is() )
|
2015-06-08 16:24:55 +02:00
|
|
|
xDesktop->removeTerminateListener( static_cast<frame::XTerminateListener*>(this) );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2007-05-22 18:35:56 +00:00
|
|
|
void SAL_CALL DocumentHolder::modified( const lang::EventObject& aEvent )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2007-05-22 18:35:56 +00:00
|
|
|
// if the component does not support document::XEventBroadcaster
|
|
|
|
// the modify notifications are used as workaround, but only for running state
|
|
|
|
if( aEvent.Source == m_xComponent && m_pEmbedObj && m_pEmbedObj->getCurrentState() == embed::EmbedStates::RUNNING )
|
2013-04-07 12:06:47 +02:00
|
|
|
m_pEmbedObj->PostEvent_Impl( OUString( "OnVisAreaChanged" ) );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void SAL_CALL DocumentHolder::notifyEvent( const document::EventObject& Event )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:52:40 +00:00
|
|
|
if( m_pEmbedObj && Event.Source == m_xComponent )
|
|
|
|
{
|
|
|
|
// for now the ignored events are not forwarded, but sent by the object itself
|
2013-11-19 15:58:58 +02:00
|
|
|
if ( !Event.EventName.startsWith( "OnSave" )
|
|
|
|
&& !Event.EventName.startsWith( "OnSaveDone" )
|
|
|
|
&& !Event.EventName.startsWith( "OnSaveAs" )
|
|
|
|
&& !Event.EventName.startsWith( "OnSaveAsDone" )
|
|
|
|
&& !( Event.EventName.startsWith( "OnVisAreaChanged" ) && m_nNoResizeReact ) )
|
2012-01-21 15:21:16 +01:00
|
|
|
m_pEmbedObj->PostEvent_Impl( Event.EventName );
|
2004-10-04 18:52:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void SAL_CALL DocumentHolder::borderWidthsChanged( const uno::Reference< uno::XInterface >& aObject,
|
|
|
|
const frame::BorderWidths& aNewSize )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
// TODO: may require mutex introduction ???
|
|
|
|
if ( m_pEmbedObj && m_xFrame.is() && aObject == m_xFrame->getController() )
|
|
|
|
{
|
|
|
|
if ( m_aBorderWidths.Left != aNewSize.Left
|
|
|
|
|| m_aBorderWidths.Right != aNewSize.Right
|
|
|
|
|| m_aBorderWidths.Top != aNewSize.Top
|
|
|
|
|| m_aBorderWidths.Bottom != aNewSize.Bottom )
|
|
|
|
{
|
|
|
|
m_aBorderWidths = aNewSize;
|
|
|
|
if ( !m_nNoBorderResizeReact )
|
|
|
|
PlaceFrame( m_aObjRect );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
void SAL_CALL DocumentHolder::requestPositioning( const awt::Rectangle& aRect )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
// TODO: may require mutex introduction ???
|
|
|
|
if ( m_pEmbedObj )
|
|
|
|
{
|
|
|
|
// borders should not be counted
|
|
|
|
awt::Rectangle aObjRect = CalculateBorderedArea( aRect );
|
2006-12-19 13:03:57 +00:00
|
|
|
IntCounterGuard aGuard( m_nNoResizeReact );
|
2004-10-04 18:52:40 +00:00
|
|
|
m_pEmbedObj->requestPositioning( aObjRect );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:52:40 +00:00
|
|
|
awt::Rectangle SAL_CALL DocumentHolder::calcAdjustedRectangle( const awt::Rectangle& aRect )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (uno::RuntimeException, std::exception)
|
2004-10-04 18:52:40 +00:00
|
|
|
{
|
|
|
|
// Solar mutex should be locked already since this is a call from HatchWindow with focus
|
|
|
|
awt::Rectangle aResult( aRect );
|
|
|
|
|
|
|
|
if ( m_xFrame.is() )
|
|
|
|
{
|
|
|
|
// borders should not be counted
|
|
|
|
uno::Reference< frame::XControllerBorder > xControllerBorder( m_xFrame->getController(), uno::UNO_QUERY );
|
|
|
|
if ( xControllerBorder.is() )
|
|
|
|
{
|
|
|
|
awt::Rectangle aObjRect = CalculateBorderedArea( aRect );
|
|
|
|
aObjRect = xControllerBorder->queryBorderedArea( aObjRect );
|
|
|
|
aResult = AddBorderToArea( aObjRect );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
awt::Rectangle aMinRectangle = AddBorderToArea( awt::Rectangle() );
|
2006-01-31 17:34:47 +00:00
|
|
|
if ( aResult.Width < aMinRectangle.Width + 2 )
|
|
|
|
aResult.Width = aMinRectangle.Width + 2;
|
|
|
|
if ( aResult.Height < aMinRectangle.Height + 2 )
|
|
|
|
aResult.Height = aMinRectangle.Height + 2;
|
2004-10-04 18:52:40 +00:00
|
|
|
|
|
|
|
return aResult;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL DocumentHolder::activated( ) throw (::com::sun::star::uno::RuntimeException, std::exception)
|
2006-11-01 17:20:30 +00:00
|
|
|
{
|
2014-08-11 09:54:20 +02:00
|
|
|
if ( (m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE) ||
|
|
|
|
svt::EmbeddedObjectRef::IsGLChart(m_pEmbedObj) )
|
2006-11-01 17:20:30 +00:00
|
|
|
{
|
|
|
|
if ( m_pEmbedObj->getCurrentState() != embed::EmbedStates::UI_ACTIVE &&
|
|
|
|
!(m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_NOUIACTIVATE) )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
m_pEmbedObj->changeState( embed::EmbedStates::UI_ACTIVE );
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch ( const com::sun::star::embed::StateChangeInProgressException& )
|
2006-11-01 17:20:30 +00:00
|
|
|
{
|
|
|
|
// must catch this exception because focus is grabbed while UI activation in doVerb()
|
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch ( const com::sun::star::uno::Exception& )
|
2006-11-01 17:20:30 +00:00
|
|
|
{
|
|
|
|
// no outgoing exceptions specified here
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
uno::Reference< frame::XFramesSupplier > xSupp( m_xFrame->getCreator(), uno::UNO_QUERY );
|
|
|
|
if ( xSupp.is() )
|
|
|
|
xSupp->setActiveFrame( m_xFrame );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocumentHolder::ResizeHatchWindow()
|
|
|
|
{
|
|
|
|
awt::Rectangle aHatchRect = AddBorderToArea( m_aObjRect );
|
|
|
|
ResizeWindows_Impl( aHatchRect );
|
|
|
|
uno::Reference< embed::XHatchWindow > xHatchWindow( m_xHatchWindow, uno::UNO_QUERY );
|
|
|
|
xHatchWindow->setHatchBorderSize( awt::Size( HATCH_BORDER_WIDTH, HATCH_BORDER_WIDTH ) );
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL DocumentHolder::deactivated( ) throw (::com::sun::star::uno::RuntimeException, std::exception)
|
2006-11-01 17:20:30 +00:00
|
|
|
{
|
|
|
|
// deactivation is too unspecific to be useful; usually we only trigger code from activation
|
|
|
|
// so UIDeactivation is actively triggered by the container
|
|
|
|
}
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|