#i12587# import shapes in charts from MSOOXML
This commit is contained in:
parent
f2f5cbfdd2
commit
a386089b53
22 changed files with 101 additions and 59 deletions
|
@ -48,6 +48,7 @@ const sal_Int32 NMSP_ACTIVATION = 12 << 16;
|
||||||
const sal_Int32 NMSP_DRAWINGML = 21 << 16;
|
const sal_Int32 NMSP_DRAWINGML = 21 << 16;
|
||||||
const sal_Int32 NMSP_DIAGRAM = 22 << 16;
|
const sal_Int32 NMSP_DIAGRAM = 22 << 16;
|
||||||
const sal_Int32 NMSP_CHART = 23 << 16;
|
const sal_Int32 NMSP_CHART = 23 << 16;
|
||||||
|
const sal_Int32 NMSP_CDR = 24 << 16; // ChartDrawingML
|
||||||
// VML
|
// VML
|
||||||
const sal_Int32 NMSP_VML = 31 << 16;
|
const sal_Int32 NMSP_VML = 31 << 16;
|
||||||
const sal_Int32 NMSP_OFFICE = 32 << 16;
|
const sal_Int32 NMSP_OFFICE = 32 << 16;
|
||||||
|
@ -80,6 +81,23 @@ inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK;
|
||||||
/** Returns the namespace of the passed element without token identifier. */
|
/** Returns the namespace of the passed element without token identifier. */
|
||||||
inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }
|
inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// defines for tokens with specific namespaces, can be used in switch/cases
|
||||||
|
#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)
|
||||||
|
#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)
|
||||||
|
#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)
|
||||||
|
#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)
|
||||||
|
#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)
|
||||||
|
#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)
|
||||||
|
#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)
|
||||||
|
#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)
|
||||||
|
#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)
|
||||||
|
#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)
|
||||||
|
#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)
|
||||||
|
#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)
|
||||||
|
#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
} // namespace oox
|
} // namespace oox
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
|
|
||||||
#include "oox/core/fragmenthandler2.hxx"
|
#include "oox/core/fragmenthandler2.hxx"
|
||||||
|
|
||||||
#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)
|
|
||||||
|
|
||||||
namespace oox { namespace drawingml { class Shape; } }
|
namespace oox { namespace drawingml { class Shape; } }
|
||||||
|
|
||||||
namespace oox {
|
namespace oox {
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include <oox/dllapi.h>
|
#include <oox/dllapi.h>
|
||||||
|
|
||||||
namespace com { namespace sun { namespace star {
|
namespace com { namespace sun { namespace star {
|
||||||
|
namespace awt { struct Size; }
|
||||||
namespace chart2 { class XChartDocument; }
|
namespace chart2 { class XChartDocument; }
|
||||||
namespace chart2 { namespace data { class XDataProvider; } }
|
namespace chart2 { namespace data { class XDataProvider; } }
|
||||||
namespace chart2 { namespace data { class XDataSequence; } }
|
namespace chart2 { namespace data { class XDataSequence; } }
|
||||||
|
@ -64,7 +65,8 @@ public:
|
||||||
void convertFromModel(
|
void convertFromModel(
|
||||||
::oox::core::XmlFilterBase& rFilter,
|
::oox::core::XmlFilterBase& rFilter,
|
||||||
ChartSpaceModel& rModel,
|
ChartSpaceModel& rModel,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc );
|
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
|
||||||
|
const ::com::sun::star::awt::Size& rChartSize );
|
||||||
|
|
||||||
/** Creates an internal data provider. Derived classes may override this
|
/** Creates an internal data provider. Derived classes may override this
|
||||||
function to create an external data provider. */
|
function to create an external data provider. */
|
||||||
|
|
|
@ -61,6 +61,7 @@ struct ChartSpaceModel
|
||||||
View3DRef mxView3D; /// 3D settings.
|
View3DRef mxView3D; /// 3D settings.
|
||||||
TitleRef mxTitle; /// Chart main title.
|
TitleRef mxTitle; /// Chart main title.
|
||||||
LegendRef mxLegend; /// Chart legend.
|
LegendRef mxLegend; /// Chart legend.
|
||||||
|
::rtl::OUString maDrawingPath; /// Path to drawing fragment with embedded shapes.
|
||||||
sal_Int32 mnDispBlanksAs; /// Mode how to display blank values.
|
sal_Int32 mnDispBlanksAs; /// Mode how to display blank values.
|
||||||
sal_Int32 mnStyle; /// Index to default formatting.
|
sal_Int32 mnStyle; /// Index to default formatting.
|
||||||
bool mbAutoTitleDel; /// True = automatic title deleted manually.
|
bool mbAutoTitleDel; /// True = automatic title deleted manually.
|
||||||
|
|
|
@ -62,7 +62,8 @@ public:
|
||||||
::oox::core::XmlFilterBase& rFilter,
|
::oox::core::XmlFilterBase& rFilter,
|
||||||
ChartConverter& rChartConverter,
|
ChartConverter& rChartConverter,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
|
||||||
const ChartSpaceModel& rChartSpace );
|
const ::com::sun::star::awt::Size& rChartSize,
|
||||||
|
const ChartSpaceModel& rChartModel );
|
||||||
virtual ~ConverterRoot();
|
virtual ~ConverterRoot();
|
||||||
|
|
||||||
/** Creates an instance for the passed service name, using the passed service factory. */
|
/** Creates an instance for the passed service name, using the passed service factory. */
|
||||||
|
@ -83,6 +84,9 @@ protected:
|
||||||
/** Returns the API chart document model. */
|
/** Returns the API chart document model. */
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
|
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
|
||||||
getChartDocument() const;
|
getChartDocument() const;
|
||||||
|
/** Returns the total size of the chart shape in 1/100 mm. */
|
||||||
|
const ::com::sun::star::awt::Size&
|
||||||
|
getChartSize() const;
|
||||||
/** Returns the object formatter. */
|
/** Returns the object formatter. */
|
||||||
ObjectFormatter& getFormatter() const;
|
ObjectFormatter& getFormatter() const;
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public:
|
||||||
// addShape is creating and inserting the corresponding XShape.
|
// addShape is creating and inserting the corresponding XShape.
|
||||||
void addShape(
|
void addShape(
|
||||||
const oox::core::XmlFilterBase& rFilterBase,
|
const oox::core::XmlFilterBase& rFilterBase,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
||||||
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
|
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
|
||||||
ShapeIdMap* pShapeMap = 0 );
|
ShapeIdMap* pShapeMap = 0 );
|
||||||
|
@ -148,14 +148,14 @@ protected:
|
||||||
createAndInsert(
|
createAndInsert(
|
||||||
const ::oox::core::XmlFilterBase& rFilterBase,
|
const ::oox::core::XmlFilterBase& rFilterBase,
|
||||||
const ::rtl::OUString& rServiceName,
|
const ::rtl::OUString& rServiceName,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
||||||
const ::com::sun::star::awt::Rectangle* pShapeRect );
|
const ::com::sun::star::awt::Rectangle* pShapeRect );
|
||||||
|
|
||||||
void addChildren(
|
void addChildren(
|
||||||
const ::oox::core::XmlFilterBase& rFilterBase,
|
const ::oox::core::XmlFilterBase& rFilterBase,
|
||||||
Shape& rMaster,
|
Shape& rMaster,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
||||||
const ::com::sun::star::awt::Rectangle& rClientRect,
|
const ::com::sun::star::awt::Rectangle& rClientRect,
|
||||||
ShapeIdMap* pShapeMap );
|
ShapeIdMap* pShapeMap );
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
void addShape(
|
void addShape(
|
||||||
const oox::core::XmlFilterBase& rFilterBase,
|
const oox::core::XmlFilterBase& rFilterBase,
|
||||||
const SlidePersist& rPersist,
|
const SlidePersist& rPersist,
|
||||||
const oox::drawingml::ThemePtr& rxTheme,
|
const oox::drawingml::Theme* pTheme,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
||||||
const com::sun::star::awt::Rectangle* pShapeRect = 0,
|
const com::sun::star::awt::Rectangle* pShapeRect = 0,
|
||||||
::oox::drawingml::ShapeIdMap* pShapeMap = 0 );
|
::oox::drawingml::ShapeIdMap* pShapeMap = 0 );
|
||||||
|
|
|
@ -34,12 +34,6 @@
|
||||||
#include "oox/core/fragmenthandler2.hxx"
|
#include "oox/core/fragmenthandler2.hxx"
|
||||||
#include "oox/xls/worksheethelper.hxx"
|
#include "oox/xls/worksheethelper.hxx"
|
||||||
|
|
||||||
#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)
|
|
||||||
#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)
|
|
||||||
#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)
|
|
||||||
#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)
|
|
||||||
#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)
|
|
||||||
|
|
||||||
namespace oox {
|
namespace oox {
|
||||||
namespace xls {
|
namespace xls {
|
||||||
|
|
||||||
|
|
|
@ -286,8 +286,6 @@ public:
|
||||||
WorksheetBuffer& getWorksheets() const;
|
WorksheetBuffer& getWorksheets() const;
|
||||||
/** Returns the office theme object read from the theme substorage. */
|
/** Returns the office theme object read from the theme substorage. */
|
||||||
ThemeBuffer& getTheme() const;
|
ThemeBuffer& getTheme() const;
|
||||||
/** Returns the office theme object reference read from the theme substorage. */
|
|
||||||
::boost::shared_ptr< ::oox::drawingml::Theme > getThemeRef() const;
|
|
||||||
/** Returns all cell formatting objects read from the styles substream. */
|
/** Returns all cell formatting objects read from the styles substream. */
|
||||||
StylesBuffer& getStyles() const;
|
StylesBuffer& getStyles() const;
|
||||||
/** Returns the shared strings read from the shared strings substream. */
|
/** Returns the shared strings read from the shared strings substream. */
|
||||||
|
|
|
@ -190,6 +190,7 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r
|
||||||
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
|
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
|
||||||
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
|
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
|
||||||
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
|
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
|
||||||
|
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR );
|
||||||
|
|
||||||
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
|
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
|
||||||
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
|
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
using ::rtl::OUString;
|
using ::rtl::OUString;
|
||||||
using ::com::sun::star::uno::Reference;
|
using ::com::sun::star::uno::Reference;
|
||||||
using ::com::sun::star::uno::Exception;
|
using ::com::sun::star::uno::Exception;
|
||||||
|
using ::com::sun::star::awt::Size;
|
||||||
using ::com::sun::star::chart2::XChartDocument;
|
using ::com::sun::star::chart2::XChartDocument;
|
||||||
using ::com::sun::star::chart2::data::XDataProvider;
|
using ::com::sun::star::chart2::data::XDataProvider;
|
||||||
using ::com::sun::star::chart2::data::XDataSequence;
|
using ::com::sun::star::chart2::data::XDataSequence;
|
||||||
|
@ -57,12 +58,12 @@ ChartConverter::~ChartConverter()
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChartConverter::convertFromModel( XmlFilterBase& rFilter,
|
void ChartConverter::convertFromModel( XmlFilterBase& rFilter,
|
||||||
ChartSpaceModel& rModel, const Reference< XChartDocument >& rxChartDoc )
|
ChartSpaceModel& rModel, const Reference< XChartDocument >& rxChartDoc, const Size& rChartSize )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" );
|
OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" );
|
||||||
if( rxChartDoc.is() )
|
if( rxChartDoc.is() )
|
||||||
{
|
{
|
||||||
ConverterRoot aConvBase( rFilter, *this, rxChartDoc, rModel );
|
ConverterRoot aConvBase( rFilter, *this, rxChartDoc, rChartSize, rModel );
|
||||||
ChartSpaceConverter aSpaceConv( aConvBase, rModel );
|
ChartSpaceConverter aSpaceConv( aConvBase, rModel );
|
||||||
aSpaceConv.convertFromModel();
|
aSpaceConv.convertFromModel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,15 @@
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
#include "oox/drawingml/chart/chartspaceconverter.hxx"
|
#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/chart/XChartDocument.hpp>
|
||||||
#include <com/sun/star/chart2/XChartDocument.hpp>
|
#include <com/sun/star/chart2/XChartDocument.hpp>
|
||||||
#include <com/sun/star/chart2/XTitled.hpp>
|
#include <com/sun/star/chart2/XTitled.hpp>
|
||||||
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
|
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
|
||||||
#include <com/sun/star/chart/MissingValueTreatment.hpp>
|
|
||||||
#include "oox/core/xmlfilterbase.hxx"
|
#include "oox/core/xmlfilterbase.hxx"
|
||||||
#include "oox/drawingml/chart/chartconverter.hxx"
|
#include "oox/drawingml/chart/chartconverter.hxx"
|
||||||
|
#include "oox/drawingml/chart/chartdrawingfragment.hxx"
|
||||||
#include "oox/drawingml/chart/chartspacemodel.hxx"
|
#include "oox/drawingml/chart/chartspacemodel.hxx"
|
||||||
#include "oox/drawingml/chart/plotareaconverter.hxx"
|
#include "oox/drawingml/chart/plotareaconverter.hxx"
|
||||||
#include "oox/drawingml/chart/titleconverter.hxx"
|
#include "oox/drawingml/chart/titleconverter.hxx"
|
||||||
|
@ -48,6 +50,8 @@ using ::com::sun::star::uno::Exception;
|
||||||
using ::com::sun::star::uno::UNO_QUERY;
|
using ::com::sun::star::uno::UNO_QUERY;
|
||||||
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
||||||
using ::com::sun::star::util::XNumberFormatsSupplier;
|
using ::com::sun::star::util::XNumberFormatsSupplier;
|
||||||
|
using ::com::sun::star::drawing::XDrawPageSupplier;
|
||||||
|
using ::com::sun::star::drawing::XShapes;
|
||||||
using ::com::sun::star::chart2::XDiagram;
|
using ::com::sun::star::chart2::XDiagram;
|
||||||
using ::com::sun::star::chart2::XTitled;
|
using ::com::sun::star::chart2::XTitled;
|
||||||
using ::com::sun::star::chart2::data::XDataReceiver;
|
using ::com::sun::star::chart2::data::XDataReceiver;
|
||||||
|
@ -85,8 +89,8 @@ void ChartSpaceConverter::convertFromModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
// formatting of the chart background
|
// formatting of the chart background
|
||||||
PropertySet aPropSet( getChartDocument()->getPageBackground() );
|
PropertySet aBackPropSet( getChartDocument()->getPageBackground() );
|
||||||
getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
|
getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
|
||||||
|
|
||||||
// convert plot area (container of all chart type groups)
|
// convert plot area (container of all chart type groups)
|
||||||
PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
|
PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
|
||||||
|
@ -125,10 +129,10 @@ void ChartSpaceConverter::convertFromModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
// legend
|
// legend
|
||||||
if( mrModel.mxLegend.is() )
|
if( xDiagram.is() && mrModel.mxLegend.is() )
|
||||||
{
|
{
|
||||||
LegendConverter aLegendConv( *this, *mrModel.mxLegend );
|
LegendConverter aLegendConv( *this, *mrModel.mxLegend );
|
||||||
aLegendConv.convertFromModel( getChartDocument()->getFirstDiagram() );
|
aLegendConv.convertFromModel( xDiagram );
|
||||||
}
|
}
|
||||||
|
|
||||||
// treatment of missing values
|
// treatment of missing values
|
||||||
|
@ -146,12 +150,25 @@ void ChartSpaceConverter::convertFromModel()
|
||||||
aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues );
|
aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues );
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the IncludeHiddenCells property via the old API as only this ensures that the data provider and al created sequences get this flag correctly
|
Reference< com::sun::star::chart::XChartDocument > xOldChartDoc( getChartDocument(), UNO_QUERY );
|
||||||
Reference< com::sun::star::chart::XChartDocument > xStandardApiChartDoc( getChartDocument(), UNO_QUERY );
|
if( xOldChartDoc.is() )
|
||||||
if( xStandardApiChartDoc.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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// embedded drawing shapes
|
||||||
|
if( mrModel.maDrawingPath.getLength() > 0 ) try
|
||||||
|
{
|
||||||
|
Reference< XDrawPageSupplier > xDrawPageSupp( getChartDocument(), UNO_QUERY_THROW );
|
||||||
|
Reference< XShapes > xShapes( xDrawPageSupp->getDrawPage(), UNO_QUERY_THROW );
|
||||||
|
getFilter().importFragment( new ChartDrawingFragment( getFilter(), mrModel.maDrawingPath, xShapes, getChartSize() ) );
|
||||||
|
}
|
||||||
|
catch( Exception& )
|
||||||
{
|
{
|
||||||
PropertySet aStandardApiDiagramProp( xStandardApiChartDoc->getDiagram() );
|
|
||||||
aStandardApiDiagramProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
|
||||||
return 0;
|
return 0;
|
||||||
case C_TOKEN( txPr ):
|
case C_TOKEN( txPr ):
|
||||||
return new TextBodyContext( *this, mrModel.mxTextProp.create() );
|
return new TextBodyContext( *this, mrModel.mxTextProp.create() );
|
||||||
|
case C_TOKEN( userShapes ):
|
||||||
|
mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ using ::com::sun::star::uno::Exception;
|
||||||
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
||||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||||
using ::com::sun::star::frame::XModel;
|
using ::com::sun::star::frame::XModel;
|
||||||
|
using ::com::sun::star::awt::Size;
|
||||||
using ::com::sun::star::chart2::XChartDocument;
|
using ::com::sun::star::chart2::XChartDocument;
|
||||||
using ::oox::core::XmlFilterBase;
|
using ::oox::core::XmlFilterBase;
|
||||||
|
|
||||||
|
@ -58,12 +59,14 @@ struct ConverterData
|
||||||
XmlFilterBase& mrFilter;
|
XmlFilterBase& mrFilter;
|
||||||
ChartConverter& mrConverter;
|
ChartConverter& mrConverter;
|
||||||
Reference< XChartDocument > mxDoc;
|
Reference< XChartDocument > mxDoc;
|
||||||
|
Size maSize;
|
||||||
ObjectFormatter maFormatter;
|
ObjectFormatter maFormatter;
|
||||||
|
|
||||||
explicit ConverterData(
|
explicit ConverterData(
|
||||||
XmlFilterBase& rFilter,
|
XmlFilterBase& rFilter,
|
||||||
ChartConverter& rChartConverter,
|
ChartConverter& rChartConverter,
|
||||||
const Reference< XChartDocument >& rxChartDoc,
|
const Reference< XChartDocument >& rxChartDoc,
|
||||||
|
const Size& rChartSize,
|
||||||
const ChartSpaceModel& rChartSpace );
|
const ChartSpaceModel& rChartSpace );
|
||||||
~ConverterData();
|
~ConverterData();
|
||||||
};
|
};
|
||||||
|
@ -74,11 +77,13 @@ ConverterData::ConverterData(
|
||||||
XmlFilterBase& rFilter,
|
XmlFilterBase& rFilter,
|
||||||
ChartConverter& rChartConverter,
|
ChartConverter& rChartConverter,
|
||||||
const Reference< XChartDocument >& rxChartDoc,
|
const Reference< XChartDocument >& rxChartDoc,
|
||||||
const ChartSpaceModel& rChartSpace ) :
|
const Size& rChartSize,
|
||||||
|
const ChartSpaceModel& rChartModel ) :
|
||||||
mrFilter( rFilter ),
|
mrFilter( rFilter ),
|
||||||
mrConverter( rChartConverter ),
|
mrConverter( rChartConverter ),
|
||||||
mxDoc( rxChartDoc ),
|
mxDoc( rxChartDoc ),
|
||||||
maFormatter( rFilter, rxChartDoc, rChartSpace )
|
maSize( rChartSize ),
|
||||||
|
maFormatter( rFilter, rxChartDoc, rChartModel )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( mxDoc.is(), "ConverterData::ConverterData - missing chart document" );
|
OSL_ENSURE( mxDoc.is(), "ConverterData::ConverterData - missing chart document" );
|
||||||
// lock the model to suppress internal updates during conversion
|
// lock the model to suppress internal updates during conversion
|
||||||
|
@ -111,8 +116,9 @@ ConverterRoot::ConverterRoot(
|
||||||
XmlFilterBase& rFilter,
|
XmlFilterBase& rFilter,
|
||||||
ChartConverter& rChartConverter,
|
ChartConverter& rChartConverter,
|
||||||
const Reference< XChartDocument >& rxChartDoc,
|
const Reference< XChartDocument >& rxChartDoc,
|
||||||
const ChartSpaceModel& rChartSpace ) :
|
const Size& rChartSize,
|
||||||
mxData( new ConverterData( rFilter, rChartConverter, rxChartDoc, rChartSpace ) )
|
const ChartSpaceModel& rChartModel ) :
|
||||||
|
mxData( new ConverterData( rFilter, rChartConverter, rxChartDoc, rChartSize, rChartModel ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +161,11 @@ Reference< XChartDocument > ConverterRoot::getChartDocument() const
|
||||||
return mxData->mxDoc;
|
return mxData->mxDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Size& ConverterRoot::getChartSize() const
|
||||||
|
{
|
||||||
|
return mxData->maSize;
|
||||||
|
}
|
||||||
|
|
||||||
ObjectFormatter& ConverterRoot::getFormatter() const
|
ObjectFormatter& ConverterRoot::getFormatter() const
|
||||||
{
|
{
|
||||||
return mxData->maFormatter;
|
return mxData->maFormatter;
|
||||||
|
|
|
@ -50,6 +50,7 @@ SLOFILES = \
|
||||||
$(SLO)$/axismodel.obj \
|
$(SLO)$/axismodel.obj \
|
||||||
$(SLO)$/chartcontextbase.obj \
|
$(SLO)$/chartcontextbase.obj \
|
||||||
$(SLO)$/chartconverter.obj \
|
$(SLO)$/chartconverter.obj \
|
||||||
|
$(SLO)$/chartdrawingfragment.obj \
|
||||||
$(SLO)$/chartspaceconverter.obj \
|
$(SLO)$/chartspaceconverter.obj \
|
||||||
$(SLO)$/chartspacefragment.obj \
|
$(SLO)$/chartspacefragment.obj \
|
||||||
$(SLO)$/chartspacemodel.obj \
|
$(SLO)$/chartspacemodel.obj \
|
||||||
|
|
|
@ -383,7 +383,7 @@ void CreateChartCallback::onCreateXShape( const Reference< drawing::XShape >& rx
|
||||||
|
|
||||||
// convert imported chart model to chart document
|
// convert imported chart model to chart document
|
||||||
Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
|
Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
|
||||||
mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc );
|
mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, rxShape->getSize() );
|
||||||
}
|
}
|
||||||
catch( Exception& )
|
catch( Exception& )
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,7 +124,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const
|
||||||
|
|
||||||
void Shape::addShape(
|
void Shape::addShape(
|
||||||
const ::oox::core::XmlFilterBase& rFilterBase,
|
const ::oox::core::XmlFilterBase& rFilterBase,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const Reference< XShapes >& rxShapes,
|
const Reference< XShapes >& rxShapes,
|
||||||
const awt::Rectangle* pShapeRect,
|
const awt::Rectangle* pShapeRect,
|
||||||
ShapeIdMap* pShapeMap )
|
ShapeIdMap* pShapeMap )
|
||||||
|
@ -134,7 +134,7 @@ void Shape::addShape(
|
||||||
rtl::OUString sServiceName( msServiceName );
|
rtl::OUString sServiceName( msServiceName );
|
||||||
if( sServiceName.getLength() )
|
if( sServiceName.getLength() )
|
||||||
{
|
{
|
||||||
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect ) );
|
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect ) );
|
||||||
|
|
||||||
if( pShapeMap && msId.getLength() )
|
if( pShapeMap && msId.getLength() )
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,7 @@ void Shape::addShape(
|
||||||
// if this is a group shape, we have to add also each child shape
|
// if this is a group shape, we have to add also each child shape
|
||||||
Reference< XShapes > xShapes( xShape, UNO_QUERY );
|
Reference< XShapes > xShapes( xShape, UNO_QUERY );
|
||||||
if ( xShapes.is() )
|
if ( xShapes.is() )
|
||||||
addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
|
addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( const Exception& )
|
catch( const Exception& )
|
||||||
|
@ -173,7 +173,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape )
|
||||||
void Shape::addChildren(
|
void Shape::addChildren(
|
||||||
const ::oox::core::XmlFilterBase& rFilterBase,
|
const ::oox::core::XmlFilterBase& rFilterBase,
|
||||||
Shape& rMaster,
|
Shape& rMaster,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const Reference< XShapes >& rxShapes,
|
const Reference< XShapes >& rxShapes,
|
||||||
const awt::Rectangle& rClientRect,
|
const awt::Rectangle& rClientRect,
|
||||||
ShapeIdMap* pShapeMap )
|
ShapeIdMap* pShapeMap )
|
||||||
|
@ -224,14 +224,14 @@ void Shape::addChildren(
|
||||||
pShapeRect = &aShapeRect;
|
pShapeRect = &aShapeRect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*aIter++)->addShape( rFilterBase, rxTheme, rxShapes, pShapeRect, pShapeMap );
|
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XShape > Shape::createAndInsert(
|
Reference< XShape > Shape::createAndInsert(
|
||||||
const ::oox::core::XmlFilterBase& rFilterBase,
|
const ::oox::core::XmlFilterBase& rFilterBase,
|
||||||
const rtl::OUString& rServiceName,
|
const rtl::OUString& rServiceName,
|
||||||
const ThemePtr& rxTheme,
|
const Theme* pTheme,
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
|
||||||
const awt::Rectangle* pShapeRect )
|
const awt::Rectangle* pShapeRect )
|
||||||
{
|
{
|
||||||
|
@ -356,23 +356,23 @@ Reference< XShape > Shape::createAndInsert(
|
||||||
aFillProperties.moFillType = XML_noFill;
|
aFillProperties.moFillType = XML_noFill;
|
||||||
sal_Int32 nFillPhClr = -1;
|
sal_Int32 nFillPhClr = -1;
|
||||||
|
|
||||||
if( rxTheme.get() )
|
if( pTheme )
|
||||||
{
|
{
|
||||||
if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) )
|
if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) )
|
||||||
{
|
{
|
||||||
if( const LineProperties* pLineProps = rxTheme->getLineStyle( pLineRef->mnThemedIdx ) )
|
if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) )
|
||||||
aLineProperties.assignUsed( *pLineProps );
|
aLineProperties.assignUsed( *pLineProps );
|
||||||
nLinePhClr = pLineRef->maPhClr.getColor( rFilterBase );
|
nLinePhClr = pLineRef->maPhClr.getColor( rFilterBase );
|
||||||
}
|
}
|
||||||
if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) )
|
if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) )
|
||||||
{
|
{
|
||||||
if( const FillProperties* pFillProps = rxTheme->getFillStyle( pFillRef->mnThemedIdx ) )
|
if( const FillProperties* pFillProps = pTheme->getFillStyle( pFillRef->mnThemedIdx ) )
|
||||||
aFillProperties.assignUsed( *pFillProps );
|
aFillProperties.assignUsed( *pFillProps );
|
||||||
nFillPhClr = pFillRef->maPhClr.getColor( rFilterBase );
|
nFillPhClr = pFillRef->maPhClr.getColor( rFilterBase );
|
||||||
}
|
}
|
||||||
// if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_fillRef ) )
|
// if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_fillRef ) )
|
||||||
// {
|
// {
|
||||||
// if( const EffectProperties* pEffectProps = rxTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
|
// if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
|
||||||
// aEffectProperties.assignUsed( *pEffectProps );
|
// aEffectProperties.assignUsed( *pEffectProps );
|
||||||
// nEffectPhClr = pEffectRef->maPhClr.getColor( rFilterBase );
|
// nEffectPhClr = pEffectRef->maPhClr.getColor( rFilterBase );
|
||||||
// }
|
// }
|
||||||
|
@ -420,8 +420,8 @@ Reference< XShape > Shape::createAndInsert(
|
||||||
TextCharacterProperties aCharStyleProperties;
|
TextCharacterProperties aCharStyleProperties;
|
||||||
if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) )
|
if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) )
|
||||||
{
|
{
|
||||||
if( rxTheme.get() )
|
if( pTheme )
|
||||||
if( const TextCharacterProperties* pCharProps = rxTheme->getFontStyle( pFontRef->mnThemedIdx ) )
|
if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) )
|
||||||
aCharStyleProperties.assignUsed( *pCharProps );
|
aCharStyleProperties.assignUsed( *pCharProps );
|
||||||
aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr );
|
aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr );
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ PPTShape::~PPTShape()
|
||||||
void PPTShape::addShape(
|
void PPTShape::addShape(
|
||||||
const oox::core::XmlFilterBase& rFilterBase,
|
const oox::core::XmlFilterBase& rFilterBase,
|
||||||
const SlidePersist& rSlidePersist,
|
const SlidePersist& rSlidePersist,
|
||||||
const oox::drawingml::ThemePtr& rxTheme,
|
const oox::drawingml::Theme* pTheme,
|
||||||
const Reference< XShapes >& rxShapes,
|
const Reference< XShapes >& rxShapes,
|
||||||
const awt::Rectangle* pShapeRect,
|
const awt::Rectangle* pShapeRect,
|
||||||
::oox::drawingml::ShapeIdMap* pShapeMap )
|
::oox::drawingml::ShapeIdMap* pShapeMap )
|
||||||
|
@ -157,7 +157,7 @@ void PPTShape::addShape(
|
||||||
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
|
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
|
||||||
setMasterTextListStyle( aMasterTextListStyle );
|
setMasterTextListStyle( aMasterTextListStyle );
|
||||||
|
|
||||||
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect ) );
|
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect ) );
|
||||||
|
|
||||||
if( pShapeMap && msId.getLength() )
|
if( pShapeMap && msId.getLength() )
|
||||||
{
|
{
|
||||||
|
@ -167,7 +167,7 @@ void PPTShape::addShape(
|
||||||
// if this is a group shape, we have to add also each child shape
|
// if this is a group shape, we have to add also each child shape
|
||||||
Reference< XShapes > xShapes( xShape, UNO_QUERY );
|
Reference< XShapes > xShapes( xShape, UNO_QUERY );
|
||||||
if ( xShapes.is() )
|
if ( xShapes.is() )
|
||||||
addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
|
addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( const Exception& )
|
catch( const Exception& )
|
||||||
|
|
|
@ -145,9 +145,9 @@ void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase )
|
||||||
{
|
{
|
||||||
PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() );
|
PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() );
|
||||||
if ( pPPTShape )
|
if ( pPPTShape )
|
||||||
pPPTShape->addShape( rFilterBase, *this, getTheme(), xShapes, 0, &getShapeMap() );
|
pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, 0, &getShapeMap() );
|
||||||
else
|
else
|
||||||
(*aChildIter)->addShape( rFilterBase, getTheme(), xShapes, 0, &getShapeMap() );
|
(*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, 0, &getShapeMap() );
|
||||||
|
|
||||||
aChildIter++;
|
aChildIter++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,7 +231,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
|
||||||
}
|
}
|
||||||
else if (mpShape.get() != NULL)
|
else if (mpShape.get() != NULL)
|
||||||
{
|
{
|
||||||
mpShape->addShape(*mxFilterBase, mpThemePtr, mxShapes);
|
mpShape->addShape(*mxFilterBase, mpThemePtr.get(), mxShapes);
|
||||||
xResult.set(mpShape->getXShape());
|
xResult.set(mpShape->getXShape());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,7 +468,7 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
|
||||||
{
|
{
|
||||||
Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuSheetSize );
|
Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuSheetSize );
|
||||||
if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
|
if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
|
||||||
mxShape->addShape( getOoxFilter(), getThemeRef(), mxDrawPage, &aLoc );
|
mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aLoc );
|
||||||
}
|
}
|
||||||
mxShape.reset();
|
mxShape.reset();
|
||||||
mxAnchor.reset();
|
mxAnchor.reset();
|
||||||
|
|
|
@ -309,8 +309,6 @@ public:
|
||||||
inline WorksheetBuffer& getWorksheets() const { return *mxWorksheets; }
|
inline WorksheetBuffer& getWorksheets() const { return *mxWorksheets; }
|
||||||
/** Returns the office theme object read from the theme substorage. */
|
/** Returns the office theme object read from the theme substorage. */
|
||||||
inline ThemeBuffer& getTheme() const { return *mxTheme; }
|
inline ThemeBuffer& getTheme() const { return *mxTheme; }
|
||||||
/** Returns the office theme object reference read from the theme substorage. */
|
|
||||||
inline ::boost::shared_ptr< Theme > getThemeRef() const { return mxTheme; }
|
|
||||||
/** Returns all cell formatting objects read from the styles substream. */
|
/** Returns all cell formatting objects read from the styles substream. */
|
||||||
inline StylesBuffer& getStyles() const { return *mxStyles; }
|
inline StylesBuffer& getStyles() const { return *mxStyles; }
|
||||||
/** Returns the shared strings read from the shared strings substream. */
|
/** Returns the shared strings read from the shared strings substream. */
|
||||||
|
@ -913,11 +911,6 @@ ThemeBuffer& WorkbookHelper::getTheme() const
|
||||||
return mrBookData.getTheme();
|
return mrBookData.getTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
::boost::shared_ptr< Theme > WorkbookHelper::getThemeRef() const
|
|
||||||
{
|
|
||||||
return mrBookData.getThemeRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
StylesBuffer& WorkbookHelper::getStyles() const
|
StylesBuffer& WorkbookHelper::getStyles() const
|
||||||
{
|
{
|
||||||
return mrBookData.getStyles();
|
return mrBookData.getStyles();
|
||||||
|
|
Loading…
Reference in a new issue