summaryrefslogtreecommitdiff
path: root/oox/inc/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox/inc/oox')
-rw-r--r--oox/inc/oox/drawingml/chart/axisconverter.hxx9
-rw-r--r--oox/inc/oox/drawingml/chart/chartcontextbase.hxx15
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx59
-rw-r--r--oox/inc/oox/drawingml/chart/modelbase.hxx19
-rw-r--r--oox/inc/oox/drawingml/chart/plotareaconverter.hxx3
-rw-r--r--oox/inc/oox/drawingml/chart/plotareamodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/seriesconverter.hxx12
-rw-r--r--oox/inc/oox/drawingml/chart/titlecontext.hxx15
-rw-r--r--oox/inc/oox/drawingml/chart/titleconverter.hxx3
-rw-r--r--oox/inc/oox/drawingml/chart/titlemodel.hxx18
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx26
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx7
12 files changed, 134 insertions, 53 deletions
diff --git a/oox/inc/oox/drawingml/chart/axisconverter.hxx b/oox/inc/oox/drawingml/chart/axisconverter.hxx
index 4e8f86279133..925fa1fe8b4f 100644
--- a/oox/inc/oox/drawingml/chart/axisconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/axisconverter.hxx
@@ -41,15 +41,6 @@ namespace chart {
// ============================================================================
-const sal_Int32 API_PRIM_AXESSET = 0;
-const sal_Int32 API_SECN_AXESSET = 1;
-
-const sal_Int32 API_X_AXIS = 0;
-const sal_Int32 API_Y_AXIS = 1;
-const sal_Int32 API_Z_AXIS = 2;
-
-// ============================================================================
-
struct AxisModel;
class TypeGroupConverter;
diff --git a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
index 470596a5228e..f034b4b6e6bb 100644
--- a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
+++ b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
@@ -79,6 +79,21 @@ public:
// ============================================================================
+struct LayoutModel;
+
+/** Handler for a chart layout context (c:layout element).
+ */
+class LayoutContext : public ContextBase< LayoutModel >
+{
+public:
+ explicit LayoutContext( ::oox::core::ContextHandler2Helper& rParent, LayoutModel& rModel );
+ virtual ~LayoutContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index 23f5a5ff9266..c937c6e94900 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -32,9 +32,12 @@
#include "oox/drawingml/chart/objectformatter.hxx"
namespace com { namespace sun { namespace star {
+ namespace awt { struct Rectangle; }
namespace awt { struct Size; }
namespace lang { class XMultiServiceFactory; }
namespace chart2 { class XChartDocument; }
+ namespace chart2 { class XTitle; }
+ namespace drawing { class XShape; }
} } }
namespace oox { namespace core {
@@ -45,13 +48,21 @@ namespace oox {
namespace drawingml {
namespace chart {
-// ============================================================================
-
class ChartConverter;
-class ObjectFormatter;
struct ChartSpaceModel;
struct ConverterData;
+// ============================================================================
+
+const sal_Int32 API_PRIM_AXESSET = 0;
+const sal_Int32 API_SECN_AXESSET = 1;
+
+const sal_Int32 API_X_AXIS = 0;
+const sal_Int32 API_Y_AXIS = 1;
+const sal_Int32 API_Z_AXIS = 2;
+
+// ============================================================================
+
class ConverterRoot
{
public:
@@ -63,12 +74,6 @@ public:
const ::com::sun::star::awt::Size& rChartSize );
virtual ~ConverterRoot();
- /** Creates an instance for the passed service name, using the passed service factory. */
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- createInstance(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::rtl::OUString& rServiceName );
-
/** Creates an instance for the passed service name, using the process service factory. */
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
createInstance( const ::rtl::OUString& rServiceName ) const;
@@ -86,12 +91,24 @@ protected:
/** Returns the object formatter. */
ObjectFormatter& getFormatter() const;
+ /** Registers a title object and its layout data, needed for conversion of
+ the title position using the old Chart1 API. */
+ void registerTitleLayout(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >& rxTitle,
+ const ModelRef< LayoutModel >& rxLayout, ObjectType eObjType,
+ sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
+ /** Converts the positions of the main title and all axis titles. */
+ void convertTitlePositions();
+
private:
::boost::shared_ptr< ConverterData > mxData;
};
// ============================================================================
+/** Base class of all converter classes. Holds a reference to a model structure
+ of the specified type.
+ */
template< typename ModelType >
class ConverterBase : public ConverterRoot
{
@@ -109,6 +126,30 @@ protected:
// ============================================================================
+/** A layout converter calculates positions and sizes for various chart objects.
+ */
+class LayoutConverter : public ConverterBase< LayoutModel >
+{
+public:
+ explicit LayoutConverter( const ConverterRoot& rParent, LayoutModel& rModel );
+ virtual ~LayoutConverter();
+
+ /** Tries to calculate the absolute position and size from the contained
+ OOXML layout model. Returns true, if returned rectangle is valid. */
+ bool calcAbsRectangle( ::com::sun::star::awt::Rectangle& orRect ) const;
+
+ /** Tries to set the position from the contained OOXML layout model.
+ Returns true, if a manual position could be calculated. */
+ bool convertFromModel( PropertySet& rPropSet );
+ /** Tries to set the position from the contained OOXML layout model.
+ Returns true, if a manual position could be calculated. */
+ bool convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ double fRotationAngle );
+};
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx
index 113d6f686fd1..d34970025abd 100644
--- a/oox/inc/oox/drawingml/chart/modelbase.hxx
+++ b/oox/inc/oox/drawingml/chart/modelbase.hxx
@@ -114,6 +114,25 @@ struct NumberFormat
// ============================================================================
+struct LayoutModel
+{
+ double mfX; /// Left position of this object.
+ double mfY; /// Top position of this object.
+ double mfW; /// Width of this object.
+ double mfH; /// Height of this object.
+ sal_Int32 mnXMode; /// Mode for left position.
+ sal_Int32 mnYMode; /// Mode for top position.
+ sal_Int32 mnWMode; /// Mode for width.
+ sal_Int32 mnHMode; /// Mode for height.
+ sal_Int32 mnTarget; /// Layout target for plot area.
+ bool mbAutoLayout; /// True = automatic positioning.
+
+ explicit LayoutModel();
+ ~LayoutModel();
+};
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
index b2583b2e57a1..e35afb633b92 100644
--- a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
@@ -83,6 +83,8 @@ public:
/** Converts the OOXML plot area model to a chart2 diagram. */
void convertFromModel( View3DModel& rView3DModel );
+ /** Converts the manual plot area position and size, if set. */
+ void convertPositionFromModel();
/** Returns the automatic chart title if the chart contains only one series. */
inline const ::rtl::OUString& getAutomaticTitle() const { return maAutoTitle; }
@@ -95,6 +97,7 @@ private:
::rtl::OUString maAutoTitle;
bool mb3dChart;
bool mbWall3dChart;
+ bool mbPieChart;
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/chart/plotareamodel.hxx b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
index 2dfe1c33f4e3..c5793717defc 100644
--- a/oox/inc/oox/drawingml/chart/plotareamodel.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
@@ -31,7 +31,6 @@
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
#include "oox/drawingml/chart/seriesmodel.hxx"
-#include "oox/drawingml/chart/titlemodel.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
namespace oox {
diff --git a/oox/inc/oox/drawingml/chart/seriesconverter.hxx b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
index 7f6a08655b17..fd3ca207d7c0 100644
--- a/oox/inc/oox/drawingml/chart/seriesconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
@@ -100,6 +100,18 @@ private:
// ============================================================================
+class TrendlineLabelConverter : public ConverterBase< TrendlineLabelModel >
+{
+public:
+ explicit TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel );
+ virtual ~TrendlineLabelConverter();
+
+ /** Converts the OOXML trendline label. */
+ void convertFromModel( PropertySet& rPropSet );
+};
+
+// ============================================================================
+
class TrendlineConverter : public ConverterBase< TrendlineModel >
{
public:
diff --git a/oox/inc/oox/drawingml/chart/titlecontext.hxx b/oox/inc/oox/drawingml/chart/titlecontext.hxx
index b5743cc78f42..b3fec5d93203 100644
--- a/oox/inc/oox/drawingml/chart/titlecontext.hxx
+++ b/oox/inc/oox/drawingml/chart/titlecontext.hxx
@@ -36,21 +36,6 @@ namespace chart {
// ============================================================================
-struct LayoutModel;
-
-/** Handler for a chart layout context (c:layout element).
- */
-class LayoutContext : public ContextBase< LayoutModel >
-{
-public:
- explicit LayoutContext( ::oox::core::ContextHandler2Helper& rParent, LayoutModel& rModel );
- virtual ~LayoutContext();
-
- virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
-};
-
-// ============================================================================
-
struct TextModel;
/** Handler for a chart text context (c:tx element).
diff --git a/oox/inc/oox/drawingml/chart/titleconverter.hxx b/oox/inc/oox/drawingml/chart/titleconverter.hxx
index d1fcfcfcfebc..d153e9f3e760 100644
--- a/oox/inc/oox/drawingml/chart/titleconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/titleconverter.hxx
@@ -84,7 +84,8 @@ public:
/** Creates a title text object and attaches it at the passed interface. */
void convertFromModel(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitled >& rxTitled,
- const ::rtl::OUString& rAutoTitle, ObjectType eObjType );
+ const ::rtl::OUString& rAutoTitle, ObjectType eObjType,
+ sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/chart/titlemodel.hxx b/oox/inc/oox/drawingml/chart/titlemodel.hxx
index f5d46957b450..f80837249809 100644
--- a/oox/inc/oox/drawingml/chart/titlemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/titlemodel.hxx
@@ -37,24 +37,6 @@ namespace chart {
// ============================================================================
-struct LayoutModel
-{
- double mfX; /// Left position of this object.
- double mfY; /// Top position of this object.
- double mfW; /// Width of this object.
- double mfH; /// Height of this object.
- sal_Int32 mnXMode; /// Mode for left position.
- sal_Int32 mnYMode; /// Mode for top position.
- sal_Int32 mnWMode; /// Mode for width.
- sal_Int32 mnHMode; /// Mode for height.
- sal_Int32 mnTarget; /// Layout target for plot area.
-
- explicit LayoutModel();
- ~LayoutModel();
-};
-
-// ============================================================================
-
struct TextModel
{
typedef ModelRef< DataSequenceModel > DataSequenceRef;
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
index e9016fdf0b2b..e3e712a52a25 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -32,6 +32,7 @@
#include "oox/dump/dffdumper.hxx"
#include "oox/dump/oledumper.hxx"
#include "oox/xls/richstring.hxx"
+#include "oox/xls/biffinputstream.hxx"
#if OOX_INCLUDE_DUMPER
@@ -211,6 +212,10 @@ protected:
void dumpRect( const String& rName,
const NameListWrapper& rListWrp = NO_LIST,
FormatType eFmtType = FORMATTYPE_DEC );
+ template< typename Type >
+ void dumpRectWithGaps( const String& rName, sal_Int32 nGap,
+ const NameListWrapper& rListWrp = NO_LIST,
+ FormatType eFmtType = FORMATTYPE_DEC );
sal_uInt16 dumpRepeatedRecId();
void dumpFrHeader( bool bWithFlags, bool bWithRange );
@@ -259,6 +264,22 @@ void BiffObjectBase::dumpRect( const String& rName,
writeRectItem( rName, nLeft, nTop, nWidth, nHeight, rListWrp, eFmtType );
}
+template< typename Type >
+void BiffObjectBase::dumpRectWithGaps( const String& rName, sal_Int32 nGap,
+ const NameListWrapper& rListWrp, FormatType eFmtType )
+{
+ Type nLeft, nTop, nWidth, nHeight;
+ *mxBiffStrm >> nLeft;
+ mxBiffStrm->skip( nGap );
+ *mxBiffStrm >> nTop;
+ mxBiffStrm->skip( nGap );
+ *mxBiffStrm >> nWidth;
+ mxBiffStrm->skip( nGap );
+ *mxBiffStrm >> nHeight;
+ mxBiffStrm->skip( nGap );
+ writeRectItem( rName, nLeft, nTop, nWidth, nHeight, rListWrp, eFmtType );
+}
+
// ============================================================================
// ============================================================================
@@ -460,6 +481,11 @@ private:
void dumpObjRecFmla( const String& rName, sal_uInt16 nFmlaSize );
void dumpObjRecPictFmla( sal_uInt16 nFmlaSize );
+ typedef ::std::pair< sal_uInt8, ::rtl::OUString > ChFrExtPropInfo;
+
+ void dumpChFrExtProps();
+ ChFrExtPropInfo dumpChFrExtPropHeader();
+
private:
NameListRef mxColors;
NameListRef mxBorderStyles;
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index b4f36c113c3d..10c62aa17513 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -301,8 +301,15 @@ const sal_uInt16 BIFF_ID_CHFRAME = 0x1032;
const sal_uInt16 BIFF_ID_CHFRAMEPOS = 0x104F;
const sal_uInt16 BIFF_ID_CHFRBLOCKBEGIN = 0x0852;
const sal_uInt16 BIFF_ID_CHFRBLOCKEND = 0x0853;
+const sal_uInt16 BIFF_ID_CHFRCATEGORYPROPS = 0x0856;
+const sal_uInt16 BIFF_ID_CHFREXTPROPS = 0x089E;
+const sal_uInt16 BIFF_ID_CHFREXTPROPSCONT = 0x089F;
const sal_uInt16 BIFF_ID_CHFRINFO = 0x0850;
const sal_uInt16 BIFF_ID_CHFRLABELPROPS = 0x086B;
+const sal_uInt16 BIFF_ID_CHFRLAYOUT = 0x089D;
+const sal_uInt16 BIFF_ID_CHFRPLOTAREALAYOUT = 0x08A7;
+const sal_uInt16 BIFF_ID_CHFRSHAPEPROPS = 0x08A4;
+const sal_uInt16 BIFF_ID_CHFRTEXTPROPS = 0x08A5;
const sal_uInt16 BIFF_ID_CHFRUNITPROPS = 0x0857;
const sal_uInt16 BIFF_ID_CHFRWRAPPER = 0x0851;
const sal_uInt16 BIFF_ID_CHLABELRANGE = 0x1020;