summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-09 08:49:31 +0200
committerobo <obo@openoffice.org>2010-06-09 08:49:31 +0200
commit88a9312b1c37e10255ba70b313b35ebb5cd84449 (patch)
tree64e95715a836a27e8d293fd86e31a4234662e44c /oox
parentad928560a6ae81a6c5ae8968e2bc7a5994e19759 (diff)
parent515244a75e8c196f06864f9c30e3348995d0cba4 (diff)
CWS-TOOLING: integrate CWS chartpositioning
Diffstat (limited to '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.hxx25
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx7
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx5
-rw-r--r--oox/source/drawingml/chart/chartcontextbase.cxx61
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx19
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx265
-rw-r--r--oox/source/drawingml/chart/modelbase.cxx20
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx19
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx50
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx21
-rw-r--r--oox/source/drawingml/chart/titlecontext.cxx59
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx62
-rw-r--r--oox/source/drawingml/chart/titlemodel.cxx19
-rw-r--r--oox/source/dump/biffdumper.cxx130
-rw-r--r--oox/source/dump/biffdumper.ini149
-rw-r--r--oox/source/token/properties.txt9
26 files changed, 880 insertions, 194 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..c7979032e0bd 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -211,6 +211,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 +263,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 +480,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;
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 3ad1c0023ebe..77cf21698c62 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -301,11 +301,12 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
// axis title ---------------------------------------------------------
- if( mrModel.mxTitle.is() )
+ // in radar charts, title objects may exist, but are not shown
+ if( mrModel.mxTitle.is() && (rTypeGroup.getTypeInfo().meTypeCategory != TYPECATEGORY_RADAR) )
{
Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW );
TitleConverter aTitleConv( *this, *mrModel.mxTitle );
- aTitleConv.convertFromModel( xTitled, CREATE_OUSTRING( "Axis Title" ), OBJECTTYPE_AXISTITLE );
+ aTitleConv.convertFromModel( xTitled, CREATE_OUSTRING( "Axis Title" ), OBJECTTYPE_AXISTITLE, nAxesSetIdx, nAxisIdx );
}
}
catch( Exception& )
diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx b/oox/source/drawingml/chart/chartcontextbase.cxx
index 2666d22ccbe0..d3746f07ba6c 100644
--- a/oox/source/drawingml/chart/chartcontextbase.cxx
+++ b/oox/source/drawingml/chart/chartcontextbase.cxx
@@ -27,6 +27,7 @@
#include "oox/drawingml/chart/chartcontextbase.hxx"
#include "oox/drawingml/shapepropertiescontext.hxx"
+#include "oox/drawingml/chart/modelbase.hxx"
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextHandlerRef;
@@ -53,6 +54,66 @@ ContextHandlerRef ShapePrWrapperContext::onCreateContext( sal_Int32 nElement, co
// ============================================================================
+LayoutContext::LayoutContext( ContextHandler2Helper& rParent, LayoutModel& rModel ) :
+ ContextBase< LayoutModel >( rParent, rModel )
+{
+}
+
+LayoutContext::~LayoutContext()
+{
+}
+
+ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( layout ):
+ switch( nElement )
+ {
+ case C_TOKEN( manualLayout ):
+ mrModel.mbAutoLayout = false;
+ return this;
+ }
+ break;
+
+ case C_TOKEN( manualLayout ):
+ switch( nElement )
+ {
+ case C_TOKEN( x ):
+ mrModel.mfX = rAttribs.getDouble( XML_val, 0.0 );
+ return 0;
+ case C_TOKEN( y ):
+ mrModel.mfY = rAttribs.getDouble( XML_val, 0.0 );
+ return 0;
+ case C_TOKEN( w ):
+ mrModel.mfW = rAttribs.getDouble( XML_val, 0.0 );
+ return 0;
+ case C_TOKEN( h ):
+ mrModel.mfH = rAttribs.getDouble( XML_val, 0.0 );
+ return 0;
+ case C_TOKEN( xMode ):
+ mrModel.mnXMode = rAttribs.getToken( XML_val, XML_factor );
+ return 0;
+ case C_TOKEN( yMode ):
+ mrModel.mnYMode = rAttribs.getToken( XML_val, XML_factor );
+ return 0;
+ case C_TOKEN( wMode ):
+ mrModel.mnWMode = rAttribs.getToken( XML_val, XML_factor );
+ return 0;
+ case C_TOKEN( hMode ):
+ mrModel.mnHMode = rAttribs.getToken( XML_val, XML_factor );
+ return 0;
+ case C_TOKEN( layoutTarget ):
+ mrModel.mnTarget = rAttribs.getToken( XML_val, XML_outer );
+ return 0;
+ }
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 6460e94a4f3b..54212f1bdbda 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -26,12 +26,12 @@
************************************************************************/
#include "oox/drawingml/chart/chartspaceconverter.hxx"
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx"
#include "oox/drawingml/chart/chartdrawingfragment.hxx"
@@ -147,14 +147,23 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues );
}
- Reference< com::sun::star::chart::XChartDocument > xOldChartDoc( getChartDocument(), UNO_QUERY );
- if( xOldChartDoc.is() )
+ /* Following all conversions needing the old Chart1 API that involves full
+ initialization of the chart view. */
+ namespace cssc = ::com::sun::star::chart;
+ Reference< cssc::XChartDocument > xChart1Doc( getChartDocument(), UNO_QUERY );
+ if( xChart1Doc.is() )
{
/* Set the IncludeHiddenCells property via the old API as only this
ensures that the data provider and all created sequences get this
flag correctly. */
- PropertySet aOldDiaProp( xOldChartDoc->getDiagram() );
- aOldDiaProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly );
+ PropertySet aDiaProp( xChart1Doc->getDiagram() );
+ aDiaProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly );
+
+ // plot area position and size
+ aPlotAreaConv.convertPositionFromModel();
+
+ // positions of main title and all axis titles
+ convertTitlePositions();
}
// embedded drawing shapes
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 534ce48e0278..b5a0511bf1b8 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -30,6 +30,14 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/chart/XAxisXSupplier.hpp>
+#include <com/sun/star/chart/XAxisYSupplier.hpp>
+#include <com/sun/star/chart/XAxisZSupplier.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
+#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
+#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <tools/solar.h> // for F_PI180
+#include "properties.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/theme.hxx"
@@ -37,22 +45,126 @@ using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::frame::XModel;
+using ::com::sun::star::awt::Point;
+using ::com::sun::star::awt::Rectangle;
using ::com::sun::star::awt::Size;
+using ::com::sun::star::chart2::RelativePosition;
using ::com::sun::star::chart2::XChartDocument;
+using ::com::sun::star::chart2::XTitle;
+using ::com::sun::star::drawing::XShape;
using ::oox::core::XmlFilterBase;
+namespace cssc = ::com::sun::star::chart;
+
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+namespace {
+
+struct TitleKey : public ::std::pair< ObjectType, ::std::pair< sal_Int32, sal_Int32 > >
+{
+ inline explicit TitleKey( ObjectType eObjType, sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 )
+ { first = eObjType; second.first = nMainIdx; second.second = nSubIdx; }
+};
+
+// ----------------------------------------------------------------------------
+
+/** A helper structure to store all data related to title objects. Needed for
+ the conversion of manual title positions that needs the old Chart1 API.
+ */
+struct TitleLayoutInfo
+{
+ typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >
+ mxTitle; /// The API title object.
+ ModelRef< LayoutModel > mxLayout; /// The layout model, if existing.
+ GetShapeFunc mpGetShape; /// Helper function to receive the title shape.
+
+ inline explicit TitleLayoutInfo() : mpGetShape( 0 ) {}
+
+ void convertTitlePos(
+ ConverterRoot& rRoot,
+ const Reference< cssc::XChartDocument >& rxChart1Doc );
+};
+
+void TitleLayoutInfo::convertTitlePos( ConverterRoot& rRoot, const Reference< cssc::XChartDocument >& rxChart1Doc )
+{
+ if( mxTitle.is() && mpGetShape ) try
+ {
+ // try to get the title shape
+ Reference< XShape > xTitleShape( mpGetShape( rxChart1Doc ), UNO_SET_THROW );
+ // get title rotation angle, needed for correction of position of top-left edge
+ double fAngle = 0.0;
+ PropertySet aTitleProp( mxTitle );
+ aTitleProp.getProperty( fAngle, PROP_TextRotation );
+ // convert the position
+ LayoutModel& rLayout = mxLayout.getOrCreate();
+ LayoutConverter aLayoutConv( rRoot, rLayout );
+ aLayoutConv.convertFromModel( xTitleShape, fAngle );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+/* The following local functions implement getting the XShape interface of all
+ supported title objects (chart and axes). This needs some effort due to the
+ design of the old Chart1 API used to access these objects. */
+
+/** A code fragment that returns a shape object from the passed shape supplier
+ using the specified interface function. Checks a boolean property first. */
+#define OOX_FRAGMENT_GETTITLESHAPE( shape_supplier, supplier_func, property_name ) \
+ PropertySet aPropSet( shape_supplier ); \
+ if( shape_supplier.is() && aPropSet.getBoolProperty( PROP_##property_name ) ) \
+ return shape_supplier->supplier_func(); \
+ return Reference< XShape >(); \
+
+/** Implements a function returning the drawing shape of an axis title, if
+ existing, using the specified API interface and its function. */
+#define OOX_DEFINEFUNC_GETAXISTITLESHAPE( func_name, interface_type, supplier_func, property_name ) \
+Reference< XShape > func_name( const Reference< cssc::XChartDocument >& rxChart1Doc ) \
+{ \
+ Reference< cssc::interface_type > xAxisSupp( rxChart1Doc->getDiagram(), UNO_QUERY ); \
+ OOX_FRAGMENT_GETTITLESHAPE( xAxisSupp, supplier_func, property_name ) \
+}
+
+/** Returns the drawing shape of the main title, if existing. */
+Reference< XShape > lclGetMainTitleShape( const Reference< cssc::XChartDocument >& rxChart1Doc )
+{
+ OOX_FRAGMENT_GETTITLESHAPE( rxChart1Doc, getTitle, HasMainTitle )
+}
+
+OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetXAxisTitleShape, XAxisXSupplier, getXAxisTitle, HasXAxisTitle )
+OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetYAxisTitleShape, XAxisYSupplier, getYAxisTitle, HasYAxisTitle )
+OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetZAxisTitleShape, XAxisZSupplier, getZAxisTitle, HasZAxisTitle )
+OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetSecXAxisTitleShape, XSecondAxisTitleSupplier, getSecondXAxisTitle, HasSecondaryXAxisTitle )
+OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetSecYAxisTitleShape, XSecondAxisTitleSupplier, getSecondYAxisTitle, HasSecondaryYAxisTitle )
+
+#undef OOX_DEFINEFUNC_GETAXISTITLESHAPE
+#undef OOX_IMPLEMENT_GETTITLESHAPE
+
+} // namespace
+
+// ============================================================================
+
struct ConverterData
{
+ typedef ::std::map< TitleKey, TitleLayoutInfo > TitleMap;
+
ObjectFormatter maFormatter;
+ TitleMap maTitles;
XmlFilterBase& mrFilter;
ChartConverter& mrConverter;
Reference< XChartDocument > mxDoc;
@@ -91,6 +203,14 @@ ConverterData::ConverterData(
catch( Exception& )
{
}
+
+ // prepare conversion of title positions
+ maTitles[ TitleKey( OBJECTTYPE_CHARTTITLE ) ].mpGetShape = lclGetMainTitleShape;
+ maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_X_AXIS ) ].mpGetShape = lclGetXAxisTitleShape;
+ maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_Y_AXIS ) ].mpGetShape = lclGetYAxisTitleShape;
+ maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_Z_AXIS ) ].mpGetShape = lclGetZAxisTitleShape;
+ maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_SECN_AXESSET, API_X_AXIS ) ].mpGetShape = lclGetSecXAxisTitleShape;
+ maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_SECN_AXESSET, API_Y_AXIS ) ].mpGetShape = lclGetSecYAxisTitleShape;
}
ConverterData::~ConverterData()
@@ -122,13 +242,12 @@ ConverterRoot::~ConverterRoot()
{
}
-Reference< XInterface > ConverterRoot::createInstance(
- const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName )
+Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceName ) const
{
Reference< XInterface > xInt;
- if( rxFactory.is() ) try
+ try
{
- xInt = rxFactory->createInstance( rServiceName );
+ xInt = mxData->mrFilter.getGlobalFactory()->createInstance( rServiceName );
}
catch( Exception& )
{
@@ -137,11 +256,6 @@ Reference< XInterface > ConverterRoot::createInstance(
return xInt;
}
-Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceName ) const
-{
- return createInstance( mxData->mrFilter.getGlobalFactory(), rServiceName );
-}
-
XmlFilterBase& ConverterRoot::getFilter() const
{
return mxData->mrFilter;
@@ -167,6 +281,139 @@ ObjectFormatter& ConverterRoot::getFormatter() const
return mxData->maFormatter;
}
+void ConverterRoot::registerTitleLayout( const Reference< XTitle >& rxTitle,
+ const ModelRef< LayoutModel >& rxLayout, ObjectType eObjType, sal_Int32 nMainIdx, sal_Int32 nSubIdx )
+{
+ OSL_ENSURE( rxTitle.is(), "ConverterRoot::registerTitleLayout - missing title object" );
+ TitleLayoutInfo& rTitleInfo = mxData->maTitles[ TitleKey( eObjType, nMainIdx, nSubIdx ) ];
+ OSL_ENSURE( rTitleInfo.mpGetShape, "ConverterRoot::registerTitleLayout - invalid title key" );
+ rTitleInfo.mxTitle = rxTitle;
+ rTitleInfo.mxLayout = rxLayout;
+}
+
+void ConverterRoot::convertTitlePositions()
+{
+ try
+ {
+ Reference< cssc::XChartDocument > xChart1Doc( mxData->mxDoc, UNO_QUERY_THROW );
+ for( ConverterData::TitleMap::iterator aIt = mxData->maTitles.begin(), aEnd = mxData->maTitles.end(); aIt != aEnd; ++aIt )
+ aIt->second.convertTitlePos( *this, xChart1Doc );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+namespace {
+
+/** Returns a position value in the chart area in 1/100 mm. */
+sal_Int32 lclCalcPosition( sal_Int32 nChartSize, double fPos, sal_Int32 nPosMode )
+{
+ switch( nPosMode )
+ {
+ case XML_edge: // absolute start position as factor of chart size
+ return getLimitedValue< sal_Int32, double >( nChartSize * fPos + 0.5, 0, nChartSize );
+ case XML_factor: // position relative to object default position
+ OSL_ENSURE( false, "lclCalcPosition - relative positioning not supported" );
+ return -1;
+ };
+
+ OSL_ENSURE( false, "lclCalcPosition - unknown positioning mode" );
+ return -1;
+}
+
+/** Returns a size value in the chart area in 1/100 mm. */
+sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_Int32 nSizeMode )
+{
+ sal_Int32 nValue = getLimitedValue< sal_Int32, double >( nChartSize * fSize + 0.5, 0, nChartSize );
+ switch( nSizeMode )
+ {
+ case XML_factor: // size as factor of chart size
+ return nValue;
+ case XML_edge: // absolute end position as factor of chart size
+ return nValue - nPos + 1;
+ };
+
+ OSL_ENSURE( false, "lclCalcSize - unknown size mode" );
+ return -1;
+}
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+LayoutConverter::LayoutConverter( const ConverterRoot& rParent, LayoutModel& rModel ) :
+ ConverterBase< LayoutModel >( rParent, rModel )
+{
+}
+
+LayoutConverter::~LayoutConverter()
+{
+}
+
+bool LayoutConverter::calcAbsRectangle( Rectangle& orRect ) const
+{
+ if( !mrModel.mbAutoLayout )
+ {
+ const Size& rChartSize = getChartSize();
+ orRect.X = lclCalcPosition( rChartSize.Width, mrModel.mfX, mrModel.mnXMode );
+ orRect.Y = lclCalcPosition( rChartSize.Height, mrModel.mfY, mrModel.mnYMode );
+ if( (orRect.X >= 0) && (orRect.Y >= 0) )
+ {
+ orRect.Width = lclCalcSize( orRect.X, rChartSize.Width, mrModel.mfW, mrModel.mnWMode );
+ orRect.Height = lclCalcSize( orRect.Y, rChartSize.Height, mrModel.mfH, mrModel.mnHMode );
+ return (orRect.Width > 0) && (orRect.Height > 0);
+ }
+ }
+ return false;
+}
+
+bool LayoutConverter::convertFromModel( PropertySet& rPropSet )
+{
+ if( !mrModel.mbAutoLayout &&
+ (mrModel.mnXMode == XML_edge) && (mrModel.mfX >= 0.0) &&
+ (mrModel.mnYMode == XML_edge) && (mrModel.mfY >= 0.0) )
+ {
+ RelativePosition aPos;
+ aPos.Primary = getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 );
+ aPos.Secondary = getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 );
+ aPos.Anchor = ::com::sun::star::drawing::Alignment_TOP_LEFT;
+ rPropSet.setProperty( PROP_RelativePosition, aPos );
+ return true;
+ }
+ return false;
+}
+
+bool LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, double fRotationAngle )
+{
+ if( !mrModel.mbAutoLayout )
+ {
+ const Size& rChartSize = getChartSize();
+ Point aShapePos(
+ lclCalcPosition( rChartSize.Width, mrModel.mfX, mrModel.mnXMode ),
+ lclCalcPosition( rChartSize.Height, mrModel.mfY, mrModel.mnYMode ) );
+ if( (aShapePos.X >= 0) && (aShapePos.Y >= 0) )
+ {
+ // the call to XShape.getSize() may recalc the chart view
+ Size aShapeSize = rxShape->getSize();
+ // rotated shapes need special handling...
+ double fSin = fabs( sin( fRotationAngle * F_PI180 ) );
+ // add part of height to X direction, if title is rotated down
+ if( fRotationAngle > 180.0 )
+ aShapePos.X += static_cast< sal_Int32 >( fSin * aShapeSize.Height + 0.5 );
+ // add part of width to Y direction, if title is rotated up
+ else if( fRotationAngle > 0.0 )
+ aShapePos.Y += static_cast< sal_Int32 >( fSin * aShapeSize.Width + 0.5 );
+ // set the resulting position at the shape
+ rxShape->setPosition( aShapePos );
+ return true;
+ }
+ }
+ return false;
+}
+
// ============================================================================
} // namespace chart
diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx
index 3aa6b1f0047f..c182d8e3e410 100644
--- a/oox/source/drawingml/chart/modelbase.cxx
+++ b/oox/source/drawingml/chart/modelbase.cxx
@@ -50,6 +50,26 @@ void NumberFormat::setAttributes( const AttributeList& rAttribs )
// ============================================================================
+LayoutModel::LayoutModel() :
+ mfX( 0.0 ),
+ mfY( 0.0 ),
+ mfW( 0.0 ),
+ mfH( 0.0 ),
+ mnXMode( XML_factor ),
+ mnYMode( XML_factor ),
+ mnWMode( XML_factor ),
+ mnHMode( XML_factor ),
+ mnTarget( XML_outer ),
+ mbAutoLayout( true )
+{
+}
+
+LayoutModel::~LayoutModel()
+{
+}
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 5b898d4da6ed..d96e2d43dd6f 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1142,18 +1142,19 @@ void ObjectFormatter::convertTextRotation( PropertySet& rPropSet, const ModelRef
{
if( rxTextProp.is() )
{
- /* Chart2 expects rotation angle as double value in range of [0,360).
- OOXML counts clockwise, Chart2 counts counterclockwise. */
- double fAngle = rxTextProp->getTextProperties().moRotation.get( 0 );
- fAngle = getDoubleIntervalValue< double >( -fAngle / 60000.0, 0.0, 360.0 );
- rPropSet.setProperty( PROP_TextRotation, fAngle );
-
+ bool bStacked = false;
if( bSupportsStacked )
{
sal_Int32 nVert = rxTextProp->getTextProperties().moVert.get( XML_horz );
- bool bStacked = (nVert == XML_wordArtVert) || (nVert == XML_wordArtVertRtl);
+ bStacked = (nVert == XML_wordArtVert) || (nVert == XML_wordArtVertRtl);
rPropSet.setProperty( PROP_StackCharacters, bStacked );
}
+
+ /* Chart2 expects rotation angle as double value in range of [0,360).
+ OOXML counts clockwise, Chart2 counts counterclockwise. */
+ double fAngle = static_cast< double >( bStacked ? 0 : rxTextProp->getTextProperties().moRotation.get( 0 ) );
+ fAngle = getDoubleIntervalValue< double >( -fAngle / 60000.0, 0.0, 360.0 );
+ rPropSet.setProperty( PROP_TextRotation, fAngle );
}
}
@@ -1195,12 +1196,12 @@ void ObjectFormatter::convertAutomaticFill( PropertySet& rPropSet, ObjectType eO
pFormat->convertAutomaticFill( rPropSet, nSeriesIdx );
}
-bool ObjectFormatter::isAutomaticLine( const ModelRef< Shape >& rxShapeProp )
+/*static*/ bool ObjectFormatter::isAutomaticLine( const ModelRef< Shape >& rxShapeProp )
{
return !rxShapeProp || !rxShapeProp->getLineProperties().maLineFill.moFillType.has();
}
-bool ObjectFormatter::isAutomaticFill( const ModelRef< Shape >& rxShapeProp )
+/*static*/ bool ObjectFormatter::isAutomaticFill( const ModelRef< Shape >& rxShapeProp )
{
return !rxShapeProp || !rxShapeProp->getFillProperties().moFillType.has();
}
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index f69fde409c0e..c3f74899ed97 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -29,6 +29,8 @@
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
+#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -42,6 +44,7 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::awt::Rectangle;
using ::com::sun::star::chart2::XCoordinateSystem;
using ::com::sun::star::chart2::XCoordinateSystemContainer;
using ::com::sun::star::chart2::XDiagram;
@@ -54,14 +57,15 @@ namespace chart {
namespace {
-/** Axes set model. This is a helper class for the plot area converter. */
+/** Axes set model. This is a helper for the plot area converter collecting all
+ type groups and axes of the primary or secondary axes set. */
struct AxesSetModel
{
typedef ModelVector< TypeGroupModel > TypeGroupVector;
typedef ModelMap< sal_Int32, AxisModel > AxisMap;
- TypeGroupVector maTypeGroups;
- AxisMap maAxes;
+ TypeGroupVector maTypeGroups; /// All type groups containing data series.
+ AxisMap maAxes; /// All axes mapped by API axis type.
inline explicit AxesSetModel() {}
inline ~AxesSetModel() {}
@@ -90,11 +94,14 @@ public:
inline bool is3dChart() const { return mb3dChart; }
/** Returns true, if chart type supports wall and floor format in 3D mode. */
inline bool isWall3dChart() const { return mbWall3dChart; }
+ /** Returns true, if chart is a pie chart or doughnut chart. */
+ inline bool isPieChart() const { return mbPieChart; }
private:
::rtl::OUString maAutoTitle;
bool mb3dChart;
bool mbWall3dChart;
+ bool mbPieChart;
};
// ----------------------------------------------------------------------------
@@ -102,7 +109,8 @@ private:
AxesSetConverter::AxesSetConverter( const ConverterRoot& rParent, AxesSetModel& rModel ) :
ConverterBase< AxesSetModel >( rParent, rModel ),
mb3dChart( false ),
- mbWall3dChart( false )
+ mbWall3dChart( false ),
+ mbPieChart( false )
{
}
@@ -159,6 +167,7 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
// 3D view settings
mb3dChart = rFirstTypeGroup.is3dChart();
mbWall3dChart = rFirstTypeGroup.isWall3dChart();
+ mbPieChart = rFirstTypeGroup.getTypeInfo().meTypeCategory == TYPECATEGORY_PIE;
if( mb3dChart )
{
View3DConverter aView3DConv( *this, rView3DModel );
@@ -305,7 +314,8 @@ void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
PlotAreaConverter::PlotAreaConverter( const ConverterRoot& rParent, PlotAreaModel& rModel ) :
ConverterBase< PlotAreaModel >( rParent, rModel ),
mb3dChart( false ),
- mbWall3dChart( false )
+ mbWall3dChart( false ),
+ mbPieChart( false )
{
}
@@ -392,6 +402,7 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
maAutoTitle = aAxesSetConv.getAutomaticTitle();
mb3dChart = aAxesSetConv.is3dChart();
mbWall3dChart = aAxesSetConv.isWall3dChart();
+ mbPieChart = aAxesSetConv.isPieChart();
}
else
{
@@ -407,6 +418,35 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
}
}
+void PlotAreaConverter::convertPositionFromModel()
+{
+ LayoutModel& rLayout = mrModel.mxLayout.getOrCreate();
+ LayoutConverter aLayoutConv( *this, rLayout );
+ Rectangle aDiagramRect;
+ if( aLayoutConv.calcAbsRectangle( aDiagramRect ) ) try
+ {
+ namespace cssc = ::com::sun::star::chart;
+ Reference< cssc::XChartDocument > xChart1Doc( getChartDocument(), UNO_QUERY_THROW );
+ Reference< cssc::XDiagramPositioning > xPositioning( xChart1Doc->getDiagram(), UNO_QUERY_THROW );
+ // for pie charts, always set inner plot area size to exclude the data labels as Excel does
+ sal_Int32 nTarget = (mbPieChart && (rLayout.mnTarget == XML_outer)) ? XML_inner : rLayout.mnTarget;
+ switch( nTarget )
+ {
+ case XML_inner:
+ xPositioning->setDiagramPositionExcludingAxes( aDiagramRect );
+ break;
+ case XML_outer:
+ xPositioning->setDiagramPositionIncludingAxes( aDiagramRect );
+ break;
+ default:
+ OSL_ENSURE( false, "PlotAreaConverter::convertPositionFromModel - unknown positioning target" );
+ }
+ }
+ catch( Exception& )
+ {
+ }
+}
+
// ============================================================================
} // namespace chart
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index a4cf7c1f3eb2..717a3972550e 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -344,6 +344,23 @@ Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence(
// ============================================================================
+TrendlineLabelConverter::TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel ) :
+ ConverterBase< TrendlineLabelModel >( rParent, rModel )
+{
+}
+
+TrendlineLabelConverter::~TrendlineLabelConverter()
+{
+}
+
+void TrendlineLabelConverter::convertFromModel( PropertySet& rPropSet )
+{
+ // formatting
+ getFormatter().convertFormatting( rPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_TRENDLINELABEL );
+}
+
+// ============================================================================
+
TrendlineConverter::TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel ) :
ConverterBase< TrendlineModel >( rParent, rModel )
{
@@ -385,8 +402,8 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat
// #i83100# formatting of the equation text box
if( mrModel.mbDispEquation || mrModel.mbDispRSquared )
{
- TrendlineLabelModel& rLabel = mrModel.mxLabel.getOrCreate();
- getFormatter().convertFormatting( aLabelProp, rLabel.mxShapeProp, rLabel.mxTextProp, OBJECTTYPE_TRENDLINELABEL );
+ TrendlineLabelConverter aLabelConv( *this, mrModel.mxLabel.getOrCreate() );
+ aLabelConv.convertFromModel( aLabelProp );
}
// unsupported: #i5085# manual trendline size
diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx
index e9007e4d53d7..963ccdad595a 100644
--- a/oox/source/drawingml/chart/titlecontext.cxx
+++ b/oox/source/drawingml/chart/titlecontext.cxx
@@ -41,65 +41,6 @@ namespace chart {
// ============================================================================
-LayoutContext::LayoutContext( ContextHandler2Helper& rParent, LayoutModel& rModel ) :
- ContextBase< LayoutModel >( rParent, rModel )
-{
-}
-
-LayoutContext::~LayoutContext()
-{
-}
-
-ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
-{
- switch( getCurrentElement() )
- {
- case C_TOKEN( layout ):
- switch( nElement )
- {
- case C_TOKEN( manualLayout ):
- return this;
- }
- break;
-
- case C_TOKEN( manualLayout ):
- switch( nElement )
- {
- case C_TOKEN( x ):
- mrModel.mfX = rAttribs.getDouble( XML_val, 0.0 );
- return 0;
- case C_TOKEN( y ):
- mrModel.mfY = rAttribs.getDouble( XML_val, 0.0 );
- return 0;
- case C_TOKEN( w ):
- mrModel.mfW = rAttribs.getDouble( XML_val, 0.0 );
- return 0;
- case C_TOKEN( h ):
- mrModel.mfH = rAttribs.getDouble( XML_val, 0.0 );
- return 0;
- case C_TOKEN( xMode ):
- mrModel.mnXMode = rAttribs.getToken( XML_val, XML_factor );
- return 0;
- case C_TOKEN( yMode ):
- mrModel.mnYMode = rAttribs.getToken( XML_val, XML_factor );
- return 0;
- case C_TOKEN( wMode ):
- mrModel.mnWMode = rAttribs.getToken( XML_val, XML_factor );
- return 0;
- case C_TOKEN( hMode ):
- mrModel.mnHMode = rAttribs.getToken( XML_val, XML_factor );
- return 0;
- case C_TOKEN( layoutTarget ):
- mrModel.mnTarget = rAttribs.getToken( XML_val, XML_outer );
- return 0;
- }
- break;
- }
- return 0;
-}
-
-// ============================================================================
-
TextContext::TextContext( ContextHandler2Helper& rParent, TextModel& rModel ) :
ContextBase< TextModel >( rParent, rModel )
{
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index 6316ee5f7ee4..bca53f1a2c01 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -26,11 +26,14 @@
************************************************************************/
#include "oox/drawingml/chart/titleconverter.hxx"
+#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XFormattedString.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
+#include "properties.hxx"
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/textparagraph.hxx"
#include "oox/drawingml/chart/datasourceconverter.hxx"
@@ -41,6 +44,7 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::awt::Rectangle;
using ::com::sun::star::chart2::XDiagram;
using ::com::sun::star::chart2::XFormattedString;
using ::com::sun::star::chart2::XLegend;
@@ -149,7 +153,7 @@ TitleConverter::~TitleConverter()
{
}
-void TitleConverter::convertFromModel( const Reference< XTitled >& rxTitled, const OUString& rAutoTitle, ObjectType eObjType )
+void TitleConverter::convertFromModel( const Reference< XTitled >& rxTitled, const OUString& rAutoTitle, ObjectType eObjType, sal_Int32 nMainIdx, sal_Int32 nSubIdx )
{
if( rxTitled.is() )
{
@@ -172,6 +176,9 @@ void TitleConverter::convertFromModel( const Reference< XTitled >& rxTitled, con
OSL_ENSURE( !mrModel.mxTextProp || !rText.mxTextBody, "TitleConverter::convertFromModel - multiple text properties" );
ModelRef< TextBody > xTextProp = mrModel.mxTextProp.is() ? mrModel.mxTextProp : rText.mxTextBody;
getFormatter().convertTextRotation( aPropSet, xTextProp, true );
+
+ // register the title and layout data for conversion of position
+ registerTitleLayout( xTitle, mrModel.mxLayout, eObjType, nMainIdx, nSubIdx );
}
catch( Exception& )
{
@@ -194,13 +201,64 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
{
if( rxDiagram.is() ) try
{
+ namespace cssc2 = ::com::sun::star::chart2;
+
// create the legend
Reference< XLegend > xLegend( createInstance( CREATE_OUSTRING( "com.sun.star.chart2.Legend" ) ), UNO_QUERY_THROW );
rxDiagram->setLegend( xLegend );
+ PropertySet aPropSet( xLegend );
+ aPropSet.setProperty( PROP_Show, true );
// legend formatting
- PropertySet aPropSet( xLegend );
getFormatter().convertFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_LEGEND );
+
+ // predefined legend position and expansion
+ cssc2::LegendPosition eLegendPos = cssc2::LegendPosition_CUSTOM;
+ cssc2::LegendExpansion eLegendExpand = cssc2::LegendExpansion_HIGH;
+ switch( mrModel.mnPosition )
+ {
+ case XML_l:
+ eLegendPos = cssc2::LegendPosition_LINE_START;
+ eLegendExpand = cssc2::LegendExpansion_HIGH;
+ break;
+ case XML_r:
+ eLegendPos = cssc2::LegendPosition_LINE_END;
+ eLegendExpand = cssc2::LegendExpansion_HIGH;
+ break;
+ case XML_t:
+ eLegendPos = cssc2::LegendPosition_PAGE_START;
+ eLegendExpand = cssc2::LegendExpansion_WIDE;
+ break;
+ case XML_b:
+ eLegendPos = cssc2::LegendPosition_PAGE_END;
+ eLegendExpand = cssc2::LegendExpansion_WIDE;
+ break;
+ case XML_tr:
+ eLegendPos = cssc2::LegendPosition_LINE_END; // top-right not supported
+ eLegendExpand = cssc2::LegendExpansion_HIGH;
+ break;
+ }
+
+ // manual positioning
+ LayoutModel& rLayout = mrModel.mxLayout.getOrCreate();
+ LayoutConverter aLayoutConv( *this, rLayout );
+ aLayoutConv.convertFromModel( aPropSet );
+ Rectangle aLegendRect;
+ if( aLayoutConv.calcAbsRectangle( aLegendRect ) )
+ {
+ // #i71697# it is not possible to set the size directly, do some magic here
+ double fRatio = static_cast< double >( aLegendRect.Width ) / aLegendRect.Height;
+ if( fRatio > 1.5 )
+ eLegendExpand = cssc2::LegendExpansion_WIDE;
+ else if( fRatio < 0.75 )
+ eLegendExpand = cssc2::LegendExpansion_HIGH;
+ else
+ eLegendExpand = cssc2::LegendExpansion_BALANCED;
+ }
+
+ // set position and expansion properties
+ aPropSet.setProperty( PROP_AnchorPosition, eLegendPos );
+ aPropSet.setProperty( PROP_Expansion, eLegendExpand );
}
catch( Exception& )
{
diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx
index 51c51a62c4b7..bb5501e05f32 100644
--- a/oox/source/drawingml/chart/titlemodel.cxx
+++ b/oox/source/drawingml/chart/titlemodel.cxx
@@ -33,25 +33,6 @@ namespace chart {
// ============================================================================
-LayoutModel::LayoutModel() :
- mfX( 0.0 ),
- mfY( 0.0 ),
- mfW( 0.0 ),
- mfH( 0.0 ),
- mnXMode( XML_factor ),
- mnYMode( XML_factor ),
- mnWMode( XML_factor ),
- mnHMode( XML_factor ),
- mnTarget( XML_outer )
-{
-}
-
-LayoutModel::~LayoutModel()
-{
-}
-
-// ============================================================================
-
TextModel::TextModel()
{
}
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index ea1944d935a4..d59164413acd 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -1697,7 +1697,7 @@ void WorkbookStreamObject::implDumpRecordBody()
case BIFF_ID_CHAXESSET:
dumpDec< sal_uInt16 >( "axesset-id", "CHAXESSET-ID" );
- dumpRect< sal_Int32 >( "position", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
+ dumpRect< sal_Int32 >( "inner-plotarea-pos", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
break;
case BIFF_ID_CHAXIS:
@@ -1728,11 +1728,6 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpHex< sal_uInt16 >( "flags", "CHCHART3D-FLAGS" );
break;
- case BIFF_ID_CHECKCOMPAT:
- dumpFrHeader( true, true );
- dumpBool< sal_uInt32 >( "check-compatibility" );
- break;
-
case BIFF_ID_CHDATAFORMAT:
dumpDec< sal_Int16 >( "point-idx", "CHDATAFORMAT-POINTIDX" );
dumpDec< sal_Int16 >( "series-idx" );
@@ -1740,6 +1735,11 @@ void WorkbookStreamObject::implDumpRecordBody()
if( eBiff >= BIFF5 ) dumpHex< sal_uInt16 >( "flags", "CHDATAFORMAT-FLAGS" );
break;
+ case BIFF_ID_CHECKCOMPAT:
+ dumpFrHeader( true, true );
+ dumpBool< sal_uInt32 >( "check-compatibility" );
+ break;
+
case BIFF_ID_CHESCHERFORMAT:
dumpEmbeddedDff();
break;
@@ -1750,9 +1750,9 @@ void WorkbookStreamObject::implDumpRecordBody()
break;
case BIFF_ID_CHFRAMEPOS:
- dumpDec< sal_uInt16 >( "object-type", "CHFRAMEPOS-OBJTYPE" );
- dumpDec< sal_uInt16 >( "size-mode", "CHFRAMEPOS-SIZEMODE" );
- dumpRect< sal_Int32 >( "position", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
+ dumpDec< sal_uInt16 >( "tl-mode", "CHFRAMEPOS-POSMODE" );
+ dumpDec< sal_uInt16 >( "br-mode", "CHFRAMEPOS-POSMODE" );
+ dumpRectWithGaps< sal_Int16 >( "position", 2 );
break;
case BIFF_ID_CHFRBLOCKBEGIN:
@@ -1770,6 +1770,25 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpUnused( 6 );
break;
+ case BIFF_ID_CHFRCATEGORYPROPS:
+ dumpFrHeader( true, false );
+ dumpDec< sal_uInt16 >( "label-offset", "CONV-PERCENT" );
+ dumpDec< sal_uInt16 >( "alignment", "CHFRCATEGORYPROPS-ALIGN" );
+ dumpHex< sal_uInt16 >( "flags", "CHFRCATEGORYPROPS-FLAGS" );
+ break;
+
+ case BIFF_ID_CHFREXTPROPS:
+ {
+ dumpFrHeader( true, true );
+ dumpDec< sal_uInt32 >( "data-size" );
+ dumpDec< sal_uInt8 >( "version" );
+ dumpUnused( 1 );
+ dumpDec< sal_uInt16 >( "parent", "CHFREXTPROPS-PARENT" );
+ dumpChFrExtProps();
+ dumpUnused( 4 );
+ }
+ break;
+
case BIFF_ID_CHFRINFO:
{
dumpFrHeader( true, false );
@@ -1788,6 +1807,45 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpUniString( "separator", BIFF_STR_SMARTFLAGS );
break;
+ case BIFF_ID_CHFRLAYOUT:
+ dumpFrHeader( true, true );
+ dumpHex< sal_uInt32 >( "checksum" );
+ dumpHex< sal_uInt16 >( "flags", "CHFRLAYOUT-FLAGS" );
+ dumpDec< sal_uInt16 >( "mode-x", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-y", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-w", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-h", "CHFRLAYOUT-MODE" );
+ dumpRect< double >( "position" );
+ dumpUnused( 2 );
+ break;
+
+ case BIFF_ID_CHFRPLOTAREALAYOUT:
+ dumpFrHeader( true, true );
+ dumpHex< sal_uInt32 >( "checksum" );
+ dumpHex< sal_uInt16 >( "flags", "CHFRPLOTAREALAYOUT-FLAGS" );
+ dumpRect< sal_Int16 >( "position" );
+ dumpDec< sal_uInt16 >( "mode-x", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-y", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-w", "CHFRLAYOUT-MODE" );
+ dumpDec< sal_uInt16 >( "mode-h", "CHFRLAYOUT-MODE" );
+ dumpRect< double >( "position" );
+ dumpUnused( 2 );
+ break;
+
+ case BIFF_ID_CHFRSHAPEPROPS:
+ dumpFrHeader( true, true );
+ dumpDec< sal_uInt16 >( "context" );
+ dumpUnused( 2 );
+ dumpHex< sal_uInt32 >( "checksum" );
+ dumpDec< sal_uInt32 >( "xml-size" );
+ break;
+
+ case BIFF_ID_CHFRTEXTPROPS:
+ dumpFrHeader( true, true );
+ dumpHex< sal_uInt32 >( "checksum" );
+ dumpDec< sal_uInt32 >( "xml-size" );
+ break;
+
case BIFF_ID_CHFRUNITPROPS:
dumpFrHeader( true, false );
dumpDec< sal_Int16 >( "preset", "CHFRUNITPROPS-PRESET" );
@@ -1941,9 +1999,9 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpDec< sal_uInt16 >( "fill-mode", "CHTEXT-FILLMODE" );
dumpColorABGR();
dumpRect< sal_Int32 >( "position", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
- dumpHex< sal_uInt16 >( "flags", "CHTEXT-FLAGS" );
+ dumpHex< sal_uInt16 >( "flags-1", "CHTEXT-FLAGS1" );
if( eBiff == BIFF8 ) dumpColorIdx();
- if( eBiff == BIFF8 ) dumpDec< sal_uInt16 >( "placement", "CHTEXT-PLACEMENT" );
+ if( eBiff == BIFF8 ) dumpHex< sal_uInt16 >( "flags-2", "CHTEXT-FLAGS2" );
if( eBiff == BIFF8 ) dumpDec< sal_uInt16 >( "rotation", "TEXTROTATION" );
break;
@@ -4116,6 +4174,56 @@ void WorkbookStreamObject::dumpObjRecPictFmla( sal_uInt16 nFmlaSize )
}
}
+void WorkbookStreamObject::dumpChFrExtProps()
+{
+ BiffInputStream& rStrm = getBiffStream();
+ bool bValid = true;
+ while( bValid && (rStrm.getRemaining() > 4) )
+ {
+ ChFrExtPropInfo aInfo = dumpChFrExtPropHeader();
+ IndentGuard aIndGuard( out() );
+ switch( aInfo.first )
+ {
+ case 0: // start
+ case 1: // end
+ break;
+ case 2: // bool
+ dumpBoolean( "value" );
+ dumpUnused( 1 );
+ break;
+ case 3: // double
+ dumpUnused( 4 );
+ dumpDec< double >( "value", aInfo.second );
+ break;
+ case 4: // int32
+ dumpDec< sal_Int32 >( "value", aInfo.second );
+ break;
+ case 5: // string
+ dumpUnicodeArray( "value", rStrm.readInt32() );
+ break;
+ case 6: // uint16
+ dumpDec< sal_uInt16 >( "value", aInfo.second );
+ break;
+ case 7: // blob
+ dumpBinary( "value", rStrm.readuInt32() );
+ break;
+ default:
+ bValid = false;
+ }
+ }
+}
+
+WorkbookStreamObject::ChFrExtPropInfo WorkbookStreamObject::dumpChFrExtPropHeader()
+{
+ MultiItemsGuard aMultiGuard( out() );
+ ChFrExtPropInfo aInfo;
+ aInfo.first = dumpDec< sal_uInt8 >( "datatype", "CHFREXTPROPS-TYPE" );
+ dumpUnused( 1 );
+ sal_uInt16 nTag = dumpDec< sal_uInt16 >( "tag", "CHFREXTPROPS-TAG" );
+ aInfo.second = cfg().getName( "CHFREXTPROPS-TAG-NAMELIST", nTag );
+ return aInfo;
+}
+
// ============================================================================
PivotCacheStreamObject::PivotCacheStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, BiffType eBiff, const ::rtl::OUString& rSysFileName )
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index 16c3fb883149..2d1f4bdf7897 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -293,7 +293,7 @@ end
multilist=RECORD-NAMES-BIFF3
include=RECORD-NAMES-BIFF2
# worksheet records
- exclude=0x0006,0x0008,0x0009,0x000B,0x0018,0x0020,0x0021,0x0023,0x0024,0x0025,0x0031,0x0036,0x0037,0x003E,0x0043,0x0044,0x0045
+ exclude=0x0006,0x0008,0x0009,0x000B,0x0018,0x0020,0x0023,0x0024,0x0025,0x0031,0x0036,0x0037,0x003E,0x0043,0x0044,0x0045
0x0050=,,,,,,BUILTINFMTCOUNT,
0x0058=TOOLBAR,XCT,CRN,FILESHARING,WRITEACCESS,OBJ,UNCALCED,SAFERECALC
0x0060=TEMPLATE,INTL,,OBJECTPROTECT,,,,
@@ -383,16 +383,17 @@ multilist=RECORD-NAMES-BIFF8
0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL
0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,VBAPROJECTEMPTY,DATAVALIDATION,
0x01C0=XL9FILE,RECALCID,INTCACHEDDATA,,,,,
+ # future records
0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
- 0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,,CHFRUNITPROPS
+ 0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,CHFRCATEGORYPROPS,CHFRUNITPROPS
0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,,
0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD
0x0868=,,,CHFRLABELPROPS,,,,
0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,,
0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES,
0x0890=,,STYLEEXT,,,,THEME,
- 0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,,,
- 0x08A0=,,,FORCEFULLCALC,,,,
+ 0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,CHFRLAYOUT,CHFREXTPROPS,CHFREXTPROPSCONT
+ 0x08A0=,,,FORCEFULLCALC,CHFRSHAPEPROPS,CHFRTEXTPROPS,,CHFRPLOTAREALAYOUT
# chart records
0x1058=,,,,,,,CH3DDATAFORMAT
0x1060=CHFONTBASE,CHPIEEXT,CHLABELRANGE2,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
@@ -829,16 +830,104 @@ end
# CHFRAMEPOS -----------------------------------------------------------------
-shortlist=CHFRAMEPOS-OBJTYPE,2,any,,,legend
-shortlist=CHFRAMEPOS-SIZEMODE,1,manual,auto
+shortlist=CHFRAMEPOS-POSMODE,0,rel-points,abssize-points,parent-dependent,offset-plotarea-size,,chartsize
# CHFRBLOCKBEGIN, CHFRBLOCKEND -----------------------------------------------
shortlist=CHFRBLOCK-TYPE,0,axes-set,,text,,axis,type-group,data-table,frame,,legend,legend-exception,,series,chart,data-format,drop-bar
+# CHFRCATEGORYPROPS ----------------------------------------------------------
+
+shortlist=CHFRCATEGORYPROPS-ALIGN,1,top-left,center,bottom-right
+
+flagslist=CHFRCATEGORYPROPS-FLAGS
+ ignore=0xFFFE
+ 0x0001=auto-label-frequency
+end
+
+# CHFREXTPROPS ---------------------------------------------------------------
+
+constlist=CHFREXTPROPS-PARENT
+ 0x0001=log-scaling
+ 0x0002=style
+ 0x0004=category-scaling
+ 0x0005=chart-props
+ 0x000F=legend
+ 0x0013=marker
+ 0x0016=plot-area
+ 0x0019=chart-title
+ 0x0037=3d-props
+end
+
+constlist=CHFREXTPROPS-TYPE
+ 0=start
+ 1=end
+ 2=bool
+ 3=double
+ 4=int32
+ 5=string
+ 6=uint16
+ 7=blob
+end
+
+constlist=CHFREXTPROPS-TAG
+ 0x0000=log-base
+ 0x0003=style
+ 0x001E=chart-formatting
+ 0x0020=text-formatting
+ 0x0022=symbol-type
+ 0x002E=no-multi-level
+ 0x002F=overlay
+ 0x0033=theme-override
+ 0x0034=color-mapping-override
+ 0x0035=backwall-thickness
+ 0x0036=floor-thickness
+ 0x004D=perspective
+ 0x004E=rotation-x
+ 0x004F=rotation-y
+ 0x0050=right-angled-axes-off
+ 0x0052=tick-mark-skip
+ 0x0051=tick-label-skip
+ 0x0053=major-unit
+ 0x0054=minor-unit
+ 0x0055=max
+ 0x0056=min
+ 0x0059=side-wall
+ 0x005B=show-data-labels-over-max
+ 0x005C=tick-label-pos
+ 0x005E=pie-combination
+ 0x005F=basetime-unit
+ 0x0064=format-code
+ 0x0065=height-percent
+ 0x0066=display-blanks-as
+ 0x006A=major-unit-type
+ 0x006B=minor-unit-type
+ 0x0076=edit-language
+end
+
+constlist=CHFREXTPROPS-TAG-NAMELIST
+ default=
+ 0x0022=CHFREXTPROPS-SYMBOLTYPE
+ 0x0035=CONV-PERCENT
+ 0x0036=CONV-PERCENT
+ 0x004E=CONV-DEG
+ 0x004F=CONV-DEG
+ 0x005C=CHFREXTPROPS-TICKLABELPOS
+ 0x005F=CHFREXTPROPS-TIMEUNIT
+ 0x0065=CONV-PERCENT
+ 0x0066=CHFREXTPROPS-DISPBLANKSAS
+ 0x006A=CHFREXTPROPS-TIMEUNIT
+ 0x006B=CHFREXTPROPS-TIMEUNIT
+end
+
+shortlist=CHFREXTPROPS-DISPBLANKSAS,0x0067,gap,,spanned
+shortlist=CHFREXTPROPS-SYMBOLTYPE,0x0023,none,diamond,square,triangle,x,star,dot,dash,circle,plus
+shortlist=CHFREXTPROPS-TICKLABELPOS,0x005D,center
+shortlist=CHFREXTPROPS-TIMEUNIT,0x0060,days,months,years
+
# CHFRINFO -------------------------------------------------------------------
-shortlist=CHFRINFO-APPVERSION,9,excel-2000,excel-xp-2003,excel-2007
+shortlist=CHFRINFO-APPVERSION,9,excel-2000,excel-xp-2003,,excel-2007
# CHFRLABELPROPS -------------------------------------------------------------
@@ -850,6 +939,26 @@ flagslist=CHFRLABELPROPS-FLAGS
0x0010=show-bubble
end
+# CHFRLAYOUT -----------------------------------------------------------------
+
+combilist=CHFRLAYOUT-FLAGS
+ 0x001E=uint8,dec,legend-pos,CHFRLAYOUT-LEGENDPOS
+end
+
+shortlist=CHFRLAYOUT-LEGENDPOS,0,bottom,top-right,top,right,left
+
+shortlist=CHFRLAYOUT-MODE,0,auto,factor,egde
+
+# CHFRPLOTAREALAYOUT ---------------------------------------------------------
+
+flagslist=CHFRPLOTAREALAYOUT-FLAGS
+ 0x0001=!outer!inner
+end
+
+shortlist=CHFRLAYOUT-LEGENDPOS,0,bottom,top-right,top,right,left
+
+shortlist=CHFRLAYOUT-MODE,0,auto,factor,egde
+
# CHFRUNITPROPS --------------------------------------------------------------
shortlist=CHFRUNITPROPS-PRESET,-1,manual,none,hundred,thousand,10000,100000,million,10-million,100-million,billion,trillion
@@ -881,7 +990,7 @@ end
# CHLEGEND -------------------------------------------------------------------
-shortlist=CHLEGEND-DOCKPOS,0,bottom,top-left,top,right,left,,,manual
+shortlist=CHLEGEND-DOCKPOS,0,bottom,top-right,top,right,left,,,manual
shortlist=CHLEGEND-SPACING,0,close,medium,open
flagslist=CHLEGEND-FLAGS
@@ -909,6 +1018,7 @@ shortlist=CHLINEFORMAT-LINEWEIGHT,-1,hair,thin,medium,thick
flagslist=CHLINEFORMAT-FLAGS
0x0001=auto
0x0004=axis-enabled
+ 0x0008=system-color
end
# CHMARKERFORMAT -------------------------------------------------------------
@@ -1040,7 +1150,7 @@ shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute
shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute
shortlist=CHTEXT-FILLMODE,1,transparent,opaque
-flagslist=CHTEXT-FLAGS-BIFF2
+flagslist=CHTEXT-FLAGS1-BIFF2
0x0001=auto-color
0x0002=show-symbol
0x0004=show-value
@@ -1051,28 +1161,31 @@ flagslist=CHTEXT-FLAGS-BIFF2
0x0080=auto-fill
end
-combilist=CHTEXT-FLAGS-BIFF3
- include=CHTEXT-FLAGS-BIFF2
+combilist=CHTEXT-FLAGS1-BIFF3
+ include=CHTEXT-FLAGS1-BIFF2
0x0700=uint8,dec,orientation,TEXTORIENTATION
end
-combilist=CHTEXT-FLAGS-BIFF5
- include=CHTEXT-FLAGS-BIFF3
+combilist=CHTEXT-FLAGS1-BIFF5
+ include=CHTEXT-FLAGS1-BIFF3
0x0800=show-categ-percent
0x1000=show-percent
end
-combilist=CHTEXT-FLAGS-BIFF8
- include=CHTEXT-FLAGS-BIFF5
+combilist=CHTEXT-FLAGS1-BIFF8
+ include=CHTEXT-FLAGS1-BIFF5
0x2000=show-bubble-size
0x4000=show-categ
end
-multilist=CHTEXT-PLACEMENT
- default=
- 0=context,outside,inside,center,axis,above,below,left,right,auto,manual
+combilist=CHTEXT-FLAGS2
+ ignore=0x3FF0
+ 0x000F=uint8,dec,placement,CHTEXT-PLACEMENT
+ 0xC000=uint8,dec,text-dir,XF-TEXTDIRECTION
end
+shortlist=CHTEXT-PLACEMENT,0,context,outside,inside,center,axis,above,below,left,right,auto,manual
+
# CHTICK ---------------------------------------------------------------------
shortlist=CHTICK-TYPE,0,none,inside,outside,both
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 203ce4552e5d..fddc13966798 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -6,6 +6,7 @@ Adjust
AdjustContrast
AdjustLuminance
Align
+AnchorPosition
ArrangeOrder
Aspect
AttachedAxisIndex
@@ -121,6 +122,7 @@ ErrorBarX
ErrorBarY
ErrorMessage
ErrorTitle
+Expansion
ExternalDocLinks
ExternalLinks
FileFormat
@@ -169,10 +171,16 @@ HasAutoShowInfo
HasColumnRowHeaders
HasHorizontalScrollBar
HasLayoutInfo
+HasMainTitle
HasReference
+HasSecondaryXAxisTitle
+HasSecondaryYAxisTitle
HasSheetTabs
HasSortInfo
HasVerticalScrollBar
+HasXAxisTitle
+HasYAxisTitle
+HasZAxisTitle
HeaderBodyDistance
HeaderHeight
HeaderIsDynamicHeight
@@ -304,6 +312,7 @@ ReferenceDevice
RegularExpressions
RelId
RelativeHorizontalTabbarWidth
+RelativePosition
Repeat
RepeatDelay
Representation