[Libreoffice-commits] .: 3 commits - sd/source
Joseph Powers
jpowers at kemper.freedesktop.org
Sun May 8 06:38:59 PDT 2011
sd/source/filter/ppt/pptin.cxx | 21 +++++------
sd/source/ui/animations/CustomAnimationDialog.cxx | 39 +++++++++-------------
sd/source/ui/animations/SlideTransitionPane.cxx | 18 +++-------
3 files changed, 32 insertions(+), 46 deletions(-)
New commits:
commit e04c06881855ffffb6a547c3dc6be84d11dba4cf
Author: Joseph Powers <jpowers27 at cox.net>
Date: Sun May 8 06:26:34 2011 -0700
Remove List from ImplSdPPTImport::Import()
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index c28ea7b..1f982cf 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -880,7 +880,7 @@ sal_Bool ImplSdPPTImport::Import()
}
else
{
- // without StyleSheet, set attributes directly. This
+ // without StyleSheet, set attributes directly. This
// should not be done at all and is an error (will be asserted by SdrPage)
pMPage->getSdrPageProperties().ClearItem();
pMPage->getSdrPageProperties().PutItemSet(pObj->GetMergedItemSet());
@@ -1933,27 +1933,24 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
// existiert. Wenn nicht, exportiere diese
// in unser lokales Sound-Verzeichnis.
sal_Bool bSoundExists = sal_False;
- List* pSoundList = new List();
+ ::std::vector< String > aSoundList;
- GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, *pSoundList );
- GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, *pSoundList );
+ GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, aSoundList );
+ GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, aSoundList );
- for( sal_uLong n = 0; ( n < pSoundList->Count() ) && !bSoundExists; n++ )
+ for( size_t n = 0; ( n < aSoundList.size() ) && !bSoundExists; n++ )
{
- INetURLObject aURL( *(String*)pSoundList->GetObject( n ) );
+ INetURLObject aURL( aSoundList[ n ] );
String aSoundName( aURL.GetName() );
if( aSoundName == aRetval )
{
- aRetval = *(String*)pSoundList->GetObject( n );
+ aRetval = aSoundList[ n ];
bSoundExists = sal_True;
}
}
- for ( void* pPtr = pSoundList->First(); pPtr; pPtr = pSoundList->Next() )
- delete (String*)pPtr;
-
- delete pSoundList;
+ aSoundList.clear();
if ( !bSoundExists )
{
commit 69449bc4e44674d5952e7f6b8d4ab403cc028558
Author: Joseph Powers <jpowers27 at cox.net>
Date: Sat May 7 23:53:59 2011 -0700
Remove List from class SlideTransitionPane
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index eca89e2..9574747 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -892,24 +892,18 @@ void SlideTransitionPane::updateControlState()
void SlideTransitionPane::updateSoundList()
{
- List aSoundList;
+ ::std::vector< String > aSoundList;
GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, aSoundList );
GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, aSoundList );
- sal_uInt32 nCount = aSoundList.Count();
+ size_t nCount = aSoundList.size();
maSoundList.clear();
maSoundList.reserve( nCount );
- for( sal_uInt32 i=0; i<nCount; ++i )
+ for( size_t i =0 ; i < nCount; ++i )
{
- String * pEntry = reinterpret_cast< String * >( aSoundList.GetObject( i ));
- if( pEntry )
- {
- // store copy of string in member list
- maSoundList.push_back( *pEntry );
- // delete pointer in temporary List
- delete pEntry;
- }
+ // store copy of string in member list
+ maSoundList.push_back( aSoundList[ i ] );
}
lcl_FillSoundListBox( maSoundList, maLB_SOUND );
commit fc2fd724ccd3b1390003f014904e820721370eb6
Author: Joseph Powers <jpowers27 at cox.net>
Date: Sat May 7 23:53:14 2011 -0700
Remove List from class CustomAnimationEffectTabPage
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index d8df66e..865cf47 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -1145,7 +1145,7 @@ private:
void onSoundPreview();
private:
- List maSoundList;
+ ::std::vector< String > maSoundList;
sal_Bool mbHasText;
const STLPropertySet* mpSet;
@@ -1466,10 +1466,10 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con
const String aTmp( aSoundURL );
sal_uLong i;
- for( i = 0; i < maSoundList.Count(); i++ )
+ for( i = 0; i < maSoundList.size(); i++ )
{
- String* pString = (String*)maSoundList.GetObject( i );
- if( *pString == aTmp )
+ String aString = maSoundList[ i ];
+ if( aString == aTmp )
{
nPos = (sal_uInt16)i+2;
break;
@@ -1478,8 +1478,8 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con
if( nPos == 0 )
{
- nPos = (sal_uInt16)maSoundList.Count()+2;
- maSoundList.Insert( new String( aTmp ), LIST_APPEND );
+ nPos = (sal_uInt16)maSoundList.size()+2;
+ maSoundList.push_back( String( aTmp ) );
INetURLObject aURL( aTmp );
nPos = mpLBSound->InsertEntry( aURL.GetBase(), nPos );
}
@@ -1717,7 +1717,7 @@ void CustomAnimationEffectTabPage::update( STLPropertySet* pSet )
}
else
{
- OUString aSoundURL( *(String*)maSoundList.GetObject( nPos-2 ) );
+ OUString aSoundURL( maSoundList[ nPos-2 ] );
aNewSoundURL = makeAny( aSoundURL );
}
@@ -1736,10 +1736,10 @@ void CustomAnimationEffectTabPage::fillSoundListBox()
mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_NO_SOUND ) ) );
mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_STOP_PREVIOUS_SOUND ) ) );
- for( sal_uLong i = 0; i < maSoundList.Count(); i++ )
+ for( size_t i = 0; i < maSoundList.size(); i++ )
{
- String* pString = (String*)maSoundList.GetObject( i );
- INetURLObject aURL( *pString );
+ String aString = maSoundList[ i ];
+ INetURLObject aURL( aString );
mpLBSound->InsertEntry( aURL.GetBase() );
}
mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_BROWSE_SOUND ) ) );
@@ -1747,12 +1747,7 @@ void CustomAnimationEffectTabPage::fillSoundListBox()
void CustomAnimationEffectTabPage::clearSoundListBox()
{
- const sal_uInt32 nCount = maSoundList.Count();
- sal_uInt32 i;
- for( i = 0; i < nCount; i++ )
- delete (String*)maSoundList.GetObject( i );
- maSoundList.Clear();
-
+ maSoundList.clear();
mpLBSound->Clear();
}
@@ -1761,11 +1756,11 @@ sal_Int32 CustomAnimationEffectTabPage::getSoundObject( const String& rStr )
String aStrIn( rStr );
aStrIn.ToLowerAscii();
- sal_uInt32 i;
- const sal_uInt32 nCount = maSoundList.Count();
+ size_t i;
+ const size_t nCount = maSoundList.size();
for( i = 0; i < nCount; i++ )
{
- String aTmpStr( *(String*)maSoundList.GetObject( i ) );
+ String aTmpStr( maSoundList[ i ] );
aTmpStr.ToLowerAscii();
if( aTmpStr == aStrIn )
@@ -1836,8 +1831,8 @@ void CustomAnimationEffectTabPage::onSoundPreview()
if( nPos >= 2 ) try
{
- const OUString aSoundURL( *(String*)maSoundList.GetObject( nPos-2 ) );
- mxPlayer.set( avmedia::MediaWindow::createPlayer( aSoundURL ), uno::UNO_QUERY_THROW );
+ const OUString aSoundURL( maSoundList[ nPos-2 ] );
+ mxPlayer.set( avmedia::MediaWindow::createPlayer( aSoundURL ), uno::UNO_QUERY_THROW );
mxPlayer->start();
}
catch( uno::Exception& e )
More information about the Libreoffice-commits
mailing list