office-gobmx/chart2/source/tools/ChartModelHelper.cxx

286 lines
10 KiB
C++
Raw Normal View History

2003-10-06 03:58:36 -05:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2003-10-06 03:58:36 -05:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org - a multi-platform office productivity suite
2003-10-06 03:58:36 -05:00
*
* $RCSfile: ChartModelHelper.cxx,v $
* $Revision: 1.12 $
2003-10-06 03:58:36 -05:00
*
* This file is part of OpenOffice.org.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2003-10-06 03:58:36 -05:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2003-10-06 03:58:36 -05:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
2003-10-06 03:58:36 -05:00
#include "ChartModelHelper.hxx"
#include "macros.hxx"
#include "DiagramHelper.hxx"
CWS-TOOLING: integrate CWS koheichart01 2009-05-15 06:32:38 +0200 hde r271925 : header fixed 2009-04-14 16:23:35 +0200 hde r270792 : #100231# 2009-04-14 16:13:48 +0200 hde r270790 : #100231# 2009-04-14 15:56:14 +0200 hde r270787 : #100231# 2009-04-14 14:28:40 +0200 hde r270767 : #100231# 2009-04-14 14:27:30 +0200 hde r270766 : #100231# 2009-04-14 09:43:07 +0200 hde r270749 : #100231# 2009-04-14 09:25:52 +0200 hde r270748 : #100231# 2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning 2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment. 2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's hidden state. 2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled elsewhere. 2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more). 2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is false. Also avoid adding data cache when the cell is hidden. 2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync. 2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync. 2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk@269781 (milestone: DEV300:m44) 2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx 2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable 2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording 2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description 2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code 2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo 2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider 2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of problem during rebase. 2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste 2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case. 2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value. This fixes the broken missing value treatment. 2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore 2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting 2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer 2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes 2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file 2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member 2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods 2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy 2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo 2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells 2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts 2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells 2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values. 2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates. 2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk@265758 (milestone: DEV300:m38) 2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on modified lines and removal of unnecessary 'using' statements. 2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells' options it false! I'm glad I caught this. 2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function. 2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach. Instead of using the original data point index in the object name, leave that index alone, and remove hidden data in the tooltip text value lookup code. 2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account the hidden data points (if any). 2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk@264807 (milestone: DEV300:m37) 2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578. 2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning. 2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning. 2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped. 2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true. 2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box. 2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion. 2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short. 2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup. 2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types. 2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions. 2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page. 2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be zero even when the document has charts. 2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener that listens on cells show/hide state for the chart's data areas. 2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied. 2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
2009-05-18 11:46:40 -05:00
#include "DataSourceHelper.hxx"
#include "ControllerLockGuard.hxx"
CWS-TOOLING: integrate CWS chart37 2009-05-22 09:10:36 +0200 iha r272170 : #i102130# color of pies is not loaded correctly 2009-04-27 17:16:20 +0200 iha r271294 : #i24203# compiler problem 2009-04-27 16:43:21 +0200 iha r271292 : #i101281# missing API documentation for secondary axis title properties 2009-04-27 15:26:05 +0200 hde r271276 : #i100987 2009-04-27 15:24:42 +0200 hde r271273 : #i100987 2009-04-24 15:08:33 +0200 iha r271214 : #i100995# crash with some logarithmic scalings 2009-04-22 18:50:56 +0200 dr r271134 : #i82177# write out deleted point labels 2009-04-22 18:40:48 +0200 iha r271133 : #i101281# missing API documentation for secondary axis title properties 2009-04-22 16:39:42 +0200 dr r271128 : #i82177# extensions for bubble charts 2009-04-22 14:37:00 +0200 dr r271114 : #i82177# import/export data label type and separator 2009-04-22 14:36:24 +0200 dr r271113 : #i82177# import/export data label type and separator 2009-04-21 15:25:26 +0200 dr r271038 : #i82177# import data label type and separator from BIFF8 CHFR records 2009-04-21 14:37:16 +0200 dr r271037 : #i82177# dump BIFF8 chart future records 2009-04-20 17:44:27 +0200 iha r271002 : #i96898# reduce library exports 2009-04-20 13:01:13 +0200 iha r270975 : #i24203# rotate data labels - help ids 2009-04-20 11:40:33 +0200 dr r270969 : #i96600# export of axis scaling/positioning properties 2009-04-16 16:02:31 +0200 dr r270892 : #i69599# keep Y axis left in 3d charts 2009-04-15 18:16:46 +0200 dr r270859 : #i69599# import of axis position settings 2009-04-15 18:16:01 +0200 dr r270858 : #i69599# correct handling of logarithmic crossing axes 2009-04-14 16:27:48 +0200 dr r270794 : #i96599# handle auto axis position on logarithmic axes 2009-04-09 19:59:51 +0200 dr r270722 : #i96599# import axis crossing settings, fix import of logarithmic scaling settings 2009-04-09 18:26:00 +0200 iha r270720 : #i96898# reduce library exports 2009-04-09 15:17:04 +0200 iha r270710 : #i96898# reduce library exports 2009-04-09 10:50:14 +0200 dr r270682 : #i24203# import/export of data label rotation, fixed some other broken stuff too 2009-04-08 16:54:54 +0200 dr r270657 : #i24203# import rotation for data point labels 2009-04-06 18:19:17 +0200 iha r270571 : #i100876# Axis scaling settings dialog wrong after API usage (anys different from double type) 2009-04-06 15:57:05 +0200 iha r270567 : #i100105# #i58585# leftover -> 2009-04-06 15:55:48 +0200 iha r270564 : #i58585# leftover -> 2009-04-02 16:41:07 +0200 iha r270422 : #i99721# remove unused code 2009-04-02 14:29:03 +0200 iha r270407 : #i99721# remove unused code 2009-03-26 10:58:23 +0100 iha r270059 : #i96898# reduce library exports 2009-03-26 10:13:49 +0100 iha r270055 : #i96898# reduce library exports 2009-03-25 09:39:13 +0100 iha r269998 : CWS-TOOLING: rebase CWS chart37 to trunk@269781 (milestone: DEV300:m44) 2009-03-24 17:56:56 +0100 iha r269986 : #i96898# reduce library exports 2009-03-24 16:56:44 +0100 iha r269974 : #i99721# remove unused code 2009-03-24 16:48:48 +0100 iha r269970 : #i89731# remove unused string 2009-03-24 15:44:04 +0100 iha r269961 : remove unused code 2009-03-24 15:22:45 +0100 iha r269959 : remove unused code 2009-03-24 15:17:17 +0100 iha r269957 : remove unused code 2009-03-24 11:14:53 +0100 iha r269923 : #i24203# rotate data labels 2009-03-09 12:10:25 +0100 hde r269076 : #i99300# 2009-03-06 15:56:26 +0100 iha r269011 : #i93953# Source Format for secondary axis without data 2009-02-17 15:59:05 +0100 iha r268177 : avoid warning during build 2009-02-17 15:01:59 +0100 iha r268173 : avoid warning during build 2009-02-13 09:39:03 +0100 ufi r267693 : i96999 2009-02-11 15:12:35 +0100 iha r267604 : removed unused string 2009-02-11 14:00:29 +0100 iha r267600 : #i96999# Corrected wording from 'correlation coefficient' to 'coefficient of determination' 2009-02-11 10:56:45 +0100 iha r267584 : #i89731# typo in resource string 2009-02-11 10:01:29 +0100 iha r267582 : #i89031# compile error on asian windows systems 2009-02-10 16:15:16 +0100 iha r267552 : #i24203# rotate data labels 2009-02-04 18:00:33 +0100 iha r267395 : #i98893# don't export defaults to file 2009-02-04 15:48:15 +0100 iha r267390 : #i92128# asian typography for chart elements 2009-02-04 15:17:41 +0100 iha r267386 : #i92128# asian typography for chart elements 2009-01-30 14:41:10 +0100 iha r267197 : CWS-TOOLING: rebase CWS chart37 to trunk@267171 (milestone: DEV300:m41)
2009-06-04 04:41:18 -05:00
#include "UndoManager.hxx"
#include "RangeHighlighter.hxx"
#include "InternalDataProvider.hxx"
CWS-TOOLING: integrate CWS koheichart01 2009-05-15 06:32:38 +0200 hde r271925 : header fixed 2009-04-14 16:23:35 +0200 hde r270792 : #100231# 2009-04-14 16:13:48 +0200 hde r270790 : #100231# 2009-04-14 15:56:14 +0200 hde r270787 : #100231# 2009-04-14 14:28:40 +0200 hde r270767 : #100231# 2009-04-14 14:27:30 +0200 hde r270766 : #100231# 2009-04-14 09:43:07 +0200 hde r270749 : #100231# 2009-04-14 09:25:52 +0200 hde r270748 : #100231# 2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning 2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment. 2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's hidden state. 2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled elsewhere. 2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more). 2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is false. Also avoid adding data cache when the cell is hidden. 2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync. 2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync. 2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk@269781 (milestone: DEV300:m44) 2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx 2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable 2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording 2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description 2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code 2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo 2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider 2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of problem during rebase. 2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste 2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case. 2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value. This fixes the broken missing value treatment. 2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore 2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting 2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer 2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes 2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file 2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member 2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods 2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy 2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo 2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells 2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts 2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells 2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values. 2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates. 2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk@265758 (milestone: DEV300:m38) 2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on modified lines and removal of unnecessary 'using' statements. 2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells' options it false! I'm glad I caught this. 2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function. 2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach. Instead of using the original data point index in the object name, leave that index alone, and remove hidden data in the tooltip text value lookup code. 2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account the hidden data points (if any). 2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk@264807 (milestone: DEV300:m37) 2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578. 2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning. 2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning. 2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped. 2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true. 2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box. 2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion. 2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short. 2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup. 2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types. 2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions. 2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page. 2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be zero even when the document has charts. 2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener that listens on cells show/hide state for the chart's data areas. 2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied. 2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
2009-05-18 11:46:40 -05:00
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/view/XSelectionChangeListener.hpp>
2003-10-06 03:58:36 -05:00
// header for define DBG_ASSERT
#include <tools/debug.hxx>
//.............................................................................
namespace chart
{
//.............................................................................
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
2003-10-06 03:58:36 -05:00
CWS-TOOLING: integrate CWS chart37 2009-05-22 09:10:36 +0200 iha r272170 : #i102130# color of pies is not loaded correctly 2009-04-27 17:16:20 +0200 iha r271294 : #i24203# compiler problem 2009-04-27 16:43:21 +0200 iha r271292 : #i101281# missing API documentation for secondary axis title properties 2009-04-27 15:26:05 +0200 hde r271276 : #i100987 2009-04-27 15:24:42 +0200 hde r271273 : #i100987 2009-04-24 15:08:33 +0200 iha r271214 : #i100995# crash with some logarithmic scalings 2009-04-22 18:50:56 +0200 dr r271134 : #i82177# write out deleted point labels 2009-04-22 18:40:48 +0200 iha r271133 : #i101281# missing API documentation for secondary axis title properties 2009-04-22 16:39:42 +0200 dr r271128 : #i82177# extensions for bubble charts 2009-04-22 14:37:00 +0200 dr r271114 : #i82177# import/export data label type and separator 2009-04-22 14:36:24 +0200 dr r271113 : #i82177# import/export data label type and separator 2009-04-21 15:25:26 +0200 dr r271038 : #i82177# import data label type and separator from BIFF8 CHFR records 2009-04-21 14:37:16 +0200 dr r271037 : #i82177# dump BIFF8 chart future records 2009-04-20 17:44:27 +0200 iha r271002 : #i96898# reduce library exports 2009-04-20 13:01:13 +0200 iha r270975 : #i24203# rotate data labels - help ids 2009-04-20 11:40:33 +0200 dr r270969 : #i96600# export of axis scaling/positioning properties 2009-04-16 16:02:31 +0200 dr r270892 : #i69599# keep Y axis left in 3d charts 2009-04-15 18:16:46 +0200 dr r270859 : #i69599# import of axis position settings 2009-04-15 18:16:01 +0200 dr r270858 : #i69599# correct handling of logarithmic crossing axes 2009-04-14 16:27:48 +0200 dr r270794 : #i96599# handle auto axis position on logarithmic axes 2009-04-09 19:59:51 +0200 dr r270722 : #i96599# import axis crossing settings, fix import of logarithmic scaling settings 2009-04-09 18:26:00 +0200 iha r270720 : #i96898# reduce library exports 2009-04-09 15:17:04 +0200 iha r270710 : #i96898# reduce library exports 2009-04-09 10:50:14 +0200 dr r270682 : #i24203# import/export of data label rotation, fixed some other broken stuff too 2009-04-08 16:54:54 +0200 dr r270657 : #i24203# import rotation for data point labels 2009-04-06 18:19:17 +0200 iha r270571 : #i100876# Axis scaling settings dialog wrong after API usage (anys different from double type) 2009-04-06 15:57:05 +0200 iha r270567 : #i100105# #i58585# leftover -> 2009-04-06 15:55:48 +0200 iha r270564 : #i58585# leftover -> 2009-04-02 16:41:07 +0200 iha r270422 : #i99721# remove unused code 2009-04-02 14:29:03 +0200 iha r270407 : #i99721# remove unused code 2009-03-26 10:58:23 +0100 iha r270059 : #i96898# reduce library exports 2009-03-26 10:13:49 +0100 iha r270055 : #i96898# reduce library exports 2009-03-25 09:39:13 +0100 iha r269998 : CWS-TOOLING: rebase CWS chart37 to trunk@269781 (milestone: DEV300:m44) 2009-03-24 17:56:56 +0100 iha r269986 : #i96898# reduce library exports 2009-03-24 16:56:44 +0100 iha r269974 : #i99721# remove unused code 2009-03-24 16:48:48 +0100 iha r269970 : #i89731# remove unused string 2009-03-24 15:44:04 +0100 iha r269961 : remove unused code 2009-03-24 15:22:45 +0100 iha r269959 : remove unused code 2009-03-24 15:17:17 +0100 iha r269957 : remove unused code 2009-03-24 11:14:53 +0100 iha r269923 : #i24203# rotate data labels 2009-03-09 12:10:25 +0100 hde r269076 : #i99300# 2009-03-06 15:56:26 +0100 iha r269011 : #i93953# Source Format for secondary axis without data 2009-02-17 15:59:05 +0100 iha r268177 : avoid warning during build 2009-02-17 15:01:59 +0100 iha r268173 : avoid warning during build 2009-02-13 09:39:03 +0100 ufi r267693 : i96999 2009-02-11 15:12:35 +0100 iha r267604 : removed unused string 2009-02-11 14:00:29 +0100 iha r267600 : #i96999# Corrected wording from 'correlation coefficient' to 'coefficient of determination' 2009-02-11 10:56:45 +0100 iha r267584 : #i89731# typo in resource string 2009-02-11 10:01:29 +0100 iha r267582 : #i89031# compile error on asian windows systems 2009-02-10 16:15:16 +0100 iha r267552 : #i24203# rotate data labels 2009-02-04 18:00:33 +0100 iha r267395 : #i98893# don't export defaults to file 2009-02-04 15:48:15 +0100 iha r267390 : #i92128# asian typography for chart elements 2009-02-04 15:17:41 +0100 iha r267386 : #i92128# asian typography for chart elements 2009-01-30 14:41:10 +0100 iha r267197 : CWS-TOOLING: rebase CWS chart37 to trunk@267171 (milestone: DEV300:m41)
2009-06-04 04:41:18 -05:00
//static
uno::Reference< chart2::XUndoManager > ChartModelHelper::createUndoManager()
{
return new UndoManager();
}
//static
uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter(
const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier )
{
return new RangeHighlighter( xSelectionSupplier );
}
//static
uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider()
{
return new InternalDataProvider();
}
//static
uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
const uno::Reference< ::com::sun::star::chart::XChartDataArray >& xDataToCopy )
{
return new InternalDataProvider( xDataToCopy );
}
//static
uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
const uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc )
{
return new InternalDataProvider( xChartDoc );
}
2003-10-06 03:58:36 -05:00
//static
uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
if( xChartDoc.is())
return ChartModelHelper::findDiagram( xChartDoc );
2003-10-06 03:58:36 -05:00
return NULL;
}
// static
uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< chart2::XChartDocument >& xChartDoc )
2003-10-06 03:58:36 -05:00
{
try
2003-10-06 03:58:36 -05:00
{
if( xChartDoc.is())
return xChartDoc->getFirstDiagram();
2003-10-06 03:58:36 -05:00
}
catch( uno::Exception & ex )
2003-10-06 03:58:36 -05:00
{
ASSERT_EXCEPTION( ex );
2003-10-06 03:58:36 -05:00
}
return NULL;
2003-10-06 03:58:36 -05:00
}
//static
uno::Reference< XCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< XCoordinateSystem > XCooSys;
uno::Reference< XCoordinateSystemContainer > xCooSysCnt( ChartModelHelper::findDiagram( xModel ), uno::UNO_QUERY );
if( xCooSysCnt.is() )
{
uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
if( aCooSysSeq.getLength() )
XCooSys = aCooSysSeq[0];
}
return XCooSys;
}
2003-10-06 03:58:36 -05:00
// static
::std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
const uno::Reference< XChartDocument > & xChartDoc )
2003-10-06 03:58:36 -05:00
{
::std::vector< uno::Reference< XDataSeries > > aResult;
uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
if( xDiagram.is())
aResult = DiagramHelper::getDataSeriesFromDiagram( xDiagram );
2003-10-06 03:58:36 -05:00
return aResult;
}
// static
::std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
const uno::Reference< frame::XModel > & xModel )
2003-10-06 03:58:36 -05:00
{
return getDataSeries( uno::Reference< chart2::XChartDocument >( xModel, uno::UNO_QUERY ));
2003-10-06 03:58:36 -05:00
}
2003-11-08 15:52:47 -06:00
uno::Reference< XChartType > ChartModelHelper::getChartTypeOfSeries(
const uno::Reference< frame::XModel >& xModel
, const uno::Reference< XDataSeries >& xGivenDataSeries )
{
return DiagramHelper::getChartTypeOfSeries( ChartModelHelper::findDiagram( xModel ), xGivenDataSeries );
}
awt::Size ChartModelHelper::getPageSize( const uno::Reference< frame::XModel >& xModel )
{
awt::Size aPageSize( 8000, 7000 );
uno::Reference< embed::XVisualObject > xVisualObject(xModel,uno::UNO_QUERY);
DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size");
if( xVisualObject.is() )
aPageSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
return aPageSize;
}
void ChartModelHelper::setPageSize( const awt::Size& rSize, const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< embed::XVisualObject > xVisualObject(xModel,uno::UNO_QUERY);
DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size");
if( xVisualObject.is() )
xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, rSize );
2003-11-08 15:52:47 -06:00
}
void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xModel, uno::UNO_QUERY );
if( xDataReceiver.is() )
{
uno::Reference< view::XSelectionChangeListener > xSelectionChangeListener( xDataReceiver->getRangeHighlighter(), uno::UNO_QUERY );
//trigger selection of cell range
if( xSelectionChangeListener.is() )
{
lang::EventObject aEvent( xSelectionChangeListener );
xSelectionChangeListener->selectionChanged( aEvent );
}
}
}
CWS-TOOLING: integrate CWS koheichart01 2009-05-15 06:32:38 +0200 hde r271925 : header fixed 2009-04-14 16:23:35 +0200 hde r270792 : #100231# 2009-04-14 16:13:48 +0200 hde r270790 : #100231# 2009-04-14 15:56:14 +0200 hde r270787 : #100231# 2009-04-14 14:28:40 +0200 hde r270767 : #100231# 2009-04-14 14:27:30 +0200 hde r270766 : #100231# 2009-04-14 09:43:07 +0200 hde r270749 : #100231# 2009-04-14 09:25:52 +0200 hde r270748 : #100231# 2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning 2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment. 2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's hidden state. 2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled elsewhere. 2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more). 2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is false. Also avoid adding data cache when the cell is hidden. 2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync. 2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync. 2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk@269781 (milestone: DEV300:m44) 2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx 2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly 2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable 2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording 2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden' 2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description 2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code 2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo 2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges 2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider 2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of problem during rebase. 2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication 2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste 2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case. 2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value. This fixes the broken missing value treatment. 2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore 2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting 2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer 2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series 2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes 2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file 2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member 2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods 2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy 2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo 2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells 2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts 2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells 2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values. 2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates. 2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk@265758 (milestone: DEV300:m38) 2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on modified lines and removal of unnecessary 'using' statements. 2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells' options it false! I'm glad I caught this. 2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function. 2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach. Instead of using the original data point index in the object name, leave that index alone, and remove hidden data in the tooltip text value lookup code. 2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account the hidden data points (if any). 2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk@264807 (milestone: DEV300:m37) 2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578. 2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning. 2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning. 2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped. 2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true. 2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box. 2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion. 2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short. 2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup. 2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types. 2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions. 2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page. 2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be zero even when the document has charts. 2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener that listens on cells show/hide state for the chart's data areas. 2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied. 2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
2009-05-18 11:46:40 -05:00
bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
{
bool bIncluded = true; // hidden cells are included by default.
uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
if (!xDiagram.is())
return bIncluded;
uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
if (!xProp.is())
return bIncluded;
try
{
xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
}
catch( const beans::UnknownPropertyException& )
{
}
return bIncluded;
}
bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const uno::Reference< frame::XModel >& xChartModel )
{
bool bChanged = false;
try
{
ControllerLockGuard aLockedControllers( xChartModel );
uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(xChartModel), uno::UNO_QUERY );
if (xDiagramProperties.is())
{
bool bOldValue = bIncludeHiddenCells;
xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= bOldValue;
if( bOldValue == bIncludeHiddenCells )
bChanged = true;
//set the property on all instances in all cases to get the different objects in sync!
uno::Any aNewValue = uno::makeAny(bIncludeHiddenCells);
try
{
uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
if( xChartDoc.is() )
{
uno::Reference< beans::XPropertySet > xDataProviderProperties( xChartDoc->getDataProvider(), uno::UNO_QUERY );
if( xDataProviderProperties.is() )
xDataProviderProperties->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
}
}
catch( const beans::UnknownPropertyException& )
{
//the property is optional!
}
try
{
uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xChartModel ) );
if( xUsedData.is() )
{
uno::Reference< beans::XPropertySet > xProp;
uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
for( sal_Int32 i=0; i<aData.getLength(); ++i )
{
xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getValues(), uno::UNO_QUERY ) );
if(xProp.is())
xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getLabel(), uno::UNO_QUERY ) );
if(xProp.is())
xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
}
}
}
catch( const beans::UnknownPropertyException& )
{
//the property is optional!
}
xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), aNewValue);
}
}
catch (uno::Exception& e)
{
ASSERT_EXCEPTION(e);
}
return bChanged;
}
2003-10-06 03:58:36 -05:00
//.............................................................................
} //namespace chart
//.............................................................................