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
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 )
{
mxString.reset();
......@@ -2049,10 +2054,16 @@ bool XclExpChSeries::ConvertStockSeries( XDataSeriesRef xDataSeries,
bool XclExpChSeries::ConvertTrendLine( const XclExpChSeries& rParent, Reference< XRegressionCurve > xRegCurve )
{
InitFromParent( rParent );
mxTrendLine.reset( new XclExpChSerTrendLine( GetChRoot() ) );
bool bOk = mxTrendLine->Convert( xRegCurve, mnSeriesIdx );
if( bOk )
{
OUString aName;
ScfPropertySet aProperties( xRegCurve );
aProperties.GetProperty(aName, EXC_CHPROP_CURVENAME);
mxTitleLink->ConvertString(aName);
mxSeriesFmt = mxTrendLine->GetDataFormat();
GetChartData().SetDataLabel( mxTrendLine->GetDataLabel() );
}
......
......@@ -1645,6 +1645,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
ScfPropertySet aPropSet( xRegCurve );
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_MOVING_AVERAGE_PERIOD, static_cast<sal_Int32> (maData.mnOrder) );
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_FORWARD, maData.mfForecastFor);
......@@ -1911,9 +1912,17 @@ void XclImpChSeries::FinalizeDataFormats()
// copy series formatting to child objects
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 )
{
aMIt->second->SetSeriesData( mxValueLink, mxSeriesFmt );
}
}
else if( XclImpChTypeGroup* pTypeGroup = GetChartData().GetTypeGroup( mnGroupIdx ).get() )
{
......@@ -2155,7 +2164,9 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c
{
Reference< XRegressionCurve > xRegCurve = (*aIt)->CreateRegressionCurve();
if( xRegCurve.is() )
{
xRegCurveCont->addRegressionCurve( xRegCurve );
}
}
catch( Exception& )
{
......
......@@ -406,6 +406,8 @@ public:
public:
explicit XclExpChSourceLink( const XclExpChRoot& rRoot, sal_uInt8 nDestType );
void ConvertString( OUString aString );
/** Converts the passed source link, returns the number of linked values. */
sal_uInt16 ConvertDataSequence( XDataSequenceRef xDataSeq, bool bSplitToColumns, sal_uInt16 nDefCount = 0 );
/** Converts the passed sequence of formatted string objects, returns leading font index. */
......
......@@ -736,11 +736,14 @@ public:
/** Sets formatting information for the trend line. */
inline void SetDataFormat( XclImpChDataFormatRef xDataFmt ) { mxDataFmt = xDataFmt; }
inline void SetTrendlineName( OUString aTrendlineName) { maTrendLineName = aTrendlineName; }
/** Creates an API object representing this trend line. */
XRegressionCurveRef CreateRegressionCurve() const;
private:
XclChSerTrendLine maData; /// Contents of the CHSERTRENDLINE record.
OUString maTrendLineName;
XclChSerTrendLine maData; /// Contents of the CHSERTRENDLINE record.
XclImpChDataFormatRef mxDataFmt; /// Formatting settings of the trend line.
};
......
......@@ -68,6 +68,7 @@ class XclRoot;
#define EXC_CHPROP_CROSSOVERPOSITION "CrossoverPosition"
#define EXC_CHPROP_CROSSOVERVALUE "CrossoverValue"
#define EXC_CHPROP_CURVESTYLE "CurveStyle"
#define EXC_CHPROP_CURVENAME "CurveName"
#define EXC_CHPROP_D3DCAMERAGEOMETRY "D3DCameraGeometry"
#define EXC_CHPROP_D3DSCENEAMBIENTCOLOR "D3DSceneAmbientColor"
#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