summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx6
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx3
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx19
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx84
-rw-r--r--oox/source/dump/biffdumper.ini2
5 files changed, 68 insertions, 46 deletions
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index 4f6e04abeee0..25a6428018aa 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -122,7 +122,11 @@ public:
/** 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 );
+ 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 );
};
// ============================================================================
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 1fd8dbd61f31..36a18117fd04 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -305,7 +305,8 @@ 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 );
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 369b71fc6b48..22b359ab0866 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -35,6 +35,8 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
+#include <com/sun/star/chart2/RelativePosition.hpp>
+#include "properties.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/theme.hxx"
@@ -48,6 +50,7 @@ using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::frame::XModel;
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 ::oox::core::XmlFilterBase;
@@ -224,7 +227,7 @@ LayoutConverter::~LayoutConverter()
{
}
-bool LayoutConverter::calcAbsRectangle( Rectangle& orRect )
+bool LayoutConverter::calcAbsRectangle( Rectangle& orRect ) const
{
if( !mrModel.mbAutoLayout )
{
@@ -241,6 +244,20 @@ bool LayoutConverter::calcAbsRectangle( Rectangle& orRect )
return false;
}
+bool LayoutConverter::convertFromModel( PropertySet& rPropSet )
+{
+ if( !mrModel.mbAutoLayout && (mrModel.mfX >= 0.0) && (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;
+}
+
// ============================================================================
} // namespace chart
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index 4d7d1d29f423..fdb8cdc7793e 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -32,7 +32,6 @@
#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/RelativePosition.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XFormattedString.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
@@ -181,6 +180,10 @@ 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 );
+
+ // frame position
+ LayoutConverter aLayoutConv( *this, mrModel.mxLayout.getOrCreate() );
+ aLayoutConv.convertFromModel( aPropSet );
}
catch( Exception& )
{
@@ -211,59 +214,56 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
PropertySet aPropSet( xLegend );
aPropSet.setProperty( PROP_Show, true );
- // legend position and expansion
+ // legend formatting
+ 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;
- bool bManualLayout = aLayoutConv.calcAbsRectangle( aLegendRect );
- if( bManualLayout )
+ if( aLayoutConv.calcAbsRectangle( aLegendRect ) )
{
- // relative position
- cssc2::RelativePosition aRelPos;
- aRelPos.Primary = getLimitedValue< double, double >( rLayout.mfX, 0.0, 1.0 );
- aRelPos.Secondary = getLimitedValue< double, double >( rLayout.mfY, 0.0, 1.0 );
- aRelPos.Anchor = ::com::sun::star::drawing::Alignment_TOP_LEFT;
- aPropSet.setProperty( PROP_AnchorPosition, cssc2::LegendPosition_CUSTOM );
- aPropSet.setProperty( PROP_RelativePosition, aRelPos );
-
// #i71697# it is not possible to set the size directly, do some magic here
- cssc2::LegendExpansion eLegendExpand = cssc2::LegendExpansion_BALANCED;
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;
- aPropSet.setProperty( PROP_Expansion, eLegendExpand );
- }
- else // automatic layout
- {
- cssc2::LegendPosition eLegendPos = cssc2::LegendPosition_LINE_END;
- 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;
- }
- aPropSet.setProperty( PROP_AnchorPosition, eLegendPos );
- aPropSet.setProperty( PROP_Expansion, eLegendExpand );
+ else
+ eLegendExpand = cssc2::LegendExpansion_BALANCED;
}
- // legend formatting
- getFormatter().convertFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_LEGEND );
+ // set position and expansion properties
+ aPropSet.setProperty( PROP_AnchorPosition, eLegendPos );
+ aPropSet.setProperty( PROP_Expansion, eLegendExpand );
}
catch( Exception& )
{
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index cc9a5d11427a..defc0b3e6ae3 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -254,7 +254,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,,,,