summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-06-17 11:32:18 +0200
committerDaniel Rentz <dr@openoffice.org>2010-06-17 11:32:18 +0200
commit74721a30a80c06fac3d51dbe9da54344b60542ab (patch)
tree4443d765a3a9b4ccc7317f3fbe258925e75394c2 /oox
parent614e369c4cb48ea4bcafcae6c29f412e20a4e6a7 (diff)
parent1f4a5d96da42928176c86bc7b29423b63dbaefc9 (diff)
mib16: rebase to m82
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/drawingml/customshapegeometry.hxx4
-rw-r--r--oox/inc/oox/drawingml/customshapeproperties.hxx4
-rw-r--r--oox/inc/oox/drawingml/drawingmltypes.hxx4
-rw-r--r--oox/inc/oox/drawingml/shape.hxx5
-rw-r--r--oox/inc/oox/drawingml/textcharacterproperties.hxx1
-rw-r--r--oox/inc/oox/drawingml/textliststyle.hxx4
-rw-r--r--oox/inc/oox/drawingml/textparagraphproperties.hxx4
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx26
-rw-r--r--oox/inc/oox/helper/propertymap.hxx5
-rw-r--r--oox/inc/oox/helper/propertyset.hxx4
-rw-r--r--oox/inc/oox/ppt/pptshape.hxx6
-rw-r--r--oox/inc/oox/ppt/slidetransition.hxx2
-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.cxx51
-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/drawingml/customshapegeometry.cxx92
-rw-r--r--oox/source/drawingml/diagram/diagramdefinitioncontext.cxx1
-rw-r--r--oox/source/drawingml/diagram/diagramfragmenthandler.cxx2
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx25
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx1
-rw-r--r--oox/source/drawingml/shape.cxx36
-rw-r--r--oox/source/drawingml/shapepropertiescontext.cxx2
-rw-r--r--oox/source/drawingml/table/tablerowcontext.cxx1
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx37
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx3
-rw-r--r--oox/source/drawingml/textliststyle.cxx11
-rw-r--r--oox/source/drawingml/theme.cxx1
-rw-r--r--oox/source/dump/biffdumper.cxx130
-rw-r--r--oox/source/dump/biffdumper.ini149
-rw-r--r--oox/source/helper/propertymap.cxx73
-rw-r--r--oox/source/helper/propertyset.cxx7
-rw-r--r--oox/source/helper/zipstorage.cxx9
-rw-r--r--oox/source/ppt/pptshape.cxx69
-rw-r--r--oox/source/ppt/pptshapecontext.cxx28
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx13
-rw-r--r--oox/source/ppt/slidetransition.cxx36
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx1
-rw-r--r--oox/source/token/properties.txt13
-rw-r--r--oox/source/xls/externallinkbuffer.cxx2
-rw-r--r--oox/source/xls/themebuffer.cxx1
59 files changed, 1352 insertions, 222 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/drawingml/customshapegeometry.hxx b/oox/inc/oox/drawingml/customshapegeometry.hxx
index 4fec38cf09eb..75a788acb609 100644
--- a/oox/inc/oox/drawingml/customshapegeometry.hxx
+++ b/oox/inc/oox/drawingml/customshapegeometry.hxx
@@ -41,11 +41,11 @@ namespace oox { namespace drawingml {
class CustomShapeGeometryContext : public ::oox::core::ContextHandler
{
public:
- CustomShapeGeometryContext( ::oox::core::ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, CustomShapeProperties& rCustomShapeProperties );
+ CustomShapeGeometryContext( ::oox::core::ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, Shape& rShape );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
- CustomShapeProperties& mrCustomShapeProperties;
+ Shape& mrShape;
};
// ---------------------------------------------------------------------
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index 44e91d6e797b..ff1f26533036 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -32,6 +32,7 @@
#include "oox/drawingml/color.hxx"
#include <com/sun/star/graphic/XGraphic.hpp>
#include <boost/shared_ptr.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
#include "tokens.hxx"
#include <vector>
#include <map>
@@ -74,11 +75,12 @@ public:
std::vector< CustomShapeGuide >& getAdjustmentValues(){ return maAdjustmentValues; };
double getValue( const std::vector< CustomShapeGuide >&, sal_uInt32 nIndex ) const;
-
+ ::basegfx::B2DPolyPolygon& getPolygon() { return maPolygon; }
private:
rtl::OUString maShapePresetType;
std::vector< CustomShapeGuide > maAdjustmentValues;
+ ::basegfx::B2DPolyPolygon maPolygon;
};
} }
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index ed4367e63857..f8bb4c91b5d5 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -30,6 +30,7 @@
#include <boost/shared_ptr.hpp>
#include <com/sun/star/style/TabAlign.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -118,6 +119,9 @@ float GetTextSize( const ::rtl::OUString& rValue );
/** converts the ST_TextSpacingPoint to 1/100mm */
sal_Int32 GetTextSpacingPoint( const ::rtl::OUString& sValue );
+sal_Int32 GetTextSpacingPoint( const sal_Int32 nValue );
+
+::com::sun::star::drawing::TextVerticalAdjust GetTextVerticalAdjust( sal_Int32 nToken );
/** */
::com::sun::star::style::TabAlign GetTabAlign( ::sal_Int32 aToken );
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index f4f5a5ee68fe..c951369dbf78 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -30,7 +30,7 @@
#include "oox/helper/propertymap.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/drawingml/customshapeproperties.hxx"
+//#include "oox/drawingml/customshapeproperties.hxx"
#include "oox/drawingml/textliststyle.hxx"
#include <com/sun/star/frame/XModel.hpp>
@@ -42,6 +42,9 @@
namespace oox { namespace drawingml {
+class CustomShapeProperties;
+typedef boost::shared_ptr< CustomShapeProperties > CustomShapePropertiesPtr;
+
typedef ::std::map< ::rtl::OUString, ShapePtr > ShapeIdMap;
struct ShapeStyleRef
diff --git a/oox/inc/oox/drawingml/textcharacterproperties.hxx b/oox/inc/oox/drawingml/textcharacterproperties.hxx
index 81cd95dddff2..6f4282471227 100644
--- a/oox/inc/oox/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/oox/drawingml/textcharacterproperties.hxx
@@ -52,6 +52,7 @@ struct TextCharacterProperties
Color maHighlightColor;
OptValue< ::rtl::OUString > moLang;
OptValue< sal_Int32 > moHeight;
+ OptValue< sal_Int32 > moSpacing;
OptValue< sal_Int32 > moUnderline;
OptValue< sal_Int32 > moStrikeout;
OptValue< sal_Int32 > moCaseMap;
diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx
index 6ba4cdf1d62a..1a8fca45bf25 100644
--- a/oox/inc/oox/drawingml/textliststyle.hxx
+++ b/oox/inc/oox/drawingml/textliststyle.hxx
@@ -50,6 +50,10 @@ public:
inline const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; };
inline TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; };
+#if OSL_DEBUG_LEVEL > 0
+ void dump( int nLevels=9 );
+#endif
+
protected:
TextParagraphPropertiesVector maListStyle;
diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index ef80af2d1c11..310df83212a0 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -112,6 +112,10 @@ public:
size can be zero and the default value is returned. */
float getCharHeightPoints( float fDefault ) const;
+#if OSL_DEBUG_LEVEL > 0
+ void dump() { maTextParagraphPropertyMap.dump(); OSL_TRACE("character height: %f", maTextCharacterProperties.getCharHeightPoints(-1)); }
+#endif
+
protected:
TextCharacterProperties maTextCharacterProperties;
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/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx
index 30df15d7e5c6..150f5c3d9364 100644
--- a/oox/inc/oox/helper/propertymap.hxx
+++ b/oox/inc/oox/helper/propertymap.hxx
@@ -89,6 +89,11 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
makePropertySet() const;
+#if OSL_DEBUG_LEVEL > 0
+ static void dump( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
+ void dump();
+#endif
+
private:
const PropertyList* mpPropNames;
};
diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx
index a1769374d959..8ddfaff44421 100644
--- a/oox/inc/oox/helper/propertyset.hxx
+++ b/oox/inc/oox/helper/propertyset.hxx
@@ -127,6 +127,10 @@ public:
@param rPropertyMap The property map. */
void setProperties( const PropertyMap& rPropertyMap );
+#if OSL_DEBUG_LEVEL > 0
+ void dump();
+#endif
+
// ------------------------------------------------------------------------
private:
/** Gets the specified property from the property set.
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 59f1beb39677..09c7830a96bb 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -61,9 +61,15 @@ public:
ShapeLocation getShapeLocation() const { return meShapeLocation; };
sal_Bool isReferenced() const { return mbReferenced; };
void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; };
+ void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
+
+ static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
+ static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes );
+ static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
protected:
+ oox::drawingml::ShapePtr mpPlaceholder;
};
} }
diff --git a/oox/inc/oox/ppt/slidetransition.hxx b/oox/inc/oox/ppt/slidetransition.hxx
index 5427d90a5e35..df2eed4d6083 100644
--- a/oox/inc/oox/ppt/slidetransition.hxx
+++ b/oox/inc/oox/ppt/slidetransition.hxx
@@ -56,6 +56,8 @@ namespace oox { namespace ppt {
static sal_Int16 ooxToOdpEightDirections( ::sal_Int32 nOoxType );
static sal_Int16 ooxToOdpCornerDirections( ::sal_Int32 nOoxType );
static sal_Int16 ooxToOdpBorderDirections( ::sal_Int32 nOoxType );
+ static sal_Int16 ooxToOdpSideDirections( ::sal_Int32 nOoxType );
+ static sal_Bool ooxToOdpSideDirectionsDirectionNormal( ::sal_Int32 nOoxType );
void setOoxTransitionType( ::sal_Int32 OoxType,
::sal_Int32 param1, ::sal_Int32 param2 );
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 82a22213b713..c3f74899ed97 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -27,7 +27,10 @@
#include "oox/drawingml/chart/plotareaconverter.hxx"
#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>
@@ -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::XCoordinateSystem;
using ::com::sun::star::chart2::XCoordinateSystemContainer;
using ::com::sun::star::chart2::XDiagram;
@@ -53,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() {}
@@ -89,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;
};
// ----------------------------------------------------------------------------
@@ -101,7 +109,8 @@ private:
AxesSetConverter::AxesSetConverter( const ConverterRoot& rParent, AxesSetModel& rModel ) :
ConverterBase< AxesSetModel >( rParent, rModel ),
mb3dChart( false ),
- mbWall3dChart( false )
+ mbWall3dChart( false ),
+ mbPieChart( false )
{
}
@@ -158,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 );
@@ -304,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 )
{
}
@@ -391,6 +402,7 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
maAutoTitle = aAxesSetConv.getAutomaticTitle();
mb3dChart = aAxesSetConv.is3dChart();
mbWall3dChart = aAxesSetConv.isWall3dChart();
+ mbPieChart = aAxesSetConv.isPieChart();
}
else
{
@@ -406,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/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index decb759579f3..79c0c2e28d99 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -26,10 +26,12 @@
************************************************************************/
#include "oox/drawingml/customshapegeometry.hxx"
+#include "oox/drawingml/customshapeproperties.hxx"
#include <com/sun/star/xml/sax/FastToken.hpp>
#include <comphelper/stl_types.hxx>
#include <hash_map>
+#include <basegfx/polygon/b2dpolygon.hxx>
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
@@ -37,6 +39,7 @@
#include "tokens.hxx"
using ::rtl::OUString;
+using namespace ::basegfx;
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -180,6 +183,88 @@ Reference< XFastContextHandler > AdjustmentValueContext::createFastChildContext(
// ---------------------------------------------------------------------
+class PathListContext : public ContextHandler
+{
+public:
+ PathListContext( ContextHandler& rParent, Shape& rShape );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException);
+
+protected:
+ Shape& mrShape;
+ sal_Int32 maPointToken;
+ ::basegfx::B2DPolygon maPolygon;
+};
+
+PathListContext::PathListContext( ContextHandler& rParent, Shape& rShape )
+: ContextHandler( rParent )
+, mrShape( rShape )
+{
+}
+
+Reference< XFastContextHandler > PathListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+{
+ switch( aElementToken ) {
+ case NMSP_DRAWINGML | XML_path:
+ maPolygon.clear();
+ break;
+ case NMSP_DRAWINGML | XML_close:
+ maPolygon.setClosed( true );
+ break;
+ case NMSP_DRAWINGML | XML_pt:
+ {
+ OUString sX, sY;
+
+ sX = xAttribs->getOptionalValue( XML_x );
+ sY = xAttribs->getOptionalValue( XML_y );
+
+ double dX, dY;
+
+ dX = sX.toDouble();
+ dY = sY.toDouble();
+
+ maPolygon.append( B2DPoint ( dX, dY ) );
+ break;
+ }
+ case NMSP_DRAWINGML | XML_lnTo:
+ case NMSP_DRAWINGML | XML_moveTo:
+ maPointToken = aElementToken;
+ break;
+ }
+
+ return this;
+}
+
+void PathListContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException)
+{
+ switch( aElementToken ) {
+ case NMSP_DRAWINGML|XML_pathLst:
+ {
+ B2DPolyPolygon& rPoly = mrShape.getCustomShapeProperties()->getPolygon();
+ if( rPoly.count() ) {
+ if( rPoly.areControlPointsUsed() ) {
+ if( rPoly.isClosed() )
+ mrShape.setServiceName( "com.sun.star.drawing.ClosedBezierShape" );
+ else
+ mrShape.setServiceName( "com.sun.star.drawing.OpenBezierShape" );
+ } else {
+ if( rPoly.isClosed() )
+ mrShape.setServiceName( "com.sun.star.drawing.PolyPolygonPathShape" );
+ else
+ mrShape.setServiceName( "com.sun.star.drawing.PolyLinePathShape" );
+ }
+ }
+ break;
+ }
+ case NMSP_DRAWINGML|XML_path:
+ if( maPolygon.count() > 0 )
+ mrShape.getCustomShapeProperties()->getPolygon().append( maPolygon );
+ break;
+ }
+}
+
+// ---------------------------------------------------------------------
+
OUString GetShapeType( sal_Int32 nType )
{
OUString sType;
@@ -981,9 +1066,9 @@ static OUString GetTextShapeType( sal_Int32 nType )
// ---------------------------------------------------------------------
// CT_CustomGeometry2D
-CustomShapeGeometryContext::CustomShapeGeometryContext( ContextHandler& rParent, const Reference< XFastAttributeList >& /* xAttribs */, CustomShapeProperties& rCustomShapeProperties )
+CustomShapeGeometryContext::CustomShapeGeometryContext( ContextHandler& rParent, const Reference< XFastAttributeList >& /* xAttribs */, Shape& rShape )
: ContextHandler( rParent )
-, mrCustomShapeProperties( rCustomShapeProperties )
+, mrShape( rShape )
{
}
@@ -997,8 +1082,9 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont
case NMSP_DRAWINGML|XML_ahLst: // CT_AdjustHandleList adjust handle list
case NMSP_DRAWINGML|XML_cxnLst: // CT_ConnectionSiteList connection site list
case NMSP_DRAWINGML|XML_rect: // CT_GeomRectList geometry rect list
+ break;
case NMSP_DRAWINGML|XML_pathLst: // CT_Path2DList 2d path list
- break;
+ return new PathListContext( *this, mrShape );
}
Reference< XFastContextHandler > xEmpty;
diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
index 81c0d597afe2..53477211848e 100644
--- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
+++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
@@ -30,6 +30,7 @@
#include "oox/helper/helper.hxx"
#include "layoutnodecontext.hxx"
#include "oox/drawingml/diagram/datamodelcontext.hxx"
+#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
index 0cad22660ab6..ac2e755bee40 100644
--- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
+++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
@@ -31,7 +31,7 @@
#include "oox/drawingml/diagram/datamodelcontext.hxx"
#include "oox/core/namespaces.hxx"
#include "diagramdefinitioncontext.hxx"
-
+#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index 6773c5d6149b..e5aef824bf54 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -37,8 +37,9 @@ using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XFastAttributeList;
using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::geometry;
+using namespace ::com::sun::star::style;
namespace oox {
namespace drawingml {
@@ -125,10 +126,30 @@ sal_Int32 GetTextSpacingPoint( const OUString& sValue )
{
sal_Int32 nRet;
if( ::sax::Converter::convertNumber( nRet, sValue ) )
- nRet = ( nRet * 254 + 360 ) / 720;
+ nRet = GetTextSpacingPoint( nRet );
return nRet;
}
+sal_Int32 GetTextSpacingPoint( const sal_Int32 nValue )
+{
+ return ( nValue * 254 + 360 ) / 720;
+}
+
+TextVerticalAdjust GetTextVerticalAdjust( sal_Int32 nToken )
+{
+ TextVerticalAdjust rVal = TextVerticalAdjust_TOP;
+
+ switch( nToken ) {
+ case XML_b:
+ rVal = TextVerticalAdjust_BOTTOM;
+ break;
+ case XML_ctr:
+ rVal = TextVerticalAdjust_CENTER;
+ break;
+ }
+
+ return rVal;
+}
float GetFontHeight( sal_Int32 nHeight )
{
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index a0335fe68ee2..8537017c2118 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
+#include "oox/drawingml/customshapeproperties.hxx"
#include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
#include "oox/drawingml/table/tablecontext.hxx"
#include "oox/core/namespaces.hxx"
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 59b3f35dc8cc..1a32d6a206a0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/customshapeproperties.hxx"
#include "oox/drawingml/theme.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/lineproperties.hxx"
@@ -218,8 +219,8 @@ void Shape::addChildren(
aIter = rMaster.maChildren.begin();
while( aIter != rMaster.maChildren.end() )
{
- Rectangle aShapeRect;
- Rectangle* pShapeRect = 0;
+ awt::Rectangle aShapeRect;
+ awt::Rectangle* pShapeRect = 0;
if ( ( nGlobalLeft != SAL_MAX_INT32 ) && ( nGlobalRight != SAL_MIN_INT32 ) && ( nGlobalTop != SAL_MAX_INT32 ) && ( nGlobalBottom != SAL_MIN_INT32 ) )
{
sal_Int32 nGlobalWidth = nGlobalRight - nGlobalLeft;
@@ -298,6 +299,35 @@ Reference< XShape > Shape::createAndInsert(
aTransformation.translate( aPosition.X / 360.0, aPosition.Y / 360.0 );
}
+ if ( mpCustomShapePropertiesPtr && mpCustomShapePropertiesPtr->getPolygon().count() )
+ {
+ ::basegfx::B2DPolyPolygon& rPolyPoly = mpCustomShapePropertiesPtr->getPolygon();
+
+ if( rPolyPoly.count() > 0 ) {
+ if( rPolyPoly.areControlPointsUsed() ) {
+ // TODO Beziers
+ } else {
+ uno::Sequence< uno::Sequence< awt::Point > > aPolyPolySequence( rPolyPoly.count() );
+
+ for (sal_uInt32 j = 0; j < rPolyPoly.count(); j++ ) {
+ ::basegfx::B2DPolygon aPoly = rPolyPoly.getB2DPolygon( j );
+
+ // now creating the corresponding PolyPolygon
+ sal_Int32 i, nNumPoints = aPoly.count();
+ uno::Sequence< awt::Point > aPointSequence( nNumPoints );
+ awt::Point* pPoints = aPointSequence.getArray();
+ for( i = 0; i < nNumPoints; ++i )
+ {
+ const ::basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) );
+ pPoints[ i ] = awt::Point( static_cast< sal_Int32 >( aPoint.getX() ), static_cast< sal_Int32 >( aPoint.getY() ) );
+ }
+ aPolyPolySequence.getArray()[ j ] = aPointSequence;
+ }
+ maShapeProperties[ PROP_PolyPolygon ] <<= aPolyPolySequence;
+ }
+ }
+ }
+
// special for lineshape
if ( aServiceName == OUString::createFromAscii( "com.sun.star.drawing.LineShape" ) )
{
@@ -422,7 +452,6 @@ Reference< XShape > Shape::createAndInsert(
PropertyMap aShapeProperties;
PropertyMap::const_iterator aShapePropIter;
- aShapeProperties.insert( getShapeProperties().begin(), getShapeProperties().end() );
if( mxCreateCallback.get() )
{
for ( aShapePropIter = mxCreateCallback->getShapeProperties().begin();
@@ -438,6 +467,7 @@ Reference< XShape > Shape::createAndInsert(
aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second;
}
+ aShapeProperties.insert( getShapeProperties().begin(), getShapeProperties().end() );
// applying properties
PropertySet aPropSet( xSet );
if ( aServiceName == OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) )
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx
index 68c8ed967159..7724ba9b44b2 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -74,7 +74,7 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
// GeometryGroup
case NMSP_DRAWINGML|XML_custGeom: // custom geometry "CT_CustomGeometry2D"
- xRet.set( new CustomShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
+ xRet.set( new CustomShapeGeometryContext( *this, xAttribs, mrShape ) );
break;
diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx
index 17881d89639b..7e0ff052bb4e 100644
--- a/oox/source/drawingml/table/tablerowcontext.cxx
+++ b/oox/source/drawingml/table/tablerowcontext.cxx
@@ -31,6 +31,7 @@
#include "oox/drawingml/table/tablecellcontext.hxx"
#include "oox/drawingml/table/tablerow.hxx"
#include "oox/core/namespaces.hxx"
+#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star;
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index ec605a3adadd..668266f2f679 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -27,7 +27,9 @@
#include "oox/drawingml/textbodypropertiescontext.hxx"
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include "oox/drawingml/textbodyproperties.hxx"
@@ -41,8 +43,9 @@
using ::rtl::OUString;
using namespace ::oox::core;
using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
namespace oox { namespace drawingml {
@@ -64,21 +67,25 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// ST_Coordinate
OUString sValue;
sValue = xAttributes->getOptionalValue( XML_lIns );
+ if( sValue.getLength() ) {
sal_Int32 nLeftInset = ( sValue.getLength() != 0 ? GetCoordinate( sValue ) : 91440 / 360 );
mrTextBodyProp.maPropertyMap[ PROP_TextLeftDistance ] <<= static_cast< sal_Int32 >( nLeftInset );
-
+ }
sValue = xAttributes->getOptionalValue( XML_tIns );
+ if( sValue.getLength() ) {
sal_Int32 nTopInset = ( sValue.getLength() != 0 ? GetCoordinate( sValue ) : 91440 / 360 );
mrTextBodyProp.maPropertyMap[ PROP_TextUpperDistance ] <<= static_cast< sal_Int32 >( nTopInset );
-
+ }
sValue = xAttributes->getOptionalValue( XML_rIns );
+ if( sValue.getLength() ) {
sal_Int32 nRightInset = ( sValue.getLength() != 0 ? GetCoordinate( sValue ) : 91440 / 360 );
mrTextBodyProp.maPropertyMap[ PROP_TextRightDistance ] <<= static_cast< sal_Int32 >( nRightInset );
-
+ }
sValue = xAttributes->getOptionalValue( XML_bIns );
+ if( sValue.getLength() ) {
sal_Int32 nBottonInset = ( sValue.getLength() != 0 ? GetCoordinate( sValue ) : 45720 / 360 );
mrTextBodyProp.maPropertyMap[ PROP_TextLowerDistance ] <<= static_cast< sal_Int32 >( nBottonInset );
-
+ }
// ST_TextAnchoringType
drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
@@ -93,7 +100,10 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
}
mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA;
-// bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
+ bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
+ if( bAnchorCenter )
+ mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ TextHorizontalAdjust_CENTER;
// bool bCompatLineSpacing = aAttribs.getBool( XML_compatLnSpc, false );
// bool bForceAA = aAttribs.getBool( XML_forceAA, false );
@@ -118,6 +128,18 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// ST_TextVerticalType
mrTextBodyProp.moVert = aAttribs.getToken( XML_vert );
+ bool bRtl = aAttribs.getBool( XML_rtl, false );
+ sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz );
+ if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) {
+ mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
+ <<= WritingMode_TB_RL;
+ // workaround for TB_LR as using WritingMode2 doesn't work
+ if( !bAnchorCenter )
+ mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ TextHorizontalAdjust_LEFT;
+ } else
+ mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
+ <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB );
}
// --------------------------------------------------------------------
@@ -143,6 +165,9 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit
break;
case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit
+ mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= true;
+ mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false;
+ break;
case NMSP_DRAWINGML|XML_spAutoFit:
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= true;
break;
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 4dbd632b2191..3ac5018c1dad 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -59,6 +59,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
maHighlightColor.assignIfUsed( rSourceProps.maHighlightColor );
maUnderlineColor.assignIfUsed( rSourceProps.maUnderlineColor );
moHeight.assignIfUsed( rSourceProps.moHeight );
+ moSpacing.assignIfUsed( rSourceProps.moSpacing );
moUnderline.assignIfUsed( rSourceProps.moUnderline );
moStrikeout.assignIfUsed( rSourceProps.moStrikeout );
moCaseMap.assignIfUsed( rSourceProps.moCaseMap );
@@ -126,6 +127,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap[ PROP_CharHeightComplex ] <<= fHeight;
}
+ rPropMap[ PROP_CharKerning ] <<= (sal_Int16) GetTextSpacingPoint( moSpacing.get( 0 ) );
+
rPropMap[ PROP_CharUnderline ] <<= GetFontUnderline( moUnderline.get( XML_none ) );
rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) );
rPropMap[ PROP_CharCaseMap ] <<= GetCaseMap( moCaseMap.get( XML_none ) );
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index 5d01a28c9cfd..07a71c0855a1 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -65,4 +65,15 @@ void TextListStyle::apply( const TextListStyle& rTextListStyle )
applyStyleList( rTextListStyle.getListStyle(), getListStyle() );
}
+#if OSL_DEBUG_LEVEL > 0
+void TextListStyle::dump( int nLevels )
+{
+ for ( int i = 0; i < nLevels; i++ )
+ {
+ OSL_TRACE("level: %d", i);
+ maListStyle[ i ]->dump();
+ }
+}
+#endif
+
} }
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index b37ccdbaf13c..59245201eb61 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -26,6 +26,7 @@
************************************************************************/
#include "oox/drawingml/theme.hxx"
+#include "tokens.hxx"
using ::rtl::OUString;
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index ea1944d935a4..aa32cbe53d1b 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( mxOut );
+ 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( mxOut );
+ 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 fab205733430..d4b862825b3c 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/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 9ff791fd21f3..31072fe449e5 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -50,6 +50,19 @@ using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::beans::XVetoableChangeListener;
+#if OSL_DEBUG_LEVEL > 0
+#include <cstdio>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/LineSpacingMode.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
+#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using ::rtl::OString;
+using ::com::sun::star::style::LineSpacing;
+using ::com::sun::star::text::WritingMode;
+#endif
+
namespace oox {
// ============================================================================
@@ -228,6 +241,66 @@ Reference< XPropertySet > PropertyMap::makePropertySet() const
return new GenericPropertySet( *this );
}
+#if OSL_DEBUG_LEVEL > 0
+void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
+{
+ Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
+ Sequence< beans::Property > props = info->getProperties ();
+
+ OSL_TRACE("dump props, len: %d", props.getLength ());
+
+ for (int i=0; i < props.getLength (); i++) {
+ OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
+ fprintf (stderr,"%30s = ", name.getStr() );
+
+ try {
+ Any value = rXPropSet->getPropertyValue( props [i].Name );
+
+ OUString strValue;
+ sal_Int32 intValue = 0;
+ sal_uInt32 uintValue = 0;
+ sal_Int16 int16Value = 0;
+ sal_uInt16 uint16Value = 0;
+ bool boolValue = false;
+ LineSpacing spacing;
+// RectanglePoint pointValue;
+ WritingMode aWritingMode;
+
+ if( value >>= strValue )
+ fprintf (stderr,"\"%s\"\n", USS( strValue ) );
+ else if( value >>= intValue )
+ fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", intValue, intValue);
+ else if( value >>= uintValue )
+ fprintf (stderr,"%"SAL_PRIdINT32" (hex: %"SAL_PRIxUINT32")\n", uintValue, uintValue);
+ else if( value >>= int16Value )
+ fprintf (stderr,"%d (hex: %x)\n", int16Value, int16Value);
+ else if( value >>= uint16Value )
+ fprintf (stderr,"%d (hex: %x)\n", uint16Value, uint16Value);
+ else if( value >>= boolValue )
+ fprintf (stderr,"%d (bool)\n", boolValue);
+ else if( value >>= aWritingMode )
+ fprintf (stderr, "%d writing mode\n", aWritingMode);
+ else if( value >>= spacing ) {
+ fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height);
+ } else if( value.isExtractableTo(::getCppuType((const sal_Int32*)0))) {
+ fprintf (stderr,"is extractable to int32\n");
+ }
+// else if( value >>= pointValue )
+// fprintf (stderr,"%d (RectanglePoint)\n", pointValue);
+ else
+ fprintf (stderr,"??? <unhandled type %s>\n", USS(value.getValueTypeName()));
+ } catch(Exception e) {
+ fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
+ }
+ }
+}
+
+void PropertyMap::dump()
+{
+ dump( Reference< XPropertySet >( makePropertySet(), UNO_QUERY ) );
+}
+#endif
+
// ============================================================================
} // namespace oox
diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx
index c52872e50f2f..e7071ba402a2 100644
--- a/oox/source/helper/propertyset.cxx
+++ b/oox/source/helper/propertyset.cxx
@@ -172,6 +172,13 @@ void PropertySet::setAnyProperty( const OUString& rPropName, const Any& rValue )
}
}
+#if OSL_DEBUG_LEVEL > 0
+void PropertySet::dump()
+{
+ PropertyMap::dump( Reference< XPropertySet >( getXPropertySet(), UNO_QUERY ) );
+}
+#endif
+
// ============================================================================
} // namespace oox
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 72b6fcd1bff0..384870430c39 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -66,10 +66,15 @@ ZipStorage::ZipStorage(
/* #i105325# ::comphelper::OStorageHelper::GetStorageFromInputStream()
cannot be used here as it will open a storage with format type
'PackageFormat' that will not work with OOXML packages.
+
+ #161971# The MS-document storages should always be opened in Repair-Mode to
+ ignore the format errors and get so much info as possible. I hate this
+ solution, but it seems to be the only consistent way to handle the MS-documents.
+
TODO: #i105410# switch to 'OFOPXMLFormat' and use its
implementation of relations handling. */
mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
- ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory );
+ ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory, sal_True );
}
catch( Exception& )
{
@@ -87,7 +92,7 @@ ZipStorage::ZipStorage(
{
using namespace ::com::sun::star::embed::ElementModes;
mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream(
- OFOPXML_STORAGE_FORMAT_STRING, rxStream, READWRITE | TRUNCATE, rxFactory );
+ OFOPXML_STORAGE_FORMAT_STRING, rxStream, READWRITE | TRUNCATE, rxFactory, sal_True );
}
catch( Exception& )
{
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index ed53992f944b..eb3b3503452e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -28,6 +28,7 @@
#include "oox/ppt/pptshape.hxx"
#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/textbody.hxx"
#include "tokens.hxx"
#include <com/sun/star/container/XNamed.hpp>
@@ -40,6 +41,7 @@
using rtl::OUString;
using namespace ::oox::core;
+using namespace ::oox::drawingml;
using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
@@ -97,6 +99,11 @@ void PPTShape::addShape(
{
if ( ( meShapeLocation == Master ) || ( meShapeLocation == Layout ) )
sServiceName = rtl::OUString();
+ else {
+ const rtl::OUString sTitleShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.SubtitleShape" ) );
+ sServiceName = sTitleShapeService;
+ aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle();
+ }
}
break;
case XML_obj :
@@ -162,6 +169,21 @@ void PPTShape::addShape(
}
}
+ // use placeholder index if possible
+ if( mnSubType && getSubTypeIndex() && rSlidePersist.getMasterPersist().get() ) {
+ oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getSubTypeIndex(), rSlidePersist.getMasterPersist()->getShapes()->getChildren() );
+ if( pPlaceholder.get() && pPlaceholder->getTextBody() ) {
+ TextListStylePtr pNewTextListStyle ( new TextListStyle() );
+
+ pNewTextListStyle->apply( pPlaceholder->getTextBody()->getTextListStyle() );
+ if( pPlaceholder->getMasterTextListStyle().get() )
+ pNewTextListStyle->apply( *pPlaceholder->getMasterTextListStyle() );
+
+ aMasterTextListStyle = pNewTextListStyle;
+ }
+ }
+
+
if ( sServiceName.getLength() )
{
if ( !aMasterTextListStyle.get() )
@@ -209,4 +231,51 @@ void PPTShape::applyShapeReference( const oox::drawingml::Shape& rReferencedShap
Shape::applyShapeReference( rReferencedShape );
}
+oox::drawingml::ShapePtr PPTShape::findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr aShapePtr;
+ std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
+ while( aRevIter != rShapes.rend() )
+ {
+ if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
+ {
+ aShapePtr = *aRevIter;
+ break;
+ }
+ std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
+ aShapePtr = findPlaceholder( nMasterPlaceholder, rChildren );
+ if ( aShapePtr.get() )
+ break;
+ aRevIter++;
+ }
+ return aShapePtr;
+}
+
+oox::drawingml::ShapePtr PPTShape::findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr aShapePtr;
+ std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
+ while( aRevIter != rShapes.rend() )
+ {
+ if ( (*aRevIter)->getSubTypeIndex() == nIdx )
+ {
+ aShapePtr = *aRevIter;
+ break;
+ }
+ std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
+ aShapePtr = findPlaceholderByIndex( nIdx, rChildren );
+ if ( aShapePtr.get() )
+ break;
+ aRevIter++;
+ }
+ return aShapePtr;
+}
+
+// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
+oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
+ return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, rShapes );
+}
+
} }
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index 8379a6e95735..86e254088041 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -111,14 +111,27 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
{
sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
mpShapePtr->setSubType( nSubType );
- mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
- if ( nSubType )
+ OUString sIdx( xAttribs->getOptionalValue( XML_idx ) );
+ sal_Bool bHasIdx = sIdx.getLength() > 0;
+ sal_Int32 nIdx = sIdx.toInt32();
+ mpShapePtr->setSubTypeIndex( nIdx );
+
+ if ( nSubType || bHasIdx )
{
PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
if ( pPPTShapePtr )
{
oox::ppt::ShapeLocation eShapeLocation = pPPTShapePtr->getShapeLocation();
- if ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) )
+ oox::drawingml::ShapePtr pPlaceholder;
+
+ if ( bHasIdx && eShapeLocation == Slide )
+ {
+ // TODO: use id to shape map
+ SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
+ if ( pMasterPersist.get() )
+ pPlaceholder = PPTShape::findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
+ }
+ if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
{
// inheriting properties from placeholder objects by cloning shape
@@ -157,7 +170,6 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
}
if ( nFirstPlaceholder )
{
- oox::drawingml::ShapePtr pPlaceholder;
if ( eShapeLocation == Layout ) // for layout objects the referenced object can be found within the same shape tree
pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, -1, mpSlidePersistPtr->getShapes()->getChildren() );
else if ( eShapeLocation == Slide ) // normal slide shapes have to search within the corresponding master tree for referenced objects
@@ -176,6 +188,14 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
}
}
}
+ if ( pPlaceholder.get() )
+ {
+ mpShapePtr->applyShapeReference( *pPlaceholder.get() );
+ PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
+ if ( pPPTShape )
+ pPPTShape->setReferenced( sal_True );
+ pPPTShapePtr->setPlaceholder( pPlaceholder );
+ }
}
}
break;
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 62fbc1a87725..69f32e01e7eb 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/container/XNamed.hpp>
#include "tokens.hxx"
+#include "properties.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
@@ -86,6 +87,18 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
case NMSP_PPT|XML_sldMaster: // CT_SlideMaster
case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster
case NMSP_PPT|XML_sld: // CT_CommonSlideData
+ {
+ AttributeList attribs( xAttribs );
+
+ Reference< XDrawPage > xSlide( mpSlidePersistPtr->getPage() );
+ PropertyMap aPropMap;
+ PropertySet aSlideProp( xSlide );
+
+ aPropMap[ PROP_Visible ] = Any( attribs.getBool( XML_show, sal_True ) );
+ aSlideProp.setProperties( aPropMap );
+
+ break;
+ }
case NMSP_PPT|XML_notes: // CT_NotesSlide
case NMSP_PPT|XML_notesMaster: // CT_NotesMaster
break;
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index bdfc1621e486..ee889e13d840 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -176,6 +176,39 @@ namespace oox { namespace ppt {
return nOdpDirection;
}
+ sal_Int16 SlideTransition::ooxToOdpSideDirections( ::sal_Int32 nOoxType )
+ {
+ sal_Int16 nOdpDirection;
+ switch( nOoxType )
+ {
+ case XML_d:
+ case XML_u:
+ nOdpDirection = TransitionSubType::TOPTOBOTTOM;
+ break;
+ case XML_l:
+ case XML_r:
+ nOdpDirection = TransitionSubType::LEFTTORIGHT;
+ break;
+ default:
+ nOdpDirection= 0;
+ break;
+ }
+ return nOdpDirection;
+ }
+
+ sal_Bool SlideTransition::ooxToOdpSideDirectionsDirectionNormal( ::sal_Int32 nOoxType )
+ {
+ sal_Bool nOdpDirection = true;
+ switch( nOoxType )
+ {
+ case XML_u:
+ case XML_l:
+ nOdpDirection = false;
+ break;
+ }
+ return nOdpDirection;
+ }
+
sal_Int16 SlideTransition::ooxToOdpCornerDirections( ::sal_Int32 nOoxType )
{
sal_Int16 nOdpDirection;
@@ -291,7 +324,8 @@ namespace oox { namespace ppt {
break;
case NMSP_PPT|XML_wipe:
mnTransitionType = TransitionType::BARWIPE;
- mnTransitionSubType = ooxToOdpBorderDirections( param1 );
+ mnTransitionSubType = ooxToOdpSideDirections( param1 );
+ mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 );
break;
case NMSP_PPT|XML_split:
mnTransitionType = TransitionType::BARNDOORWIPE;
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 42efee474d90..05734b65e2a7 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -29,6 +29,7 @@
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
+#include "tokens.hxx"
#if DEBUG
#include <iostream>
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 59018311d49f..56606a289a6e 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
@@ -58,6 +59,7 @@ CharFontPitchComplex
CharHeight
CharHeightAsian
CharHeightComplex
+CharKerning
CharLocale
CharLocaleAsian
CharLocaleComplex
@@ -121,6 +123,7 @@ ErrorBarX
ErrorBarY
ErrorMessage
ErrorTitle
+Expansion
ExternalDocLinks
ExternalLinks
FileFormat
@@ -169,10 +172,16 @@ HasAutoShowInfo
HasColumnRowHeaders
HasHorizontalScrollBar
HasLayoutInfo
+HasMainTitle
HasReference
+HasSecondaryXAxisTitle
+HasSecondaryYAxisTitle
HasSheetTabs
HasSortInfo
HasVerticalScrollBar
+HasXAxisTitle
+HasYAxisTitle
+HasZAxisTitle
HeaderBodyDistance
HeaderHeight
HeaderIsDynamicHeight
@@ -305,6 +314,7 @@ ReferenceDevice
RegularExpressions
RelId
RelativeHorizontalTabbarWidth
+RelativePosition
Repeat
RepeatDelay
Representation
@@ -382,6 +392,8 @@ Text
TextAutoGrowHeight
TextBreak
TextColor
+TextFitToSize
+TextHorizontalAdjust
TextLeftDistance
TextLowerDistance
TextOverlap
@@ -415,6 +427,7 @@ VertJustify
VerticalAlign
VerticalSplitMode
VerticalSplitPositionTwips
+Visible
VisibleSize
VisualArea
VisualEffect
diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx
index a4c0731b19ed..04fcd2f84648 100644
--- a/oox/source/xls/externallinkbuffer.cxx
+++ b/oox/source/xls/externallinkbuffer.cxx
@@ -909,7 +909,7 @@ void ExternalLink::insertExternalSheet( const OUString& rSheetName )
OSL_ENSURE( rSheetName.getLength() > 0, "ExternalLink::insertExternalSheet - empty sheet name" );
if( mxDocLink.is() )
{
- Reference< XExternalSheetCache > xSheetCache = mxDocLink->addSheetCache( rSheetName );
+ Reference< XExternalSheetCache > xSheetCache = mxDocLink->addSheetCache( rSheetName, false );
sal_Int32 nCacheIdx = xSheetCache.is() ? xSheetCache->getTokenIndex() : -1;
maSheetCaches.push_back( nCacheIdx );
}
diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx
index 3aabd471742d..23617287dc57 100644
--- a/oox/source/xls/themebuffer.cxx
+++ b/oox/source/xls/themebuffer.cxx
@@ -27,6 +27,7 @@
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/stylesbuffer.hxx"
+#include "tokens.hxx"
using ::oox::drawingml::ClrScheme;