small chart2 cleanups

This commit is contained in:
René Kjellerup 2010-10-16 21:14:56 +01:00 committed by Michael Meeks
parent 35a5521b07
commit 8b60c1e935
2 changed files with 12 additions and 23 deletions

View file

@ -29,15 +29,11 @@
#include <sfx2/sfxdefs.hxx>
/*
// header for SID_OBJ1_START
#include <sfx2/sfxsids.hrc>
*/
// ============================================================
// SCHATTR
// ============================================================
// can't this be changed to 0?
#define SCHATTR_START 1
#define SCHATTR_DATADESCR_START SCHATTR_START
@ -56,8 +52,7 @@
#define SCHATTR_LEGEND_END SCHATTR_LEGEND_POS
#define SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1)
// #define SCHATTR_TEXT_ORIENT SCHATTR_TEXT_START
// name changed:
// name changed, was SCHATTR_TEXT_ORIENT:
#define SCHATTR_TEXT_STACKED SCHATTR_TEXT_START
#define SCHATTR_TEXT_ORDER (SCHATTR_TEXT_START + 1)
#define SCHATTR_TEXT_END SCHATTR_TEXT_ORDER
@ -124,7 +119,7 @@
#define SCHATTR_TEXT2_START ( SCHATTR_STAT_END + 1)
#define SCHATTR_TEXT_DEGREES ( SCHATTR_TEXT2_START )
#define SCHATTR_TEXT_OVERLAP (SCHATTR_TEXT2_START +1)
#define SCHATTR_TEXT_OVERLAP ( SCHATTR_TEXT2_START +1 )
#define SCHATTR_TEXT2_END ( SCHATTR_TEXT_OVERLAP )
// --------------------------------------------------------
@ -153,7 +148,7 @@
// --------------------------------------------------------------------------
#define SCHATTR_AXIS (SCHATTR_STYLE_END + 1)// see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
//Ummappen:
//Re-mapped:
#define SCHATTR_AXIS_START (SCHATTR_AXIS + 1)
#define SCHATTR_AXIS_AUTO_MIN SCHATTR_AXIS_START
#define SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 1)
@ -167,7 +162,7 @@
#define SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 8)
#define SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 9)
#define SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 10)
//Neu:
//New:
#define SCHATTR_AXIS_TICKS (SCHATTR_AXIS_START + 11)
#define SCHATTR_AXIS_NUMFMT (SCHATTR_AXIS_START + 12)
#define SCHATTR_AXIS_NUMFMTPERCENT (SCHATTR_AXIS_START + 13)
@ -241,8 +236,8 @@
#define CHART_AXIS_Z 2
// values for SCHATTR_STYLE_SHAPE items
#define CHART_SHAPE3D_IGNORE -2 //intern! (GetChartShapeStyle()!)
#define CHART_SHAPE3D_ANY -1 //undefinierter Typ (GetChartShapeStyle()!)
#define CHART_SHAPE3D_IGNORE -2 //internal! (GetChartShapeStyle()!)
#define CHART_SHAPE3D_ANY -1 //undefined type (GetChartShapeStyle()!)
#define CHART_SHAPE3D_SQUARE 0
#define CHART_SHAPE3D_CYLINDER 1
#define CHART_SHAPE3D_CONE 2

View file

@ -31,7 +31,6 @@
#include "ChartItemPool.hxx"
#include "macros.hxx"
#include "chartview/ChartSfxItemIds.hxx"
#include <svx/chrtitem.hxx>
#include <svl/intitem.hxx>
@ -51,7 +50,6 @@ namespace chart
ChartItemPool::ChartItemPool():
SfxItemPool( String( RTL_CONSTASCII_USTRINGPARAM( "ChartItemPool" )), SCHATTR_START, SCHATTR_END, NULL, NULL )
{
// OSL_TRACE( "SCH: CTOR: ChartItemPool" );
/**************************************************************************
* PoolDefaults
**************************************************************************/
@ -68,7 +66,6 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
ppPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SvxChartLegendPosItem( CHLEGEND_RIGHT, SCHATTR_LEGEND_POS );
// ppPoolDefaults[SCHATTR_TEXT_ORIENT - SCHATTR_START] = new SvxChartTextOrientItem;
ppPoolDefaults[SCHATTR_TEXT_STACKED - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_STACKED,FALSE);
ppPoolDefaults[SCHATTR_TEXT_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_TEXT_ORDER);
@ -145,7 +142,6 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN);
ppPoolDefaults[SCHATTR_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN);
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP);
// ppPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_HELP);
// type changed from double to sal_Int32
ppPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_STEP_HELP,0);
ppPoolDefaults[SCHATTR_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LOGARITHM);
@ -201,11 +197,11 @@ ChartItemPool::ChartItemPool():
**************************************************************************/
pItemInfos = new SfxItemInfo[SCHATTR_END - SCHATTR_START + 1];
USHORT i;
for( i = SCHATTR_START; i <= SCHATTR_END; i++ )
const USHORT nMax = SCHATTR_END - SCHATTR_START + 1;
for( USHORT i = 0; i < nMax; i++ )
{
pItemInfos[i - SCHATTR_START]._nSID = 0;
pItemInfos[i - SCHATTR_START]._nFlags = SFX_ITEM_POOLABLE;
pItemInfos[i]._nSID = 0;
pItemInfos[i]._nFlags = SFX_ITEM_POOLABLE;
}
// slot ids differing from which ids
@ -220,18 +216,16 @@ ChartItemPool::ChartItemPool():
ChartItemPool::ChartItemPool(const ChartItemPool& rPool):
SfxItemPool(rPool)
{
// OSL_TRACE( "SCH: CTOR: ChartItemPool" );
}
ChartItemPool::~ChartItemPool()
{
// OSL_TRACE( "SCH: DTOR: ChartItemPool" );
Delete();
delete[] pItemInfos;
const USHORT nMax = SCHATTR_END - SCHATTR_START + 1;
for( USHORT i=0; i<nMax; ++i )
for( USHORT i = 0; i < nMax; i++ )
{
SetRefCount(*ppPoolDefaults[i], 0);
delete ppPoolDefaults[i];