From 2c82e5d304b56c1dd95d0f3dcafc9a36ce02b5f4 Mon Sep 17 00:00:00 2001 From: Cao Cuong Ngo Date: Tue, 2 Apr 2013 18:37:00 +0200 Subject: fdo#59071 Slideshow: allow automatic transitions with sub-second Enable slide transition each 0.25 second instead of whole second. Change-Id: I1907a1baf30cede91a0438d021e003204ea06651 --- offapi/com/sun/star/presentation/DrawPage.idl | 6 ++++++ sd/inc/sdpage.hxx | 6 +++--- sd/source/core/sdpage.cxx | 2 +- sd/source/core/sdpage2.cxx | 2 +- sd/source/filter/html/htmlex.cxx | 14 +++++++------- sd/source/filter/html/htmlex.hxx | 2 +- sd/source/filter/ppt/pptin.cxx | 2 +- sd/source/ui/animations/SlideTransitionPane.cxx | 14 +++++++------- sd/source/ui/animations/SlideTransitionPane.src | 10 +++++----- sd/source/ui/dlg/dlgass.cxx | 4 ++-- sd/source/ui/unoidl/unopage.cxx | 19 ++++++++++++++++--- slideshow/source/engine/slideshowimpl.cxx | 2 +- xmloff/source/draw/propimp0.cxx | 9 +++++---- xmloff/source/draw/sdpropls.cxx | 2 +- 14 files changed, 57 insertions(+), 37 deletions(-) diff --git a/offapi/com/sun/star/presentation/DrawPage.idl b/offapi/com/sun/star/presentation/DrawPage.idl index 59dd8f3d3061..2abde0f3906d 100644 --- a/offapi/com/sun/star/presentation/DrawPage.idl +++ b/offapi/com/sun/star/presentation/DrawPage.idl @@ -62,6 +62,11 @@ published service DrawPage */ [property] long Duration; + /** If the property DrawPage::Change is set to 1, + this is the time in seconds this page is shown before switching + to the next page, also permitting sub-second precision here. + */ + [optional, property] double HighResDuration; /** This is the effect that is used to fade in this page. */ @@ -136,6 +141,7 @@ published service DrawPage this page. This is only used if IsDateTimeFixed is . */ [optional, property] long DateTimeFormat; + }; diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index 18b58a315a1c..0b5d631b24a5 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -115,7 +115,7 @@ protected: sd::ScopeLock maLockAutoLayoutArrangement; sal_Bool mbSelected; ///< selection identifier PresChange mePresChange; ///< manual / automatic / semi automatic - sal_uInt32 mnTime; ///< Display time in seconds + double mfTime; ///< Display time in seconds sal_Bool mbSoundOn; ///< with / without sound. sal_Bool mbExcluded; ///< will (not) be displayed during show. OUString maLayoutName; ///< Name of the layout @@ -223,8 +223,8 @@ public: void SetPresChange(PresChange eChange) { mePresChange = eChange; } PresChange GetPresChange() const { return mePresChange; } - void SetTime(sal_uInt32 nNewTime) { mnTime = nNewTime; } - sal_uInt32 GetTime() const { return mnTime; } + void SetTime(double fNewTime) { mfTime = fNewTime; } + double GetTime() const { return mfTime; } void SetSound(sal_Bool bNewSoundOn) { mbSoundOn = bNewSoundOn; } sal_Bool IsSoundOn() const { return mbSoundOn; } diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 499af5031cb1..9057a4f68c73 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -88,7 +88,7 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage) , meAutoLayout(AUTOLAYOUT_NONE) , mbSelected(sal_False) , mePresChange(PRESCHANGE_MANUAL) -, mnTime(1) +, mfTime(1.0) , mbSoundOn(sal_False) , mbExcluded(sal_False) , mbLoopSound(sal_False) diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index c446f05876e1..7007bf5fae69 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -390,7 +390,7 @@ SdPage::SdPage(const SdPage& rSrcPage) mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor; mfTransitionDuration = rSrcPage.mfTransitionDuration; mePresChange = rSrcPage.mePresChange; - mnTime = rSrcPage.mnTime; + mfTime = rSrcPage.mfTime; mbSoundOn = rSrcPage.mbSoundOn; mbExcluded = rSrcPage.mbExcluded; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 706b199745bb..5cc1a4f1baf3 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -584,9 +584,9 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams } else if ( pParams->Name == "KioskSlideDuration" ) { - sal_Int32 temp = sal_False; + double temp = 0.0; pParams->Value >>= temp; - mnSlideDuration = temp; + mfSlideDuration = temp; mbAutoSlide = true; } else if ( pParams->Name == "KioskEndless" ) @@ -1521,28 +1521,28 @@ bool HtmlExport::CreateHtmlForPresPages() pPage = maPages[ nSdPage ]; if( meMode == PUBLISH_KIOSK ) { - sal_uLong nSecs = 0; + double fSecs = 0; bool bEndless = false; if( !mbAutoSlide ) { if( pPage->GetPresChange() != PRESCHANGE_MANUAL ) { - nSecs = pPage->GetTime(); + fSecs = pPage->GetTime(); bEndless = mpDoc->getPresentationSettings().mbEndless; } } else { - nSecs = mnSlideDuration; + fSecs = mfSlideDuration; bEndless = mbEndless; } - if( nSecs != 0 ) + if( fSecs != 0 ) { if( nSdPage < (mnSdPageCount-1) || bEndless ) { aStr.AppendAscii( "GetSdPageCount(PK_STANDARD); sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); - sal_uInt32 nNewTime = (sal_uInt32)mpPage3PresTimeTMF->GetTime().GetMSFromTime() / 1000; + double fNewTime = (double)mpPage3PresTimeTMF->GetTime().GetMSFromTime() / 1000.0; if(bKiosk) { PresentationSettings& rSettings = pDoc->getPresentationSettings(); @@ -1058,7 +1058,7 @@ SfxObjectShellLock AssistentDlgImpl::GetDocument() if(bKiosk) { pPage->SetPresChange( PRESCHANGE_AUTO ); - pPage->SetTime(nNewTime); + pPage->SetTime(fNewTime); } nPgRelNum++; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 03b11bd7c2c0..a5c237b05cf0 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -92,7 +92,7 @@ enum WID_PAGE { WID_PAGE_LEFT, WID_PAGE_RIGHT, WID_PAGE_TOP, WID_PAGE_BOTTOM, WID_PAGE_WIDTH, WID_PAGE_HEIGHT, WID_PAGE_EFFECT, WID_PAGE_CHANGE, WID_PAGE_SPEED, WID_PAGE_NUMBER, - WID_PAGE_ORIENT, WID_PAGE_LAYOUT, WID_PAGE_DURATION, WID_PAGE_LDNAME, WID_PAGE_LDBITMAP, + WID_PAGE_ORIENT, WID_PAGE_LAYOUT, WID_PAGE_DURATION, WID_PAGE_HIGHRESDURATION, WID_PAGE_LDNAME, WID_PAGE_LDBITMAP, WID_PAGE_BACK, WID_PAGE_PREVIEW, WID_PAGE_PREVIEWBITMAP, WID_PAGE_VISIBLE, WID_PAGE_SOUNDFILE, WID_PAGE_BACKFULL, WID_PAGE_BACKVIS, WID_PAGE_BACKOBJVIS, WID_PAGE_USERATTRIBS, WID_PAGE_BOOKMARK, WID_PAGE_ISDARK, WID_PAGE_HEADERVISIBLE, WID_PAGE_HEADERTEXT, WID_PAGE_FOOTERVISIBLE, WID_PAGE_FOOTERTEXT, @@ -141,6 +141,7 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( sal_Bool bImpress, PageKin { MAP_CHAR_LEN(sUNO_Prop_IsBackgroundObjectsVisible), WID_PAGE_BACKOBJVIS, &::getBooleanCppuType(), 0, 0}, { MAP_CHAR_LEN(sUNO_Prop_UserDefinedAttributes),WID_PAGE_USERATTRIBS, &::getCppuType((const Reference< ::com::sun::star::container::XNameContainer >*)0) , 0, 0}, { MAP_CHAR_LEN(sUNO_Prop_BookmarkURL), WID_PAGE_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0}, + { MAP_CHAR_LEN("HighResDuration"), WID_PAGE_HIGHRESDURATION, &::getCppuType((const double*)0), 0, 0}, { MAP_CHAR_LEN("IsBackgroundDark" ), WID_PAGE_ISDARK, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, { MAP_CHAR_LEN("IsFooterVisible"), WID_PAGE_FOOTERVISIBLE, &::getBooleanCppuType(), 0, 0}, { MAP_CHAR_LEN("FooterText"), WID_PAGE_FOOTERTEXT, &::getCppuType((const OUString*)0), 0, 0}, @@ -612,11 +613,20 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName GetPage()->SetAutoLayout( (AutoLayout)nValue, sal_True ); break; case WID_PAGE_DURATION: - GetPage()->SetTime((sal_uInt32)nValue); + GetPage()->SetTime((sal_Int32)nValue); break; } break; } + case WID_PAGE_HIGHRESDURATION: + { + double fValue = 0; + if(!(aValue >>= fValue)) + throw lang::IllegalArgumentException(); + + GetPage()->SetTime(fValue); + break; + } case WID_PAGE_WIDTH: { sal_Int32 nWidth = 0; @@ -1033,7 +1043,10 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) } break; case WID_PAGE_DURATION: - aAny <<= (sal_Int32)(GetPage()->GetTime()); + aAny <<= (sal_Int32)( GetPage()->GetTime() + .5 ); + break; + case WID_PAGE_HIGHRESDURATION: + aAny <<= (double)( GetPage()->GetTime() ); break; case WID_PAGE_LDNAME: { diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index f64f68136da4..c1d0b2a4a765 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -2176,7 +2176,7 @@ void queryAutomaticSlideTransition( uno::Reference const& xD !getPropertyValue( nAutomaticNextSlideTimeout, xPropSet, ::rtl::OUString( - "Duration")) ) + "HighResDuration")) ) { OSL_TRACE( "queryAutomaticSlideTransition(): " diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index 75d8b93aa461..3d6dc4a59d83 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -56,9 +56,9 @@ sal_Bool XMLDurationPropertyHdl::importXML( util::Duration aDuration; ::sax::Converter::convertDuration(aDuration, rStrImpValue); - const sal_Int32 nSeconds = ((aDuration.Days * 24 + aDuration.Hours) * 60 - + aDuration.Minutes) * 60 + aDuration.Seconds; - rValue <<= nSeconds; + const double fSeconds = ((aDuration.Days * 24 + aDuration.Hours) * 60 + + aDuration.Minutes) * 60 + aDuration.Seconds + aDuration.MilliSeconds / 1000.0; + rValue <<= fSeconds; return sal_True; } @@ -68,12 +68,13 @@ sal_Bool XMLDurationPropertyHdl::exportXML( const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_Int32 nVal = 0; + double nVal = 0; if(rValue >>= nVal) { util::Duration aDuration; aDuration.Seconds = static_cast(nVal); + aDuration.MilliSeconds = static_cast(nVal * 1000.0) % 1000 ; OUStringBuffer aOut; ::sax::Converter::convertDuration(aOut, aDuration); diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 1bf5b277538d..273517bccb0a 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -304,7 +304,7 @@ const XMLPropertyMapEntry aXMLSDPresPageProps[] = DPMAP( "Change", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_TYPE, XML_SD_TYPE_PRESPAGE_TYPE, CTF_PAGE_TRANS_TYPE ), DPMAP( "Effect", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_STYLE, XML_SD_TYPE_PRESPAGE_STYLE, CTF_PAGE_TRANS_STYLE ), DPMAP( "Speed", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_SPEED, XML_SD_TYPE_PRESPAGE_SPEED, CTF_PAGE_TRANS_SPEED ), - DPMAP( "Duration", XML_NAMESPACE_PRESENTATION, XML_DURATION, XML_SD_TYPE_PRESPAGE_DURATION, CTF_PAGE_TRANS_DURATION ), + DPMAP( "HighResDuration", XML_NAMESPACE_PRESENTATION, XML_DURATION, XML_SD_TYPE_PRESPAGE_DURATION, CTF_PAGE_TRANS_DURATION ), DPMAP( "Visible", XML_NAMESPACE_PRESENTATION, XML_VISIBILITY, XML_SD_TYPE_PRESPAGE_VISIBILITY, CTF_PAGE_VISIBLE ), DPMAP( "Sound", XML_NAMESPACE_PRESENTATION, XML_SOUND, XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM, CTF_PAGE_SOUND_URL ), DPMAP( "BackgroundFullSize", XML_NAMESPACE_DRAW, XML_BACKGROUND_SIZE, XML_SD_TYPE_PRESPAGE_BACKSIZE, CTF_PAGE_BACKSIZE ), -- cgit v1.2.3