summaryrefslogtreecommitdiff
path: root/sc/source/filter/inc/xichart.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/inc/xichart.hxx')
-rw-r--r--sc/source/filter/inc/xichart.hxx44
1 files changed, 40 insertions, 4 deletions
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 25e52f3f0168..5d03c99b124a 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -39,8 +39,8 @@
#include "token.hxx"
#include "xlchart.hxx"
#include "xlstyle.hxx"
+#include "xiescher.hxx"
#include "xistring.hxx"
-#include "xiroot.hxx"
namespace com { namespace sun { namespace star {
namespace frame
@@ -111,7 +111,7 @@ public:
/** Starts the API chart document conversion. Must be called once before all API conversion. */
void InitConversion( XChartDocRef xChartDoc ) const;
/** Finishes the API chart document conversion. Must be called once after all API conversion. */
- void FinishConversion( ScfProgressBar& rProgress ) const;
+ void FinishConversion( XclImpDffConverter& rDffConv ) const;
/** Returns the data provider for the chart document. */
XDataProviderRef GetDataProvider() const;
@@ -1355,7 +1355,9 @@ public:
inline sal_Size GetProgressSize() const { return 2 * EXC_CHART_PROGRESS_SIZE; }
/** Converts and writes all properties to the passed chart. */
- void Convert( XChartDocRef xChartDoc, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const;
+ void Convert( XChartDocRef xChartDoc,
+ XclImpDffConverter& rDffConv,
+ const ::rtl::OUString& rObjName ) const;
private:
/** Reads a CHSERIES group (data series source and formatting). */
@@ -1400,6 +1402,31 @@ typedef ScfRef< XclImpChChart > XclImpChChartRef;
// ----------------------------------------------------------------------------
+/** Drawing container of a chart. */
+class XclImpChartDrawing : public XclImpDrawing
+{
+public:
+ explicit XclImpChartDrawing( const XclImpRoot& rRoot, bool bOwnTab );
+
+ /** Converts all objects and inserts them into the chart drawing page. */
+ void ConvertObjects(
+ XclImpDffConverter& rDffConv,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ const Rectangle& rChartRect );
+
+ /** Calculate the resulting rectangle of the passed anchor. */
+ virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
+ /** Called whenever an object has been inserted into the draw page. */
+ virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj );
+
+private:
+ Rectangle maChartRect; /// Position and size of the chart shape in 1/100 mm.
+ SCTAB mnScTab; /// Index of the sheet that contains the chart.
+ bool mbOwnTab; /// True = own sheet, false = embedded object.
+};
+
+// ----------------------------------------------------------------------------
+
/** Represents the entire chart substream (all records in BOF/EOF block). */
class XclImpChart : protected XclImpRoot
{
@@ -1410,6 +1437,7 @@ public:
/** Constructs a new chart object.
@param bOwnTab True = chart is on an own sheet; false = chart is an embedded object. */
explicit XclImpChart( const XclImpRoot& rRoot, bool bOwnTab );
+ virtual ~XclImpChart();
/** Reads the complete chart substream (BOF/EOF block).
@descr The passed stream must be located in the BOF record of the chart substream. */
@@ -1423,14 +1451,22 @@ public:
inline bool IsPivotChart() const { return mbIsPivotChart; }
/** Creates the chart object in the passed component. */
- void Convert( XModelRef xModel, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const;
+ void Convert( XModelRef xModel,
+ XclImpDffConverter& rDffConv,
+ const ::rtl::OUString& rObjName,
+ const Rectangle& rChartRect ) const;
private:
+ /** Returns (initially creates) the drawing container for embedded shapes. **/
+ XclImpChartDrawing& GetChartDrawing();
/** Reads the CHCHART group (entire chart data). */
void ReadChChart( XclImpStream& rStrm );
private:
+ typedef ScfRef< XclImpChartDrawing > XclImpChartDrawingRef;
+
XclImpChChartRef mxChartData; /// The chart data (CHCHART group).
+ XclImpChartDrawingRef mxChartDrawing; /// Drawing container for embedded shapes.
bool mbOwnTab; /// true = own sheet; false = embedded object.
bool mbIsPivotChart; /// true = chart is based on a pivot table.
};