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
|
|
|
|
|
|
|
#include <commonembobj.hxx>
|
|
|
|
#include <com/sun/star/embed/EmbedStates.hpp>
|
|
|
|
#include <com/sun/star/embed/EmbedVerbs.hpp>
|
|
|
|
#include <com/sun/star/embed/XStorage.hpp>
|
|
|
|
#include <com/sun/star/embed/EmbedUpdateModes.hpp>
|
2004-10-04 18:49:37 +00:00
|
|
|
#include <com/sun/star/embed/XInplaceClient.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
2017-02-06 17:08:38 +01:00
|
|
|
#include <com/sun/star/lang/NoSupportException.hpp>
|
2004-10-04 18:49:37 +00:00
|
|
|
#include <com/sun/star/beans/NamedValue.hpp>
|
|
|
|
|
2021-04-08 10:30:15 +02:00
|
|
|
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
|
|
|
|
#include <com/sun/star/io/TempFile.hpp>
|
2021-08-07 09:24:46 +02:00
|
|
|
#include <comphelper/multicontainer2.hxx>
|
2021-04-08 10:30:15 +02:00
|
|
|
#include <comphelper/storagehelper.hxx>
|
|
|
|
|
2014-11-18 00:06:30 +01:00
|
|
|
#include <cppuhelper/queryinterface.hxx>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <cppuhelper/interfacecontainer.h>
|
2010-12-01 11:22:11 +01:00
|
|
|
#include <comphelper/mimeconfighelper.hxx>
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2016-07-08 09:07:44 +02:00
|
|
|
#include <vcl/svapp.hxx>
|
2020-11-30 14:19:29 +02:00
|
|
|
#include <tools/diagnose_ex.h>
|
2021-08-10 16:37:15 +02:00
|
|
|
#include <cppuhelper/supportsservice.hxx>
|
2016-07-08 09:07:44 +02:00
|
|
|
|
2014-06-25 14:57:44 +02:00
|
|
|
#include "persistence.hxx"
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
|
2013-01-08 15:29:57 +02:00
|
|
|
OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< uno::XComponentContext >& rxContext,
|
2004-10-04 18:49:37 +00:00
|
|
|
const uno::Sequence< beans::NamedValue >& aObjProps )
|
2021-03-19 14:44:16 +02:00
|
|
|
: m_bReadOnly( false )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bDisposed( false )
|
|
|
|
, m_bClosed( false )
|
2003-10-27 12:05:38 +00:00
|
|
|
, m_nObjectState( -1 )
|
2005-02-25 08:21:15 +00:00
|
|
|
, m_nTargetState( -1 )
|
2004-05-10 16:51:12 +00:00
|
|
|
, m_nUpdateMode ( embed::EmbedUpdateModes::ALWAYS_UPDATE )
|
2013-01-08 15:29:57 +02:00
|
|
|
, m_xContext( rxContext )
|
2004-10-04 18:49:37 +00:00
|
|
|
, m_nMiscStatus( 0 )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bEmbeddedScriptSupport( true )
|
|
|
|
, m_bDocumentRecoverySupport( true )
|
|
|
|
, m_bWaitSaveCompleted( false )
|
2021-04-08 10:30:15 +02:00
|
|
|
, m_bIsLinkURL( false )
|
|
|
|
, m_bLinkTempFileChanged( false )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bLinkHasPassword( false )
|
|
|
|
, m_bHasClonedSize( false )
|
2007-08-02 16:04:58 +00:00
|
|
|
, m_nClonedMapUnit( 0 )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:49:37 +00:00
|
|
|
CommonInit_Impl( aObjProps );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
OCommonEmbeddedObject::OCommonEmbeddedObject(
|
2013-01-08 15:29:57 +02:00
|
|
|
const uno::Reference< uno::XComponentContext >& rxContext,
|
2004-10-04 18:49:37 +00:00
|
|
|
const uno::Sequence< beans::NamedValue >& aObjProps,
|
|
|
|
const uno::Sequence< beans::PropertyValue >& aMediaDescr,
|
|
|
|
const uno::Sequence< beans::PropertyValue >& aObjectDescr )
|
2021-03-19 14:44:16 +02:00
|
|
|
: m_bReadOnly( false )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bDisposed( false )
|
|
|
|
, m_bClosed( false )
|
2004-05-10 16:51:12 +00:00
|
|
|
, m_nObjectState( embed::EmbedStates::LOADED )
|
2005-02-25 08:21:15 +00:00
|
|
|
, m_nTargetState( -1 )
|
2004-05-10 16:51:12 +00:00
|
|
|
, m_nUpdateMode ( embed::EmbedUpdateModes::ALWAYS_UPDATE )
|
2013-01-08 15:29:57 +02:00
|
|
|
, m_xContext( rxContext )
|
2004-10-04 18:49:37 +00:00
|
|
|
, m_nMiscStatus( 0 )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bEmbeddedScriptSupport( true )
|
|
|
|
, m_bDocumentRecoverySupport( true )
|
|
|
|
, m_bWaitSaveCompleted( false )
|
2021-04-08 10:30:15 +02:00
|
|
|
, m_bIsLinkURL( true )
|
|
|
|
, m_bLinkTempFileChanged( false )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bLinkHasPassword( false )
|
|
|
|
, m_bHasClonedSize( false )
|
2007-08-02 16:04:58 +00:00
|
|
|
, m_nClonedMapUnit( 0 )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2004-10-04 18:49:37 +00:00
|
|
|
// linked object has no own persistence so it is in loaded state starting from creation
|
|
|
|
LinkInit_Impl( aObjProps, aMediaDescr, aObjectDescr );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
void OCommonEmbeddedObject::CommonInit_Impl( const uno::Sequence< beans::NamedValue >& aObjectProps )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2017-04-20 11:08:35 +02:00
|
|
|
OSL_ENSURE( m_xContext.is(), "No ServiceFactory is provided!" );
|
2013-01-08 15:29:57 +02:00
|
|
|
if ( !m_xContext.is() )
|
2003-10-27 12:05:38 +00:00
|
|
|
throw uno::RuntimeException();
|
|
|
|
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder = new DocumentHolder( m_xContext, this );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
// parse configuration entries
|
|
|
|
// TODO/LATER: in future UI names can be also provided here
|
2020-05-20 08:48:56 +02:00
|
|
|
for ( beans::NamedValue const & prop : aObjectProps )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
if ( prop.Name == "ClassID" )
|
|
|
|
prop.Value >>= m_aClassID;
|
|
|
|
else if ( prop.Name == "ObjectDocumentServiceName" )
|
|
|
|
prop.Value >>= m_aDocServiceName;
|
|
|
|
else if ( prop.Name == "ObjectDocumentFilterName" )
|
|
|
|
prop.Value >>= m_aPresetFilterName;
|
|
|
|
else if ( prop.Name == "ObjectMiscStatus" )
|
|
|
|
prop.Value >>= m_nMiscStatus;
|
|
|
|
else if ( prop.Name == "ObjectVerbs" )
|
|
|
|
prop.Value >>= m_aObjectVerbs;
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
|
|
|
|
2005-03-29 13:55:45 +00:00
|
|
|
if ( m_aClassID.getLength() != 16 /*|| !m_aDocServiceName.getLength()*/ )
|
2004-10-04 18:49:37 +00:00
|
|
|
throw uno::RuntimeException(); // something goes really wrong
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
// accepted states
|
2004-10-04 18:49:37 +00:00
|
|
|
m_aAcceptedStates.realloc( NUM_SUPPORTED_STATES );
|
|
|
|
|
2004-05-10 16:51:12 +00:00
|
|
|
m_aAcceptedStates[0] = embed::EmbedStates::LOADED;
|
|
|
|
m_aAcceptedStates[1] = embed::EmbedStates::RUNNING;
|
2004-10-04 18:49:37 +00:00
|
|
|
m_aAcceptedStates[2] = embed::EmbedStates::INPLACE_ACTIVE;
|
|
|
|
m_aAcceptedStates[3] = embed::EmbedStates::UI_ACTIVE;
|
|
|
|
m_aAcceptedStates[4] = embed::EmbedStates::ACTIVE;
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
// intermediate states
|
2004-10-04 18:49:37 +00:00
|
|
|
// In the following table the first index points to starting state,
|
|
|
|
// the second one to the target state, and the sequence referenced by
|
|
|
|
// first two indexes contains intermediate states, that should be
|
|
|
|
// passed by object to reach the target state.
|
|
|
|
// If the sequence is empty that means that indirect switch from start
|
|
|
|
// state to the target state is forbidden, only if direct switch is possible
|
|
|
|
// the state can be reached.
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
m_pIntermediateStatesSeqs[0][2].realloc( 1 );
|
2004-05-10 16:51:12 +00:00
|
|
|
m_pIntermediateStatesSeqs[0][2][0] = embed::EmbedStates::RUNNING;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
m_pIntermediateStatesSeqs[0][3].realloc( 2 );
|
|
|
|
m_pIntermediateStatesSeqs[0][3][0] = embed::EmbedStates::RUNNING;
|
|
|
|
m_pIntermediateStatesSeqs[0][3][1] = embed::EmbedStates::INPLACE_ACTIVE;
|
|
|
|
|
|
|
|
m_pIntermediateStatesSeqs[0][4].realloc( 1 );
|
|
|
|
m_pIntermediateStatesSeqs[0][4][0] = embed::EmbedStates::RUNNING;
|
|
|
|
|
|
|
|
m_pIntermediateStatesSeqs[1][3].realloc( 1 );
|
|
|
|
m_pIntermediateStatesSeqs[1][3][0] = embed::EmbedStates::INPLACE_ACTIVE;
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
m_pIntermediateStatesSeqs[2][0].realloc( 1 );
|
2004-05-10 16:51:12 +00:00
|
|
|
m_pIntermediateStatesSeqs[2][0][0] = embed::EmbedStates::RUNNING;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
m_pIntermediateStatesSeqs[3][0].realloc( 2 );
|
|
|
|
m_pIntermediateStatesSeqs[3][0][0] = embed::EmbedStates::INPLACE_ACTIVE;
|
|
|
|
m_pIntermediateStatesSeqs[3][0][1] = embed::EmbedStates::RUNNING;
|
|
|
|
|
|
|
|
m_pIntermediateStatesSeqs[3][1].realloc( 1 );
|
|
|
|
m_pIntermediateStatesSeqs[3][1][0] = embed::EmbedStates::INPLACE_ACTIVE;
|
|
|
|
|
|
|
|
m_pIntermediateStatesSeqs[4][0].realloc( 1 );
|
|
|
|
m_pIntermediateStatesSeqs[4][0][0] = embed::EmbedStates::RUNNING;
|
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
// verbs table
|
2020-05-20 08:48:56 +02:00
|
|
|
for ( auto const & verb : std::as_const(m_aObjectVerbs) )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_PRIMARY )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::UI_ACTIVE } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_SHOW )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::UI_ACTIVE } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_OPEN )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::ACTIVE } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_IPACTIVATE )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::INPLACE_ACTIVE } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_UIACTIVATE )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::UI_ACTIVE } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( verb.VerbID == embed::EmbedVerbs::MS_OLEVERB_HIDE )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
m_aVerbTable.insert( { verb.VerbID, embed::EmbedStates::RUNNING } );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
void OCommonEmbeddedObject::LinkInit_Impl(
|
|
|
|
const uno::Sequence< beans::NamedValue >& aObjectProps,
|
|
|
|
const uno::Sequence< beans::PropertyValue >& aMediaDescr,
|
|
|
|
const uno::Sequence< beans::PropertyValue >& aObjectDescr )
|
|
|
|
{
|
|
|
|
// setPersistance has no effect on own links, so the complete initialization must be done here
|
|
|
|
|
2020-05-20 08:48:56 +02:00
|
|
|
for ( beans::PropertyValue const & prop : aMediaDescr )
|
|
|
|
if ( prop.Name == "URL" )
|
|
|
|
prop.Value >>= m_aLinkURL;
|
|
|
|
else if ( prop.Name == "FilterName" )
|
|
|
|
prop.Value >>= m_aLinkFilterName;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2017-04-20 11:08:35 +02:00
|
|
|
OSL_ENSURE( m_aLinkURL.getLength() && m_aLinkFilterName.getLength(), "Filter and URL must be provided!" );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bReadOnly = true;
|
2010-12-01 11:22:11 +01:00
|
|
|
if ( m_aLinkFilterName.getLength() )
|
|
|
|
{
|
2013-01-08 15:29:57 +02:00
|
|
|
::comphelper::MimeConfigurationHelper aHelper( m_xContext );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aExportFilterName = aHelper.GetExportFilterFromImportFilter( m_aLinkFilterName );
|
2017-07-13 09:56:52 +02:00
|
|
|
m_bReadOnly = aExportFilterName != m_aLinkFilterName;
|
2010-12-01 11:22:11 +01:00
|
|
|
}
|
|
|
|
|
2021-04-08 10:30:15 +02:00
|
|
|
if(m_bIsLinkURL && !m_bReadOnly)
|
|
|
|
{
|
|
|
|
// tdf#141529 we have a linked OLE object. To prevent the original OLE
|
|
|
|
// data to be changed each time the OLE gets changed (at deactivate), copy it to
|
|
|
|
// a temporary file. That file will be changed on activated OLE changes then.
|
|
|
|
// The moment the original gets changed itself will now be associated with the
|
|
|
|
// file/document embedding the OLE being changed (see other additions to the
|
|
|
|
// task-ID above)
|
|
|
|
//
|
|
|
|
// open OLE original data as read input file
|
|
|
|
uno::Reference< ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( m_xContext ) );
|
|
|
|
uno::Reference< io::XInputStream > xInStream( xTempAccess->openFileRead( m_aLinkURL ) );
|
|
|
|
|
|
|
|
if(xInStream.is())
|
|
|
|
{
|
|
|
|
// create temporary file
|
|
|
|
m_aLinkTempFile = io::TempFile::create(m_xContext);
|
|
|
|
|
|
|
|
if(m_aLinkTempFile.is())
|
|
|
|
{
|
|
|
|
// completely copy content of original OLE data
|
|
|
|
uno::Reference < io::XOutputStream > xTempOut = m_aLinkTempFile->getOutputStream();
|
|
|
|
::comphelper::OStorageHelper::CopyInputToOutput( xInStream, xTempOut );
|
|
|
|
xTempOut->flush();
|
|
|
|
xTempOut->closeOutput();
|
|
|
|
|
|
|
|
// reset flag m_bLinkTempFileChanged, so it will also work for multiple
|
|
|
|
// save op's of the containing file/document
|
|
|
|
m_bLinkTempFileChanged = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(m_aLinkTempFile.is())
|
|
|
|
{
|
|
|
|
uno::Sequence< beans::PropertyValue > aAlternativeMediaDescr(aMediaDescr.getLength());
|
|
|
|
|
|
|
|
for ( sal_Int32 a(0); a < aMediaDescr.getLength(); a++ )
|
|
|
|
{
|
|
|
|
const beans::PropertyValue& rSource(aMediaDescr[a]);
|
|
|
|
beans::PropertyValue& rDestination(aAlternativeMediaDescr[a]);
|
|
|
|
|
|
|
|
rDestination.Name = rSource.Name;
|
|
|
|
if(rSource.Name == "URL")
|
|
|
|
rDestination.Value <<= m_aLinkTempFile->getUri();
|
|
|
|
else
|
|
|
|
rDestination.Value = rSource.Value;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_aDocMediaDescriptor = GetValuableArgs_Impl( aAlternativeMediaDescr, false );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_aDocMediaDescriptor = GetValuableArgs_Impl( aMediaDescr, false );
|
|
|
|
}
|
2004-10-04 18:49:37 +00:00
|
|
|
|
|
|
|
uno::Reference< frame::XDispatchProviderInterceptor > xDispatchInterceptor;
|
2020-05-20 08:48:56 +02:00
|
|
|
for ( beans::PropertyValue const & prop : aObjectDescr )
|
|
|
|
if ( prop.Name == "OutplaceDispatchInterceptor" )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
prop.Value >>= xDispatchInterceptor;
|
2004-10-04 18:49:37 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-05-20 08:48:56 +02:00
|
|
|
else if ( prop.Name == "Parent" )
|
2007-05-22 18:35:12 +00:00
|
|
|
{
|
2020-05-20 08:48:56 +02:00
|
|
|
prop.Value >>= m_xParent;
|
2007-05-22 18:35:12 +00:00
|
|
|
}
|
2004-10-04 18:49:37 +00:00
|
|
|
|
|
|
|
CommonInit_Impl( aObjectProps );
|
|
|
|
|
|
|
|
if ( xDispatchInterceptor.is() )
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder->SetOutplaceDispatchInterceptor( xDispatchInterceptor );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
OCommonEmbeddedObject::~OCommonEmbeddedObject()
|
2003-11-17 15:19:26 +00:00
|
|
|
{
|
2020-04-14 15:48:35 +02:00
|
|
|
if ( !(m_pInterfaceContainer || m_xDocHolder.is()) )
|
|
|
|
return;
|
2003-11-17 15:19:26 +00:00
|
|
|
|
2020-04-14 15:48:35 +02:00
|
|
|
osl_atomic_increment(&m_refCount);
|
2021-03-19 14:44:16 +02:00
|
|
|
if ( m_pInterfaceContainer )
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) );
|
2020-04-14 15:48:35 +02:00
|
|
|
m_pInterfaceContainer->disposeAndClear( aSource );
|
2021-03-19 14:44:16 +02:00
|
|
|
} catch( const uno::Exception& ) {}
|
|
|
|
m_pInterfaceContainer.reset();
|
|
|
|
}
|
2020-04-14 15:48:35 +02:00
|
|
|
|
|
|
|
try {
|
|
|
|
if ( m_xDocHolder.is() )
|
|
|
|
{
|
|
|
|
m_xDocHolder->CloseFrame();
|
|
|
|
try {
|
|
|
|
m_xDocHolder->CloseDocument( true, true );
|
|
|
|
} catch ( const uno::Exception& ) {}
|
|
|
|
m_xDocHolder->FreeOffice();
|
|
|
|
|
|
|
|
m_xDocHolder.clear();
|
|
|
|
}
|
|
|
|
} catch( const uno::Exception& ) {}
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-10-04 18:49:37 +00:00
|
|
|
void OCommonEmbeddedObject::requestPositioning( const awt::Rectangle& aRect )
|
|
|
|
{
|
|
|
|
// the method is called in case object is inplace active and the object window was resized
|
|
|
|
|
2017-04-20 11:08:35 +02:00
|
|
|
OSL_ENSURE( m_xClientSite.is(), "The client site must be set for inplace active object!" );
|
2020-04-14 15:48:35 +02:00
|
|
|
if ( !m_xClientSite.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
|
2004-10-04 18:49:37 +00:00
|
|
|
|
2020-04-14 15:48:35 +02:00
|
|
|
OSL_ENSURE( xInplaceClient.is(), "The client site must support XInplaceClient to allow inplace activation!" );
|
|
|
|
if ( xInplaceClient.is() )
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
xInplaceClient->changedPlacement( aRect );
|
|
|
|
}
|
|
|
|
catch( const uno::Exception& )
|
2004-10-04 18:49:37 +00:00
|
|
|
{
|
2020-11-30 14:19:29 +02:00
|
|
|
TOOLS_WARN_EXCEPTION( "embeddedobj", "Exception on request to resize!" );
|
2004-10-04 18:49:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void OCommonEmbeddedObject::PostEvent_Impl( const OUString& aEventName )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2020-04-14 15:48:35 +02:00
|
|
|
if ( !m_pInterfaceContainer )
|
|
|
|
return;
|
|
|
|
|
2021-08-07 09:24:46 +02:00
|
|
|
comphelper::OInterfaceContainerHelper2* pIC = m_pInterfaceContainer->getContainer(
|
2020-04-14 15:48:35 +02:00
|
|
|
cppu::UnoType<document::XEventListener>::get());
|
|
|
|
if( !pIC )
|
|
|
|
return;
|
|
|
|
|
|
|
|
document::EventObject aEvent;
|
|
|
|
aEvent.EventName = aEventName;
|
|
|
|
aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
|
|
|
|
// For now all the events are sent as object events
|
|
|
|
// aEvent.Source = ( xSource.is() ? xSource
|
|
|
|
// : uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ) );
|
2021-08-07 09:24:46 +02:00
|
|
|
comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
|
2020-04-14 15:48:35 +02:00
|
|
|
while( aIt.hasMoreElements() )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2020-04-14 15:48:35 +02:00
|
|
|
try
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2020-04-14 15:48:35 +02:00
|
|
|
static_cast<document::XEventListener *>(aIt.next())->notifyEvent( aEvent );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
2020-04-14 15:48:35 +02:00
|
|
|
catch( const uno::RuntimeException& )
|
|
|
|
{
|
|
|
|
aIt.remove();
|
|
|
|
}
|
|
|
|
|
|
|
|
// the listener could dispose the object.
|
|
|
|
if ( m_bDisposed )
|
|
|
|
return;
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType )
|
|
|
|
{
|
|
|
|
uno::Any aReturn;
|
|
|
|
|
2014-05-17 00:23:39 +02:00
|
|
|
if ( rType == cppu::UnoType<embed::XEmbeddedObject>::get() )
|
2009-09-14 10:57:16 +00:00
|
|
|
{
|
|
|
|
void * p = static_cast< embed::XEmbeddedObject * >( this );
|
|
|
|
return uno::Any( &p, rType );
|
|
|
|
}
|
2014-07-11 10:50:29 -04:00
|
|
|
else if (rType == cppu::UnoType<embed::XEmbedPersist2>::get())
|
|
|
|
{
|
|
|
|
void* p = static_cast<embed::XEmbedPersist2*>(this);
|
|
|
|
return uno::Any(&p, rType);
|
|
|
|
}
|
2021-08-10 16:37:15 +02:00
|
|
|
else if (rType == cppu::UnoType<lang::XServiceInfo>::get())
|
|
|
|
{
|
|
|
|
void* p = static_cast<lang::XServiceInfo*>(this);
|
|
|
|
return uno::Any(&p, rType);
|
|
|
|
}
|
|
|
|
else if (rType == cppu::UnoType<lang::XTypeProvider>::get())
|
|
|
|
{
|
|
|
|
void* p = static_cast<lang::XTypeProvider*>(this);
|
|
|
|
return uno::Any(&p, rType);
|
|
|
|
}
|
2009-09-14 10:57:16 +00:00
|
|
|
else
|
2016-10-16 07:52:45 +02:00
|
|
|
aReturn = ::cppu::queryInterface(
|
2004-10-04 18:49:37 +00:00
|
|
|
rType,
|
|
|
|
static_cast< embed::XInplaceObject* >( this ),
|
|
|
|
static_cast< embed::XVisualObject* >( this ),
|
|
|
|
static_cast< embed::XCommonEmbedPersist* >( static_cast< embed::XEmbedPersist* >( this ) ),
|
|
|
|
static_cast< embed::XEmbedPersist* >( this ),
|
|
|
|
static_cast< embed::XLinkageSupport* >( this ),
|
2005-01-05 11:47:07 +00:00
|
|
|
static_cast< embed::XStateChangeBroadcaster* >( this ),
|
2004-10-04 18:49:37 +00:00
|
|
|
static_cast< embed::XClassifiedObject* >( this ),
|
|
|
|
static_cast< embed::XComponentSupplier* >( this ),
|
|
|
|
static_cast< util::XCloseable* >( this ),
|
2005-04-04 07:08:11 +00:00
|
|
|
static_cast< container::XChild* >( this ),
|
2009-09-14 10:57:16 +00:00
|
|
|
static_cast< chart2::XDefaultSizeTransmitter* >( this ),
|
2004-10-04 18:49:37 +00:00
|
|
|
static_cast< document::XEventBroadcaster* >( this ) );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
if ( aReturn.hasValue() )
|
|
|
|
return aReturn;
|
|
|
|
else
|
|
|
|
return ::cppu::OWeakObject::queryInterface( rType ) ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::acquire()
|
2021-04-30 08:20:03 +02:00
|
|
|
noexcept
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
|
|
|
::cppu::OWeakObject::acquire() ;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::release()
|
2021-04-30 08:20:03 +02:00
|
|
|
noexcept
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
|
|
|
::cppu::OWeakObject::release() ;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
uno::Sequence< sal_Int8 > SAL_CALL OCommonEmbeddedObject::getClassID()
|
|
|
|
{
|
|
|
|
if ( m_bDisposed )
|
2010-12-03 10:58:55 +01:00
|
|
|
throw lang::DisposedException();
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
return m_aClassID;
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SAL_CALL OCommonEmbeddedObject::getClassName()
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
|
|
|
if ( m_bDisposed )
|
2010-12-03 10:58:55 +01:00
|
|
|
throw lang::DisposedException();
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
return m_aClassName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL OCommonEmbeddedObject::setClassInfo(
|
2013-04-07 12:06:47 +02:00
|
|
|
const uno::Sequence< sal_Int8 >& /*aClassID*/, const OUString& /*aClassName*/ )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
|
|
|
// the object class info can not be changed explicitly
|
|
|
|
throw lang::NoSupportException(); //TODO:
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-18 08:03:56 +00:00
|
|
|
uno::Reference< util::XCloseable > SAL_CALL OCommonEmbeddedObject::getComponent()
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( m_bDisposed )
|
|
|
|
throw lang::DisposedException(); // TODO
|
|
|
|
|
|
|
|
// add an exception
|
|
|
|
if ( m_nObjectState == -1 )
|
|
|
|
{
|
|
|
|
// the object is still not loaded
|
2014-05-26 14:29:07 +02:00
|
|
|
throw uno::RuntimeException( "Can't store object without persistence!",
|
2014-05-26 15:26:03 +02:00
|
|
|
static_cast< ::cppu::OWeakObject* >(this) );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2019-07-19 14:05:10 +02:00
|
|
|
return m_xDocHolder->GetComponent();
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-05-10 16:51:12 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::addStateChangeListener( const uno::Reference< embed::XStateChangeListener >& xListener )
|
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2004-05-10 16:51:12 +00:00
|
|
|
if ( m_bDisposed )
|
|
|
|
throw lang::DisposedException(); // TODO
|
|
|
|
|
|
|
|
if ( !m_pInterfaceContainer )
|
2021-08-07 09:24:46 +02:00
|
|
|
m_pInterfaceContainer.reset(new comphelper::OMultiTypeInterfaceContainerHelper2( m_aMutex ));
|
2004-05-10 16:51:12 +00:00
|
|
|
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->addInterface( cppu::UnoType<embed::XStateChangeListener>::get(),
|
2004-05-10 16:51:12 +00:00
|
|
|
xListener );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-05-10 16:51:12 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::removeStateChangeListener(
|
|
|
|
const uno::Reference< embed::XStateChangeListener >& xListener )
|
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2004-05-10 16:51:12 +00:00
|
|
|
if ( m_pInterfaceContainer )
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->removeInterface( cppu::UnoType<embed::XStateChangeListener>::get(),
|
2004-05-10 16:51:12 +00:00
|
|
|
xListener );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-11-18 11:47:08 +00:00
|
|
|
if ( m_bClosed )
|
2003-10-27 12:05:38 +00:00
|
|
|
throw lang::DisposedException(); // TODO
|
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >( this ) );
|
|
|
|
lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
if ( m_pInterfaceContainer )
|
|
|
|
{
|
2021-08-07 09:24:46 +02:00
|
|
|
comphelper::OInterfaceContainerHelper2* pContainer =
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->getContainer( cppu::UnoType<util::XCloseListener>::get());
|
2015-11-10 10:14:40 +01:00
|
|
|
if ( pContainer != nullptr )
|
2003-11-17 15:19:26 +00:00
|
|
|
{
|
2021-08-07 09:24:46 +02:00
|
|
|
comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer);
|
2003-11-17 15:19:26 +00:00
|
|
|
while (pIterator.hasMoreElements())
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2014-10-01 12:59:38 +02:00
|
|
|
static_cast<util::XCloseListener*>(pIterator.next())->queryClosing( aSource, bDeliverOwnership );
|
2003-11-17 15:19:26 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::RuntimeException& )
|
2003-11-17 15:19:26 +00:00
|
|
|
{
|
|
|
|
pIterator.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pContainer = m_pInterfaceContainer->getContainer(
|
2014-05-17 00:23:39 +02:00
|
|
|
cppu::UnoType<util::XCloseListener>::get());
|
2015-11-10 10:14:40 +01:00
|
|
|
if ( pContainer != nullptr )
|
2003-11-17 15:19:26 +00:00
|
|
|
{
|
2021-08-07 09:24:46 +02:00
|
|
|
comphelper::OInterfaceIteratorHelper2 pCloseIterator(*pContainer);
|
2003-11-17 15:19:26 +00:00
|
|
|
while (pCloseIterator.hasMoreElements())
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2014-10-01 12:59:38 +02:00
|
|
|
static_cast<util::XCloseListener*>(pCloseIterator.next())->notifyClosing( aSource );
|
2003-11-17 15:19:26 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::RuntimeException& )
|
2003-11-17 15:19:26 +00:00
|
|
|
{
|
|
|
|
pCloseIterator.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-18 11:47:08 +00:00
|
|
|
|
|
|
|
m_pInterfaceContainer->disposeAndClear( aSource );
|
2021-03-19 14:44:16 +02:00
|
|
|
m_pInterfaceContainer.reset();
|
2003-11-18 11:47:08 +00:00
|
|
|
}
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bDisposed = true; // the object is disposed now for outside
|
2003-11-18 11:47:08 +00:00
|
|
|
|
|
|
|
// it is possible that the document can not be closed, in this case if the argument is false
|
|
|
|
// the exception will be thrown otherwise in addition to exception the object must register itself
|
|
|
|
// as termination listener and listen for document events
|
|
|
|
|
2017-01-20 13:35:32 +02:00
|
|
|
if ( m_xDocHolder.is() )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder->CloseFrame();
|
2003-11-18 11:47:08 +00:00
|
|
|
|
|
|
|
try {
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder->CloseDocument( bDeliverOwnership, bDeliverOwnership );
|
2003-11-18 11:47:08 +00:00
|
|
|
}
|
2011-12-09 02:56:30 +09:00
|
|
|
catch( const uno::Exception& )
|
2003-11-18 11:47:08 +00:00
|
|
|
{
|
|
|
|
if ( bDeliverOwnership )
|
|
|
|
{
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder.clear();
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bClosed = true;
|
2003-11-18 11:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder->FreeOffice();
|
2003-11-18 11:47:08 +00:00
|
|
|
|
2017-01-20 13:35:32 +02:00
|
|
|
m_xDocHolder.clear();
|
2003-11-17 15:19:26 +00:00
|
|
|
}
|
|
|
|
|
2003-11-20 16:02:23 +00:00
|
|
|
// TODO: for now the storage will be disposed by the object, but after the document
|
|
|
|
// will use the storage, the storage will be disposed by the document and recreated by the object
|
|
|
|
if ( m_xObjectStorage.is() )
|
|
|
|
{
|
2019-07-19 14:05:10 +02:00
|
|
|
try {
|
|
|
|
m_xObjectStorage->dispose();
|
|
|
|
} catch ( const uno::Exception& ) {}
|
2003-11-20 16:02:23 +00:00
|
|
|
|
autorecovery: save/recover forms and reports
Still some lose ends. Most notably, the current code contains cases for other sub component types,
but has no real implementation - attempting to save/recover those other types will yield multiple
assertions only. Also, recovery of SRB-reports has not been tested, yet, chances are good there's
some work ahead here.
Other known open issues:
- recovering sub components immediately shows them, instead of initially hiding them, and showing
only when the main document window is shown
- the implementation currently is no real session save, which would require saving information about
*unmodified* open sub components (though not their actual content), and restoring them upon
recovery.
- doing an implicit "connect" at the controller of the to-be-recovered database document is a requirement
to actually load the sub components, but might yield problems in case this requires interaction
(e.g. a login). Need to investigate
- the "recovery" storage is not removed from the database document storage after un/successful recovery
- cancelling the recovery of a "modified" database document always suggests to store this doc somewhere
2010-01-15 15:21:15 +01:00
|
|
|
m_xObjectStorage.clear();
|
2010-01-26 13:19:11 +01:00
|
|
|
m_xRecoveryStorage.clear();
|
2003-11-20 16:02:23 +00:00
|
|
|
}
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
m_bClosed = true; // the closing succeeded
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::addCloseListener( const uno::Reference< util::XCloseListener >& xListener )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( m_bDisposed )
|
|
|
|
throw lang::DisposedException(); // TODO
|
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
if ( !m_pInterfaceContainer )
|
2021-08-07 09:24:46 +02:00
|
|
|
m_pInterfaceContainer.reset(new comphelper::OMultiTypeInterfaceContainerHelper2(m_aMutex));
|
2003-11-17 15:19:26 +00:00
|
|
|
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->addInterface( cppu::UnoType<util::XCloseListener>::get(), xListener );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::removeCloseListener( const uno::Reference< util::XCloseListener >& xListener )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( m_pInterfaceContainer )
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->removeInterface( cppu::UnoType<util::XCloseListener>::get(),
|
2003-11-17 15:19:26 +00:00
|
|
|
xListener );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::addEventListener( const uno::Reference< document::XEventListener >& xListener )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( m_bDisposed )
|
|
|
|
throw lang::DisposedException(); // TODO
|
|
|
|
|
|
|
|
if ( !m_pInterfaceContainer )
|
2021-08-07 09:24:46 +02:00
|
|
|
m_pInterfaceContainer.reset(new comphelper::OMultiTypeInterfaceContainerHelper2(m_aMutex));
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->addInterface( cppu::UnoType<document::XEventListener>::get(), xListener );
|
2003-10-27 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void SAL_CALL OCommonEmbeddedObject::removeEventListener( const uno::Reference< document::XEventListener >& xListener )
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
2016-07-08 09:07:44 +02:00
|
|
|
SolarMutexGuard aGuard;
|
2003-10-27 12:05:38 +00:00
|
|
|
if ( m_pInterfaceContainer )
|
2014-05-17 00:23:39 +02:00
|
|
|
m_pInterfaceContainer->removeInterface( cppu::UnoType<document::XEventListener>::get(),
|
2003-10-27 12:05:38 +00:00
|
|
|
xListener );
|
|
|
|
}
|
|
|
|
|
2021-08-10 16:37:15 +02:00
|
|
|
OUString SAL_CALL OCommonEmbeddedObject::getImplementationName()
|
|
|
|
{
|
|
|
|
return "com.sun.star.comp.embed.OCommonEmbeddedObject";
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OCommonEmbeddedObject::supportsService(const OUString& ServiceName)
|
|
|
|
{
|
|
|
|
return cppu::supportsService(this, ServiceName);
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence<OUString> SAL_CALL OCommonEmbeddedObject::getSupportedServiceNames()
|
|
|
|
{
|
|
|
|
return { "com.sun.star.comp.embed.OCommonEmbeddedObject" };
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence<uno::Type> SAL_CALL OCommonEmbeddedObject::getTypes()
|
|
|
|
{
|
|
|
|
static const uno::Sequence<uno::Type> aTypes{
|
|
|
|
cppu::UnoType<embed::XEmbeddedObject>::get(),
|
|
|
|
cppu::UnoType<embed::XEmbedPersist2>::get(),
|
|
|
|
cppu::UnoType<embed::XLinkageSupport>::get(),
|
|
|
|
cppu::UnoType<embed::XInplaceObject>::get(),
|
|
|
|
cppu::UnoType<container::XChild>::get(),
|
|
|
|
cppu::UnoType<chart2::XDefaultSizeTransmitter>::get(),
|
|
|
|
cppu::UnoType<lang::XServiceInfo>::get(),
|
|
|
|
cppu::UnoType<lang::XTypeProvider>::get(),
|
|
|
|
};
|
|
|
|
return aTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence<sal_Int8> SAL_CALL OCommonEmbeddedObject::getImplementationId()
|
|
|
|
{
|
|
|
|
return uno::Sequence<sal_Int8>();
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|