Bugzilla – Attachment 75133 Details for
Bug 61135
Implement a 'stepped lines' feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for adding the actual stepped line code
LO_stepped_lines_first_step.diff (text/plain), 4.64 KB, created by
Eric Seynaeve
on 2013-02-19 21:34:43 UTC
(
hide
)
Description:
Patch for adding the actual stepped line code
Filename:
MIME Type:
Creator:
Eric Seynaeve
Created:
2013-02-19 21:34:43 UTC
Size:
4.64 KB
patch
obsolete
>diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src >index 45659cf..fa9c93b 100644 >--- a/chart2/source/controller/dialogs/Strings.src >+++ b/chart2/source/controller/dialogs/Strings.src >@@ -27,6 +27,11 @@ String STR_DLG_SMOOTH_LINE_PROPERTIES > Text [ en-US ] = "Smooth Lines" ; > }; > >+String STR_DLG_STEPPED_LINE_PROPERTIES >+{ >+ Text [ en-US ] = "Stepped Lines" ; >+}; >+ > String STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE > { > Text [ en-US ] = "Number Format for Percentage Value" ; >diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx >index a9e207c..895bdbf 100644 >--- a/chart2/source/view/charttypes/AreaChart.cxx >+++ b/chart2/source/view/charttypes/AreaChart.cxx >@@ -287,6 +287,56 @@ void lcl_removeDuplicatePoints( drawing::PolyPolygonShape3D& rPolyPoly, Plotting > rPolyPoly=aTmp; > } > >+bool AreaChart::create_stepped_line( drawing::PolyPolygonShape3D aStartPoly, PlottingPositionHelper* pPosHelper, drawing::PolyPolygonShape3D &aPoly ) >+{ >+ drawing::PolyPolygonShape3D aSteppedPoly; >+ >+ aSteppedPoly.SequenceX.realloc(0); >+ aSteppedPoly.SequenceY.realloc(0); >+ aSteppedPoly.SequenceZ.realloc(0); >+ >+ sal_uInt32 nOuterCount = aStartPoly.SequenceX.getLength(); >+ if ( !nOuterCount ) >+ return false; >+ >+ aSteppedPoly.SequenceX.realloc(nOuterCount); >+ aSteppedPoly.SequenceY.realloc(nOuterCount); >+ aSteppedPoly.SequenceZ.realloc(nOuterCount); >+ for( sal_uInt32 nOuter = 0; nOuter < nOuterCount; ++nOuter ) >+ { >+ if( aStartPoly.SequenceX[nOuter].getLength() <= 1 ) >+ continue; //we need at least two points >+ >+ sal_uInt32 nMaxIndexPoints = aStartPoly.SequenceX[nOuter].getLength()-1; // is >=1 >+ const double* pOldX = aStartPoly.SequenceX[nOuter].getConstArray(); >+ const double* pOldY = aStartPoly.SequenceY[nOuter].getConstArray(); >+ const double* pOldZ = aStartPoly.SequenceZ[nOuter].getConstArray(); >+ >+ aSteppedPoly.SequenceX[nOuter].realloc( nMaxIndexPoints*2); >+ aSteppedPoly.SequenceY[nOuter].realloc( nMaxIndexPoints*2); >+ aSteppedPoly.SequenceZ[nOuter].realloc( nMaxIndexPoints*2); >+ >+ double* pNewX = aSteppedPoly.SequenceX[nOuter].getArray(); >+ double* pNewY = aSteppedPoly.SequenceY[nOuter].getArray(); >+ double* pNewZ = aSteppedPoly.SequenceZ[nOuter].getArray(); >+ >+ for( sal_uInt32 oi = 0; oi < nMaxIndexPoints; oi++ ) >+ { >+ // create the intermediate point >+ pNewX[oi*2] = pOldX[oi]; >+ pNewY[oi*2] = pOldY[oi+1]; >+ pNewZ[oi*2] = pOldZ[oi]; >+ // and now the normal one >+ pNewX[oi*2+1] = pOldX[oi+1]; >+ pNewY[oi*2+1] = pOldY[oi+1]; >+ pNewZ[oi*2+1] = pOldZ[oi+1]; >+ } >+ } >+ Clipping::clipPolygonAtRectangle( aSteppedPoly, pPosHelper->getScaledLogicClipDoubleRect(), aPoly ); >+ >+ return true; >+} >+ > bool AreaChart::impl_createLine( VDataSeries* pSeries > , drawing::PolyPolygonShape3D* pSeriesPoly > , PlottingPositionHelper* pPosHelper ) >@@ -309,6 +359,13 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries > lcl_removeDuplicatePoints( aSplinePoly, *pPosHelper ); > Clipping::clipPolygonAtRectangle( aSplinePoly, pPosHelper->getScaledLogicClipDoubleRect(), aPoly ); > } >+ else if (CurveStyle_STEPPED_LINES==m_eCurveStyle) >+ { >+ if (!create_stepped_line(*pSeriesPoly, pPosHelper, aPoly)) >+ { >+ return false; >+ } >+ } > else > { > bool bIsClipped = false; >diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx >index cc8b9ae..34304ad 100644 >--- a/chart2/source/view/charttypes/AreaChart.hxx >+++ b/chart2/source/view/charttypes/AreaChart.hxx >@@ -80,6 +80,9 @@ private: //methods > bool impl_createLine( VDataSeries* pSeries > , ::com::sun::star::drawing::PolyPolygonShape3D* pSeriesPoly > , PlottingPositionHelper* pPosHelper ); >+ bool create_stepped_line( ::com::sun::star::drawing::PolyPolygonShape3D aStartPoly >+ , PlottingPositionHelper* pPosHelper >+ , ::com::sun::star::drawing::PolyPolygonShape3D &aPoly ); > > private: //member > PlottingPositionHelper* m_pMainPosHelper; >diff --git a/offapi/com/sun/star/chart2/CurveStyle.idl b/offapi/com/sun/star/chart2/CurveStyle.idl >index 3164186..08ac4d0 100644 >--- a/offapi/com/sun/star/chart2/CurveStyle.idl >+++ b/offapi/com/sun/star/chart2/CurveStyle.idl >@@ -48,7 +48,11 @@ enum CurveStyle > > /** > */ >- NURBS >+ NURBS, >+ >+ /** >+ */ >+ STEPPED_LINES > }; > > } ; // chart2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 61135
:
75133
|
75201
|
75202
|
75203
|
75983
|
75984
|
75985
|
75987
|
75989