2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: fuins2.cxx,v $
|
|
|
|
*
|
2005-03-15 10:43:15 +00:00
|
|
|
* $Revision: 1.19 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-03-15 10:43:15 +00:00
|
|
|
* last change: $Author: obo $ $Date: 2005-03-15 11:43:15 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (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.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifdef PCH
|
|
|
|
#include "ui_pch.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
2005-03-15 10:43:15 +00:00
|
|
|
#ifndef _COM_SUN_STAR_EMBED_NOVISUALAREASIZEEXCEPTION_HPP_
|
|
|
|
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
|
|
|
|
#endif
|
2004-10-04 19:16:42 +00:00
|
|
|
#ifndef _COM_SUN_STAR_EMBED_ASPECTS_HPP_
|
|
|
|
#include <com/sun/star/embed/Aspects.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
2003-09-19 07:23:36 +00:00
|
|
|
#include <sot/exchange.hxx>
|
2003-03-26 17:07:02 +00:00
|
|
|
#include <svtools/globalnameitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
2005-01-11 12:21:00 +00:00
|
|
|
#include <sfx2/docfile.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svtools/stritem.hxx>
|
|
|
|
#include <sch/schdll.hxx>
|
|
|
|
#include <sch/memchrt.hxx>
|
|
|
|
#include <svx/svdoole2.hxx>
|
|
|
|
#include <svx/svdview.hxx>
|
|
|
|
#include <svx/pfiledlg.hxx>
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#ifndef SVTOOLS_URIHELPER_HXX
|
|
|
|
#include <svtools/urihelper.hxx>
|
|
|
|
#endif
|
2000-11-14 15:26:30 +00:00
|
|
|
#include <svtools/moduleoptions.hxx>
|
2004-10-04 19:16:42 +00:00
|
|
|
#include <svtools/insdlg.hxx>
|
|
|
|
#include <svtools/soerr.hxx>
|
|
|
|
#include <svx/svxdlg.hxx>
|
2003-09-19 07:23:36 +00:00
|
|
|
#include <sot/clsids.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
// BM --
|
|
|
|
#include <cppuhelper/component_context.hxx>
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2004-10-04 19:16:42 +00:00
|
|
|
#include <comphelper/storagehelper.hxx>
|
2004-02-11 09:11:05 +00:00
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
|
|
|
|
#include <com/sun/star/frame/XComponentLoader.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
|
|
|
#include <com/sun/star/chart2/XDataProvider.hpp>
|
|
|
|
#include <com/sun/star/chart2/XDataReceiver.hpp>
|
|
|
|
|
|
|
|
#include "ScDevChart.hxx"
|
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
// BM --
|
|
|
|
|
|
|
|
// erAck
|
|
|
|
#include "chart2uno.hxx"
|
|
|
|
// erAck
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuinsert.hxx"
|
|
|
|
#include "tabvwsh.hxx"
|
|
|
|
#include "sc.hrc"
|
|
|
|
#include "chartarr.hxx"
|
|
|
|
#include "docsh.hxx"
|
|
|
|
#include "document.hxx"
|
|
|
|
#include "undotab.hxx"
|
|
|
|
#include "chartlis.hxx"
|
|
|
|
#include "uiitems.hxx"
|
|
|
|
#include "globstr.hrc"
|
|
|
|
|
|
|
|
extern SdrObject* pSkipPaintObj; // output.cxx - dieses Objekt nicht zeichnen
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#define IS_AVAILABLE(WhichId,ppItem) \
|
|
|
|
(pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& aIPObj, ScViewData* pViewData, Window* pWin )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-06-04 10:26:55 +00:00
|
|
|
SCCOL nCol1 = 0;
|
|
|
|
SCROW nRow1 = 0;
|
|
|
|
SCTAB nTab1 = 0;
|
|
|
|
SCCOL nCol2 = 0;
|
|
|
|
SCROW nRow2 = 0;
|
|
|
|
SCTAB nTab2 = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
ScMarkData& rMark = pViewData->GetMarkData();
|
|
|
|
if ( !rMark.IsMarked() )
|
|
|
|
pViewData->GetView()->MarkDataArea( TRUE );
|
|
|
|
|
|
|
|
if ( pViewData->GetSimpleArea( nCol1,nRow1,nTab1, nCol2,nRow2,nTab2 ) )
|
|
|
|
{
|
|
|
|
PutInOrder( nCol1, nCol2 );
|
|
|
|
PutInOrder( nRow1, nRow2 );
|
|
|
|
if ( nCol2>nCol1 || nRow2>nRow1 )
|
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
String aChartName = pViewData->GetDocShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( aIPObj );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
ScDocument* pDoc = pViewData->GetDocument();
|
|
|
|
pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
|
|
|
|
|
|
|
|
// Chart-Collection gibt's nicht mehr
|
|
|
|
|
|
|
|
ScRange aRange( nCol1,nRow1,nTab1, nCol2,nRow2,nTab1 );
|
|
|
|
ScChartListener* pCL = new ScChartListener( aChartName, pDoc, aRange );
|
|
|
|
pDoc->GetChartListenerCollection()->Insert( pCL );
|
|
|
|
pCL->StartListeningTo();
|
|
|
|
|
|
|
|
ScChartArray aParam( pDoc, nTab1, nCol1,nRow1, nCol2,nRow2, String() );
|
|
|
|
SchMemChart* pMemChart = aParam.CreateMemChart();
|
2004-10-04 19:16:42 +00:00
|
|
|
// TODO/LATER: looks like there is no need to update replacement, but it should be checked.
|
2000-09-18 16:07:07 +00:00
|
|
|
SchDLL::Update( aIPObj, pMemChart, pWin );
|
|
|
|
delete pMemChart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize("",off)
|
|
|
|
#endif
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
void lcl_ChartInit2( const uno::Reference < embed::XEmbeddedObject >& aIPObj, ScViewData* pViewData, Window* pWin,
|
2000-09-18 16:07:07 +00:00
|
|
|
const SfxItemSet* pReqArgs, const String& rChartName )
|
|
|
|
{
|
|
|
|
ScDocument* pDoc = pViewData->GetDocument();
|
|
|
|
ScMarkData& rMark = pViewData->GetMarkData();
|
|
|
|
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
BOOL bRowHeader = TRUE;
|
|
|
|
BOOL bColHeader = TRUE;
|
|
|
|
|
|
|
|
if( IS_AVAILABLE( SID_ATTR_ROWHEADERS, &pItem ) )
|
|
|
|
bRowHeader = ((const SfxBoolItem*)pItem)->GetValue();
|
|
|
|
|
|
|
|
if( IS_AVAILABLE( SID_ATTR_COLHEADERS, &pItem ) )
|
|
|
|
bColHeader = ((const SfxBoolItem*)pItem)->GetValue();
|
|
|
|
|
2004-06-04 10:26:55 +00:00
|
|
|
SchMemChart* pMemChart = 0;
|
|
|
|
ScChartListener* pChartListener = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
BOOL bMulti;
|
|
|
|
if ( IS_AVAILABLE( FN_PARAM_5, &pItem ) )
|
|
|
|
{
|
|
|
|
String aStr( ((const SfxStringItem*)pItem)->GetValue() );
|
|
|
|
ScRangeListRef aRangeListRef( new ScRangeList() );
|
|
|
|
aRangeListRef->Parse( aStr, pDoc );
|
|
|
|
|
|
|
|
if ( aRangeListRef->Count() )
|
|
|
|
{
|
|
|
|
ScChartArray aParam( pDoc, aRangeListRef, String() );
|
|
|
|
aParam.SetHeaders( bColHeader, bRowHeader );
|
|
|
|
pMemChart = aParam.CreateMemChart();
|
|
|
|
|
|
|
|
pChartListener = new ScChartListener( rChartName, pDoc, aRangeListRef );
|
|
|
|
bMulti = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bMulti = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bMulti = FALSE;
|
|
|
|
if ( !bMulti )
|
|
|
|
{
|
|
|
|
ScRange aMarkRange;
|
|
|
|
rMark.GetMarkArea( aMarkRange );
|
2004-06-04 10:26:55 +00:00
|
|
|
SCCOL nColStart = aMarkRange.aStart.Col();
|
|
|
|
SCROW nRowStart = aMarkRange.aStart.Row();
|
|
|
|
SCCOL nColEnd = aMarkRange.aEnd.Col();
|
|
|
|
SCROW nRowEnd = aMarkRange.aEnd.Row();
|
|
|
|
SCTAB nTab = aMarkRange.aStart.Tab();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
pDoc->LimitChartArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
|
|
|
|
|
|
|
|
// Chart-Collection gibt's nicht mehr
|
|
|
|
|
|
|
|
ScChartArray aParam( pDoc, nTab, nColStart, nRowStart, nColEnd, nRowEnd, String() );
|
|
|
|
aParam.SetHeaders( bColHeader, bRowHeader );
|
|
|
|
pMemChart = aParam.CreateMemChart();
|
|
|
|
|
|
|
|
pChartListener = new ScChartListener( rChartName, pDoc,
|
|
|
|
ScRange( nColStart, nRowStart, nTab, nColEnd, nRowEnd, nTab ) );
|
|
|
|
}
|
|
|
|
pDoc->GetChartListenerCollection()->Insert( pChartListener );
|
|
|
|
pChartListener->StartListeningTo();
|
2004-10-04 19:16:42 +00:00
|
|
|
// TODO/LATER: looks like there is no need to update replacement, but it should be checked.
|
2000-09-18 16:07:07 +00:00
|
|
|
SchDLL::Update( aIPObj, pMemChart, *pReqArgs, pWin );
|
|
|
|
delete pMemChart;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize("",on)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertOLE::Konstruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, SdrView* pView,
|
|
|
|
SdrModel* pDoc, SfxRequest& rReq)
|
|
|
|
: FuPoor(pViewSh, pWin, pView, pDoc, rReq)
|
|
|
|
{
|
|
|
|
if( ! rReq.IsAPI() )
|
|
|
|
rReq.Done();
|
|
|
|
|
|
|
|
//! hier DLL's initalisieren, damit die Factories existieren?
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj;
|
|
|
|
uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
|
2000-09-18 16:07:07 +00:00
|
|
|
BOOL bIsFromFile = FALSE;
|
2004-10-04 19:16:42 +00:00
|
|
|
::rtl::OUString aName;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
USHORT nSlot = rReq.GetSlot();
|
2004-10-04 19:16:42 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
|
|
|
|
if ( nSlot == SID_INSERT_OBJECT && pNameItem )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
SvGlobalName aClassName = pNameItem->GetValue();
|
|
|
|
xObj = pViewShell->GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-10-04 19:16:42 +00:00
|
|
|
else if ( nSlot == SID_INSERT_SMATH )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-11-14 15:26:30 +00:00
|
|
|
if ( SvtModuleOptions().IsMath() )
|
2003-09-19 07:23:36 +00:00
|
|
|
{
|
|
|
|
nSlot = SID_INSERT_OBJECT;
|
2004-10-04 19:16:42 +00:00
|
|
|
xObj = pViewShell->GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName );
|
2003-09-19 07:23:36 +00:00
|
|
|
rReq.AppendItem( SfxGlobalNameItem( SID_INSERT_OBJECT, SvGlobalName( SO3_SM_CLASSID_60 ) ) );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-10-04 19:16:42 +00:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
SvObjectServerList aServerLst;
|
|
|
|
switch ( nSlot )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
case SID_INSERT_OBJECT :
|
|
|
|
aServerLst.FillInsertObjects();
|
|
|
|
aServerLst.Remove( ScDocShell::Factory().GetClassId() ); // Starcalc nicht anzeigen
|
|
|
|
//TODO/LATER: currently no inserting of ClassId into SfxRequest!
|
|
|
|
case SID_INSERT_PLUGIN :
|
|
|
|
case SID_INSERT_APPLET :
|
|
|
|
case SID_INSERT_FLOATINGFRAME :
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
SfxAbstractInsertObjectDialog* pDlg =
|
|
|
|
pFact->CreateInsertObjectDialog( pViewShell->GetWindow(), nSlot,
|
|
|
|
xStorage, &aServerLst );
|
|
|
|
if ( pDlg )
|
|
|
|
{
|
|
|
|
pDlg->Execute();
|
|
|
|
bIsFromFile = !pDlg->IsCreateNew();
|
|
|
|
xObj = pDlg->GetObject();
|
|
|
|
if ( xObj.is() )
|
|
|
|
pViewSh->GetObjectShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xObj, aName );
|
|
|
|
// damit DrawShell eingeschaltet wird (Objekt aktivieren ist unnoetig):
|
|
|
|
bIsFromFile = !pDlg->IsCreateNew();
|
|
|
|
DELETEZ( pDlg );
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-10-04 19:16:42 +00:00
|
|
|
case SID_INSERT_SOUND :
|
|
|
|
case SID_INSERT_VIDEO :
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
// create special filedialog for plugins
|
|
|
|
SvxPluginFileDlg aPluginFileDialog(pWin, nSlot);
|
2003-09-19 07:23:36 +00:00
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
// open filedlg
|
|
|
|
if ( ERRCODE_NONE == aPluginFileDialog.Execute() )
|
|
|
|
{
|
|
|
|
// get URL
|
|
|
|
INetURLObject aURL;
|
|
|
|
aURL.SetSmartProtocol( INET_PROT_FILE );
|
2005-01-11 12:21:00 +00:00
|
|
|
if ( aURL.SetURL( aPluginFileDialog.GetPath() ) )
|
2004-10-04 19:16:42 +00:00
|
|
|
{
|
|
|
|
// create a plugin object
|
|
|
|
::rtl::OUString aName;
|
|
|
|
SvGlobalName aClassId( SO3_PLUGIN_CLASSID );
|
|
|
|
comphelper::EmbeddedObjectContainer aCnt( xStorage );
|
|
|
|
xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName );
|
|
|
|
if ( xObj.is() )
|
|
|
|
{
|
|
|
|
// set properties from dialog
|
|
|
|
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
|
|
|
|
if ( xSet.is() )
|
|
|
|
{
|
|
|
|
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
|
|
|
|
uno::makeAny( ::rtl::OUString( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-01-11 12:21:00 +00:00
|
|
|
DBG_ERROR("Invalid URL!");
|
2004-10-04 19:16:42 +00:00
|
|
|
//! error message
|
|
|
|
//! can this happen???
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-03-26 17:07:02 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SvInsertObjectDialog (alles in einem Dialog) wird nicht mehr benutzt
|
2004-10-04 19:16:42 +00:00
|
|
|
if (xObj.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pView->UnmarkAll();
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
|
2005-01-31 08:07:32 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2005-03-15 10:43:15 +00:00
|
|
|
awt::Size aSz;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
aSz = xObj->getVisualAreaSize( nAspect );
|
|
|
|
}
|
|
|
|
catch( embed::NoVisualAreaSizeException& )
|
|
|
|
{
|
|
|
|
// the default size will be set later
|
|
|
|
}
|
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
Size aSize( aSz.Width, aSz.Height );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
if (aSize.Height() == 0 || aSize.Width() == 0)
|
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
// Rechteck mit ausgewogenem Kantenverhaeltnis
|
2000-09-18 16:07:07 +00:00
|
|
|
aSize.Width() = 5000;
|
|
|
|
aSize.Height() = 5000;
|
2004-10-04 19:16:42 +00:00
|
|
|
Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit );
|
|
|
|
aSz.Width = aTmp.Width();
|
|
|
|
aSz.Height = aTmp.Height();
|
|
|
|
xObj->setVisualAreaSize( nAspect, aSz );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// re-convert aSize to 1/100th mm to avoid rounding errors in comparison below
|
2004-10-04 19:16:42 +00:00
|
|
|
aSize = Window::LogicToLogic( aTmp,
|
|
|
|
MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
aSize = Window::LogicToLogic( aSize,
|
2004-10-04 19:16:42 +00:00
|
|
|
MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Chart initialisieren ?
|
2004-10-04 19:16:42 +00:00
|
|
|
if ( SvtModuleOptions().IsChart() && SotExchange::IsChart( SvGlobalName( xObj->getClassID() ) ) )
|
|
|
|
lcl_ChartInit( xObj, pViewSh->GetViewData(), pWin );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-03 11:36:00 +00:00
|
|
|
ScViewData* pData = pViewSh->GetViewData();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
Point aPnt = pViewSh->GetInsertPos();
|
2004-02-03 11:36:00 +00:00
|
|
|
if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
|
|
|
|
aPnt.X() -= aSize.Width(); // move position to left edge
|
2000-09-18 16:07:07 +00:00
|
|
|
Rectangle aRect (aPnt, aSize);
|
2004-10-04 19:16:42 +00:00
|
|
|
SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Dieses Objekt nicht vor dem Aktivieren zeichnen
|
|
|
|
// (in MarkListHasChanged kommt ein Update)
|
|
|
|
if (!bIsFromFile)
|
|
|
|
pSkipPaintObj = pObj;
|
|
|
|
|
|
|
|
SdrPageView* pPV = pView->GetPageViewPvNum(0);
|
|
|
|
pView->InsertObject(pObj, *pPV);
|
|
|
|
|
|
|
|
// #73279# Math objects change their object size during InsertObject.
|
|
|
|
// New size must be set in SdrObject, or a wrong scale will be set at
|
|
|
|
// ActivateObject.
|
|
|
|
|
2005-03-15 10:43:15 +00:00
|
|
|
try
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-03-15 10:43:15 +00:00
|
|
|
aSz = xObj->getVisualAreaSize( nAspect );
|
|
|
|
|
|
|
|
Size aNewSize( aSz.Width, aSz.Height );
|
|
|
|
aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MAP_100TH_MM );
|
|
|
|
|
|
|
|
if ( aNewSize != aSize )
|
|
|
|
{
|
|
|
|
aRect.SetSize( aNewSize );
|
|
|
|
pObj->SetLogicRect( aRect );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-03-15 10:43:15 +00:00
|
|
|
catch( embed::NoVisualAreaSizeException& )
|
|
|
|
{}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ( !rReq.IsAPI() )
|
|
|
|
{
|
|
|
|
// XXX Activate aus Makro ist toedlich !!! ???
|
|
|
|
if (bIsFromFile)
|
|
|
|
{
|
|
|
|
// #45012# Objekt ist selektiert, also Draw-Shell aktivieren
|
|
|
|
pViewShell->SetDrawShell( TRUE );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
|
|
|
|
pSkipPaintObj = NULL;
|
|
|
|
}
|
|
|
|
}
|
2003-03-26 17:07:02 +00:00
|
|
|
|
|
|
|
rReq.Done();
|
2005-01-31 08:07:32 +00:00
|
|
|
}
|
|
|
|
catch( uno::Exception& )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( "May need error handling here!\n" );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2003-03-26 17:07:02 +00:00
|
|
|
else
|
|
|
|
rReq.Ignore();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertOLE::Destruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
FuInsertOLE::~FuInsertOLE()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertOLE::Function aktivieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void FuInsertOLE::Activate()
|
|
|
|
{
|
|
|
|
FuPoor::Activate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertOLE::Function deaktivieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void FuInsertOLE::Deactivate()
|
|
|
|
{
|
|
|
|
FuPoor::Deactivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertChart::Konstruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, SdrView* pView,
|
|
|
|
SdrModel* pDoc, SfxRequest& rReq)
|
|
|
|
: FuPoor(pViewSh, pWin, pView, pDoc, rReq)
|
|
|
|
{
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if( ! rReq.IsAPI() )
|
|
|
|
rReq.Done();
|
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
if( ScDevChart::UseDevChart())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
// BM --
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
uno::Reference< chart2::XDataProvider > xDataProvider = new
|
|
|
|
ScChart2DataProvider( pViewSh->GetViewData()->GetDocShell());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
// get range
|
|
|
|
::rtl::OUString aRangeString;
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
if ( IS_AVAILABLE( FN_PARAM_5, &pItem ) )
|
|
|
|
aRangeString = ::rtl::OUString( ((const SfxStringItem*)pItem)->GetValue());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
uno::Reference< lang::XMultiServiceFactory > xMultServFac( ::comphelper::getProcessServiceFactory());
|
|
|
|
OSL_ASSERT( xMultServFac.is());
|
|
|
|
if( xMultServFac.is())
|
|
|
|
{
|
|
|
|
uno::Reference< frame::XComponentLoader > xLoader(
|
|
|
|
xMultServFac->createInstance(
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.frame.Desktop" ))),
|
|
|
|
uno::UNO_QUERY );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
OSL_ASSERT( xLoader.is());
|
|
|
|
if( xLoader.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
uno::Sequence< beans::PropertyValue > aArgs;
|
|
|
|
|
|
|
|
uno::Reference< ::com::sun::star::chart2::XDataReceiver > xReceiver(
|
|
|
|
xLoader->loadComponentFromURL(
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/chart" )),
|
|
|
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )),
|
|
|
|
0, // flags
|
|
|
|
aArgs ),
|
|
|
|
uno::UNO_QUERY );
|
|
|
|
|
|
|
|
OSL_ASSERT( xReceiver.is());
|
|
|
|
if( xReceiver.is())
|
|
|
|
{
|
|
|
|
xReceiver->attachDataProvider( xDataProvider );
|
|
|
|
xReceiver->setRangeRepresentation( aRangeString );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
DBG_ERROR( "Couldn't get XMultiComponentFactory" );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
return;
|
|
|
|
// BM --
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( SvtModuleOptions().IsChart() )
|
|
|
|
{
|
|
|
|
pView->UnmarkAll();
|
2004-10-04 19:16:42 +00:00
|
|
|
::rtl::OUString aName;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-10-04 19:16:42 +00:00
|
|
|
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
|
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj =
|
|
|
|
pViewShell->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID_60 ).GetByteSequence(), aName );
|
|
|
|
if ( !xObj.is() )
|
2004-02-11 09:11:05 +00:00
|
|
|
pViewSh->ErrorMessage( STR_ERR_INSERTOBJ );
|
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
ScRangeListRef aDummy;
|
|
|
|
Rectangle aMarkDest;
|
2004-06-04 10:26:55 +00:00
|
|
|
SCTAB nMarkTab;
|
2004-02-11 09:11:05 +00:00
|
|
|
BOOL bDrawRect = pViewShell->GetChartArea( aDummy, aMarkDest, nMarkTab );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
// Objekt-Groesse
|
2004-10-04 19:16:42 +00:00
|
|
|
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
|
|
|
|
Size aSize( aSz.Width, aSz.Height );
|
|
|
|
|
|
|
|
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
|
2004-02-11 09:11:05 +00:00
|
|
|
|
|
|
|
BOOL bSizeCh = FALSE;
|
|
|
|
if (bDrawRect && !aMarkDest.IsEmpty())
|
|
|
|
{
|
|
|
|
aSize = aMarkDest.GetSize();
|
|
|
|
bSizeCh = TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
if (aSize.Height() <= 0 || aSize.Width() <= 0)
|
|
|
|
{
|
|
|
|
aSize.Width() = 5000;
|
|
|
|
aSize.Height() = 5000;
|
|
|
|
bSizeCh = TRUE;
|
|
|
|
}
|
|
|
|
if (bSizeCh)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
aSize = Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
|
|
|
|
aSz.Width = aSize.Width();
|
|
|
|
aSz.Height = aSize.Height();
|
|
|
|
xObj->setVisualAreaSize( nAspect, aSz );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
ScViewData* pData = pViewSh->GetViewData();
|
|
|
|
ScDocShell* pScDocSh = pData->GetDocShell();
|
|
|
|
ScDocument* pScDoc = pScDocSh->GetDocument();
|
|
|
|
BOOL bUndo (pScDoc->IsUndoEnabled());
|
|
|
|
|
|
|
|
if( pReqArgs )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 19:16:42 +00:00
|
|
|
lcl_ChartInit2( xObj, pData, pWin, pReqArgs, aName );
|
2004-02-11 09:11:05 +00:00
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
UINT16 nToTable = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
if( IS_AVAILABLE( FN_PARAM_4, &pItem ) )
|
|
|
|
{
|
|
|
|
if ( pItem->ISA( SfxUInt16Item ) )
|
|
|
|
nToTable = ((const SfxUInt16Item*)pItem)->GetValue();
|
|
|
|
else if ( pItem->ISA( SfxBoolItem ) )
|
|
|
|
{
|
|
|
|
// #46033# in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
|
|
|
|
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
if ( ((const SfxBoolItem*)pItem)->GetValue() )
|
2004-06-04 10:26:55 +00:00
|
|
|
nToTable = static_cast<UINT16>(pScDoc->GetTableCount());
|
2004-02-11 09:11:05 +00:00
|
|
|
else
|
2004-06-04 10:26:55 +00:00
|
|
|
nToTable = static_cast<UINT16>(pData->GetTabNo());
|
2004-02-11 09:11:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
if (bDrawRect)
|
2004-06-04 10:26:55 +00:00
|
|
|
nToTable = static_cast<UINT16>(nMarkTab);
|
2004-02-11 09:11:05 +00:00
|
|
|
rReq.AppendItem( SfxUInt16Item( FN_PARAM_4, nToTable ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// auf neue Tabelle ausgeben?
|
|
|
|
if ( nToTable == pScDoc->GetTableCount() )
|
|
|
|
{
|
|
|
|
// dann los...
|
|
|
|
String aTabName;
|
2004-06-04 10:26:55 +00:00
|
|
|
SCTAB nNewTab = pScDoc->GetTableCount();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
pScDoc->CreateValidTabName( aTabName );
|
|
|
|
|
|
|
|
if ( pScDoc->InsertTab( nNewTab, aTabName ) )
|
2001-02-14 14:34:08 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
BOOL bAppend = TRUE;
|
|
|
|
|
|
|
|
if (bUndo)
|
|
|
|
{
|
|
|
|
pScDocSh->GetUndoManager()->AddUndoAction(
|
|
|
|
new ScUndoInsertTab( pScDocSh, nNewTab,
|
|
|
|
bAppend, aTabName ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
pScDocSh->Broadcast( ScTablesHint( SC_TAB_INSERTED, nNewTab ) );
|
|
|
|
pViewSh->SetTabNo( nNewTab, TRUE );
|
|
|
|
pScDocSh->PostPaintExtras(); //! erst hinterher ???
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ERROR( "Could not create new table :-/" );
|
2001-02-14 14:34:08 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
else if ( nToTable != pData->GetTabNo() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
pViewSh->SetTabNo( nToTable, TRUE );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
else
|
2004-10-04 19:16:42 +00:00
|
|
|
lcl_ChartInit( xObj, pData, pWin );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Objekt-Position
|
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
Point aStart;
|
|
|
|
if ( bDrawRect )
|
|
|
|
aStart = aMarkDest.TopLeft(); // marked by hand
|
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-06-04 10:26:55 +00:00
|
|
|
SCCOL nC0, nC1;
|
|
|
|
SCROW nR0, nR1;
|
|
|
|
SCTAB nT0, nT1;
|
2004-02-11 09:11:05 +00:00
|
|
|
if( pData->GetSimpleArea( nC0, nR0, nT0, nC1, nR1, nT1 )
|
|
|
|
&& ( nT0 == nT1 ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
// Einfache Selektion in der gleichen Tabelle:
|
|
|
|
// Positionieren 1/2 Spalte rechts
|
|
|
|
// und 1 1/2 Zeilen unterhalb des Starts
|
|
|
|
ScDocument* pScDoc = pData->GetDocument();
|
2004-08-02 16:02:02 +00:00
|
|
|
long x = 0, y = 0;
|
2004-06-04 10:26:55 +00:00
|
|
|
SCCOL i;
|
2004-02-11 09:11:05 +00:00
|
|
|
for( i = 0; i <= nC1; i++ )
|
|
|
|
x += pScDoc->GetColWidth( i, nT0 );
|
|
|
|
while( ++i <= MAXCOL )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-02-11 09:11:05 +00:00
|
|
|
USHORT n = pScDoc->GetColWidth( i, nT0 );
|
|
|
|
if( n )
|
|
|
|
{
|
|
|
|
x += n / 2; break;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-08-20 08:14:20 +00:00
|
|
|
y += pScDoc->FastGetRowHeight( 0, nR0, nT0);
|
|
|
|
// Find the first non-hidden row with row height >0 and
|
|
|
|
// add the half of it's height.
|
|
|
|
SCROW j = pScDoc->FastGetFirstNonHiddenRow( nR0 + 1, nT0 );
|
|
|
|
if (j <= MAXROW)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-08-20 08:14:20 +00:00
|
|
|
USHORT n = pScDoc->FastGetOriginalRowHeight( j, nT0);
|
|
|
|
if (n)
|
|
|
|
y += n / 2;
|
|
|
|
else
|
|
|
|
{ // bad luck, not hidden but height 0
|
|
|
|
for( ++j; j <= MAXROW; ++j )
|
|
|
|
{
|
|
|
|
n = pScDoc->FastGetRowHeight( j, nT0 );
|
|
|
|
if( n )
|
|
|
|
{
|
|
|
|
y += n / 2;
|
|
|
|
break; // for
|
|
|
|
}
|
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
// Das ganze von Twips nach 1/100 mm
|
2004-08-02 16:02:02 +00:00
|
|
|
x = (long) ((double) x * HMM_PER_TWIPS);
|
|
|
|
y = (long) ((double) y * HMM_PER_TWIPS);
|
2004-02-11 09:11:05 +00:00
|
|
|
if ( pScDoc->IsNegativePage( nT0 ) )
|
|
|
|
x = -x;
|
|
|
|
aStart = Point( x, y );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-11 09:11:05 +00:00
|
|
|
else
|
|
|
|
aStart = pViewSh->GetInsertPos();
|
|
|
|
|
|
|
|
// if not from marked rectangle, move position to left edge
|
2004-02-03 11:36:00 +00:00
|
|
|
if ( pScDoc->IsNegativePage( nT0 ) )
|
2004-02-11 09:11:05 +00:00
|
|
|
aStart.X() -= aSize.Width();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-02-03 11:36:00 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
Rectangle aRect (aStart, aSize);
|
2004-10-04 19:16:42 +00:00
|
|
|
SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Dieses Objekt nicht vor dem Aktivieren zeichnen
|
|
|
|
// (in MarkListHasChanged kommt ein Update)
|
2004-02-11 09:11:05 +00:00
|
|
|
pSkipPaintObj = pObj;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
SdrPageView* pPV = pView->GetPageViewPvNum(0);
|
|
|
|
pView->InsertObject(pObj, *pPV);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
// Dies veranlaesst Chart zum sofortigen Update
|
|
|
|
//SvData aEmpty;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
//aIPObj->SendDataChanged( aEmpty );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
if (!rReq.IsAPI())
|
|
|
|
{
|
|
|
|
// XXX Activate aus Makro ist toedlich !!! ???
|
|
|
|
pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
pSkipPaintObj = NULL;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-02-11 09:11:05 +00:00
|
|
|
pViewShell->ResetChartArea(); // Einstellungen nur einmal auslesen
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertChart::Destruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
FuInsertChart::~FuInsertChart()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertChart::Function aktivieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void FuInsertChart::Activate()
|
|
|
|
{
|
|
|
|
FuPoor::Activate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* FuInsertChart::Function deaktivieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void FuInsertChart::Deactivate()
|
|
|
|
{
|
|
|
|
FuPoor::Deactivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|