Files
libreoffice/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx

1000 lines
39 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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-06 08:58:36 +00:00
#include "AxisItemConverter.hxx"
#include "ItemPropertyMap.hxx"
#include "CharacterPropertyItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
#include "chartview/ChartSfxItemIds.hxx"
#include "chartview/ExplicitValueProvider.hxx"
2003-10-06 08:58:36 +00:00
#include "SchWhichPairs.hxx"
#include "macros.hxx"
#include "ChartModelHelper.hxx"
#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
2010-11-30 01:45:03 +01:00
#include "ChartTypeHelper.hxx"
2008-12-12 12:17:17 +00:00
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
2010-11-30 01:45:03 +01:00
#include <com/sun/star/chart2/AxisType.hpp>
2003-10-06 08:58:36 +00:00
// for SfxBoolItem
#include <svl/eitem.hxx>
2003-10-06 08:58:36 +00:00
// for SvxDoubleItem
#include <svx/chrtitem.hxx>
// for SfxInt32Item
#include <svl/intitem.hxx>
2003-10-06 08:58:36 +00:00
#include <rtl/math.hxx>
#include <algorithm>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
2010-11-30 01:45:03 +01:00
using ::com::sun::star::chart::TimeInterval;
using ::com::sun::star::chart::TimeIncrement;
2003-10-06 08:58:36 +00:00
namespace
{
::comphelper::ItemPropertyMapType & lcl_GetAxisPropertyMap()
2003-10-06 08:58:36 +00:00
{
static ::comphelper::ItemPropertyMapType aAxisPropertyMap(
::comphelper::MakeItemPropertyMap
2010-11-30 01:45:03 +01:00
IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 )
IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 )
IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 )
IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_ORDER, "ArrangeOrder", 0 )
IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 )
IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_BREAK, "TextBreak", 0 )
IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_OVERLAP, "TextOverlap", 0 )
2003-10-06 08:58:36 +00:00
);
return aAxisPropertyMap;
};
} // anonymous namespace
namespace chart
{
namespace wrapper
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
2003-10-06 08:58:36 +00:00
AxisItemConverter::AxisItemConverter(
const Reference< beans::XPropertySet > & rPropertySet,
2003-10-06 08:58:36 +00:00
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
const Reference< chart2::XChartDocument > & xChartDoc,
2010-11-30 01:45:03 +01:00
::chart::ExplicitScaleData * pScale /* = NULL */,
::chart::ExplicitIncrementData * pIncrement /* = NULL */,
::std::auto_ptr< awt::Size > pRefSize /* = NULL */ ) :
2003-10-06 08:58:36 +00:00
ItemConverter( rPropertySet, rItemPool ),
m_xChartDoc( xChartDoc ),
2003-10-06 08:58:36 +00:00
m_pExplicitScale( NULL ),
m_pExplicitIncrement( NULL )
2003-10-06 08:58:36 +00:00
{
Reference< lang::XMultiServiceFactory > xNamedPropertyContainerFactory( xChartDoc, uno::UNO_QUERY );
2003-10-06 08:58:36 +00:00
if( pScale )
2010-11-30 01:45:03 +01:00
m_pExplicitScale = new ::chart::ExplicitScaleData( *pScale );
2003-10-06 08:58:36 +00:00
if( pIncrement )
2010-11-30 01:45:03 +01:00
m_pExplicitIncrement = new ::chart::ExplicitIncrementData( *pIncrement );
2003-10-06 08:58:36 +00:00
m_aConverters.push_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
xNamedPropertyContainerFactory,
2003-10-06 08:58:36 +00:00
GraphicPropertyItemConverter::LINE_PROPERTIES ));
m_aConverters.push_back( new CharacterPropertyItemConverter( rPropertySet, rItemPool, pRefSize,
"ReferencePageSize" ));
2003-10-06 08:58:36 +00:00
m_xAxis.set( Reference< chart2::XAxis >( rPropertySet, uno::UNO_QUERY ) );
OSL_ASSERT( m_xAxis.is());
2003-10-06 08:58:36 +00:00
}
SAL_WNODEPRECATED_DECLARATIONS_POP
2003-10-06 08:58:36 +00:00
AxisItemConverter::~AxisItemConverter()
{
delete m_pExplicitScale;
delete m_pExplicitIncrement;
::std::for_each( m_aConverters.begin(), m_aConverters.end(),
::comphelper::DeleteItemConverterPtr() );
2003-10-06 08:58:36 +00:00
}
void AxisItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
::std::for_each( m_aConverters.begin(), m_aConverters.end(),
::comphelper::FillItemSetFunc( rOutItemSet ));
2003-10-06 08:58:36 +00:00
// own items
ItemConverter::FillItemSet( rOutItemSet );
}
bool AxisItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
::std::for_each( m_aConverters.begin(), m_aConverters.end(),
::comphelper::ApplyItemSetFunc( rItemSet, bResult ));
2003-10-06 08:58:36 +00:00
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
const sal_uInt16 * AxisItemConverter::GetWhichPairs() const
2003-10-06 08:58:36 +00:00
{
// must span all used items!
return nAxisWhichPairs;
}
bool AxisItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const
2003-10-06 08:58:36 +00:00
{
::comphelper::ItemPropertyMapType & rMap( lcl_GetAxisPropertyMap());
::comphelper::ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId ));
2003-10-06 08:58:36 +00:00
if( aIt == rMap.end())
return false;
rOutProperty =(*aIt).second;
2003-10-06 08:58:36 +00:00
return true;
}
2010-11-30 01:45:03 +01:00
bool lcl_hasTimeIntervalValue( const uno::Any& rAny )
{
bool bRet = false;
TimeInterval aValue;
if( rAny >>= aValue )
bRet = true;
return bRet;
}
void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
if( !m_xAxis.is() )
2003-10-06 08:58:36 +00:00
return;
2010-11-30 01:45:03 +01:00
const chart2::ScaleData& rScale( m_xAxis->getScaleData() );
const chart2::IncrementData& rIncrement( rScale.IncrementData );
const uno::Sequence< chart2::SubIncrement >& rSubIncrements( rScale.IncrementData.SubIncrements );
const TimeIncrement& rTimeIncrement( rScale.TimeIncrement );
bool bDateAxis = (chart2::AxisType::DATE == rScale.AxisType);
if( m_pExplicitScale )
bDateAxis = (chart2::AxisType::DATE == m_pExplicitScale->AxisType);
2003-10-06 08:58:36 +00:00
switch( nWhichId )
{
case SCHATTR_AXIS_AUTO_MAX:
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Maximum) ) );
2003-10-06 08:58:36 +00:00
break;
case SCHATTR_AXIS_MAX:
{
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 09:41:18 +00:00
double fMax = 10.0;
2010-11-30 01:45:03 +01:00
if( rScale.Maximum >>= fMax )
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 09:41:18 +00:00
rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
else
{
if( m_pExplicitScale )
fMax = m_pExplicitScale->Maximum;
rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
}
2003-10-06 08:58:36 +00:00
}
break;
case SCHATTR_AXIS_AUTO_MIN:
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Minimum) ) );
2003-10-06 08:58:36 +00:00
break;
case SCHATTR_AXIS_MIN:
{
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 09:41:18 +00:00
double fMin = 0.0;
2010-11-30 01:45:03 +01:00
if( rScale.Minimum >>= fMin )
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 09:41:18 +00:00
rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) );
2010-11-30 01:45:03 +01:00
else if( m_pExplicitScale )
rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
2003-10-06 08:58:36 +00:00
}
break;
case SCHATTR_AXIS_LOGARITHM:
2010-11-30 01:45:03 +01:00
{
2011-02-07 13:06:08 +01:00
sal_Bool bValue = AxisHelper::isLogarithmic( rScale.Scaling );
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_REVERSE:
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == rScale.Orientation) ));
break;
2003-10-06 08:58:36 +00:00
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
2010-11-30 01:45:03 +01:00
if( bDateAxis )
rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MajorTimeInterval) ) );
else
rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rIncrement.Distance) ) );
break;
case SCHATTR_AXIS_MAIN_TIME_UNIT:
{
TimeInterval aTimeInterval;
if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
else if( m_pExplicitIncrement )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MajorTimeInterval.TimeUnit ) );
}
2003-10-06 08:58:36 +00:00
break;
case SCHATTR_AXIS_STEP_MAIN:
2010-11-30 01:45:03 +01:00
if( bDateAxis )
{
TimeInterval aTimeInterval;
if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, nWhichId ));
else if( m_pExplicitIncrement )
rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, nWhichId ));
}
else
2003-10-06 08:58:36 +00: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 09:41:18 +00:00
double fDistance = 1.0;
2010-11-30 01:45:03 +01:00
if( rIncrement.Distance >>= fDistance )
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 09:41:18 +00:00
rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId ));
2010-11-30 01:45:03 +01:00
else if( m_pExplicitIncrement )
rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
2003-10-06 08:58:36 +00:00
}
break;
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
2010-11-30 01:45:03 +01:00
if( bDateAxis )
rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MinorTimeInterval) ) );
else
rOutItemSet.Put( SfxBoolItem( nWhichId,
! ( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue() )));
break;
case SCHATTR_AXIS_HELP_TIME_UNIT:
{
TimeInterval aTimeInterval;
if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
else if( m_pExplicitIncrement )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.TimeUnit ) );
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_STEP_HELP:
2010-11-30 01:45:03 +01:00
if( bDateAxis )
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
TimeInterval aTimeInterval;
if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.Number ));
else if( m_pExplicitIncrement )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.Number ));
2003-10-06 08:58:36 +00:00
}
else
{
2010-11-30 01:45:03 +01:00
if( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue())
{
OSL_ASSERT( rSubIncrements[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG );
rOutItemSet.Put( SfxInt32Item( nWhichId,
*reinterpret_cast< const sal_Int32 * >(
rSubIncrements[0].IntervalCount.getValue()) ));
}
else
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
if( m_pExplicitIncrement && !m_pExplicitIncrement->SubIncrements.empty() )
{
rOutItemSet.Put( SfxInt32Item( nWhichId,
m_pExplicitIncrement->SubIncrements[0].IntervalCount ));
}
2003-10-06 08:58:36 +00:00
}
}
2010-11-30 01:45:03 +01:00
break;
case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
{
rOutItemSet.Put( SfxBoolItem( nWhichId,
!rTimeIncrement.TimeResolution.hasValue() ));
}
break;
case SCHATTR_AXIS_TIME_RESOLUTION:
{
long nTimeResolution=0;
if( rTimeIncrement.TimeResolution >>= nTimeResolution )
rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
else if( m_pExplicitScale )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitScale->TimeResolution ) );
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_AUTO_ORIGIN:
{
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(rScale.Origin) )));
2003-10-06 08:58:36 +00:00
}
break;
case SCHATTR_AXIS_ORIGIN:
{
double fOrigin = 0.0;
2010-11-30 01:45:03 +01:00
if( !(rScale.Origin >>= fOrigin) )
2003-10-06 08:58:36 +00:00
{
if( m_pExplicitScale )
fOrigin = m_pExplicitScale->Origin;
2003-10-06 08:58:36 +00:00
}
rOutItemSet.Put( SvxDoubleItem( fOrigin, nWhichId ));
2003-10-06 08:58:36 +00:00
}
break;
2008-12-12 12:17:17 +00:00
case SCHATTR_AXIS_POSITION:
{
::com::sun::star::chart::ChartAxisPosition eAxisPos( ::com::sun::star::chart::ChartAxisPosition_ZERO );
GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eAxisPos;
2008-12-12 12:17:17 +00:00
rOutItemSet.Put( SfxInt32Item( nWhichId, eAxisPos ) );
}
break;
case SCHATTR_AXIS_POSITION_VALUE:
{
double fValue = 0.0;
if( GetPropertySet()->getPropertyValue( "CrossoverValue" ) >>= fValue )
2008-12-12 12:17:17 +00:00
rOutItemSet.Put( SvxDoubleItem( fValue, nWhichId ) );
}
break;
case SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT:
{
//read only item
//necessary tp display the crossing value with an appropriate format
Reference< chart2::XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
Reference< chart2::XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ) );
sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
xCrossingMainAxis, xCooSys, Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY ) );
rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey ));
}
break;
case SCHATTR_AXIS_LABEL_POSITION:
{
::com::sun::star::chart::ChartAxisLabelPosition ePos( ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= ePos;
2008-12-12 12:17:17 +00:00
rOutItemSet.Put( SfxInt32Item( nWhichId, ePos ) );
}
break;
case SCHATTR_AXIS_MARK_POSITION:
{
::com::sun::star::chart::ChartAxisMarkPosition ePos( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= ePos;
2008-12-12 12:17:17 +00:00
rOutItemSet.Put( SfxInt32Item( nWhichId, ePos ) );
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_TEXT_DEGREES:
{
// convert double to int (times 100)
double fVal = 0;
2003-10-06 08:58:36 +00:00
if( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fVal )
2003-10-06 08:58:36 +00:00
{
rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast< sal_Int32 >(
::rtl::math::round( fVal * 100.0 ) ) ));
}
}
break;
case SID_ATTR_NUMBERFORMAT_VALUE:
{
if( m_pExplicitScale )
2003-10-06 08:58:36 +00:00
{
Reference< chart2::XCoordinateSystem > xCooSys(
AxisHelper::getCoordinateSystemOfAxis(
m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
m_xAxis, xCooSys, Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY ) );
rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey ));
2003-10-06 08:58:36 +00:00
}
}
break;
case SID_ATTR_NUMBERFORMAT_SOURCE:
{
bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue());
rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
}
break;
case SCHATTR_AXISTYPE:
2010-11-30 01:45:03 +01:00
rOutItemSet.Put( SfxInt32Item( nWhichId, rScale.AxisType ));
break;
case SCHATTR_AXIS_AUTO_DATEAXIS:
rOutItemSet.Put( SfxBoolItem( nWhichId, rScale.AutoDateAxis ));
break;
case SCHATTR_AXIS_ALLOW_DATEAXIS:
{
Reference< chart2::XCoordinateSystem > xCooSys(
AxisHelper::getCoordinateSystemOfAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
AxisHelper::getIndicesForAxis(m_xAxis, xCooSys, nDimensionIndex, nAxisIndex );
bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), 2, nDimensionIndex );
rOutItemSet.Put( SfxBoolItem( nWhichId, bChartTypeAllowsDateAxis ));
}
break;
2003-10-06 08:58:36 +00:00
}
}
2010-11-30 01:45:03 +01:00
bool lcl_isDateAxis( const SfxItemSet & rItemSet )
{
sal_Int32 nAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( SCHATTR_AXISTYPE )).GetValue();//::com::sun::star::chart2::AxisType
return (chart2::AxisType::DATE == nAxisType);
}
bool lcl_isAutoMajor( const SfxItemSet & rItemSet )
{
bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue();
return bRet;
}
bool lcl_isAutoMinor( const SfxItemSet & rItemSet )
{
bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue();
return bRet;
}
bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
2003-10-06 08:58:36 +00:00
{
if( !m_xAxis.is() )
2003-10-06 08:58:36 +00:00
return false;
chart2::ScaleData aScale( m_xAxis->getScaleData() );
2003-10-06 08:58:36 +00:00
bool bSetScale = false;
2003-10-06 08:58:36 +00:00
bool bChangedOtherwise = false;
uno::Any aValue;
switch( nWhichId )
{
case SCHATTR_AXIS_AUTO_MAX:
if( (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( nWhichId )).GetValue() ))
{
aScale.Maximum.clear();
bSetScale = true;
}
// else SCHATTR_AXIS_MAX must have some value
break;
case SCHATTR_AXIS_MAX:
// only if auto if false
if( ! (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( SCHATTR_AXIS_AUTO_MAX )).GetValue() ))
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
if( aScale.Maximum != aValue )
{
aScale.Maximum = aValue;
bSetScale = true;
}
}
break;
case SCHATTR_AXIS_AUTO_MIN:
if( (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( nWhichId )).GetValue() ))
{
aScale.Minimum.clear();
bSetScale = true;
}
// else SCHATTR_AXIS_MIN must have some value
break;
case SCHATTR_AXIS_MIN:
// only if auto if false
if( ! (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( SCHATTR_AXIS_AUTO_MIN )).GetValue() ))
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
if( aScale.Minimum != aValue )
{
aScale.Minimum = aValue;
bSetScale = true;
}
}
break;
case SCHATTR_AXIS_LOGARITHM:
{
bool bWasLogarithm = AxisHelper::isLogarithmic( aScale.Scaling );
2003-10-06 08:58:36 +00:00
if( (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( nWhichId )).GetValue() ))
{
// logarithm is true
if( ! bWasLogarithm )
{
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 09:41:18 +00:00
aScale.Scaling = AxisHelper::createLogarithmicScaling( 10.0 );
2003-10-06 08:58:36 +00:00
bSetScale = true;
}
}
else
{
// logarithm is false => linear scaling
if( bWasLogarithm )
{
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 09:41:18 +00:00
aScale.Scaling = AxisHelper::createLinearScaling();
2003-10-06 08:58:36 +00:00
bSetScale = true;
}
}
}
break;
case SCHATTR_AXIS_REVERSE:
{
bool bWasReverse = ( AxisOrientation_REVERSE == aScale.Orientation );
bool bNewReverse = (static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue() );
if( bWasReverse != bNewReverse )
{
aScale.Orientation = bNewReverse ? AxisOrientation_REVERSE : AxisOrientation_MATHEMATICAL;
bSetScale = true;
}
}
break;
2003-10-06 08:58:36 +00:00
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
2010-11-30 01:45:03 +01:00
if( lcl_isAutoMajor(rItemSet) )
2003-10-06 08:58:36 +00:00
{
aScale.IncrementData.Distance.clear();
2010-11-30 01:45:03 +01:00
aScale.TimeIncrement.MajorTimeInterval.clear();
bSetScale = true;
2003-10-06 08:58:36 +00:00
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
2010-11-30 01:45:03 +01:00
case SCHATTR_AXIS_MAIN_TIME_UNIT:
if( !lcl_isAutoMajor(rItemSet) )
{
if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
{
TimeInterval aTimeInterval;
aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
aValue >>= aTimeInterval.TimeUnit;
aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
bSetScale = true;
}
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_STEP_MAIN:
// only if auto if false
2010-11-30 01:45:03 +01:00
if( !lcl_isAutoMajor(rItemSet) )
2003-10-06 08:58:36 +00:00
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
2010-11-30 01:45:03 +01:00
if( lcl_isDateAxis(rItemSet) )
{
double fValue = 1.0;
if( aValue >>= fValue )
{
TimeInterval aTimeInterval;
aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
aTimeInterval.Number = static_cast<sal_Int32>(fValue);
2010-11-30 01:45:03 +01:00
aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
bSetScale = true;
}
}
else if( aScale.IncrementData.Distance != aValue )
2003-10-06 08:58:36 +00:00
{
aScale.IncrementData.Distance = aValue;
bSetScale = true;
2003-10-06 08:58:36 +00:00
}
}
break;
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
2010-11-30 01:45:03 +01:00
if( lcl_isAutoMinor(rItemSet) )
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
if( aScale.IncrementData.SubIncrements.getLength() > 0 &&
aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() )
{
aScale.IncrementData.SubIncrements[0].IntervalCount.clear();
bSetScale = true;
}
if( aScale.TimeIncrement.MinorTimeInterval.hasValue() )
{
aScale.TimeIncrement.MinorTimeInterval.clear();
bSetScale = true;
2010-11-30 01:45:03 +01:00
}
2003-10-06 08:58:36 +00:00
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
2010-11-30 01:45:03 +01:00
case SCHATTR_AXIS_HELP_TIME_UNIT:
if( !lcl_isAutoMinor(rItemSet) )
{
if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
{
TimeInterval aTimeInterval;
aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
aValue >>= aTimeInterval.TimeUnit;
aScale.TimeIncrement.MinorTimeInterval = uno::makeAny( aTimeInterval );
bSetScale = true;
}
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_STEP_HELP:
2010-11-30 01:45:03 +01:00
// only if auto is false
if( !lcl_isAutoMinor(rItemSet) )
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
if( lcl_isDateAxis(rItemSet) )
{
TimeInterval aTimeInterval;
aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
aValue >>= aTimeInterval.Number;
aScale.TimeIncrement.MinorTimeInterval = uno::makeAny(aTimeInterval);
bSetScale = true;
}
else if( aScale.IncrementData.SubIncrements.getLength() > 0 )
{
if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ||
aScale.IncrementData.SubIncrements[0].IntervalCount != aValue )
{
OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG );
aScale.IncrementData.SubIncrements[0].IntervalCount = aValue;
bSetScale = true;
}
}
}
break;
case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
if( (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() ))
{
aScale.TimeIncrement.TimeResolution.clear();
bSetScale = true;
}
break;
case SCHATTR_AXIS_TIME_RESOLUTION:
// only if auto is false
if( ! (static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_TIME_RESOLUTION )).GetValue() ))
2003-10-06 08:58:36 +00:00
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
2010-11-30 01:45:03 +01:00
if( aScale.TimeIncrement.TimeResolution != aValue )
2003-10-06 08:58:36 +00:00
{
2010-11-30 01:45:03 +01:00
aScale.TimeIncrement.TimeResolution = aValue;
bSetScale = true;
2003-10-06 08:58:36 +00:00
}
}
break;
2010-11-30 01:45:03 +01:00
2003-10-06 08:58:36 +00:00
case SCHATTR_AXIS_AUTO_ORIGIN:
{
if( (static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue() ))
2003-10-06 08:58:36 +00:00
{
aScale.Origin.clear();
bSetScale = true;
2003-10-06 08:58:36 +00:00
}
}
break;
case SCHATTR_AXIS_ORIGIN:
{
// only if auto is false
if( ! (static_cast< const SfxBoolItem & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( SCHATTR_AXIS_AUTO_ORIGIN )).GetValue() ))
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
if( aScale.Origin != aValue )
2003-10-06 08:58:36 +00:00
{
aScale.Origin = aValue;
bSetScale = true;
2008-12-12 12:17:17 +00:00
if( !AxisHelper::isAxisPositioningEnabled() )
{
//keep old and new settings for axis positioning in sync somehow
Reference< chart2::XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
sal_Int32 nDimensionIndex=0;
sal_Int32 nAxisIndex=0;
if( AxisHelper::getIndicesForAxis( m_xAxis, xCooSys, nDimensionIndex, nAxisIndex ) && nAxisIndex==0 )
{
Reference< beans::XPropertySet > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ), uno::UNO_QUERY );
if( xCrossingMainAxis.is() )
{
double fValue = 0.0;
if( aValue >>= fValue )
{
xCrossingMainAxis->setPropertyValue( "CrossoverPosition" , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE ));
xCrossingMainAxis->setPropertyValue( "CrossoverValue" , uno::makeAny( fValue ));
2008-12-12 12:17:17 +00:00
}
else
xCrossingMainAxis->setPropertyValue( "CrossoverPosition" , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START ));
2008-12-12 12:17:17 +00:00
}
}
}
2003-10-06 08:58:36 +00:00
}
}
}
break;
2008-12-12 12:17:17 +00:00
case SCHATTR_AXIS_POSITION:
{
::com::sun::star::chart::ChartAxisPosition eAxisPos =
(::com::sun::star::chart::ChartAxisPosition)
static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
::com::sun::star::chart::ChartAxisPosition eOldAxisPos( ::com::sun::star::chart::ChartAxisPosition_ZERO );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eOldAxisPos );
2008-12-12 12:17:17 +00:00
if( !bPropExisted || ( eOldAxisPos != eAxisPos ))
{
GetPropertySet()->setPropertyValue( "CrossoverPosition" , uno::makeAny( eAxisPos ));
2008-12-12 12:17:17 +00:00
bChangedOtherwise = true;
//move the parallel axes to the other side if necessary
if( eAxisPos==::com::sun::star::chart::ChartAxisPosition_START || eAxisPos==::com::sun::star::chart::ChartAxisPosition_END )
{
Reference< beans::XPropertySet > xParallelAxis( AxisHelper::getParallelAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ), uno::UNO_QUERY );
if( xParallelAxis.is() )
{
::com::sun::star::chart::ChartAxisPosition eOtherPos;
if( xParallelAxis->getPropertyValue( "CrossoverPosition" ) >>= eOtherPos )
2008-12-12 12:17:17 +00:00
{
if( eOtherPos == eAxisPos )
{
::com::sun::star::chart::ChartAxisPosition eOppositePos =
(eAxisPos==::com::sun::star::chart::ChartAxisPosition_START)
? ::com::sun::star::chart::ChartAxisPosition_END
: ::com::sun::star::chart::ChartAxisPosition_START;
xParallelAxis->setPropertyValue( "CrossoverPosition" , uno::makeAny( eOppositePos ));
2008-12-12 12:17:17 +00:00
}
}
}
}
}
}
break;
case SCHATTR_AXIS_POSITION_VALUE:
{
double fValue = static_cast< const SvxDoubleItem & >( rItemSet.Get( nWhichId )).GetValue();
double fOldValue = 0.0;
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "CrossoverValue" ) >>= fOldValue );
2008-12-12 12:17:17 +00:00
if( !bPropExisted || ( fOldValue != fValue ))
{
GetPropertySet()->setPropertyValue( "CrossoverValue" , uno::makeAny( fValue ));
2008-12-12 12:17:17 +00:00
bChangedOtherwise = true;
//keep old and new settings for axis positioning in sync somehow
{
Reference< chart2::XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
sal_Int32 nDimensionIndex=0;
sal_Int32 nAxisIndex=0;
if( AxisHelper::getIndicesForAxis( m_xAxis, xCooSys, nDimensionIndex, nAxisIndex ) && nAxisIndex==0 && nDimensionIndex==0 )
{
Reference< chart2::XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ) );
if( xCrossingMainAxis.is() )
{
ScaleData aCrossingScale( xCrossingMainAxis->getScaleData() );
aCrossingScale.Origin = uno::makeAny(fValue);
xCrossingMainAxis->setScaleData(aCrossingScale);
}
}
}
}
}
break;
case SCHATTR_AXIS_LABEL_POSITION:
{
::com::sun::star::chart::ChartAxisLabelPosition ePos =
(::com::sun::star::chart::ChartAxisLabelPosition)
static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
::com::sun::star::chart::ChartAxisLabelPosition eOldPos( ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= eOldPos );
2008-12-12 12:17:17 +00:00
if( !bPropExisted || ( eOldPos != ePos ))
{
GetPropertySet()->setPropertyValue( "LabelPosition" , uno::makeAny( ePos ));
2008-12-12 12:17:17 +00:00
bChangedOtherwise = true;
//move the parallel axes to the other side if necessary
if( ePos==::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START || ePos==::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END )
{
Reference< beans::XPropertySet > xParallelAxis( AxisHelper::getParallelAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ), uno::UNO_QUERY );
if( xParallelAxis.is() )
{
::com::sun::star::chart::ChartAxisLabelPosition eOtherPos;
if( xParallelAxis->getPropertyValue( "LabelPosition" ) >>= eOtherPos )
2008-12-12 12:17:17 +00:00
{
if( eOtherPos == ePos )
{
::com::sun::star::chart::ChartAxisLabelPosition eOppositePos =
(ePos==::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START)
? ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END
: ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START;
xParallelAxis->setPropertyValue( "LabelPosition" , uno::makeAny( eOppositePos ));
2008-12-12 12:17:17 +00:00
}
}
}
}
}
}
break;
case SCHATTR_AXIS_MARK_POSITION:
{
::com::sun::star::chart::ChartAxisMarkPosition ePos =
(::com::sun::star::chart::ChartAxisMarkPosition)
static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
::com::sun::star::chart::ChartAxisMarkPosition eOldPos( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= eOldPos );
2008-12-12 12:17:17 +00:00
if( !bPropExisted || ( eOldPos != ePos ))
{
GetPropertySet()->setPropertyValue( "MarkPosition" , uno::makeAny( ePos ));
2008-12-12 12:17:17 +00:00
bChangedOtherwise = true;
}
}
break;
2003-10-06 08:58:36 +00:00
case SCHATTR_TEXT_DEGREES:
{
// convert int to double (divided by 100)
double fVal = static_cast< double >(
static_cast< const SfxInt32Item & >(
2003-10-06 08:58:36 +00:00
rItemSet.Get( nWhichId )).GetValue()) / 100.0;
double fOldVal = 0.0;
bool bPropExisted =
( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldVal );
2003-10-06 08:58:36 +00:00
if( ! bPropExisted ||
( bPropExisted && fOldVal != fVal ))
{
GetPropertySet()->setPropertyValue( "TextRotation" , uno::makeAny( fVal ));
2003-10-06 08:58:36 +00:00
bChangedOtherwise = true;
}
}
break;
case SID_ATTR_NUMBERFORMAT_VALUE:
{
if( m_pExplicitScale )
2003-10-06 08:58:36 +00:00
{
bool bUseSourceFormat =
(static_cast< const SfxBoolItem & >(
rItemSet.Get( SID_ATTR_NUMBERFORMAT_SOURCE )).GetValue() );
2003-10-06 08:58:36 +00:00
if( ! bUseSourceFormat )
2003-10-06 08:58:36 +00:00
{
sal_Int32 nFmt = static_cast< sal_Int32 >(
static_cast< const SfxUInt32Item & >(
rItemSet.Get( nWhichId )).GetValue());
aValue = uno::makeAny(nFmt);
if( GetPropertySet()->getPropertyValue( "NumberFormat" ) != aValue )
{
GetPropertySet()->setPropertyValue( "NumberFormat" , aValue );
bChangedOtherwise = true;
}
2003-10-06 08:58:36 +00:00
}
}
}
break;
case SID_ATTR_NUMBERFORMAT_SOURCE:
{
bool bUseSourceFormat =
(static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue() );
bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat").hasValue());
bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet);
if( bChangedOtherwise )
2003-10-06 08:58:36 +00:00
{
if( ! bUseSourceFormat )
{
SfxItemState aState = rItemSet.GetItemState( SID_ATTR_NUMBERFORMAT_VALUE );
if( aState == SFX_ITEM_SET )
{
sal_Int32 nFormatKey = static_cast< sal_Int32 >(
static_cast< const SfxUInt32Item & >(
rItemSet.Get( SID_ATTR_NUMBERFORMAT_VALUE )).GetValue());
aValue <<= nFormatKey;
}
else
{
Reference< chart2::XCoordinateSystem > xCooSys(
AxisHelper::getCoordinateSystemOfAxis(
m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
m_xAxis, xCooSys, Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY ) );
aValue <<= nFormatKey;
}
}
// else set a void Any
GetPropertySet()->setPropertyValue( "NumberFormat" , aValue );
2003-10-06 08:58:36 +00:00
}
}
break;
case SCHATTR_AXISTYPE:
2010-11-30 01:45:03 +01:00
{
sal_Int32 nNewAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();//::com::sun::star::chart2::AxisType
aScale.AxisType = nNewAxisType;
bSetScale = true;
}
break;
case SCHATTR_AXIS_AUTO_DATEAXIS:
{
bool bNewValue = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
bool bOldValue = aScale.AutoDateAxis;
if( bOldValue != bNewValue )
{
aScale.AutoDateAxis = bNewValue;
bSetScale = true;
}
}
break;
2003-10-06 08:58:36 +00:00
}
if( bSetScale )
m_xAxis->setScaleData( aScale );
return (bSetScale || bChangedOtherwise);
2003-10-06 08:58:36 +00:00
}
} // namespace wrapper
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */