[ooo-build-commit] patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Oct 2 09:51:04 PDT 2009
patches/dev300/apply | 12
patches/dev300/chart-axis-multi-chart-types-chart2.diff | 617 ----------------
patches/dev300/chart-axis-multi-chart-types-sc.diff | 265 ------
patches/dev300/chart-axis-multi-chart-types-xmloff.diff | 83 --
patches/dev300/cws-koheichart02-chart2.diff | 617 ++++++++++++++++
patches/dev300/cws-koheichart02-sc.diff | 274 +++++++
patches/dev300/cws-koheichart02-xmloff.diff | 83 ++
7 files changed, 980 insertions(+), 971 deletions(-)
New commits:
commit f4b0b1fd60a28796733401056dd3499f2abfe045
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Oct 2 11:21:36 2009 -0400
Backported koheichart02, and removed obsolete patches.
* patches/dev300/apply:
* patches/dev300/chart-axis-multi-chart-types-chart2.diff:
* patches/dev300/chart-axis-multi-chart-types-sc.diff:
* patches/dev300/chart-axis-multi-chart-types-xmloff.diff:
* patches/dev300/cws-koheichart02-chart2.diff:
* patches/dev300/cws-koheichart02-sc.diff:
* patches/dev300/cws-koheichart02-xmloff.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index f37f5e7..1e03c83 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -203,6 +203,12 @@ cws-calctabcolor-oox.diff, kohei
# calctabcolor cws (tab color feature by Daniel Watson)
cws-calctabcolor-oox-m58.diff, kohei
+[ CWSBackports ]
+# koheichart02 cws (supported mixed chart types in single diagram).
+cws-koheichart02-chart2.diff, kohei
+cws-koheichart02-sc.diff, kohei
+cws-koheichart02-xmloff.diff, kohei
+
[ LinuxOnly ]
# Don't stat tons of config files we don't need to read on startup
speed-configmgr.diff, i#56783, michael
@@ -871,12 +877,6 @@ calc-general-type-auto-decimal-svtools.diff, n#541973, i#46511, kohei
# LATER: I'll take care of this later. --kohei
# calc-formula-asian-phonetic.diff, i#80764, i#80765, i#80766, kohei
-# render charts with multiple chart types correctly for xls interop.
-# LATER: I'll take care of this later. --kohei
-# chart-axis-multi-chart-types-chart2.diff, n#437322, i#95934, kohei
-# chart-axis-multi-chart-types-sc.diff, n#437322, i#95934, kohei
-# chart-axis-multi-chart-types-xmloff.diff, n#437322, i#95934, kohei
-
# Place a border around the Copy source cell(s).
# LATER: 2009-09-10: This needs to be re-implemented for the 3.2 code line.
# sc-copy-source-border.diff, n#367489, jonp
diff --git a/patches/dev300/chart-axis-multi-chart-types-chart2.diff b/patches/dev300/chart-axis-multi-chart-types-chart2.diff
deleted file mode 100644
index 8ccd9cf..0000000
--- a/patches/dev300/chart-axis-multi-chart-types-chart2.diff
+++ /dev/null
@@ -1,617 +0,0 @@
-diff --git chart2/source/model/template/AreaChartType.cxx chart2/source/model/template/AreaChartType.cxx
-index db529a7..3a562f0 100644
---- chart2/source/model/template/AreaChartType.cxx
-+++ chart2/source/model/template/AreaChartType.cxx
-@@ -33,8 +33,72 @@
- #include "AreaChartType.hxx"
- #include "macros.hxx"
- #include "servicenames_charttypes.hxx"
-+#include "PropertyHelper.hxx"
-+#include "ContainerHelper.hxx"
-+
-+#include <com/sun/star/beans/PropertyAttribute.hpp>
-
- using namespace ::com::sun::star;
-+using ::com::sun::star::beans::Property;
-+using ::com::sun::star::uno::Sequence;
-+
-+namespace
-+{
-+
-+enum
-+{
-+ PROP_AREACHARTTYPE_STACKED,
-+ PROP_AREACHARTTYPE_PERCENT
-+};
-+
-+void lcl_AddPropertiesToVector(
-+ ::std::vector< Property > & rOutProperties )
-+{
-+ rOutProperties.push_back(
-+ Property( C2U( "Stacked" ),
-+ PROP_AREACHARTTYPE_STACKED,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
-+ rOutProperties.push_back(
-+ Property( C2U( "Percent" ),
-+ PROP_AREACHARTTYPE_PERCENT,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
-+}
-+
-+void lcl_AddDefaultsToMap(
-+ ::chart::tPropertyValueMap & rOutMap )
-+{
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_STACKED, false );
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_PERCENT, false );
-+}
-+
-+const Sequence< Property > & lcl_GetPropertySequence()
-+{
-+ static Sequence< Property > aPropSeq;
-+
-+ // /--
-+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-+ if( 0 == aPropSeq.getLength() )
-+ {
-+ // get properties
-+ ::std::vector< ::com::sun::star::beans::Property > aProperties;
-+ lcl_AddPropertiesToVector( aProperties );
-+
-+ // and sort them for access via bsearch
-+ ::std::sort( aProperties.begin(), aProperties.end(),
-+ ::chart::PropertyNameLess() );
-+
-+ // transfer result to static Sequence
-+ aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
-+ }
-+
-+ return aPropSeq;
-+}
-+
-+} // anonymous namespace
-
- namespace chart
- {
-@@ -65,6 +129,56 @@ uno::Reference< util::XCloneable > SAL_CALL AreaChartType::createClone()
- return CHART2_SERVICE_NAME_CHARTTYPE_AREA;
- }
-
-+// ____ OPropertySet ____
-+uno::Any AreaChartType::GetDefaultValue( sal_Int32 nHandle ) const
-+ throw(beans::UnknownPropertyException)
-+{
-+ static tPropertyValueMap aStaticDefaults;
-+
-+ // /--
-+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-+ if( 0 == aStaticDefaults.size() )
-+ {
-+ // initialize defaults
-+ lcl_AddDefaultsToMap( aStaticDefaults );
-+ }
-+
-+ tPropertyValueMap::const_iterator aFound(
-+ aStaticDefaults.find( nHandle ));
-+
-+ if( aFound == aStaticDefaults.end())
-+ return uno::Any();
-+
-+ return (*aFound).second;
-+ // \--
-+}
-+
-+::cppu::IPropertyArrayHelper & SAL_CALL AreaChartType::getInfoHelper()
-+{
-+ static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
-+ /* bSorted = */ sal_True );
-+
-+ return aArrayHelper;
-+}
-+
-+// ____ XPropertySet ____
-+uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartType::getPropertySetInfo()
-+ throw (uno::RuntimeException)
-+{
-+ static uno::Reference< beans::XPropertySetInfo > xInfo;
-+
-+ // /--
-+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-+ if( !xInfo.is())
-+ {
-+ xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
-+ getInfoHelper());
-+ }
-+
-+ return xInfo;
-+ // \--
-+}
-+
- uno::Sequence< ::rtl::OUString > AreaChartType::getSupportedServiceNames_Static()
- {
- uno::Sequence< ::rtl::OUString > aServices( 2 );
-diff --git chart2/source/model/template/AreaChartType.hxx chart2/source/model/template/AreaChartType.hxx
-index 6b619b2..778f936 100644
---- chart2/source/model/template/AreaChartType.hxx
-+++ chart2/source/model/template/AreaChartType.hxx
-@@ -56,6 +56,16 @@ protected:
- virtual ::rtl::OUString SAL_CALL getChartType()
- throw (::com::sun::star::uno::RuntimeException);
-
-+ // ____ OPropertySet ____
-+ virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
-+ throw(::com::sun::star::beans::UnknownPropertyException);
-+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-+
-+ // ____ XPropertySet ____
-+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
-+ getPropertySetInfo()
-+ throw (::com::sun::star::uno::RuntimeException);
-+
- // ____ XCloneable ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
- throw (::com::sun::star::uno::RuntimeException);
-diff --git chart2/source/model/template/AreaChartTypeTemplate.cxx chart2/source/model/template/AreaChartTypeTemplate.cxx
-index 98874ef..f7d24a5 100644
---- chart2/source/model/template/AreaChartTypeTemplate.cxx
-+++ chart2/source/model/template/AreaChartTypeTemplate.cxx
-@@ -48,6 +48,8 @@ using ::com::sun::star::beans::Property;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::Any;
-+using ::com::sun::star::uno::UNO_QUERY;
-+using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::osl::MutexGuard;
-
- namespace
-@@ -275,6 +277,7 @@ Reference< chart2::XChartType > SAL_CALL AreaChartTypeTemplate::getChartTypeForN
- {
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
- ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/BarChartTypeTemplate.cxx chart2/source/model/template/BarChartTypeTemplate.cxx
-index e6382d5..0e5904d 100644
---- chart2/source/model/template/BarChartTypeTemplate.cxx
-+++ chart2/source/model/template/BarChartTypeTemplate.cxx
-@@ -221,6 +221,7 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe
- {
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
- ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/ChartTypeTemplate.cxx chart2/source/model/template/ChartTypeTemplate.cxx
-index 3e9be6e..2b7aa35 100644
---- chart2/source/model/template/ChartTypeTemplate.cxx
-+++ chart2/source/model/template/ChartTypeTemplate.cxx
-@@ -63,6 +63,7 @@ using ::rtl::OUString;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::Any;
-+using ::com::sun::star::uno::UNO_QUERY;
-
- // ======================================================================
-
-@@ -968,6 +969,48 @@ void ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem(
- comphelper::copyProperties( xSource, xDestination );
- }
-
-+void ChartTypeTemplate::setStackModePropertiesToChartType(const Reference<XChartType>& xChartType)
-+{
-+ Reference<beans::XPropertySet> xPropSet(xChartType, UNO_QUERY);
-+ if (!xPropSet.is())
-+ return;
-+
-+ bool bStacked = false;
-+ bool bPercent = false;
-+ switch (getStackMode(0))
-+ {
-+ case StackMode_Y_STACKED:
-+ bStacked = true;
-+ break;
-+ case StackMode_Y_STACKED_PERCENT:
-+ bStacked = true;
-+ bPercent = true;
-+ break;
-+ case StackMode_Z_STACKED:
-+ break;
-+ default:
-+ ;
-+ }
-+
-+ try
-+ {
-+ xPropSet->setPropertyValue(
-+ C2U("Stacked"), uno::makeAny(static_cast<sal_Bool>(bStacked)));
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+
-+ try
-+ {
-+ xPropSet->setPropertyValue(
-+ C2U("Percent"), uno::makeAny(static_cast<sal_Bool>(bPercent)));
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+}
-+
- // ________
-
- Sequence< OUString > ChartTypeTemplate::getSupportedServiceNames_Static()
-diff --git chart2/source/model/template/ChartTypeTemplate.hxx chart2/source/model/template/ChartTypeTemplate.hxx
-index 47633ad..57d78d4 100644
---- chart2/source/model/template/ChartTypeTemplate.hxx
-+++ chart2/source/model/template/ChartTypeTemplate.hxx
-@@ -272,6 +272,11 @@ protected:
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartType > & xNewChartType );
-
-+ void setStackModePropertiesToChartType(
-+ const ::com::sun::star::uno::Reference<
-+ ::com::sun::star::chart2::XChartType>& xChartType );
-+
-+
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- m_xContext;
-diff --git chart2/source/model/template/ColumnChartType.cxx chart2/source/model/template/ColumnChartType.cxx
-index ed5aea8..a326aa4 100644
---- chart2/source/model/template/ColumnChartType.cxx
-+++ chart2/source/model/template/ColumnChartType.cxx
-@@ -49,7 +49,9 @@ namespace
- enum
- {
- PROP_BARCHARTTYPE_OVERLAP_SEQUENCE,
-- PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE
-+ PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE,
-+ PROP_BARCHARTTYPE_STACKED,
-+ PROP_BARCHARTTYPE_PERCENT
- };
-
- void lcl_AddPropertiesToVector(
-@@ -68,6 +70,19 @@ void lcl_AddPropertiesToVector(
- ::getCppuType( reinterpret_cast< const Sequence< sal_Int32 > * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-+
-+ rOutProperties.push_back(
-+ Property( C2U( "Stacked" ),
-+ PROP_BARCHARTTYPE_STACKED,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
-+ rOutProperties.push_back(
-+ Property( C2U( "Percent" ),
-+ PROP_BARCHARTTYPE_PERCENT,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
- }
-
- void lcl_AddDefaultsToMap(
-@@ -80,6 +95,9 @@ void lcl_AddDefaultsToMap(
-
- aSeq[0] = aSeq[1] = 100;
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
-+
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_STACKED, false );
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_PERCENT, false );
- }
-
- const Sequence< Property > & lcl_GetPropertySequence()
-diff --git chart2/source/model/template/ColumnLineChartTypeTemplate.cxx chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
-index 54e7ea8..4d92176 100644
---- chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
-+++ chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
-@@ -410,6 +410,7 @@ Reference< XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForNew
- ASSERT_EXCEPTION( ex );
- }
-
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/LineChartType.cxx chart2/source/model/template/LineChartType.cxx
-index 05f6b43..274abb0 100644
---- chart2/source/model/template/LineChartType.cxx
-+++ chart2/source/model/template/LineChartType.cxx
-@@ -54,7 +54,9 @@ enum
- {
- PROP_LINECHARTTYPE_CURVE_STYLE,
- PROP_LINECHARTTYPE_CURVE_RESOLUTION,
-- PROP_LINECHARTTYPE_SPLINE_ORDER
-+ PROP_LINECHARTTYPE_SPLINE_ORDER,
-+ PROP_LINECHARTTYPE_STACKED,
-+ PROP_LINECHARTTYPE_PERCENT
- };
-
- void lcl_AddPropertiesToVector(
-@@ -79,6 +81,19 @@ void lcl_AddPropertiesToVector(
- ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-+
-+ rOutProperties.push_back(
-+ Property( C2U( "Stacked" ),
-+ PROP_LINECHARTTYPE_STACKED,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
-+ rOutProperties.push_back(
-+ Property( C2U( "Percent" ),
-+ PROP_LINECHARTTYPE_PERCENT,
-+ ::getBooleanCppuType(),
-+ beans::PropertyAttribute::BOUND
-+ | beans::PropertyAttribute::MAYBEDEFAULT ));
- }
-
- void lcl_AddDefaultsToMap(
-@@ -90,6 +105,9 @@ void lcl_AddDefaultsToMap(
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
-+
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_STACKED, false );
-+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_PERCENT, false );
- }
-
- const Sequence< Property > & lcl_GetPropertySequence()
-diff --git chart2/source/model/template/LineChartTypeTemplate.cxx chart2/source/model/template/LineChartTypeTemplate.cxx
-index 746920a..eb08a53 100644
---- chart2/source/model/template/LineChartTypeTemplate.cxx
-+++ chart2/source/model/template/LineChartTypeTemplate.cxx
-@@ -348,6 +348,7 @@ Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForN
- ASSERT_EXCEPTION( ex );
- }
-
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/NetChartTypeTemplate.cxx chart2/source/model/template/NetChartTypeTemplate.cxx
-index ea85c9c..f13db16 100644
---- chart2/source/model/template/NetChartTypeTemplate.cxx
-+++ chart2/source/model/template/NetChartTypeTemplate.cxx
-@@ -183,6 +183,7 @@ Reference< chart2::XChartType > SAL_CALL NetChartTypeTemplate::getChartTypeForNe
- {
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
- ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/PieChartTypeTemplate.cxx chart2/source/model/template/PieChartTypeTemplate.cxx
-index 8df8ce9..dbce73d 100644
---- chart2/source/model/template/PieChartTypeTemplate.cxx
-+++ chart2/source/model/template/PieChartTypeTemplate.cxx
-@@ -475,6 +475,7 @@ Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForNe
- ASSERT_EXCEPTION( ex );
- }
-
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/ScatterChartTypeTemplate.cxx chart2/source/model/template/ScatterChartTypeTemplate.cxx
-index 2b67f37..62d0a77 100644
---- chart2/source/model/template/ScatterChartTypeTemplate.cxx
-+++ chart2/source/model/template/ScatterChartTypeTemplate.cxx
-@@ -387,6 +387,7 @@ Reference< chart2::XChartType > SAL_CALL ScatterChartTypeTemplate::getChartTypeF
- ASSERT_EXCEPTION( ex );
- }
-
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/model/template/StockChartTypeTemplate.cxx chart2/source/model/template/StockChartTypeTemplate.cxx
-index 43cc054..0d090a5 100644
---- chart2/source/model/template/StockChartTypeTemplate.cxx
-+++ chart2/source/model/template/StockChartTypeTemplate.cxx
-@@ -528,6 +528,7 @@ Reference< XChartType > SAL_CALL StockChartTypeTemplate::getChartTypeForNewSerie
- ASSERT_EXCEPTION( ex );
- }
-
-+ setStackModePropertiesToChartType(xResult);
- return xResult;
- }
-
-diff --git chart2/source/view/axes/ScaleAutomatism.cxx chart2/source/view/axes/ScaleAutomatism.cxx
-index 3e412c4..c151ce0 100644
---- chart2/source/view/axes/ScaleAutomatism.cxx
-+++ chart2/source/view/axes/ScaleAutomatism.cxx
-@@ -132,7 +132,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
- if( bAutoMinimum )
- {
- if( m_aSourceScale.AxisType==AxisType::PERCENT )
-+ {
- rExplicitScale.Minimum = 0.0;
-+ if (!::rtl::math::isNan(m_fValueMinimum))
-+ {
-+ double fMin = m_fValueMinimum / 100.0;
-+ if (rExplicitScale.Minimum > fMin)
-+ rExplicitScale.Minimum = fMin;
-+ }
-+ }
- else if( ::rtl::math::isNan( m_fValueMinimum ) )
- rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
- else
-@@ -143,7 +151,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
- if( bAutoMaximum )
- {
- if( m_aSourceScale.AxisType==AxisType::PERCENT )
-+ {
- rExplicitScale.Maximum = 1.0;
-+ if (!::rtl::math::isNan(m_fValueMaximum))
-+ {
-+ double fMax = m_fValueMaximum / 100.0;
-+ if (rExplicitScale.Maximum < fMax)
-+ rExplicitScale.Maximum = fMax;
-+ }
-+ }
- else if( ::rtl::math::isNan( m_fValueMaximum ) )
- rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
- else
-diff --git chart2/source/view/charttypes/AreaChart.cxx chart2/source/view/charttypes/AreaChart.cxx
-index 1ed2c6d..0ab9969 100644
---- chart2/source/view/charttypes/AreaChart.cxx
-+++ chart2/source/view/charttypes/AreaChart.cxx
-@@ -600,6 +600,19 @@ struct FormerPoint
-
- void AreaChart::createShapes()
- {
-+ sal_Bool bPercent = sal_False;
-+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
-+ if (xPropSet.is())
-+ {
-+ try
-+ {
-+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+ }
-+
- if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
- return;
-
-@@ -753,9 +766,30 @@ void AreaChart::createShapes()
- if( m_nDimension==3 && m_bArea && pSeriesList->size()!=1 )
- fLogicY = fabs( fLogicY );
-
-- if( pPosHelper->isPercentY() && !::rtl::math::approxEqual( aLogicYSumMap[nAttachedAxisIndex], 0.0 ) )
-+ if (bPercent)
-+ {
-+ // This data series is percent-stacked.
-+
-+ if (::rtl::math::approxEqual(aLogicYSumMap[nAttachedAxisIndex], 0.0))
-+ fLogicY = 0.0;
-+ else
-+ fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex];
-+
-+ if (!pPosHelper->isPercentY())
-+ {
-+ // When the axis itself is not percent-stacked,
-+ // their internal range value is 0 - 100. So we
-+ // need to adjust the data point values
-+ // accordingly.
-+ fLogicY *= 100.0;
-+ }
-+ }
-+ else if (pPosHelper->isPercentY())
- {
-- fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex];
-+ // The data series is not percent-stacked, but the
-+ // axis itself is. In this case, the axis' internal
-+ // range is 0 to 1. Adjust the data point values.
-+ fLogicY /= 100.0;
- }
-
- if( ::rtl::math::isNan(fLogicX) || ::rtl::math::isInf(fLogicX)
-diff --git chart2/source/view/charttypes/BarChart.cxx chart2/source/view/charttypes/BarChart.cxx
-index 88d2461..feadf90 100644
---- chart2/source/view/charttypes/BarChart.cxx
-+++ chart2/source/view/charttypes/BarChart.cxx
-@@ -456,6 +456,19 @@ void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis()
-
- void BarChart::createShapes()
- {
-+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
-+ sal_Bool bPercent = sal_False;
-+ if (xPropSet.is())
-+ {
-+ try
-+ {
-+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+ }
-+
- if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
- return;
-
-diff --git chart2/source/view/charttypes/VSeriesPlotter.cxx chart2/source/view/charttypes/VSeriesPlotter.cxx
-index 159866c..fe790b9 100644
---- chart2/source/view/charttypes/VSeriesPlotter.cxx
-+++ chart2/source/view/charttypes/VSeriesPlotter.cxx
-@@ -1154,6 +1154,23 @@ double VSeriesPlotter::getMaximumX()
-
- double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
- {
-+ sal_Bool bPercent = sal_False;
-+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
-+ if (xPropSet.is())
-+ {
-+ try
-+ {
-+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+ }
-+
-+ if (bPercent)
-+ // This plotter is percent-stacked.
-+ return 0.0;
-+
- if( !m_bCategoryXAxis )
- {
- double fMinY, fMaxY;
-@@ -1188,6 +1205,23 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s
-
- double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
- {
-+ sal_Bool bPercent = sal_False;
-+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
-+ if (xPropSet.is())
-+ {
-+ try
-+ {
-+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ }
-+ }
-+
-+ if (bPercent)
-+ // This plotter is percent-stacked.
-+ return 100.0;
-+
- if( !m_bCategoryXAxis )
- {
- double fMinY, fMaxY;
-diff --git chart2/source/view/main/ChartView.cxx chart2/source/view/main/ChartView.cxx
-index 0357b26..639b4ec 100644
---- chart2/source/view/main/ChartView.cxx
-+++ chart2/source/view/main/ChartView.cxx
-@@ -1735,7 +1735,15 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
- if( nDimensionIndex == 0 )
- aRoleToMatch = C2U("values-x");
- Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
-- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
-+ sal_Int32 nCTCount = aChartTypes.getLength();
-+ if (nCTCount > 0)
-+ // When multiple chart types share the same axis, always
-+ // use the first chart type for automatic detection of
-+ // desired number format. This is in line with the
-+ // fact that the axis type is also determined from the
-+ // first chart type alone.
-+ nCTCount = 1;
-+ for( sal_Int32 nCTIdx=0; nCTIdx<nCTCount; ++nCTIdx )
- {
- if( nDimensionIndex != 0 )
- aRoleToMatch = aChartTypes[nCTIdx]->getRoleOfSequenceForSeriesLabel();
diff --git a/patches/dev300/chart-axis-multi-chart-types-sc.diff b/patches/dev300/chart-axis-multi-chart-types-sc.diff
deleted file mode 100644
index d4c2349..0000000
--- a/patches/dev300/chart-axis-multi-chart-types-sc.diff
+++ /dev/null
@@ -1,265 +0,0 @@
---- sc/source/filter/excel/xechart.cxx
-+++ sc/source/filter/excel/xechart.cxx
-@@ -124,16 +124,27 @@ void lclSaveRecord( XclExpStream& rStrm, XclExpRecordRef xRec, sal_uInt16 nRecId
- }
-
- template< typename Type >
--inline bool lclIsAutoAnyOrGetValue( Type& rValue, const Any& rAny )
-+inline bool lclIsAutoAnyOrGetValue( Type& rValue, const Any& rAny, bool bPercent )
- {
-- return !rAny.hasValue() || !(rAny >>= rValue);
-+ if (!rAny.hasValue())
-+ return true;
-+
-+ if (rAny >>= rValue)
-+ {
-+ if (bPercent)
-+ rValue *= 100.0;
-+ return false;
-+ }
-+ else
-+ return true;
- }
-
--bool lclIsAutoAnyOrGetScaledValue( double& rfValue, const Any& rAny, bool bLogScale )
-+bool lclIsAutoAnyOrGetScaledValue( double& rfValue, const Any& rAny, bool bLogScale, bool bPercent )
- {
-- bool bIsAuto = lclIsAutoAnyOrGetValue( rfValue, rAny );
-+ bool bIsAuto = lclIsAutoAnyOrGetValue( rfValue, rAny, bPercent );
- if( !bIsAuto && bLogScale )
- rfValue = log( rfValue ) / log( 10.0 );
-+
- return bIsAuto;
- }
-
-@@ -2147,7 +2158,7 @@ void XclExpChLabelRange::Convert( const ScaleData& rScaleData, bool bMirrorOrien
- {
- // origin
- double fOrigin = 0.0;
-- if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin ) )
-+ if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin, false ) )
- maData.mnCross = limit_cast< sal_uInt16 >( fOrigin, 1, 31999 );
-
- // reverse order
-@@ -2171,7 +2182,7 @@ XclExpChValueRange::XclExpChValueRange( const XclExpChRoot& rRoot ) :
- {
- }
-
--void XclExpChValueRange::Convert( const ScaleData& rScaleData )
-+void XclExpChValueRange::Convert( const ScaleData& rScaleData, bool bPercent )
- {
- // scaling algorithm
- bool bLogScale = ScfApiHelper::GetServiceName( rScaleData.Scaling ) == SERVICE_CHART2_LOGSCALING;
-@@ -2181,24 +2192,24 @@ void XclExpChValueRange::Convert( const ScaleData& rScaleData )
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_LOGSCALE, bLogScale );
-
- // min/max
-- bool bAutoMin = lclIsAutoAnyOrGetScaledValue( maData.mfMin, rScaleData.Minimum, bLogScale );
-+ bool bAutoMin = lclIsAutoAnyOrGetScaledValue( maData.mfMin, rScaleData.Minimum, bLogScale, bPercent );
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN, bAutoMin );
-- bool bAutoMax = lclIsAutoAnyOrGetScaledValue( maData.mfMax, rScaleData.Maximum, bLogScale );
-+ bool bAutoMax = lclIsAutoAnyOrGetScaledValue( maData.mfMax, rScaleData.Maximum, bLogScale, bPercent );
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX, bAutoMax );
-
- // origin
-- bool bAutoCross = lclIsAutoAnyOrGetScaledValue( maData.mfCross, rScaleData.Origin, bLogScale );
-+ bool bAutoCross = lclIsAutoAnyOrGetScaledValue( maData.mfCross, rScaleData.Origin, bLogScale, bPercent );
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOCROSS, bAutoCross );
-
- // major increment
- const IncrementData& rIncrementData = rScaleData.IncrementData;
-- bool bAutoMajor = lclIsAutoAnyOrGetValue( maData.mfMajorStep, rIncrementData.Distance ) || (maData.mfMajorStep <= 0.0);
-+ bool bAutoMajor = lclIsAutoAnyOrGetValue( maData.mfMajorStep, rIncrementData.Distance, bPercent ) || (maData.mfMajorStep <= 0.0);
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAJOR, bAutoMajor );
- // minor increment
- const Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
- sal_Int32 nCount = 0;
- bool bAutoMinor = bLogScale || bAutoMajor || (rSubIncrementSeq.getLength() < 1) ||
-- lclIsAutoAnyOrGetValue( nCount, rSubIncrementSeq[ 0 ].IntervalCount ) || (nCount < 1);
-+ lclIsAutoAnyOrGetValue( nCount, rSubIncrementSeq[ 0 ].IntervalCount, false ) || (nCount < 1);
- if( !bAutoMinor )
- maData.mfMinorStep = maData.mfMajorStep / nCount;
- ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMINOR, bAutoMinor );
-@@ -2320,7 +2331,7 @@ void XclExpChAxis::SetRotation( sal_uInt16 nRotation )
- mxTick->SetRotation( nRotation );
- }
-
--void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis, const XclChExtTypeInfo& rTypeInfo )
-+void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis, const XclChExtTypeInfo& rTypeInfo, bool bPercent )
- {
- ScfPropertySet aAxisProp( xAxis );
- bool bCategoryAxis = ((GetAxisType() == EXC_CHAXIS_X) && rTypeInfo.mbCategoryAxis) || (GetAxisType() == EXC_CHAXIS_Z);
-@@ -2349,7 +2361,7 @@ void XclExpChAxis::Convert( Reference< XAxis > xAxis, const XclChExtTypeInfo& rT
- {
- mxValueRange.reset( new XclExpChValueRange( GetChRoot() ) );
- if( xAxis.is() )
-- mxValueRange->Convert( xAxis->getScaleData() );
-+ mxValueRange->Convert( xAxis->getScaleData(), bPercent );
- // get position of crossing axis on this axis from passed axis object
- if( aCrossingProp.Is() )
- mxValueRange->ConvertAxisPosition( aCrossingProp );
-@@ -2523,10 +2535,10 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
- // create axes according to chart type (no axes for pie and donut charts)
- if( rTypeInfo.meTypeCateg != EXC_CHTYPECATEG_PIE )
- {
-- ConvertAxis( mxXAxis, EXC_CHAXIS_X, mxXAxisTitle, EXC_CHOBJLINK_XAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_Y );
-- ConvertAxis( mxYAxis, EXC_CHAXIS_Y, mxYAxisTitle, EXC_CHOBJLINK_YAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_X );
-+ ConvertAxis( mxXAxis, EXC_CHAXIS_X, mxXAxisTitle, EXC_CHOBJLINK_XAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_Y, bPercent );
-+ ConvertAxis( mxYAxis, EXC_CHAXIS_Y, mxYAxisTitle, EXC_CHOBJLINK_YAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_X, bPercent );
- if( pGroup->Is3dDeepChart() )
-- ConvertAxis( mxZAxis, EXC_CHAXIS_Z, mxZAxisTitle, EXC_CHOBJLINK_ZAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_NONE );
-+ ConvertAxis( mxZAxis, EXC_CHAXIS_Z, mxZAxisTitle, EXC_CHOBJLINK_ZAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_NONE, bPercent );
- }
-
- // X axis category ranges
-@@ -2610,15 +2622,16 @@ XclExpChTypeGroupRef XclExpChAxesSet::GetLastTypeGroup() const
- XclExpChAxisRef& rxChAxis, sal_uInt16 nAxisType,
- XclExpChTextRef& rxChAxisTitle, sal_uInt16 nTitleTarget,
- Reference< XCoordinateSystem > xCoordSystem, const XclChExtTypeInfo& rTypeInfo,
-- sal_Int32 nCrossingAxisDim )
-+ sal_Int32 nCrossingAxisDim,
-+ bool bPercent )
- {
- // create and convert axis object
- rxChAxis.reset( new XclExpChAxis( GetChRoot(), nAxisType ) );
- sal_Int32 nApiAxisDim = rxChAxis->GetApiAxisDimension();
- sal_Int32 nApiAxesSetIdx = GetApiAxesSetIndex();
- Reference< XAxis > xAxis = lclGetApiAxis( xCoordSystem, nApiAxisDim, nApiAxesSetIdx );
- Reference< XAxis > xCrossingAxis = lclGetApiAxis( xCoordSystem, nCrossingAxisDim, nApiAxesSetIdx );
-- rxChAxis->Convert( xAxis, xCrossingAxis, rTypeInfo );
-+ rxChAxis->Convert( xAxis, xCrossingAxis, rTypeInfo, bPercent );
-
- // create and convert axis title
- Reference< XTitled > xTitled( xAxis, UNO_QUERY );
---- sc/source/filter/excel/xichart.cxx
-+++ sc/source/filter/excel/xichart.cxx
-@@ -1988,6 +1988,15 @@ Reference< XChartType > XclImpChType::CreateChartType( Reference< XDiagram > xDi
- // additional properties
- switch( maTypeInfo.meTypeCateg )
- {
-+ case EXC_CHTYPECATEG_LINE:
-+ {
-+ ScfPropertySet aTypeProp(xChartType);
-+ bool bStacked = (maData.mnFlags & EXC_CHLINE_STACKED);
-+ bool bPercent = (maData.mnFlags & EXC_CHLINE_PERCENT);
-+ aTypeProp.SetBoolProperty(EXC_CHPROP_STACKED, bStacked);
-+ aTypeProp.SetBoolProperty(EXC_CHPROP_PERCENT, bPercent);
-+ }
-+ break;
- case EXC_CHTYPECATEG_BAR:
- {
- ScfPropertySet aTypeProp( xChartType );
-@@ -1996,6 +2005,10 @@ Reference< XChartType > XclImpChType::CreateChartType( Reference< XDiagram > xDi
- aTypeProp.SetProperty( EXC_CHPROP_OVERLAPSEQ, aInt32Seq );
- aInt32Seq[ 0 ] = aInt32Seq[ 1 ] = maData.mnGap;
- aTypeProp.SetProperty( EXC_CHPROP_GAPWIDTHSEQ, aInt32Seq );
-+ bool bStacked = (maData.mnFlags & EXC_CHBAR_STACKED);
-+ bool bPercent = (maData.mnFlags & EXC_CHBAR_PERCENT);
-+ aTypeProp.SetBoolProperty(EXC_CHPROP_STACKED, bStacked);
-+ aTypeProp.SetBoolProperty(EXC_CHPROP_PERCENT, bPercent);
- }
- break;
- case EXC_CHTYPECATEG_PIE:
-@@ -2542,7 +2555,7 @@ void XclImpChValueRange::ReadChValueRange( XclImpStream& rStrm )
- >> maData.mnFlags;
- }
-
--void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) const
-+void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient, bool bPercent ) const
- {
- // scaling algorithm
- bool bLogScale = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_LOGSCALE );
-@@ -2557,15 +2570,18 @@ void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) co
- rScaleData.Scaling.set( ScfApiHelper::CreateInstance( aScalingService ), UNO_QUERY );
-
- // min/max
-- lclSetExpValueOrClearAny( rScaleData.Minimum, maData.mfMin, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN ) );
-- lclSetExpValueOrClearAny( rScaleData.Maximum, maData.mfMax, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX ) );
-+ double fMinVal = bPercent ? maData.mfMin/100.0 : maData.mfMin;
-+ double fMaxVal = bPercent ? maData.mfMax/100.0 : maData.mfMax;
-+ lclSetExpValueOrClearAny( rScaleData.Minimum, fMinVal, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN ) );
-+ lclSetExpValueOrClearAny( rScaleData.Maximum, fMaxVal, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX ) );
-
- // increment
- bool bAutoMajor = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAJOR );
- bool bAutoMinor = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMINOR );
- // major increment
- IncrementData& rIncrementData = rScaleData.IncrementData;
-- lclSetValueOrClearAny( rIncrementData.Distance, maData.mfMajorStep, bAutoMajor );
-+ double fMajorStep = bPercent ? maData.mfMajorStep/100.0 : maData.mfMajorStep;
-+ lclSetValueOrClearAny( rIncrementData.Distance, fMajorStep, bAutoMajor );
- // minor increment
- Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
- rSubIncrementSeq.realloc( 1 );
-@@ -2809,8 +2826,11 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
- break;
- case cssc2::AxisType::REALNUMBER:
- case cssc2::AxisType::PERCENT:
-+ {
-+ bool bPercent = (aScaleData.AxisType == cssc2::AxisType::PERCENT);
- // #i85167# pie/donut charts have reversed rotation direction (at Y axis!)
-- mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE );
-+ mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE, bPercent );
-+ }
- break;
- default:
- DBG_ERRORFILE( "XclImpChAxis::CreateAxis - unknown axis type" );
---- sc/source/filter/inc/xechart.hxx
-+++ sc/source/filter/inc/xechart.hxx
-@@ -944,7 +944,7 @@ public:
- explicit XclExpChValueRange( const XclExpChRoot& rRoot );
-
- /** Converts value axis scaling settings. */
-- void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData );
-+ void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData, bool bPercent );
- /** Converts position settings of a crossing axis at this axis. */
- void ConvertAxisPosition( const ScfPropertySet& rPropSet );
-
-@@ -1004,7 +1004,7 @@ public:
- virtual void SetRotation( sal_uInt16 nRotation );
-
- /** Converts formatting and scaling settings from the passed axis. */
-- void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis, const XclChExtTypeInfo& rTypeInfo );
-+ void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis, const XclChExtTypeInfo& rTypeInfo, bool bPercent );
- /** Converts and writes 3D wall/floor properties from the passed diagram. */
- void ConvertWall( XDiagramRef xDiagram );
-
-@@ -1076,7 +1077,8 @@ private:
- void ConvertAxis( XclExpChAxisRef& rxChAxis, sal_uInt16 nAxisType,
- XclExpChTextRef& rxChAxisTitle, sal_uInt16 nTitleTarget,
- XCoordSystemRef xCoordSystem, const XclChExtTypeInfo& rTypeInfo,
-- sal_Int32 nCrossingAxisDim );
-+ sal_Int32 nCrossingAxisDim,
-+ bool bPercent );
-
- virtual void WriteBody( XclExpStream& rStrm );
-
---- sc/source/filter/inc/xichart.hxx
-+++ sc/source/filter/inc/xichart.hxx
-@@ -1109,7 +1109,7 @@ public:
- /** Reads the CHVALUERANGE record (numeric axis scaling properties). */
- void ReadChValueRange( XclImpStream& rStrm );
- /** Converts value axis scaling settings. */
-- void Convert( ScaleData& rScaleData, bool bMirrorOrient ) const;
-+ void Convert( ScaleData& rScaleData, bool bMirrorOrient, bool bPercent ) const;
- /** Converts position settings of this axis at a crossing axis. */
- void ConvertAxisPosition( ScfPropertySet& rPropSet ) const;
-
---- sc/source/filter/inc/xlchart.hxx
-+++ sc/source/filter/inc/xlchart.hxx
-@@ -107,6 +107,7 @@ namespace com { namespace sun { namespace star {
- #define EXC_CHPROP_OFFSET CREATE_OUSTRING( "Offset" )
- #define EXC_CHPROP_OVERLAPSEQ CREATE_OUSTRING( "OverlapSequence" )
- #define EXC_CHPROP_PERCENTAGENUMFMT CREATE_OUSTRING( "PercentageNumberFormat" )
-+#define EXC_CHPROP_PERCENT CREATE_OUSTRING( "Percent" )
- #define EXC_CHPROP_PERCENTDIAGONAL CREATE_OUSTRING( "PercentDiagonal" )
- #define EXC_CHPROP_PERSPECTIVE CREATE_OUSTRING( "Perspective" )
- #define EXC_CHPROP_POSITIVEERROR CREATE_OUSTRING( "PositiveError" )
-@@ -121,6 +122,7 @@ namespace com { namespace sun { namespace star {
- #define EXC_CHPROP_SHOWHIGHLOW CREATE_OUSTRING( "ShowHighLow" )
- #define EXC_CHPROP_SHOWNEGATIVEERROR CREATE_OUSTRING( "ShowNegativeError" )
- #define EXC_CHPROP_SHOWPOSITIVEERROR CREATE_OUSTRING( "ShowPositiveError" )
-+#define EXC_CHPROP_STACKED CREATE_OUSTRING( "Stacked" )
- #define EXC_CHPROP_STACKCHARACTERS CREATE_OUSTRING( "StackCharacters" )
- #define EXC_CHPROP_STACKINGDIR CREATE_OUSTRING( "StackingDirection" )
- #define EXC_CHPROP_STARTINGANGLE CREATE_OUSTRING( "StartingAngle" )
diff --git a/patches/dev300/chart-axis-multi-chart-types-xmloff.diff b/patches/dev300/chart-axis-multi-chart-types-xmloff.diff
deleted file mode 100644
index 524a8bf..0000000
--- a/patches/dev300/chart-axis-multi-chart-types-xmloff.diff
+++ /dev/null
@@ -1,83 +0,0 @@
-diff --git xmloff/source/chart/SchXMLChartContext.cxx xmloff/source/chart/SchXMLChartContext.cxx
-index 510d366..3824e67 100644
---- xmloff/source/chart/SchXMLChartContext.cxx
-+++ xmloff/source/chart/SchXMLChartContext.cxx
-@@ -71,13 +71,17 @@
- #include <com/sun/star/chart2/data/XDataSink.hpp>
- #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
- #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-+#include <com/sun/star/chart2/XCoordinateSystem.hpp>
- #include <com/sun/star/chart2/XChartTypeContainer.hpp>
-+#include <com/sun/star/chart2/XChartType.hpp>
- #include <com/sun/star/chart2/XTitled.hpp>
-
- using namespace com::sun::star;
- using namespace ::xmloff::token;
- using ::rtl::OUString;
- using com::sun::star::uno::Reference;
-+using ::com::sun::star::uno::Sequence;
-+using ::com::sun::star::uno::UNO_QUERY;
- using namespace ::SchXMLTools;
-
- namespace
-@@ -706,6 +710,48 @@ void SchXMLChartContext::ChangeDiagramAccordingToTemplate(
- xTemplate->changeDiagramData( xNewDia, xDataSource, aArgs );
- }
-
-+static void lcl_setStackTypeToAllChartTypes(
-+ const Reference<chart2::XDiagram>& rDiagram, const uno::Any& rStacked, const uno::Any& rPercent)
-+{
-+ Reference<chart2::XCoordinateSystemContainer> xCoordContainer(rDiagram, uno::UNO_QUERY);
-+ if (!xCoordContainer.is())
-+ return;
-+
-+ Sequence< Reference<chart2::XCoordinateSystem> > xCoords = xCoordContainer->getCoordinateSystems();
-+
-+ sal_Int32 n = xCoords.getLength();
-+ if (!n)
-+ return;
-+
-+ for (sal_Int32 i = 0; i < n; ++i)
-+ {
-+ Reference<chart2::XChartTypeContainer> xChartTypeContainer(xCoords[i], UNO_QUERY);
-+ if (!xChartTypeContainer.is())
-+ continue;
-+
-+ Sequence< Reference<chart2::XChartType> > xChartTypes = xChartTypeContainer->getChartTypes();
-+ sal_Int32 nChartTypeCount = xChartTypes.getLength();
-+ for (sal_Int32 j = 0; j < nChartTypeCount; ++j)
-+ {
-+ Reference<beans::XPropertySet> xProp(xChartTypes[j], UNO_QUERY);
-+ if (!xProp.is())
-+ continue;
-+
-+ try
-+ {
-+ if (rStacked.hasValue())
-+ xProp->setPropertyValue(OUString::createFromAscii("Stacked"), rStacked);
-+ if (rPercent.hasValue())
-+ xProp->setPropertyValue(OUString::createFromAscii("Percent"), rPercent);
-+ }
-+ catch (const beans::UnknownPropertyException&)
-+ {
-+ // fail silently.
-+ }
-+ }
-+ }
-+}
-+
- void SchXMLChartContext::EndElement()
- {
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
-@@ -869,6 +915,11 @@ void SchXMLChartContext::EndElement()
- , SchXMLSeriesHelper::getDataSeriesIndexMapFromDiagram(xNewDiagram) );
- }
-
-+ // For now, set the diagram's stack-related properties to all included
-+ // chart types until we support chart types of mixed stack states.
-+ lcl_setStackTypeToAllChartTypes(
-+ xNewDoc->getFirstDiagram(), maSeriesDefaultsAndStyles.maStackedDefault, maSeriesDefaultsAndStyles.maPercentDefault);
-+
- SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, uno::Reference< frame::XModel >(xDoc, uno::UNO_QUERY ) );
-
- //set defaults from diagram to the new series:
diff --git a/patches/dev300/cws-koheichart02-chart2.diff b/patches/dev300/cws-koheichart02-chart2.diff
new file mode 100644
index 0000000..1c4e474
--- /dev/null
+++ b/patches/dev300/cws-koheichart02-chart2.diff
@@ -0,0 +1,617 @@
+diff --git chart2/source/model/template/AreaChartType.cxx chart2/source/model/template/AreaChartType.cxx
+index db529a7..3a562f0 100644
+--- chart2/source/model/template/AreaChartType.cxx
++++ chart2/source/model/template/AreaChartType.cxx
+@@ -33,8 +33,72 @@
+ #include "AreaChartType.hxx"
+ #include "macros.hxx"
+ #include "servicenames_charttypes.hxx"
++#include "PropertyHelper.hxx"
++#include "ContainerHelper.hxx"
++
++#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+ using namespace ::com::sun::star;
++using ::com::sun::star::beans::Property;
++using ::com::sun::star::uno::Sequence;
++
++namespace
++{
++
++enum
++{
++ PROP_AREACHARTTYPE_STACKED,
++ PROP_AREACHARTTYPE_PERCENT
++};
++
++void lcl_AddPropertiesToVector(
++ ::std::vector< Property > & rOutProperties )
++{
++ rOutProperties.push_back(
++ Property( C2U( "Stacked" ),
++ PROP_AREACHARTTYPE_STACKED,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++ rOutProperties.push_back(
++ Property( C2U( "Percent" ),
++ PROP_AREACHARTTYPE_PERCENT,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++}
++
++void lcl_AddDefaultsToMap(
++ ::chart::tPropertyValueMap & rOutMap )
++{
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_STACKED, false );
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_PERCENT, false );
++}
++
++const Sequence< Property > & lcl_GetPropertySequence()
++{
++ static Sequence< Property > aPropSeq;
++
++ // /--
++ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
++ if( 0 == aPropSeq.getLength() )
++ {
++ // get properties
++ ::std::vector< ::com::sun::star::beans::Property > aProperties;
++ lcl_AddPropertiesToVector( aProperties );
++
++ // and sort them for access via bsearch
++ ::std::sort( aProperties.begin(), aProperties.end(),
++ ::chart::PropertyNameLess() );
++
++ // transfer result to static Sequence
++ aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
++ }
++
++ return aPropSeq;
++}
++
++} // anonymous namespace
+
+ namespace chart
+ {
+@@ -65,6 +129,56 @@ uno::Reference< util::XCloneable > SAL_CALL AreaChartType::createClone()
+ return CHART2_SERVICE_NAME_CHARTTYPE_AREA;
+ }
+
++// ____ OPropertySet ____
++uno::Any AreaChartType::GetDefaultValue( sal_Int32 nHandle ) const
++ throw(beans::UnknownPropertyException)
++{
++ static tPropertyValueMap aStaticDefaults;
++
++ // /--
++ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
++ if( 0 == aStaticDefaults.size() )
++ {
++ // initialize defaults
++ lcl_AddDefaultsToMap( aStaticDefaults );
++ }
++
++ tPropertyValueMap::const_iterator aFound(
++ aStaticDefaults.find( nHandle ));
++
++ if( aFound == aStaticDefaults.end())
++ return uno::Any();
++
++ return (*aFound).second;
++ // \--
++}
++
++::cppu::IPropertyArrayHelper & SAL_CALL AreaChartType::getInfoHelper()
++{
++ static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
++ /* bSorted = */ sal_True );
++
++ return aArrayHelper;
++}
++
++// ____ XPropertySet ____
++uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartType::getPropertySetInfo()
++ throw (uno::RuntimeException)
++{
++ static uno::Reference< beans::XPropertySetInfo > xInfo;
++
++ // /--
++ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
++ if( !xInfo.is())
++ {
++ xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
++ getInfoHelper());
++ }
++
++ return xInfo;
++ // \--
++}
++
+ uno::Sequence< ::rtl::OUString > AreaChartType::getSupportedServiceNames_Static()
+ {
+ uno::Sequence< ::rtl::OUString > aServices( 2 );
+diff --git chart2/source/model/template/AreaChartType.hxx chart2/source/model/template/AreaChartType.hxx
+index 9783074..d3f905d 100644
+--- chart2/source/model/template/AreaChartType.hxx
++++ chart2/source/model/template/AreaChartType.hxx
+@@ -56,6 +56,16 @@ protected:
+ virtual ::rtl::OUString SAL_CALL getChartType()
+ throw (::com::sun::star::uno::RuntimeException);
+
++ // ____ OPropertySet ____
++ virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
++ throw(::com::sun::star::beans::UnknownPropertyException);
++ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
++
++ // ____ XPropertySet ____
++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
++ getPropertySetInfo()
++ throw (::com::sun::star::uno::RuntimeException);
++
+ // ____ XCloneable ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
+ throw (::com::sun::star::uno::RuntimeException);
+diff --git chart2/source/model/template/AreaChartTypeTemplate.cxx chart2/source/model/template/AreaChartTypeTemplate.cxx
+index 98874ef..f7d24a5 100644
+--- chart2/source/model/template/AreaChartTypeTemplate.cxx
++++ chart2/source/model/template/AreaChartTypeTemplate.cxx
+@@ -48,6 +48,8 @@ using ::com::sun::star::beans::Property;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::Any;
++using ::com::sun::star::uno::UNO_QUERY;
++using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::osl::MutexGuard;
+
+ namespace
+@@ -275,6 +277,7 @@ Reference< chart2::XChartType > SAL_CALL AreaChartTypeTemplate::getChartTypeForN
+ {
+ Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/BarChartTypeTemplate.cxx chart2/source/model/template/BarChartTypeTemplate.cxx
+index e6382d5..0e5904d 100644
+--- chart2/source/model/template/BarChartTypeTemplate.cxx
++++ chart2/source/model/template/BarChartTypeTemplate.cxx
+@@ -221,6 +221,7 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe
+ {
+ Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/ChartTypeTemplate.cxx chart2/source/model/template/ChartTypeTemplate.cxx
+index 9d6524e..fb0cff0 100644
+--- chart2/source/model/template/ChartTypeTemplate.cxx
++++ chart2/source/model/template/ChartTypeTemplate.cxx
+@@ -62,6 +62,7 @@ using ::rtl::OUString;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::Any;
++using ::com::sun::star::uno::UNO_QUERY;
+
+ // ======================================================================
+
+@@ -943,6 +944,48 @@ void ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem(
+ comphelper::copyProperties( xSource, xDestination );
+ }
+
++void ChartTypeTemplate::setStackModePropertiesToChartType(const Reference<XChartType>& xChartType)
++{
++ Reference<beans::XPropertySet> xPropSet(xChartType, UNO_QUERY);
++ if (!xPropSet.is())
++ return;
++
++ bool bStacked = false;
++ bool bPercent = false;
++ switch (getStackMode(0))
++ {
++ case StackMode_Y_STACKED:
++ bStacked = true;
++ break;
++ case StackMode_Y_STACKED_PERCENT:
++ bStacked = true;
++ bPercent = true;
++ break;
++ case StackMode_Z_STACKED:
++ break;
++ default:
++ ;
++ }
++
++ try
++ {
++ xPropSet->setPropertyValue(
++ C2U("Stacked"), uno::makeAny(static_cast<sal_Bool>(bStacked)));
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++
++ try
++ {
++ xPropSet->setPropertyValue(
++ C2U("Percent"), uno::makeAny(static_cast<sal_Bool>(bPercent)));
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++}
++
+ // ________
+
+ Sequence< OUString > ChartTypeTemplate::getSupportedServiceNames_Static()
+diff --git chart2/source/model/template/ChartTypeTemplate.hxx chart2/source/model/template/ChartTypeTemplate.hxx
+index d8b2b7b..0469478 100644
+--- chart2/source/model/template/ChartTypeTemplate.hxx
++++ chart2/source/model/template/ChartTypeTemplate.hxx
+@@ -272,6 +272,11 @@ protected:
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType > & xNewChartType );
+
++ void setStackModePropertiesToChartType(
++ const ::com::sun::star::uno::Reference<
++ ::com::sun::star::chart2::XChartType>& xChartType );
++
++
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
+diff --git chart2/source/model/template/ColumnChartType.cxx chart2/source/model/template/ColumnChartType.cxx
+index ed5aea8..a326aa4 100644
+--- chart2/source/model/template/ColumnChartType.cxx
++++ chart2/source/model/template/ColumnChartType.cxx
+@@ -49,7 +49,9 @@ namespace
+ enum
+ {
+ PROP_BARCHARTTYPE_OVERLAP_SEQUENCE,
+- PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE
++ PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE,
++ PROP_BARCHARTTYPE_STACKED,
++ PROP_BARCHARTTYPE_PERCENT
+ };
+
+ void lcl_AddPropertiesToVector(
+@@ -68,6 +70,19 @@ void lcl_AddPropertiesToVector(
+ ::getCppuType( reinterpret_cast< const Sequence< sal_Int32 > * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
++
++ rOutProperties.push_back(
++ Property( C2U( "Stacked" ),
++ PROP_BARCHARTTYPE_STACKED,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++ rOutProperties.push_back(
++ Property( C2U( "Percent" ),
++ PROP_BARCHARTTYPE_PERCENT,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
+ }
+
+ void lcl_AddDefaultsToMap(
+@@ -80,6 +95,9 @@ void lcl_AddDefaultsToMap(
+
+ aSeq[0] = aSeq[1] = 100;
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
++
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_STACKED, false );
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_PERCENT, false );
+ }
+
+ const Sequence< Property > & lcl_GetPropertySequence()
+diff --git chart2/source/model/template/ColumnLineChartTypeTemplate.cxx chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+index 54e7ea8..4d92176 100644
+--- chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
++++ chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+@@ -410,6 +410,7 @@ Reference< XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForNew
+ ASSERT_EXCEPTION( ex );
+ }
+
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/LineChartType.cxx chart2/source/model/template/LineChartType.cxx
+index 05f6b43..274abb0 100644
+--- chart2/source/model/template/LineChartType.cxx
++++ chart2/source/model/template/LineChartType.cxx
+@@ -54,7 +54,9 @@ enum
+ {
+ PROP_LINECHARTTYPE_CURVE_STYLE,
+ PROP_LINECHARTTYPE_CURVE_RESOLUTION,
+- PROP_LINECHARTTYPE_SPLINE_ORDER
++ PROP_LINECHARTTYPE_SPLINE_ORDER,
++ PROP_LINECHARTTYPE_STACKED,
++ PROP_LINECHARTTYPE_PERCENT
+ };
+
+ void lcl_AddPropertiesToVector(
+@@ -79,6 +81,19 @@ void lcl_AddPropertiesToVector(
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
++
++ rOutProperties.push_back(
++ Property( C2U( "Stacked" ),
++ PROP_LINECHARTTYPE_STACKED,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++ rOutProperties.push_back(
++ Property( C2U( "Percent" ),
++ PROP_LINECHARTTYPE_PERCENT,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
+ }
+
+ void lcl_AddDefaultsToMap(
+@@ -90,6 +105,9 @@ void lcl_AddDefaultsToMap(
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
++
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_STACKED, false );
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_PERCENT, false );
+ }
+
+ const Sequence< Property > & lcl_GetPropertySequence()
+diff --git chart2/source/model/template/LineChartTypeTemplate.cxx chart2/source/model/template/LineChartTypeTemplate.cxx
+index 749a3b1..93cd9c8 100644
+--- chart2/source/model/template/LineChartTypeTemplate.cxx
++++ chart2/source/model/template/LineChartTypeTemplate.cxx
+@@ -336,6 +336,7 @@ Reference< chart2::XChartType > LineChartTypeTemplate::getChartTypeForIndex( sal
+ ASSERT_EXCEPTION( ex );
+ }
+
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/NetChartTypeTemplate.cxx chart2/source/model/template/NetChartTypeTemplate.cxx
+index f21857c..a9bc6bc 100644
+--- chart2/source/model/template/NetChartTypeTemplate.cxx
++++ chart2/source/model/template/NetChartTypeTemplate.cxx
+@@ -213,6 +213,7 @@ Reference< chart2::XChartType > SAL_CALL NetChartTypeTemplate::getChartTypeForNe
+ {
+ Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/PieChartTypeTemplate.cxx chart2/source/model/template/PieChartTypeTemplate.cxx
+index 8280389..233ae85 100644
+--- chart2/source/model/template/PieChartTypeTemplate.cxx
++++ chart2/source/model/template/PieChartTypeTemplate.cxx
+@@ -474,6 +474,7 @@ Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForNe
+ ASSERT_EXCEPTION( ex );
+ }
+
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/ScatterChartTypeTemplate.cxx chart2/source/model/template/ScatterChartTypeTemplate.cxx
+index bc384a9..b9e18c9 100644
+--- chart2/source/model/template/ScatterChartTypeTemplate.cxx
++++ chart2/source/model/template/ScatterChartTypeTemplate.cxx
+@@ -374,6 +374,7 @@ Reference< chart2::XChartType > ScatterChartTypeTemplate::getChartTypeForIndex(
+ ASSERT_EXCEPTION( ex );
+ }
+
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/model/template/StockChartTypeTemplate.cxx chart2/source/model/template/StockChartTypeTemplate.cxx
+index 32c8eea..fc9538a 100644
+--- chart2/source/model/template/StockChartTypeTemplate.cxx
++++ chart2/source/model/template/StockChartTypeTemplate.cxx
+@@ -527,6 +527,7 @@ Reference< XChartType > SAL_CALL StockChartTypeTemplate::getChartTypeForNewSerie
+ ASSERT_EXCEPTION( ex );
+ }
+
++ setStackModePropertiesToChartType(xResult);
+ return xResult;
+ }
+
+diff --git chart2/source/view/axes/ScaleAutomatism.cxx chart2/source/view/axes/ScaleAutomatism.cxx
+index 085d300..57922f1 100644
+--- chart2/source/view/axes/ScaleAutomatism.cxx
++++ chart2/source/view/axes/ScaleAutomatism.cxx
+@@ -131,7 +131,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
+ if( bAutoMinimum )
+ {
+ if( m_aSourceScale.AxisType==AxisType::PERCENT )
++ {
+ rExplicitScale.Minimum = 0.0;
++ if (!::rtl::math::isNan(m_fValueMinimum))
++ {
++ double fMin = m_fValueMinimum / 100.0;
++ if (rExplicitScale.Minimum > fMin)
++ rExplicitScale.Minimum = fMin;
++ }
++ }
+ else if( ::rtl::math::isNan( m_fValueMinimum ) )
+ rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
+ else
+@@ -142,7 +150,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
+ if( bAutoMaximum )
+ {
+ if( m_aSourceScale.AxisType==AxisType::PERCENT )
++ {
+ rExplicitScale.Maximum = 1.0;
++ if (!::rtl::math::isNan(m_fValueMaximum))
++ {
++ double fMax = m_fValueMaximum / 100.0;
++ if (rExplicitScale.Maximum < fMax)
++ rExplicitScale.Maximum = fMax;
++ }
++ }
+ else if( ::rtl::math::isNan( m_fValueMaximum ) )
+ rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
+ else
+diff --git chart2/source/view/charttypes/AreaChart.cxx chart2/source/view/charttypes/AreaChart.cxx
+index f8bc0f0..159f665 100644
+--- chart2/source/view/charttypes/AreaChart.cxx
++++ chart2/source/view/charttypes/AreaChart.cxx
+@@ -603,6 +603,19 @@ struct FormerPoint
+
+ void AreaChart::createShapes()
+ {
++ sal_Bool bPercent = sal_False;
++ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
++ if (xPropSet.is())
++ {
++ try
++ {
++ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++ }
++
+ if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
+ return;
+
+@@ -752,9 +765,30 @@ void AreaChart::createShapes()
+ if( m_nDimension==3 && m_bArea && pSeriesList->size()!=1 )
+ fLogicY = fabs( fLogicY );
+
+- if( pPosHelper->isPercentY() && !::rtl::math::approxEqual( aLogicYSumMap[nAttachedAxisIndex], 0.0 ) )
++ if (bPercent)
++ {
++ // This data series is percent-stacked.
++
++ if (::rtl::math::approxEqual(aLogicYSumMap[nAttachedAxisIndex], 0.0))
++ fLogicY = 0.0;
++ else
++ fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex];
++
++ if (!pPosHelper->isPercentY())
++ {
++ // When the axis itself is not percent-stacked,
++ // their internal range value is 0 - 100. So we
++ // need to adjust the data point values
++ // accordingly.
++ fLogicY *= 100.0;
++ }
++ }
++ else if (pPosHelper->isPercentY())
+ {
+- fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex];
++ // The data series is not percent-stacked, but the
++ // axis itself is. In this case, the axis' internal
++ // range is 0 to 1. Adjust the data point values.
++ fLogicY /= 100.0;
+ }
+
+ if( ::rtl::math::isNan(fLogicX) || ::rtl::math::isInf(fLogicX)
+diff --git chart2/source/view/charttypes/BarChart.cxx chart2/source/view/charttypes/BarChart.cxx
+index f57ffa7..124d4af 100644
+--- chart2/source/view/charttypes/BarChart.cxx
++++ chart2/source/view/charttypes/BarChart.cxx
+@@ -466,6 +466,19 @@ void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis()
+
+ void BarChart::createShapes()
+ {
++ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
++ sal_Bool bPercent = sal_False;
++ if (xPropSet.is())
++ {
++ try
++ {
++ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++ }
++
+ if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
+ return;
+
+diff --git chart2/source/view/charttypes/VSeriesPlotter.cxx chart2/source/view/charttypes/VSeriesPlotter.cxx
+index 67cac8b..8a246ba 100644
+--- chart2/source/view/charttypes/VSeriesPlotter.cxx
++++ chart2/source/view/charttypes/VSeriesPlotter.cxx
+@@ -1149,6 +1149,23 @@ double VSeriesPlotter::getMaximumX()
+
+ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
+ {
++ sal_Bool bPercent = sal_False;
++ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
++ if (xPropSet.is())
++ {
++ try
++ {
++ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++ }
++
++ if (bPercent)
++ // This plotter is percent-stacked.
++ return 0.0;
++
+ if( !m_bCategoryXAxis )
+ {
+ double fMinY, fMaxY;
+@@ -1183,6 +1200,23 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s
+
+ double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
+ {
++ sal_Bool bPercent = sal_False;
++ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY);
++ if (xPropSet.is())
++ {
++ try
++ {
++ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent;
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ }
++ }
++
++ if (bPercent)
++ // This plotter is percent-stacked.
++ return 100.0;
++
+ if( !m_bCategoryXAxis )
+ {
+ double fMinY, fMaxY;
+diff --git chart2/source/view/main/ChartView.cxx chart2/source/view/main/ChartView.cxx
+index 09d510f..b5af9db 100644
+--- chart2/source/view/main/ChartView.cxx
++++ chart2/source/view/main/ChartView.cxx
+@@ -1751,7 +1751,15 @@ sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
+ if( nDimensionIndex == 0 )
+ aRoleToMatch = C2U("values-x");
+ Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
+- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
++ sal_Int32 nCTCount = aChartTypes.getLength();
++ if (nCTCount > 0)
++ // When multiple chart types share the same axis, always
++ // use the first chart type for automatic detection of
++ // desired number format. This is in line with the
++ // fact that the axis type is also determined from the
++ // first chart type alone.
++ nCTCount = 1;
++ for( sal_Int32 nCTIdx=0; nCTIdx<nCTCount; ++nCTIdx )
+ {
+ if( nDimensionIndex != 0 )
+ aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
diff --git a/patches/dev300/cws-koheichart02-sc.diff b/patches/dev300/cws-koheichart02-sc.diff
new file mode 100644
index 0000000..3631c84
--- /dev/null
+++ b/patches/dev300/cws-koheichart02-sc.diff
@@ -0,0 +1,274 @@
+diff --git sc/source/filter/excel/xechart.cxx sc/source/filter/excel/xechart.cxx
+index cf80876..0155f7b 100644
+--- sc/source/filter/excel/xechart.cxx
++++ sc/source/filter/excel/xechart.cxx
+@@ -143,16 +143,27 @@ void lclWriteChFrBlockRecord( XclExpStream& rStrm, const XclChFrBlock& rFrBlock,
+ }
+
+ template< typename Type >
+-inline bool lclIsAutoAnyOrGetValue( Type& rValue, const Any& rAny )
++inline bool lclIsAutoAnyOrGetValue( Type& rValue, const Any& rAny, bool bPercent )
+ {
+- return !rAny.hasValue() || !(rAny >>= rValue);
++ if (!rAny.hasValue())
++ return true;
++
++ if (rAny >>= rValue)
++ {
++ if (bPercent)
++ rValue *= 100.0;
++ return false;
++ }
++ else
++ return true;
+ }
+
+-bool lclIsAutoAnyOrGetScaledValue( double& rfValue, const Any& rAny, bool bLogScale )
++bool lclIsAutoAnyOrGetScaledValue( double& rfValue, const Any& rAny, bool bLogScale, bool bPercent )
+ {
+- bool bIsAuto = lclIsAutoAnyOrGetValue( rfValue, rAny );
++ bool bIsAuto = lclIsAutoAnyOrGetValue( rfValue, rAny, bPercent );
+ if( !bIsAuto && bLogScale )
+ rfValue = log( rfValue ) / log( 10.0 );
++
+ return bIsAuto;
+ }
+
+@@ -2412,7 +2423,7 @@ void XclExpChLabelRange::Convert( const ScaleData& rScaleData, bool bMirrorOrien
+ {
+ // origin
+ double fOrigin = 0.0;
+- if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin ) )
++ if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin, false ) )
+ maData.mnCross = limit_cast< sal_uInt16 >( fOrigin, 1, 31999 );
+
+ // reverse order
+@@ -2450,31 +2461,31 @@ XclExpChValueRange::XclExpChValueRange( const XclExpChRoot& rRoot ) :
+ {
+ }
+
+-void XclExpChValueRange::Convert( const ScaleData& rScaleData )
++void XclExpChValueRange::Convert( const ScaleData& rScaleData, bool bPercent )
+ {
+ // scaling algorithm
+ bool bLogScale = ScfApiHelper::GetServiceName( rScaleData.Scaling ) == SERVICE_CHART2_LOGSCALING;
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_LOGSCALE, bLogScale );
+
+ // min/max
+- bool bAutoMin = lclIsAutoAnyOrGetScaledValue( maData.mfMin, rScaleData.Minimum, bLogScale );
++ bool bAutoMin = lclIsAutoAnyOrGetScaledValue( maData.mfMin, rScaleData.Minimum, bLogScale, bPercent );
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN, bAutoMin );
+- bool bAutoMax = lclIsAutoAnyOrGetScaledValue( maData.mfMax, rScaleData.Maximum, bLogScale );
++ bool bAutoMax = lclIsAutoAnyOrGetScaledValue( maData.mfMax, rScaleData.Maximum, bLogScale, bPercent );
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX, bAutoMax );
+
+ // origin
+- bool bAutoCross = lclIsAutoAnyOrGetScaledValue( maData.mfCross, rScaleData.Origin, bLogScale );
++ bool bAutoCross = lclIsAutoAnyOrGetScaledValue( maData.mfCross, rScaleData.Origin, bLogScale, bPercent );
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOCROSS, bAutoCross );
+
+ // major increment
+ const IncrementData& rIncrementData = rScaleData.IncrementData;
+- bool bAutoMajor = lclIsAutoAnyOrGetValue( maData.mfMajorStep, rIncrementData.Distance ) || (maData.mfMajorStep <= 0.0);
++ bool bAutoMajor = lclIsAutoAnyOrGetValue( maData.mfMajorStep, rIncrementData.Distance, bPercent ) || (maData.mfMajorStep <= 0.0);
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAJOR, bAutoMajor );
+ // minor increment
+ const Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
+ sal_Int32 nCount = 0;
+ bool bAutoMinor = bLogScale || bAutoMajor || (rSubIncrementSeq.getLength() < 1) ||
+- lclIsAutoAnyOrGetValue( nCount, rSubIncrementSeq[ 0 ].IntervalCount ) || (nCount < 1);
++ lclIsAutoAnyOrGetValue( nCount, rSubIncrementSeq[ 0 ].IntervalCount, false ) || (nCount < 1);
+ if( !bAutoMinor )
+ maData.mfMinorStep = maData.mfMajorStep / nCount;
+ ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMINOR, bAutoMinor );
+@@ -2652,7 +2663,7 @@ void XclExpChAxis::SetRotation( sal_uInt16 nRotation )
+ mxTick->SetRotation( nRotation );
+ }
+
+-void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis, const XclChExtTypeInfo& rTypeInfo )
++void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis, const XclChExtTypeInfo& rTypeInfo, bool bPercent )
+ {
+ ScfPropertySet aAxisProp( xAxis );
+ bool bCategoryAxis = ((GetAxisType() == EXC_CHAXIS_X) && rTypeInfo.mbCategoryAxis) || (GetAxisType() == EXC_CHAXIS_Z);
+@@ -2682,7 +2693,7 @@ void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossi
+ {
+ mxValueRange.reset( new XclExpChValueRange( GetChRoot() ) );
+ if( xAxis.is() )
+- mxValueRange->Convert( xAxis->getScaleData() );
++ mxValueRange->Convert( xAxis->getScaleData(), bPercent );
+ // get position of crossing axis on this axis from passed axis object
+ if( aCrossingProp.Is() )
+ mxValueRange->ConvertAxisPosition( aCrossingProp );
+@@ -2847,10 +2858,10 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
+ // create axes according to chart type (no axes for pie and donut charts)
+ if( rTypeInfo.meTypeCateg != EXC_CHTYPECATEG_PIE )
+ {
+- ConvertAxis( mxXAxis, EXC_CHAXIS_X, mxXAxisTitle, EXC_CHOBJLINK_XAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_Y );
+- ConvertAxis( mxYAxis, EXC_CHAXIS_Y, mxYAxisTitle, EXC_CHOBJLINK_YAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_X );
++ ConvertAxis( mxXAxis, EXC_CHAXIS_X, mxXAxisTitle, EXC_CHOBJLINK_XAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_Y, bPercent );
++ ConvertAxis( mxYAxis, EXC_CHAXIS_Y, mxYAxisTitle, EXC_CHOBJLINK_YAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_X, bPercent );
+ if( pGroup->Is3dDeepChart() )
+- ConvertAxis( mxZAxis, EXC_CHAXIS_Z, mxZAxisTitle, EXC_CHOBJLINK_ZAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_NONE );
++ ConvertAxis( mxZAxis, EXC_CHAXIS_Z, mxZAxisTitle, EXC_CHOBJLINK_ZAXIS, xCoordSystem, rTypeInfo, EXC_CHART_AXIS_NONE, bPercent );
+ }
+
+ // X axis category ranges
+@@ -2935,7 +2946,8 @@ void XclExpChAxesSet::ConvertAxis(
+ XclExpChAxisRef& rxChAxis, sal_uInt16 nAxisType,
+ XclExpChTextRef& rxChAxisTitle, sal_uInt16 nTitleTarget,
+ Reference< XCoordinateSystem > xCoordSystem, const XclChExtTypeInfo& rTypeInfo,
+- sal_Int32 nCrossingAxisDim )
++ sal_Int32 nCrossingAxisDim,
++ bool bPercent )
+ {
+ // create and convert axis object
+ rxChAxis.reset( new XclExpChAxis( GetChRoot(), nAxisType ) );
+@@ -2943,7 +2955,7 @@ void XclExpChAxesSet::ConvertAxis(
+ sal_Int32 nApiAxesSetIdx = GetApiAxesSetIndex();
+ Reference< XAxis > xAxis = lclGetApiAxis( xCoordSystem, nApiAxisDim, nApiAxesSetIdx );
+ Reference< XAxis > xCrossingAxis = lclGetApiAxis( xCoordSystem, nCrossingAxisDim, nApiAxesSetIdx );
+- rxChAxis->Convert( xAxis, xCrossingAxis, rTypeInfo );
++ rxChAxis->Convert( xAxis, xCrossingAxis, rTypeInfo, bPercent );
+
+ // create and convert axis title
+ Reference< XTitled > xTitled( xAxis, UNO_QUERY );
+diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx
+index 41ec801..2c0af2d 100644
+--- sc/source/filter/excel/xichart.cxx
++++ sc/source/filter/excel/xichart.cxx
+@@ -2142,6 +2142,15 @@ Reference< XChartType > XclImpChType::CreateChartType( Reference< XDiagram > xDi
+ // additional properties
+ switch( maTypeInfo.meTypeCateg )
+ {
++ case EXC_CHTYPECATEG_LINE:
++ {
++ ScfPropertySet aTypeProp(xChartType);
++ bool bStacked = (maData.mnFlags & EXC_CHLINE_STACKED);
++ bool bPercent = (maData.mnFlags & EXC_CHLINE_PERCENT);
++ aTypeProp.SetBoolProperty(EXC_CHPROP_STACKED, bStacked);
++ aTypeProp.SetBoolProperty(EXC_CHPROP_PERCENT, bPercent);
++ }
++ break;
+ case EXC_CHTYPECATEG_BAR:
+ {
+ ScfPropertySet aTypeProp( xChartType );
+@@ -2150,6 +2159,10 @@ Reference< XChartType > XclImpChType::CreateChartType( Reference< XDiagram > xDi
+ aTypeProp.SetProperty( EXC_CHPROP_OVERLAPSEQ, aInt32Seq );
+ aInt32Seq[ 0 ] = aInt32Seq[ 1 ] = maData.mnGap;
+ aTypeProp.SetProperty( EXC_CHPROP_GAPWIDTHSEQ, aInt32Seq );
++ bool bStacked = (maData.mnFlags & EXC_CHBAR_STACKED);
++ bool bPercent = (maData.mnFlags & EXC_CHBAR_PERCENT);
++ aTypeProp.SetBoolProperty(EXC_CHPROP_STACKED, bStacked);
++ aTypeProp.SetBoolProperty(EXC_CHPROP_PERCENT, bPercent);
+ }
+ break;
+ case EXC_CHTYPECATEG_PIE:
+@@ -2712,7 +2725,7 @@ void XclImpChValueRange::ReadChValueRange( XclImpStream& rStrm )
+ >> maData.mnFlags;
+ }
+
+-void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) const
++void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient, bool bPercent ) const
+ {
+ // scaling algorithm
+ bool bLogScale = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_LOGSCALE );
+@@ -2720,15 +2733,18 @@ void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) co
+ rScaleData.Scaling.set( ScfApiHelper::CreateInstance( aScalingService ), UNO_QUERY );
+
+ // min/max
+- lclSetExpValueOrClearAny( rScaleData.Minimum, maData.mfMin, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN ) );
+- lclSetExpValueOrClearAny( rScaleData.Maximum, maData.mfMax, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX ) );
++ double fMinVal = bPercent ? maData.mfMin/100.0 : maData.mfMin;
++ double fMaxVal = bPercent ? maData.mfMax/100.0 : maData.mfMax;
++ lclSetExpValueOrClearAny( rScaleData.Minimum, fMinVal, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMIN ) );
++ lclSetExpValueOrClearAny( rScaleData.Maximum, fMaxVal, bLogScale, ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAX ) );
+
+ // increment
+ bool bAutoMajor = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMAJOR );
+ bool bAutoMinor = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMINOR );
+ // major increment
+ IncrementData& rIncrementData = rScaleData.IncrementData;
+- lclSetValueOrClearAny( rIncrementData.Distance, maData.mfMajorStep, bAutoMajor );
++ double fMajorStep = bPercent ? maData.mfMajorStep/100.0 : maData.mfMajorStep;
++ lclSetValueOrClearAny( rIncrementData.Distance, fMajorStep, bAutoMajor );
+ // minor increment
+ Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
+ rSubIncrementSeq.realloc( 1 );
+@@ -3007,8 +3023,11 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
+ break;
+ case cssc2::AxisType::REALNUMBER:
+ case cssc2::AxisType::PERCENT:
++ {
++ bool bPercent = (aScaleData.AxisType == cssc2::AxisType::PERCENT);
+ // #i85167# pie/donut charts have reversed rotation direction (at Y axis!)
+- mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE );
++ mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE, bPercent );
++ }
+ break;
+ default:
+ DBG_ERRORFILE( "XclImpChAxis::CreateAxis - unknown axis type" );
+diff --git sc/source/filter/inc/xechart.hxx sc/source/filter/inc/xechart.hxx
+index 8a724aa..6c04739 100644
+--- sc/source/filter/inc/xechart.hxx
++++ sc/source/filter/inc/xechart.hxx
+@@ -998,7 +998,7 @@ public:
+ explicit XclExpChValueRange( const XclExpChRoot& rRoot );
+
+ /** Converts value axis scaling settings. */
+- void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData );
++ void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData, bool bPercent );
+ /** Converts position settings of a crossing axis at this axis. */
+ void ConvertAxisPosition( const ScfPropertySet& rPropSet );
+
+@@ -1058,7 +1058,7 @@ public:
+ virtual void SetRotation( sal_uInt16 nRotation );
+
+ /** Converts formatting and scaling settings from the passed axis. */
+- void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis, const XclChExtTypeInfo& rTypeInfo );
++ void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis, const XclChExtTypeInfo& rTypeInfo, bool bPercent );
+ /** Converts and writes 3D wall/floor properties from the passed diagram. */
+ void ConvertWall( XDiagramRef xDiagram );
+
+@@ -1131,7 +1131,8 @@ private:
+ void ConvertAxis( XclExpChAxisRef& rxChAxis, sal_uInt16 nAxisType,
+ XclExpChTextRef& rxChAxisTitle, sal_uInt16 nTitleTarget,
+ XCoordSystemRef xCoordSystem, const XclChExtTypeInfo& rTypeInfo,
+- sal_Int32 nCrossingAxisDim );
++ sal_Int32 nCrossingAxisDim,
++ bool bPercent );
+
+ virtual void WriteBody( XclExpStream& rStrm );
+
+diff --git sc/source/filter/inc/xichart.hxx sc/source/filter/inc/xichart.hxx
+index e923ee1..0686c26 100644
+--- sc/source/filter/inc/xichart.hxx
++++ sc/source/filter/inc/xichart.hxx
+@@ -1130,7 +1130,7 @@ public:
+ /** Reads the CHVALUERANGE record (numeric axis scaling properties). */
+ void ReadChValueRange( XclImpStream& rStrm );
+ /** Converts value axis scaling settings. */
+- void Convert( ScaleData& rScaleData, bool bMirrorOrient ) const;
++ void Convert( ScaleData& rScaleData, bool bMirrorOrient, bool bPercent ) const;
+ /** Converts position settings of this axis at a crossing axis. */
+ void ConvertAxisPosition( ScfPropertySet& rPropSet ) const;
+
+diff --git sc/source/filter/inc/xlchart.hxx sc/source/filter/inc/xlchart.hxx
+index 7e3873b..43ea79b 100644
+--- sc/source/filter/inc/xlchart.hxx
++++ sc/source/filter/inc/xlchart.hxx
+@@ -115,6 +115,7 @@ namespace com { namespace sun { namespace star {
+ #define EXC_CHPROP_OFFSET CREATE_OUSTRING( "Offset" )
+ #define EXC_CHPROP_OVERLAPSEQ CREATE_OUSTRING( "OverlapSequence" )
+ #define EXC_CHPROP_PERCENTAGENUMFMT CREATE_OUSTRING( "PercentageNumberFormat" )
++#define EXC_CHPROP_PERCENT CREATE_OUSTRING( "Percent" )
+ #define EXC_CHPROP_PERCENTDIAGONAL CREATE_OUSTRING( "PercentDiagonal" )
+ #define EXC_CHPROP_PERSPECTIVE CREATE_OUSTRING( "Perspective" )
+ #define EXC_CHPROP_POSITIVEERROR CREATE_OUSTRING( "PositiveError" )
+@@ -129,6 +130,7 @@ namespace com { namespace sun { namespace star {
+ #define EXC_CHPROP_SHOWHIGHLOW CREATE_OUSTRING( "ShowHighLow" )
+ #define EXC_CHPROP_SHOWNEGATIVEERROR CREATE_OUSTRING( "ShowNegativeError" )
+ #define EXC_CHPROP_SHOWPOSITIVEERROR CREATE_OUSTRING( "ShowPositiveError" )
++#define EXC_CHPROP_STACKED CREATE_OUSTRING( "Stacked" )
+ #define EXC_CHPROP_STACKCHARACTERS CREATE_OUSTRING( "StackCharacters" )
+ #define EXC_CHPROP_STACKINGDIR CREATE_OUSTRING( "StackingDirection" )
+ #define EXC_CHPROP_STARTINGANGLE CREATE_OUSTRING( "StartingAngle" )
diff --git a/patches/dev300/cws-koheichart02-xmloff.diff b/patches/dev300/cws-koheichart02-xmloff.diff
new file mode 100644
index 0000000..f0d12f3
--- /dev/null
+++ b/patches/dev300/cws-koheichart02-xmloff.diff
@@ -0,0 +1,83 @@
+diff --git xmloff/source/chart/SchXMLChartContext.cxx xmloff/source/chart/SchXMLChartContext.cxx
+index 5125a37..04a5505 100644
+--- xmloff/source/chart/SchXMLChartContext.cxx
++++ xmloff/source/chart/SchXMLChartContext.cxx
+@@ -71,13 +71,17 @@
+ #include <com/sun/star/chart2/data/XDataSink.hpp>
+ #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+ #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
++#include <com/sun/star/chart2/XCoordinateSystem.hpp>
+ #include <com/sun/star/chart2/XChartTypeContainer.hpp>
++#include <com/sun/star/chart2/XChartType.hpp>
+ #include <com/sun/star/chart2/XTitled.hpp>
+
+ using namespace com::sun::star;
+ using namespace ::xmloff::token;
+ using ::rtl::OUString;
+ using com::sun::star::uno::Reference;
++using ::com::sun::star::uno::Sequence;
++using ::com::sun::star::uno::UNO_QUERY;
+ using namespace ::SchXMLTools;
+
+ namespace
+@@ -767,6 +771,48 @@ void lcl_ApplyDataFromRectangularRangeToDiagram(
+ xTemplate->changeDiagramData( xNewDia, xDataSource, aArgs );
+ }
+
++static void lcl_setStackTypeToAllChartTypes(
++ const Reference<chart2::XDiagram>& rDiagram, const uno::Any& rStacked, const uno::Any& rPercent)
++{
++ Reference<chart2::XCoordinateSystemContainer> xCoordContainer(rDiagram, uno::UNO_QUERY);
++ if (!xCoordContainer.is())
++ return;
++
++ Sequence< Reference<chart2::XCoordinateSystem> > xCoords = xCoordContainer->getCoordinateSystems();
++
++ sal_Int32 n = xCoords.getLength();
++ if (!n)
++ return;
++
++ for (sal_Int32 i = 0; i < n; ++i)
++ {
++ Reference<chart2::XChartTypeContainer> xChartTypeContainer(xCoords[i], UNO_QUERY);
++ if (!xChartTypeContainer.is())
++ continue;
++
++ Sequence< Reference<chart2::XChartType> > xChartTypes = xChartTypeContainer->getChartTypes();
++ sal_Int32 nChartTypeCount = xChartTypes.getLength();
++ for (sal_Int32 j = 0; j < nChartTypeCount; ++j)
++ {
++ Reference<beans::XPropertySet> xProp(xChartTypes[j], UNO_QUERY);
++ if (!xProp.is())
++ continue;
++
++ try
++ {
++ if (rStacked.hasValue())
++ xProp->setPropertyValue(OUString::createFromAscii("Stacked"), rStacked);
++ if (rPercent.hasValue())
++ xProp->setPropertyValue(OUString::createFromAscii("Percent"), rPercent);
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ // fail silently.
++ }
++ }
++ }
++}
++
+ void SchXMLChartContext::EndElement()
+ {
+ uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
+@@ -952,6 +998,11 @@ void SchXMLChartContext::EndElement()
+ , SchXMLSeriesHelper::getDataSeriesIndexMapFromDiagram(xNewDiagram) );
+ }
+
++ // For now, set the diagram's stack-related properties to all included
++ // chart types until we support chart types of mixed stack states.
++ lcl_setStackTypeToAllChartTypes(
++ xNewDoc->getFirstDiagram(), maSeriesDefaultsAndStyles.maStackedDefault, maSeriesDefaultsAndStyles.maPercentDefault);
++
+ SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, uno::Reference< frame::XModel >(xDoc, uno::UNO_QUERY ) );
+
+ //set defaults from diagram to the new series:
More information about the ooo-build-commit
mailing list