Kaydet (Commit) 28871957 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Support regression curve name in old binary XLS XP/2k/2k3 format.

Change-Id: Ie6f2fd3cce70e4789805e788846d3beb64620a4b
üst fdb67118
...@@ -972,6 +972,11 @@ sal_uInt16 XclExpChSourceLink::ConvertDataSequence( Reference< XDataSequence > x ...@@ -972,6 +972,11 @@ sal_uInt16 XclExpChSourceLink::ConvertDataSequence( Reference< XDataSequence > x
return ulimit_cast< sal_uInt16 >( nValueCount, EXC_CHDATAFORMAT_MAXPOINTCOUNT ); return ulimit_cast< sal_uInt16 >( nValueCount, EXC_CHDATAFORMAT_MAXPOINTCOUNT );
} }
void XclExpChSourceLink::ConvertString( OUString aString )
{
mxString = XclExpStringHelper::CreateString( GetRoot(), aString, EXC_STR_FORCEUNICODE | EXC_STR_8BITLENGTH | EXC_STR_SEPARATEFORMATS );
}
sal_uInt16 XclExpChSourceLink::ConvertStringSequence( const Sequence< Reference< XFormattedString > >& rStringSeq ) sal_uInt16 XclExpChSourceLink::ConvertStringSequence( const Sequence< Reference< XFormattedString > >& rStringSeq )
{ {
mxString.reset(); mxString.reset();
...@@ -2049,10 +2054,16 @@ bool XclExpChSeries::ConvertStockSeries( XDataSeriesRef xDataSeries, ...@@ -2049,10 +2054,16 @@ bool XclExpChSeries::ConvertStockSeries( XDataSeriesRef xDataSeries,
bool XclExpChSeries::ConvertTrendLine( const XclExpChSeries& rParent, Reference< XRegressionCurve > xRegCurve ) bool XclExpChSeries::ConvertTrendLine( const XclExpChSeries& rParent, Reference< XRegressionCurve > xRegCurve )
{ {
InitFromParent( rParent ); InitFromParent( rParent );
mxTrendLine.reset( new XclExpChSerTrendLine( GetChRoot() ) ); mxTrendLine.reset( new XclExpChSerTrendLine( GetChRoot() ) );
bool bOk = mxTrendLine->Convert( xRegCurve, mnSeriesIdx ); bool bOk = mxTrendLine->Convert( xRegCurve, mnSeriesIdx );
if( bOk ) if( bOk )
{ {
OUString aName;
ScfPropertySet aProperties( xRegCurve );
aProperties.GetProperty(aName, EXC_CHPROP_CURVENAME);
mxTitleLink->ConvertString(aName);
mxSeriesFmt = mxTrendLine->GetDataFormat(); mxSeriesFmt = mxTrendLine->GetDataFormat();
GetChartData().SetDataLabel( mxTrendLine->GetDataLabel() ); GetChartData().SetDataLabel( mxTrendLine->GetDataLabel() );
} }
......
...@@ -1645,6 +1645,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons ...@@ -1645,6 +1645,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
ScfPropertySet aPropSet( xRegCurve ); ScfPropertySet aPropSet( xRegCurve );
mxDataFmt->ConvertLine( aPropSet, EXC_CHOBJTYPE_TRENDLINE ); mxDataFmt->ConvertLine( aPropSet, EXC_CHOBJTYPE_TRENDLINE );
aPropSet.SetProperty(EXC_CHPROP_CURVENAME, maTrendLineName);
aPropSet.SetProperty(EXC_CHPROP_POLYNOMIAL_DEGREE, static_cast<sal_Int32> (maData.mnOrder) ); aPropSet.SetProperty(EXC_CHPROP_POLYNOMIAL_DEGREE, static_cast<sal_Int32> (maData.mnOrder) );
aPropSet.SetProperty(EXC_CHPROP_MOVING_AVERAGE_PERIOD, static_cast<sal_Int32> (maData.mnOrder) ); aPropSet.SetProperty(EXC_CHPROP_MOVING_AVERAGE_PERIOD, static_cast<sal_Int32> (maData.mnOrder) );
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_FORWARD, maData.mfForecastFor); aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_FORWARD, maData.mfForecastFor);
...@@ -1911,10 +1912,18 @@ void XclImpChSeries::FinalizeDataFormats() ...@@ -1911,10 +1912,18 @@ void XclImpChSeries::FinalizeDataFormats()
// copy series formatting to child objects // copy series formatting to child objects
for( XclImpChSerTrendLineList::iterator aLIt = maTrendLines.begin(), aLEnd = maTrendLines.end(); aLIt != aLEnd; ++aLIt ) for( XclImpChSerTrendLineList::iterator aLIt = maTrendLines.begin(), aLEnd = maTrendLines.end(); aLIt != aLEnd; ++aLIt )
(*aLIt)->SetDataFormat( mxSeriesFmt ); {
(*aLIt)->SetDataFormat(mxSeriesFmt);
if (mxTitleLink->HasString())
{
(*aLIt)->SetTrendlineName(mxTitleLink->GetString());
}
}
for( XclImpChSerErrorBarMap::iterator aMIt = maErrorBars.begin(), aMEnd = maErrorBars.end(); aMIt != aMEnd; ++aMIt ) for( XclImpChSerErrorBarMap::iterator aMIt = maErrorBars.begin(), aMEnd = maErrorBars.end(); aMIt != aMEnd; ++aMIt )
{
aMIt->second->SetSeriesData( mxValueLink, mxSeriesFmt ); aMIt->second->SetSeriesData( mxValueLink, mxSeriesFmt );
} }
}
else if( XclImpChTypeGroup* pTypeGroup = GetChartData().GetTypeGroup( mnGroupIdx ).get() ) else if( XclImpChTypeGroup* pTypeGroup = GetChartData().GetTypeGroup( mnGroupIdx ).get() )
{ {
// *** series is a regular data series *** // *** series is a regular data series ***
...@@ -2155,8 +2164,10 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c ...@@ -2155,8 +2164,10 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c
{ {
Reference< XRegressionCurve > xRegCurve = (*aIt)->CreateRegressionCurve(); Reference< XRegressionCurve > xRegCurve = (*aIt)->CreateRegressionCurve();
if( xRegCurve.is() ) if( xRegCurve.is() )
{
xRegCurveCont->addRegressionCurve( xRegCurve ); xRegCurveCont->addRegressionCurve( xRegCurve );
} }
}
catch( Exception& ) catch( Exception& )
{ {
OSL_FAIL( "XclImpChSeries::ConvertTrendLines - cannot add regression curve" ); OSL_FAIL( "XclImpChSeries::ConvertTrendLines - cannot add regression curve" );
......
...@@ -406,6 +406,8 @@ public: ...@@ -406,6 +406,8 @@ public:
public: public:
explicit XclExpChSourceLink( const XclExpChRoot& rRoot, sal_uInt8 nDestType ); explicit XclExpChSourceLink( const XclExpChRoot& rRoot, sal_uInt8 nDestType );
void ConvertString( OUString aString );
/** Converts the passed source link, returns the number of linked values. */ /** Converts the passed source link, returns the number of linked values. */
sal_uInt16 ConvertDataSequence( XDataSequenceRef xDataSeq, bool bSplitToColumns, sal_uInt16 nDefCount = 0 ); sal_uInt16 ConvertDataSequence( XDataSequenceRef xDataSeq, bool bSplitToColumns, sal_uInt16 nDefCount = 0 );
/** Converts the passed sequence of formatted string objects, returns leading font index. */ /** Converts the passed sequence of formatted string objects, returns leading font index. */
......
...@@ -736,10 +736,13 @@ public: ...@@ -736,10 +736,13 @@ public:
/** Sets formatting information for the trend line. */ /** Sets formatting information for the trend line. */
inline void SetDataFormat( XclImpChDataFormatRef xDataFmt ) { mxDataFmt = xDataFmt; } inline void SetDataFormat( XclImpChDataFormatRef xDataFmt ) { mxDataFmt = xDataFmt; }
inline void SetTrendlineName( OUString aTrendlineName) { maTrendLineName = aTrendlineName; }
/** Creates an API object representing this trend line. */ /** Creates an API object representing this trend line. */
XRegressionCurveRef CreateRegressionCurve() const; XRegressionCurveRef CreateRegressionCurve() const;
private: private:
OUString maTrendLineName;
XclChSerTrendLine maData; /// Contents of the CHSERTRENDLINE record. XclChSerTrendLine maData; /// Contents of the CHSERTRENDLINE record.
XclImpChDataFormatRef mxDataFmt; /// Formatting settings of the trend line. XclImpChDataFormatRef mxDataFmt; /// Formatting settings of the trend line.
}; };
......
...@@ -68,6 +68,7 @@ class XclRoot; ...@@ -68,6 +68,7 @@ class XclRoot;
#define EXC_CHPROP_CROSSOVERPOSITION "CrossoverPosition" #define EXC_CHPROP_CROSSOVERPOSITION "CrossoverPosition"
#define EXC_CHPROP_CROSSOVERVALUE "CrossoverValue" #define EXC_CHPROP_CROSSOVERVALUE "CrossoverValue"
#define EXC_CHPROP_CURVESTYLE "CurveStyle" #define EXC_CHPROP_CURVESTYLE "CurveStyle"
#define EXC_CHPROP_CURVENAME "CurveName"
#define EXC_CHPROP_D3DCAMERAGEOMETRY "D3DCameraGeometry" #define EXC_CHPROP_D3DCAMERAGEOMETRY "D3DCameraGeometry"
#define EXC_CHPROP_D3DSCENEAMBIENTCOLOR "D3DSceneAmbientColor" #define EXC_CHPROP_D3DSCENEAMBIENTCOLOR "D3DSceneAmbientColor"
#define EXC_CHPROP_D3DSCENELIGHTON1 "D3DSceneLightOn1" #define EXC_CHPROP_D3DSCENELIGHTON1 "D3DSceneLightOn1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment