Files
libreoffice/sc/source/ui/view/dbfunc4.cxx

127 lines
3.9 KiB
C++
Raw Normal View History

2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* $RCSfile: dbfunc4.cxx,v $
2000-09-18 16:07:07 +00:00
*
* $Revision: 1.7 $
2000-09-18 16:07:07 +00:00
*
* last change: $Author: obo $ $Date: 2006-07-10 14:09:56 $
2000-09-18 16:07:07 +00:00
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
2000-09-18 16:07:07 +00:00
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
2000-09-18 16:07:07 +00:00
*
* 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.
2000-09-18 16:07:07 +00:00
*
* 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.
2000-09-18 16:07:07 +00:00
*
* 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
2000-09-18 16:07:07 +00:00
*
************************************************************************/
#ifdef PCH
#include "ui_pch.hxx"
#endif
#pragma hdrstop
//------------------------------------------------------------------
// INCLUDE ---------------------------------------------------------------
#include <svx/svditer.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdpage.hxx>
#include <sch/schdll.hxx>
#include <sch/memchrt.hxx>
#include "dbfunc.hxx"
2000-09-18 16:07:07 +00:00
#include "chartarr.hxx"
#include "drwlayer.hxx"
#include "document.hxx"
// -----------------------------------------------------------------------
#ifdef WNT
#pragma optimize ( "", off )
#endif
using namespace com::sun::star;
2000-09-18 16:07:07 +00:00
//==================================================================
// static
USHORT ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc,
2000-09-18 16:07:07 +00:00
Window* pActiveWin, BOOL bAllCharts )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
return 0;
USHORT nFound = 0;
USHORT nPageCount = pModel->GetPageCount();
for (USHORT nPageNo=0; nPageNo<nPageCount; nPageNo++)
{
SdrPage* pPage = pModel->GetPage(nPageNo);
DBG_ASSERT(pPage,"Page ?");
SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
SdrObject* pObject = aIter.Next();
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
{
uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef();
if (xObj.is())
2000-09-18 16:07:07 +00:00
{
const SchMemChart* pChartData = SchDLL::GetChartData(xObj);
2000-09-18 16:07:07 +00:00
if ( pChartData )
{
ScChartArray aArray( pDoc, *pChartData );
if (aArray.IsValid())
{
if ( bAllCharts || aArray.IsAtCursor(rPos) )
2000-09-18 16:07:07 +00:00
{
SchMemChart* pMemChart = aArray.CreateMemChart();
ScChartArray::CopySettings( *pMemChart, *pChartData );
SchDLL::Update( xObj, pMemChart, pActiveWin );
2000-09-18 16:07:07 +00:00
delete pMemChart;
++nFound;
((SdrOle2Obj*)pObject)->GetNewReplacement();
2000-09-18 16:07:07 +00:00
// redraw only
pObject->ActionChanged();
// pObject->SendRepaintBroadcast();
2000-09-18 16:07:07 +00:00
}
}
}
}
}
pObject = aIter.Next();
}
}
return nFound;
}