summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-09-18 14:06:01 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-09-18 14:06:01 +0000
commit7983b2e67febeeef3e5043f606c0e234bb3bff05 (patch)
tree1f18b84545f42581c08285704eda31286af85a46 /chart2/source
parentbcc2ad7ceb33a6771711c422f6cfb489ea1a702e (diff)
INTEGRATION: CWS chart11 (1.15.2); FILE MERGED
2007/07/31 12:56:45 bm 1.15.2.1: #i80084# avoid usage of map operator[] with enums as keys, simplify initialization of default property values
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/model/main/Legend.cxx26
-rw-r--r--chart2/source/model/template/LineChartTypeTemplate.cxx17
2 files changed, 13 insertions, 30 deletions
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 20f478b5e066..178f291e0181 100644
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: Legend.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: rt $ $Date: 2007-07-25 08:51:04 $
+ * last change: $Author: vg $ $Date: 2007-09-18 15:02:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -132,24 +132,14 @@ void lcl_AddPropertiesToVector(
void lcl_AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LEGEND_ANCHOR_POSITION ));
- rOutMap[ PROP_LEGEND_ANCHOR_POSITION ] =
- uno::makeAny( chart2::LegendPosition_LINE_END );
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LEGEND_PREFERRED_EXPANSION ));
- rOutMap[ PROP_LEGEND_PREFERRED_EXPANSION ] =
- uno::makeAny( chart2::LegendExpansion_HIGH );
-
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LEGEND_SHOW ));
- rOutMap[ PROP_LEGEND_SHOW ] =
- uno::makeAny( sal_True );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
float fDefaultCharHeight = 8.0;
- rOutMap[ ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT ] =
- uno::makeAny( fDefaultCharHeight );
- rOutMap[ ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT ] =
- uno::makeAny( fDefaultCharHeight );
- rOutMap[ ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT ] =
- uno::makeAny( fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
}
const Sequence< Property > & lcl_GetPropertySequence()
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index 942536b6944d..3082dddbe79c 100644
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: LineChartTypeTemplate.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: rt $ $Date: 2007-07-25 08:53:53 $
+ * last change: $Author: vg $ $Date: 2007-09-18 15:06:01 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -111,19 +111,12 @@ void lcl_AddPropertiesToVector(
void lcl_AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
- rOutMap[ PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ] =
- uno::makeAny( chart2::CurveStyle_LINES );
-
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
- rOutMap[ PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ] =
- uno::makeAny( sal_Int32( 20 ) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
// todo: check whether order 3 means polygons of order 3 or 2. (see
// http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
- rOutMap[ PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ] =
- uno::makeAny( sal_Int32( 3 ) );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
}
const Sequence< Property > & lcl_GetPropertySequence()