diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-05-22 15:13:55 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-05-22 15:13:55 +0000 |
commit | c2869a30059a3d90e647d956f3f274dde2d1ef2c (patch) | |
tree | d79cbce4839a70db9d39d877d292dba8f94ff409 /sd/source | |
parent | 53203a8ac69b30947209d0e67b3d98d2a609296f (diff) |
INTEGRATION: CWS chart2mst3 (1.45.38); FILE MERGED
2007/05/14 18:48:35 bm 1.45.38.5: RESYNC: (1.48-1.49); FILE MERGED
2007/04/24 22:32:50 bm 1.45.38.4: RESYNC: (1.47-1.48); FILE MERGED
2007/02/07 17:50:54 iha 1.45.38.3: RESYNC: (1.46-1.47); FILE MERGED
2006/11/24 19:18:32 bm 1.45.38.2: RESYNC: (1.45-1.46); FILE MERGED
2006/11/15 17:37:22 bm 1.45.38.1: set transparent background for charts (ActivateObject on creation of OLE in placeholder)
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 45fd4dfe6aee..de749bd73cb1 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -4,9 +4,9 @@ * * $RCSfile: viewshe2.cxx,v $ * - * $Revision: 1.49 $ + * $Revision: 1.50 $ * - * last change: $Author: kz $ $Date: 2007-05-10 15:37:00 $ + * last change: $Author: vg $ $Date: 2007-05-22 16:13:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,6 +39,15 @@ #ifndef _COM_SUN_STAR_EMBED_NOVISUALAREASIZEEXCEPTION_HPP_ #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_FILLSTYLE_HPP_ +#include <com/sun/star/drawing/FillStyle.hpp> +#endif #include "ViewShell.hxx" #include "ViewShellHint.hxx" @@ -61,9 +70,6 @@ #ifndef _SFXAPP_HXX //autogen #include <sfx2/app.hxx> #endif -#ifndef _SCH_DLL_HXX //autogen -#include <sch/schdll.hxx> -#endif #ifndef _SVX_RULER_HXX //autogen #include <svx/ruler.hxx> #endif @@ -149,6 +155,34 @@ using namespace com::sun::star; const String aEmptyStr; +namespace +{ +void lcl_setTransparentBackgroundAtChart( + const uno::Reference < embed::XEmbeddedObject > & xEmbObj ) +{ + if( xEmbObj.is()) + { + uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY ); + OSL_ENSURE( xChartDoc.is(), "Trying to set chart property to non-chart OLE" ); + if( !xChartDoc.is()) + return; + + try + { + uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground()); + if( xPageProp.is()) + xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FillStyle")), + uno::makeAny( drawing::FillStyle_NONE )); + } + catch( const uno::Exception & ) + { + OSL_ENSURE( false, "Exception caught in lcl_setTransparentBackgroundAtChart" ); + } + } +} + +} // anonymous namespace + namespace sd { /************************************************************************* @@ -924,10 +958,10 @@ BOOL ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetActiveWindow(), RID_SO_ERRCTX); BOOL bAbort = FALSE; - BOOL bChartActive = FALSE; GetDocSh()->SetWaitCursor( TRUE ); SfxViewShell* pViewShell = GetViewShell(); OSL_ASSERT (pViewShell!=NULL); + bool bSetTransparentChartBackground = false; uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef(); if ( !xObj.is() ) @@ -942,7 +976,10 @@ BOOL ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) if( aName.EqualsAscii( "StarChart" ) || aName.EqualsAscii("StarOrg") ) { if( SvtModuleOptions().IsChart() ) + { aClass = SvGlobalName( SO3_SCH_CLASSID ); + bSetTransparentChartBackground = true; + } } else if( aName.EqualsAscii( "StarCalc" )) { @@ -1012,13 +1049,6 @@ BOOL ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) GetViewShellBase().SetVerbs( xObj->getSupportedVerbs() ); - if( aName.EqualsAscii( "StarChart" )) - { - bChartActive = TRUE; - // TODO/LATER: looks like there is no need to update graphical replacement, but it should be checked. - SchDLL::Update(xObj, NULL, GetActiveWindow()); // BM: use different DLL-call - } - nVerb = SVVERB_SHOW; } else @@ -1062,6 +1092,11 @@ BOOL ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) // the object area size must be set after scaling, since it triggers the resizing pSdClient->SetObjArea(aRect); + if( bSetTransparentChartBackground && xObj.is()) + { + lcl_setTransparentBackgroundAtChart( xObj ); + } + pSdClient->DoVerb(nVerb); // ErrCode wird ggf. vom Sfx ausgegeben pViewShell->GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, TRUE, FALSE); |