summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-09-14 10:57:16 +0000
committerKurt Zenker <kz@openoffice.org>2009-09-14 10:57:16 +0000
commit8570f88531e1b206f3fa63e10b308df9c57bb9c9 (patch)
treeb420e9d1c73aab8056983737c42063f4f8a81bd7 /embeddedobj
parente3dfab7581113959dc4d7a61a65e109d3b01a3a8 (diff)
CWS-TOOLING: integrate CWS chart41
2009-09-07 11:17:59 +0200 iha r275880 : #i104854# ODF: Fallback to bar chart for surface charts as long as surface charts are not implemented 2009-09-03 10:07:24 +0200 iha r275745 : #i104020# Y axis scaling problem with stock chart 2009-09-02 17:11:42 +0200 iha r275723 : #i103984# XChartDataArray / setDataArray broken 2009-09-02 17:05:16 +0200 iha r275721 : #i103984# XChartDataArray / setDataArray broken 2009-08-31 18:18:21 +0200 iha r275629 : #i103076# ODF, chart from MS-Office2007sp2 doesn't load caused be different xlink:href syntax 2009-08-28 18:35:52 +0200 iha r275548 : #i103460# ODF charts without svg:width and svg:height are not imported correctly 2009-08-28 18:35:25 +0200 iha r275547 : #i103460# ODF charts without svg:width and svg:height are not imported correctly 2009-08-28 18:25:45 +0200 iha r275546 : #i103460# ODF charts without svg:width and svg:height are not imported correctly 2009-08-28 18:23:21 +0200 iha r275544 : #i103460# ODF charts without svg:width and svg:height are not imported correctly 2009-08-28 18:18:34 +0200 iha r275543 : #i103460# ODF charts without svg:width and svg:height are not imported correctly 2009-08-27 15:57:20 +0200 iha r275490 : #i104160# report designer broken
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx6
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx10
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx10
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx7
4 files changed, 31 insertions, 2 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 668c4a53508f..85f9b8b0b2c9 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -696,3 +696,9 @@ void SAL_CALL OCommonEmbeddedObject::setParent( const com::sun::star::uno::Refer
}
}
+// XDefaultSizeTransmitter
+void SAL_CALL OCommonEmbeddedObject::setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ m_aDefaultSizeForChart_In_100TH_MM = rSize_100TH_MM;
+}
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 58a5e87fe418..e557437e336d 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -361,9 +361,14 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType
{
uno::Any aReturn;
- aReturn <<= ::cppu::queryInterface(
+ if ( rType == ::getCppuType( (uno::Reference< embed::XEmbeddedObject > const *)0 ))
+ {
+ void * p = static_cast< embed::XEmbeddedObject * >( this );
+ return uno::Any( &p, rType );
+ }
+ else
+ aReturn <<= ::cppu::queryInterface(
rType,
- static_cast< embed::XEmbeddedObject* >( this ),
static_cast< embed::XInplaceObject* >( this ),
static_cast< embed::XVisualObject* >( this ),
static_cast< embed::XCommonEmbedPersist* >( static_cast< embed::XEmbedPersist* >( this ) ),
@@ -374,6 +379,7 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType
static_cast< embed::XComponentSupplier* >( this ),
static_cast< util::XCloseable* >( this ),
static_cast< container::XChild* >( this ),
+ static_cast< chart2::XDefaultSizeTransmitter* >( this ),
static_cast< document::XEventBroadcaster* >( this ) );
if ( aReturn.hasValue() )
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 8d33935168b6..47b16bf961af 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <comphelper/fileformat.h>
#include <comphelper/storagehelper.hxx>
@@ -463,6 +464,15 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
m_bEmbeddedScriptSupport ) );
+ //#i103460# ODF: take the size given from the parent frame as default
+ uno::Reference< chart2::XChartDocument > xChart( xDocument, uno::UNO_QUERY );
+ if( xChart.is() )
+ {
+ uno::Reference< embed::XVisualObject > xChartVisualObject( xChart, uno::UNO_QUERY );
+ if( xChartVisualObject.is() )
+ xChartVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, m_aDefaultSizeForChart_In_100TH_MM );
+ }
+
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
uno::Reference< document::XStorageBasedDocument > xDoc
#ifdef USE_STORAGEBASED_DOCUMENT
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index afd199af9207..5a2827de3aa6 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -47,6 +47,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
#include <cppuhelper/weak.hxx>
namespace com { namespace sun { namespace star {
@@ -85,6 +86,7 @@ class OCommonEmbeddedObject : public ::com::sun::star::embed::XEmbeddedObject
, public ::com::sun::star::embed::XLinkageSupport
, public ::com::sun::star::embed::XInplaceObject
, public ::com::sun::star::container::XChild
+ , public ::com::sun::star::chart2::XDefaultSizeTransmitter
, public ::cppu::OWeakObject
{
protected:
@@ -159,6 +161,7 @@ protected:
sal_Bool m_bHasClonedSize; // the object has cached size
::com::sun::star::awt::Size m_aClonedSize;
sal_Int32 m_nClonedMapUnit;
+ ::com::sun::star::awt::Size m_aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
private:
void CommonInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
@@ -492,6 +495,10 @@ public:
// XChild
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XDefaultSizeTransmitter
+ //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ virtual void SAL_CALL setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException);
};
#endif