Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svx/svditer.hxx>
30 : : #include <svx/svdoole2.hxx>
31 : : #include <svx/svdpage.hxx>
32 : :
33 : : #include "dbfunc.hxx"
34 : : #include "drwlayer.hxx"
35 : : #include "document.hxx"
36 : :
37 : : // -----------------------------------------------------------------------
38 : :
39 : : #ifdef _MSC_VER
40 : : #pragma optimize ( "", off )
41 : : #endif
42 : :
43 : : using namespace com::sun::star;
44 : :
45 : : //==================================================================
46 : :
47 : 53 : sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts )
48 : : {
49 : 53 : ScDrawLayer* pModel = pDoc->GetDrawLayer();
50 [ - + ]: 53 : if (!pModel)
51 : 0 : return 0;
52 : :
53 : 53 : sal_uInt16 nFound = 0;
54 : :
55 : 53 : sal_uInt16 nPageCount = pModel->GetPageCount();
56 [ + + ]: 134 : for (sal_uInt16 nPageNo=0; nPageNo<nPageCount; nPageNo++)
57 : : {
58 [ + - ]: 81 : SdrPage* pPage = pModel->GetPage(nPageNo);
59 : : OSL_ENSURE(pPage,"Page ?");
60 : :
61 [ + - ]: 81 : SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
62 [ + - ]: 81 : SdrObject* pObject = aIter.Next();
63 [ + + ]: 90 : while (pObject)
64 : : {
65 [ + - ][ - + ]: 9 : if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart( pObject ) )
[ # # ][ # # ]
[ - + ]
66 : : {
67 [ # # ]: 0 : String aName = ((SdrOle2Obj*)pObject)->GetPersistName();
68 : 0 : bool bHit = true;
69 [ # # ]: 0 : if ( !bAllCharts )
70 : : {
71 [ # # ]: 0 : ScRangeList aRanges;
72 : 0 : bool bColHeaders = false;
73 : 0 : bool bRowHeaders = false;
74 [ # # ][ # # ]: 0 : pDoc->GetOldChartParameters( aName, aRanges, bColHeaders, bRowHeaders );
75 [ # # ][ # # ]: 0 : bHit = aRanges.In( rPos );
76 : : }
77 [ # # ]: 0 : if ( bHit )
78 : : {
79 [ # # ][ # # ]: 0 : pDoc->UpdateChart( aName );
80 : 0 : ++nFound;
81 [ # # ]: 0 : }
82 : : }
83 [ + - ]: 9 : pObject = aIter.Next();
84 : : }
85 : 81 : }
86 : 53 : return nFound;
87 : : }
88 : :
89 : :
90 : :
91 : :
92 : :
93 : :
94 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|