Files
libreoffice/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
Kurt Zenker a3acf41195 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

628 lines
26 KiB
C++

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dlg_ObjectProperties.cxx,v $
* $Revision: 1.23.42.3 $
*
* This file is part of OpenOffice.org.
*
* 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.
*
* 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).
*
* 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.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#ifndef _ZFORLIST_HXX
#ifndef _ZFORLIST_DECLARE_TABLE
#define _ZFORLIST_DECLARE_TABLE
#endif
#include <svtools/zforlist.hxx>
#endif
#include "dlg_ObjectProperties.hxx"
#include "ResourceIds.hrc"
#include "Strings.hrc"
#include "TabPages.hrc"
#include "tp_AxisLabel.hxx"
#include "tp_DataLabel.hxx"
#include "tp_LegendPosition.hxx"
#include "tp_PointGeometry.hxx"
#include "tp_Scale.hxx"
#include "tp_AxisPositions.hxx"
#include "tp_ErrorBars.hxx"
#include "tp_Trendline.hxx"
#include "tp_SeriesToAxis.hxx"
#include "tp_TitleRotation.hxx"
#include "tp_PolarOptions.hxx"
#include "ResId.hxx"
#include "ViewElementListProvider.hxx"
#include "macros.hxx"
#include "ChartModelHelper.hxx"
#include "ChartTypeHelper.hxx"
#include "ObjectNameProvider.hxx"
#include "DiagramHelper.hxx"
#include "chartview/NumberFormatterWrapper.hxx"
#include "AxisIndexDefines.hxx"
#include "AxisHelper.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <svtools/intitem.hxx>
#include <svtools/languageoptions.hxx>
#include <svx/svxids.hrc>
#include <svx/drawitem.hxx>
#include <svx/ofaitem.hxx>
#include <svx/svxgrahicitem.hxx>
#include <svx/dialogs.hrc>
#include <svx/flstitem.hxx>
#include <svx/tabline.hxx>
#include <svx/flagsdef.hxx>
#include <svx/numinf.hxx>
#include <svtools/cjkoptions.hxx>
//.............................................................................
namespace chart
{
//.............................................................................
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const rtl::OUString& rObjectCID )
: m_aObjectCID( rObjectCID )
, m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) )
, m_bAffectsMultipleObjects(false)
, m_aLocalizedName()
, m_bHasGeometryProperties(false)
, m_bHasStatisticProperties(false)
, m_bProvidesSecondaryYAxis(false)
, m_bProvidesOverlapAndGapWidth(false)
, m_bProvidesBarConnectors(false)
, m_bHasAreaProperties(false)
, m_bHasSymbolProperties(false)
, m_bHasNumberProperties(false)
, m_bProvidesStartingAngle(false)
, m_bProvidesMissingValueTreatments(false)
, m_bHasScaleProperties(false)
, m_bCanAxisLabelsBeStaggered(false)
, m_bSupportingAxisPositioning(false)
, m_bShowAxisOrigin(false)
, m_bIsCrossingAxisIsCategoryAxis(false)
, m_aCategories()
, m_xChartDocument( 0 )
{
rtl::OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
m_bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS"));
}
ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
{
}
ObjectType ObjectPropertiesDialogParameter::getObjectType() const
{
return m_eObjectType;
}
rtl::OUString ObjectPropertiesDialogParameter::getLocalizedName() const
{
return m_aLocalizedName;
}
void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel >& xChartModel )
{
m_xChartDocument.set( xChartModel, uno::UNO_QUERY );
uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
bool bHasSeriesProperties = (OBJECTTYPE_DATA_SERIES==m_eObjectType || OBJECTTYPE_DATA_LABELS==m_eObjectType);
bool bHasDataPointproperties = (OBJECTTYPE_DATA_POINT==m_eObjectType);
if( bHasSeriesProperties || bHasDataPointproperties )
{
m_bHasGeometryProperties = ChartTypeHelper::isSupportingGeometryProperties( xChartType, nDimensionCount );
m_bHasAreaProperties = ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount );
m_bHasSymbolProperties = ChartTypeHelper::isSupportingSymbolProperties( xChartType, nDimensionCount );
if( bHasSeriesProperties )
{
m_bHasStatisticProperties = ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount );
m_bProvidesSecondaryYAxis = ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount, 1 );
m_bProvidesOverlapAndGapWidth = ChartTypeHelper::isSupportingOverlapAndGapWidthProperties( xChartType, nDimensionCount );
m_bProvidesBarConnectors = ChartTypeHelper::isSupportingBarConnectors( xChartType, nDimensionCount );
m_bProvidesStartingAngle = ChartTypeHelper::isSupportingStartingAngle( xChartType );
m_bProvidesMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType )
.getLength() ? true : false;
}
}
if( OBJECTTYPE_DATA_ERRORS == m_eObjectType )
m_bHasStatisticProperties = true;
if( OBJECTTYPE_AXIS == m_eObjectType )
{
//show scale properties only for a single axis not for multiselection
m_bHasScaleProperties = !m_bAffectsMultipleObjects;
if( m_bHasScaleProperties )
{
uno::Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel ) );
if( xAxis.is() )
{
//no scale page for series axis
ScaleData aData( xAxis->getScaleData() );
if( chart2::AxisType::SERIES == aData.AxisType )
m_bHasScaleProperties = false;
if( chart2::AxisType::REALNUMBER == aData.AxisType || chart2::AxisType::PERCENT == aData.AxisType )
m_bHasNumberProperties = true;
sal_Int32 nCooSysIndex=0;
sal_Int32 nDimensionIndex=0;
sal_Int32 nAxisIndex=0;
if( AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex ) )
{
xChartType = AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisIndex( xDiagram, nAxisIndex );
//show positioning controls only if they make sense
m_bSupportingAxisPositioning = ChartTypeHelper::isSupportingAxisPositioning( xChartType, nDimensionCount, nDimensionIndex );
//show axis origin only for secondary y axis
if( 1==nDimensionIndex && 1==nAxisIndex && ChartTypeHelper::isSupportingBaseValue( xChartType ) )
m_bShowAxisOrigin = true;
}
//is the crossin main axis a category axes?:
uno::Reference< XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, xDiagram ) );
uno::Reference< XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, xCooSys ) );
if( xCrossingMainAxis.is() )
{
ScaleData aScale( xCrossingMainAxis->getScaleData() );
m_bIsCrossingAxisIsCategoryAxis = ( chart2::AxisType::CATEGORY == aScale.AxisType );
if( m_bIsCrossingAxisIsCategoryAxis )
m_aCategories = DiagramHelper::generateAutomaticCategories( Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY) );
}
}
}
//no staggering of labels for 3D axis
m_bCanAxisLabelsBeStaggered = nDimensionCount==2;
}
//create gui name for this object
{
if( !m_bAffectsMultipleObjects && OBJECTTYPE_AXIS == m_eObjectType )
{
m_aLocalizedName = ObjectNameProvider::getAxisName( m_aObjectCID, xChartModel );
}
else
{
ObjectType eType = m_eObjectType;
if( OBJECTTYPE_DATA_LABEL == eType )
eType = OBJECTTYPE_DATA_POINT;
else if( OBJECTTYPE_DATA_LABELS == eType )
eType = OBJECTTYPE_DATA_SERIES;
m_aLocalizedName = ObjectNameProvider::getName(eType,m_bAffectsMultipleObjects);
}
}
}
bool ObjectPropertiesDialogParameter::HasGeometryProperties() const
{
return m_bHasGeometryProperties;
}
bool ObjectPropertiesDialogParameter::HasStatisticProperties() const
{
return m_bHasStatisticProperties;
}
bool ObjectPropertiesDialogParameter::ProvidesSecondaryYAxis() const
{
return m_bProvidesSecondaryYAxis;
}
bool ObjectPropertiesDialogParameter::ProvidesOverlapAndGapWidth() const
{
return m_bProvidesOverlapAndGapWidth;
}
bool ObjectPropertiesDialogParameter::ProvidesBarConnectors() const
{
return m_bProvidesBarConnectors;
}
bool ObjectPropertiesDialogParameter::HasAreaProperties() const
{
return m_bHasAreaProperties;
}
bool ObjectPropertiesDialogParameter::HasSymbolProperties() const
{
return m_bHasSymbolProperties;
}
bool ObjectPropertiesDialogParameter::HasScaleProperties() const
{
return m_bHasScaleProperties;
}
bool ObjectPropertiesDialogParameter::CanAxisLabelsBeStaggered() const
{
return m_bCanAxisLabelsBeStaggered;
}
bool ObjectPropertiesDialogParameter::ShowAxisOrigin() const
{
return m_bShowAxisOrigin;
}
bool ObjectPropertiesDialogParameter::IsSupportingAxisPositioning() const
{
return m_bSupportingAxisPositioning;
}
bool ObjectPropertiesDialogParameter::IsCrossingAxisIsCategoryAxis() const
{
return m_bIsCrossingAxisIsCategoryAxis;
}
const uno::Sequence< rtl::OUString >& ObjectPropertiesDialogParameter::GetCategories() const
{
return m_aCategories;
}
bool ObjectPropertiesDialogParameter::HasNumberProperties() const
{
return m_bHasNumberProperties;
}
bool ObjectPropertiesDialogParameter::ProvidesStartingAngle() const
{
return m_bProvidesStartingAngle;
}
bool ObjectPropertiesDialogParameter::ProvidesMissingValueTreatments() const
{
return m_bProvidesMissingValueTreatments;
}
uno::Reference< chart2::XChartDocument > ObjectPropertiesDialogParameter::getDocument() const
{
return m_xChartDocument;
}
//const USHORT nNoArrowDlg = 1100;
const USHORT nNoArrowNoShadowDlg = 1101;
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
void SchAttribTabDlg::setSymbolInformation( SfxItemSet* pSymbolShapeProperties,
Graphic* pAutoSymbolGraphic )
{
m_pSymbolShapeProperties = pSymbolShapeProperties;
m_pAutoSymbolGraphic = pAutoSymbolGraphic;
}
void SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
{
m_fAxisMinorStepWidthForErrorBarDecimals = fMinorStepWidth;
}
SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
const SfxItemSet* pAttr,
const ObjectPropertiesDialogParameter* pDialogParameter,
const ViewElementListProvider* pViewElementListProvider,
const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
)
: SfxTabDialog(pParent, SchResId(DLG_OBJECT_PROPERTIES), pAttr)
, eObjectType(pDialogParameter->getObjectType())
, nDlgType(nNoArrowNoShadowDlg)
, nPageType(0)
, m_pParameter( pDialogParameter )
, m_pViewElementListProvider( pViewElementListProvider )
, m_pNumberFormatter(0)
, m_pSymbolShapeProperties(NULL)
, m_pAutoSymbolGraphic(NULL)
, m_fAxisMinorStepWidthForErrorBarDecimals(0.1)
, m_bOKPressed(false)
{
FreeResource();
NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
m_pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
this->SetText( pDialogParameter->getLocalizedName() );
SvtCJKOptions aCJKOptions;
switch (eObjectType)
{
case OBJECTTYPE_TITLE:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(TP_ALIGNMENT, String(SchResId(STR_PAGE_ALIGNMENT)), SchAlignmentTabPage::Create, NULL);
if( aCJKOptions.IsAsianTypographyEnabled() )
AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
case OBJECTTYPE_LEGEND:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(TP_LEGEND_POS, String(SchResId(STR_PAGE_POSITION)), SchLegendPosTabPage::Create, NULL);
if( aCJKOptions.IsAsianTypographyEnabled() )
AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
case OBJECTTYPE_DATA_SERIES:
case OBJECTTYPE_DATA_POINT:
case OBJECTTYPE_DATA_LABEL:
case OBJECTTYPE_DATA_LABELS:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE )));
if(m_pParameter->HasAreaProperties())
{
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
}
AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
if( aCJKOptions.IsAsianTypographyEnabled() )
AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
AddTabPage(TP_DATA_DESCR, String(SchResId(STR_OBJECT_DATALABELS)), DataLabelsTabPage::Create, NULL);
// if( m_pParameter->HasStatisticProperties() )
// AddTabPage(TP_YERRORBAR, String(SchResId(STR_PAGE_YERROR_BARS)), ErrorBarsTabPage::Create, NULL);
if( m_pParameter->HasGeometryProperties() )
AddTabPage(TP_LAYOUT, String(SchResId(STR_PAGE_LAYOUT)),SchLayoutTabPage::Create, NULL);
if( m_pParameter->ProvidesSecondaryYAxis() || m_pParameter->ProvidesOverlapAndGapWidth() || m_pParameter->ProvidesMissingValueTreatments() )
AddTabPage(TP_OPTIONS, String(SchResId(STR_PAGE_OPTIONS)),SchOptionTabPage::Create, NULL);
if( m_pParameter->ProvidesStartingAngle())
AddTabPage(TP_POLAROPTIONS, String(SchResId(STR_PAGE_OPTIONS)),PolarOptionsTabPage::Create, NULL);
break;
case OBJECTTYPE_AXIS:
{
if( m_pParameter->HasScaleProperties() )
AddTabPage(TP_SCALE, String(SchResId(STR_PAGE_SCALE)), ScaleTabPage::Create, NULL);
if( m_pParameter->HasScaleProperties() )//no positioning page for z axes so far as the tickmarks are not shown so far
AddTabPage(TP_AXIS_POSITIONS, String(SchResId(STR_PAGE_POSITIONING)), AxisPositionsTabPage::Create, NULL);
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE)));
AddTabPage(TP_AXIS_LABEL, String(SchResId(STR_OBJECT_LABEL)), SchAxisLabelTabPage::Create, NULL);
if( m_pParameter->HasNumberProperties() )
AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS)));
AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
if( aCJKOptions.IsAsianTypographyEnabled() )
AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
}
case OBJECTTYPE_DATA_ERRORS:
case OBJECTTYPE_DATA_ERRORS_X:
case OBJECTTYPE_DATA_ERRORS_Y:
case OBJECTTYPE_DATA_ERRORS_Z:
AddTabPage(TP_YERRORBAR, String(SchResId(STR_PAGE_YERROR_BARS)), ErrorBarsTabPage::Create, NULL);
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE)));
break;
case OBJECTTYPE_GRID:
case OBJECTTYPE_SUBGRID:
case OBJECTTYPE_DATA_AVERAGE_LINE:
case OBJECTTYPE_DATA_STOCK_RANGE:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE)));
break;
case OBJECTTYPE_DATA_CURVE:
AddTabPage(TP_TRENDLINE, String(SchResId(STR_PAGE_TRENDLINE_TYPE)), TrendlineTabPage::Create, NULL);
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE)));
break;
case OBJECTTYPE_DATA_STOCK_LOSS:
case OBJECTTYPE_DATA_STOCK_GAIN:
case OBJECTTYPE_PAGE:
case OBJECTTYPE_DIAGRAM_FLOOR:
case OBJECTTYPE_DIAGRAM_WALL:
case OBJECTTYPE_DIAGRAM:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
break;
case OBJECTTYPE_LEGEND_ENTRY:
case OBJECTTYPE_AXIS_UNITLABEL:
case OBJECTTYPE_UNKNOWN:
// nothing
break;
case OBJECTTYPE_DATA_CURVE_EQUATION:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS)));
if( SvtLanguageOptions().IsCTLFontEnabled() )
/* When rotation is supported for equation text boxes, use
SchAlignmentTabPage::Create here. The special
SchAlignmentTabPage::CreateWithoutRotation can be deleted. */
AddTabPage(TP_ALIGNMENT, String(SchResId(STR_PAGE_ALIGNMENT)), SchAlignmentTabPage::CreateWithoutRotation, NULL);
break;
}
// used to find out if user left the dialog with OK. When OK is pressed but
// no changes were done, Cancel is returned by the SfxTabDialog. See method
// DialogWasClosedWithOK.
m_aOriginalOKClickHdl = GetOKButton().GetClickHdl();
GetOKButton().SetClickHdl( LINK( this, SchAttribTabDlg, OKPressed ));
}
SchAttribTabDlg::~SchAttribTabDlg()
{
delete m_pSymbolShapeProperties;
delete m_pAutoSymbolGraphic;
}
void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch (nId)
{
case TP_LAYOUT:
break;
case RID_SVXPAGE_LINE:
aSet.Put (SvxColorTableItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
aSet.Put (SvxDashListItem(m_pViewElementListProvider->GetDashList(),SID_DASH_LIST));
aSet.Put (SvxLineEndListItem(m_pViewElementListProvider->GetLineEndList(),SID_LINEEND_LIST));
aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
if( m_pParameter->HasSymbolProperties() )
{
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
if( m_pSymbolShapeProperties )
aSet.Put(SfxTabDialogItem(SID_ATTR_SET,*m_pSymbolShapeProperties));
if( m_pAutoSymbolGraphic )
aSet.Put(SvxGraphicItem(SID_GRAPHIC,*m_pAutoSymbolGraphic));
}
rPage.PageCreated(aSet);
//rPage.ActivatePage(*GetInputSetImpl()); //what for?
break;
case RID_SVXPAGE_AREA:
aSet.Put(SvxColorTableItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
aSet.Put(SvxGradientListItem(m_pViewElementListProvider->GetGradientList(),SID_GRADIENT_LIST));
aSet.Put(SvxHatchListItem(m_pViewElementListProvider->GetHatchList(),SID_HATCH_LIST));
aSet.Put(SvxBitmapListItem(m_pViewElementListProvider->GetBitmapList(),SID_BITMAP_LIST));
aSet.Put(SfxUInt16Item(SID_PAGE_TYPE,nPageType));
aSet.Put(SfxUInt16Item(SID_DLG_TYPE,nDlgType));
rPage.PageCreated(aSet);
//rPage.ActivatePage(*GetInputSetImpl()); //what for?
break;
case RID_SVXPAGE_TRANSPARENCE:
aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
rPage.PageCreated(aSet);
break;
case RID_SVXPAGE_CHAR_NAME:
//CHINA001 ((SvxCharNamePage&)rPage).
//CHINA001 SetFontList(SvxFontListItem(m_pViewElementListProvider->getFontList()));
aSet.Put (SvxFontListItem(m_pViewElementListProvider->getFontList(), SID_ATTR_CHAR_FONTLIST)); //CHINA001
rPage.PageCreated(aSet); //CHINA001
break;
case RID_SVXPAGE_CHAR_EFFECTS:
//CHINA001 ((SvxCharEffectsPage&) rPage).DisableControls( DISABLE_CASEMAP );
aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); //CHINA001
rPage.PageCreated(aSet);
break;
case TP_AXIS_LABEL:
{
bool bShowStaggeringControls = m_pParameter->CanAxisLabelsBeStaggered();
((SchAxisLabelTabPage&)rPage).ShowStaggeringControls( bShowStaggeringControls );
break;
}
case TP_ALIGNMENT:
break;
case TP_AXIS_POSITIONS:
{
AxisPositionsTabPage* pPage = dynamic_cast< AxisPositionsTabPage* >( &rPage );
if(pPage)
{
pPage->SetNumFormatter( m_pNumberFormatter );
if( m_pParameter->IsCrossingAxisIsCategoryAxis() )
{
pPage->SetCrossingAxisIsCategoryAxis( m_pParameter->IsCrossingAxisIsCategoryAxis() );
pPage->SetCategories( m_pParameter->GetCategories() );
}
pPage->SupportAxisPositioning( m_pParameter->IsSupportingAxisPositioning() );
}
}
break;
case TP_SCALE:
{
ScaleTabPage* pScaleTabPage = dynamic_cast< ScaleTabPage* >( &rPage );
if(pScaleTabPage)
{
pScaleTabPage->SetNumFormatter( m_pNumberFormatter );
pScaleTabPage->ShowAxisOrigin( m_pParameter->ShowAxisOrigin() );
}
}
break;
case TP_DATA_DESCR:
{
DataLabelsTabPage* pLabelPage = dynamic_cast< DataLabelsTabPage* >( &rPage );
if( pLabelPage )
pLabelPage->SetNumberFormatter( m_pNumberFormatter );
}
break;
case RID_SVXPAGE_NUMBERFORMAT:
aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const USHORT)SID_ATTR_NUMBERFORMAT_INFO));
rPage.PageCreated(aSet);
break;
case TP_YERRORBAR:
{
ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( &rPage );
OSL_ASSERT( pTabPage );
if( pTabPage )
{
pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( m_fAxisMinorStepWidthForErrorBarDecimals );
pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_Y );
pTabPage->SetChartDocumentForRangeChoosing( m_pParameter->getDocument());
}
break;
}
case TP_OPTIONS:
{
SchOptionTabPage* pTabPage = dynamic_cast< SchOptionTabPage* >( &rPage );
if( pTabPage && m_pParameter )
pTabPage->Init( m_pParameter->ProvidesSecondaryYAxis(), m_pParameter->ProvidesOverlapAndGapWidth(),
m_pParameter->ProvidesBarConnectors() );
break;
}
}
}
IMPL_LINK( SchAttribTabDlg, OKPressed, void * , EMPTYARG )
{
m_bOKPressed = true;
return m_aOriginalOKClickHdl.Call( this );
}
bool SchAttribTabDlg::DialogWasClosedWithOK() const
{
return m_bOKPressed;
}
//.............................................................................
} //namespace chart
//.............................................................................