diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-04-02 08:45:07 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-04-02 08:45:07 +0000 |
commit | 79fbdc571f3cdfbffd338e31b761204833271a1c (patch) | |
tree | b83423a38ab22e7265758b57bf5fd05b72e934d3 /sd/source/ui/animations | |
parent | 11d5a9c66d5b7f9d5ad175d63366c58fff873a8c (diff) |
INTEGRATION: CWS impress139 (1.29.118); FILE MERGED
2008/03/17 15:01:58 cl 1.29.118.3: fixing linux build problem
2008/03/13 15:03:48 cl 1.29.118.2: #i69364# disable animate form for invisible textboxes
2008/03/12 12:25:14 cl 1.29.118.1: #i67343# display currently selected effect when changing effect
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 71 |
1 files changed, 56 insertions, 15 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 4698fd084ae5..b0ef59c4bdf7 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -4,9 +4,9 @@ * * $RCSfile: CustomAnimationPane.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.30 $ * - * last change: $Author: ihi $ $Date: 2007-08-17 15:33:28 $ + * last change: $Author: kz $ $Date: 2008-04-02 09:45:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -80,6 +80,8 @@ #ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_ #include <com/sun/star/awt/XWindow.hpp> #endif +#include <com/sun/star/drawing/LineStyle.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> @@ -201,23 +203,14 @@ using namespace ::com::sun::star::presentation; using namespace ::com::sun::star::text; using ::rtl::OUString; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::makeAny; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Exception; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; using ::com::sun::star::view::XSelectionSupplier; using ::com::sun::star::view::XSelectionChangeListener; using ::com::sun::star::frame::XController; using ::com::sun::star::frame::XModel; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::beans::XPropertyChangeListener; -using ::com::sun::star::drawing::XDrawView; -using ::com::sun::star::drawing::XShape; -using ::com::sun::star::drawing::XShapes; -using ::com::sun::star::drawing::XDrawPage; using ::com::sun::star::container::XIndexAccess; using ::com::sun::star::container::XEnumerationAccess; using ::com::sun::star::container::XEnumeration; @@ -422,6 +415,12 @@ void CustomAnimationPane::StateChanged( StateChangedType nStateChange ) updateMotionPathTags(); } +void CustomAnimationPane::KeyInput( const KeyEvent& rKEvt ) +{ + if( mpCustomAnimationList ) + mpCustomAnimationList->KeyInput( rKEvt ); +} + void CustomAnimationPane::addListener() { Link aLink( LINK(this,CustomAnimationPane,EventMultiplexerListener) ); @@ -1362,6 +1361,36 @@ bool CustomAnimationPane::setProperty1Value( sal_Int32 nType, CustomAnimationEff return bEffectChanged; } +static sal_Bool hasVisibleShape( const Reference< XShape >& xShape ) +{ + try + { + const OUString sShapeType( xShape->getShapeType() ); + + if( sShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.TitleTextShape") ) || + sShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.OutlinerShape") ) || + sShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.SubtitleShape") ) || + sShapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TextShape") ) ) + { + const OUString sFillStyle( RTL_CONSTASCII_USTRINGPARAM("FillStyle" ) ); + const OUString sLineStyle( RTL_CONSTASCII_USTRINGPARAM("LineStyle" ) ); + Reference< XPropertySet > xSet( xShape, UNO_QUERY_THROW ); + + FillStyle eFillStyle; + xSet->getPropertyValue( sFillStyle ) >>= eFillStyle; + + ::com::sun::star::drawing::LineStyle eLineStyle; + xSet->getPropertyValue( sLineStyle ) >>= eLineStyle; + + return eFillStyle != FillStyle_NONE || eLineStyle != ::com::sun::star::drawing::LineStyle_NONE; + } + } + catch( Exception& e ) + { + (void)e; + } + return sal_True; +} STLPropertySet* CustomAnimationPane::createSelectionSet() { @@ -1414,6 +1443,8 @@ STLPropertySet* CustomAnimationPane::createSelectionSet() addValue( pSet, nHandleHasText, makeAny( (sal_Bool)pEffect->hasText() ) ); + addValue( pSet, nHandleHasVisibleShape, Any( hasVisibleShape( pEffect->getTargetShape() ) ) ); + Any aSoundSource; if( pEffect->getAudio().is() ) { @@ -1926,6 +1957,9 @@ void CustomAnimationPane::onChange( bool bCreate ) // first create vector of targets for dialog preview std::vector< Any > aTargets; + OUString sPresetId; + double fDuration = 2.0f; + if( bCreate ) { // gather shapes from the selection @@ -1992,15 +2026,22 @@ void CustomAnimationPane::onChange( bool bCreate ) { if( !bHasText || !(*aIter)->hasText() ) bHasText = false; + + if( sPresetId.getLength() == 0 ) + { + sPresetId = (*aIter)->getPresetId(); + fDuration = (*aIter)->getDuration(); + } + aTargets.push_back( (*aIter++)->getTarget() ); } } - CustomAnimationCreateDialog* pDlg = new CustomAnimationCreateDialog( this, this, aTargets, bHasText ); + CustomAnimationCreateDialog* pDlg = new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ); if( pDlg->Execute() ) { addUndo(); - double fDuration = pDlg->getSelectedDuration(); + fDuration = pDlg->getSelectedDuration(); CustomAnimationPresetPtr pDescriptor = pDlg->getSelectedPreset(); if( pDescriptor.get() ) { |