diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-08-16 12:07:52 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-08-16 12:08:45 +0400 |
commit | 1f7d320eae75f7d96846f117f7b061ab6a5a84b1 (patch) | |
tree | 1474f54fe383b01f43f139fe836d652e0c283aaa /sd | |
parent | ca9541a95263ea30e856ce78468b67c095b66c4d (diff) |
String->OUString
Change-Id: I082aaa9ddd539a9d7989f763c320343bd1951f4e
Diffstat (limited to 'sd')
10 files changed, 89 insertions, 112 deletions
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx index 5074eaff09ae..39fc2d850069 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx @@ -245,7 +245,7 @@ OUString { SolarMutexGuard aGuard; - return String( SdResId(SID_SD_A11Y_I_OUTLINEVIEW_N) ); + return SD_RESSTR(SID_SD_A11Y_I_OUTLINEVIEW_N); } @@ -258,7 +258,7 @@ OUString { SolarMutexGuard aGuard; - return String( SdResId(SID_SD_A11Y_I_OUTLINEVIEW_D) ); + return SD_RESSTR(SID_SD_A11Y_I_OUTLINEVIEW_D); } void AccessibleOutlineView::UpdateChildren() diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index 9366bd16af40..c5177c1807f0 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -203,7 +203,7 @@ OUString SAL_CALL AccessibleSlideSorterObject::getAccessibleDescription (void) throw (uno::RuntimeException) { ThrowIfDisposed(); - return String(SdResId(STR_PAGE)); + return SD_RESSTR(STR_PAGE); } @@ -219,7 +219,7 @@ OUString SAL_CALL AccessibleSlideSorterObject::getAccessibleName (void) if (pPage != NULL) return pPage->GetName(); else - return String(); + return OUString(); } diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index ba31c04cb623..e682668bb46a 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -294,7 +294,7 @@ OUString SAL_CALL AccessibleSlideSorterView::getAccessibleDescription (void) ThrowIfDisposed(); SolarMutexGuard aGuard; - return String(SdResId(SID_SD_A11Y_I_SLIDEVIEW_D)); + return SD_RESSTR(SID_SD_A11Y_I_SLIDEVIEW_D); } @@ -306,7 +306,7 @@ OUString SAL_CALL AccessibleSlideSorterView::getAccessibleName (void) ThrowIfDisposed(); SolarMutexGuard aGuard; - return String(SdResId(SID_SD_A11Y_I_SLIDEVIEW_N)); + return SD_RESSTR(SID_SD_A11Y_I_SLIDEVIEW_N); } diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx index 813ff4e1a69c..95454ad4b95b 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx @@ -252,7 +252,7 @@ CustomAnimationCreateTabPage::CustomAnimationCreateTabPage( Window* pParent, Cus fillDurationComboBox(mpCBSpeed); - String sMotionPathLabel( SdResId( STR_CUSTOMANIMATION_USERPATH ) ); + OUString sMotionPathLabel( SD_RESSTR( STR_CUSTOMANIMATION_USERPATH ) ); sal_uInt16 nFirstEffect = LISTBOX_ENTRY_NOTFOUND; diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 058a0720b7f3..691ec3a3a11c 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -566,8 +566,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, Window mpMenu = new PopupMenu(); for( sal_Int32 i = 25; i < 101; i += 25 ) { - String aStr(OUString::valueOf(i)); - aStr += sal_Unicode('%'); + OUString aStr(OUString::number(i) + "%"); mpMenu->InsertItem( i, aStr ); } @@ -1004,7 +1003,7 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, Window* pPar , maModifyHdl( rModifyHdl ) { mpEdit = new Edit( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY); - mpEdit->SetText( String( SdResId( STR_CUSTOMANIMATION_SAMPLE ) ) ); + mpEdit->SetText( SD_RESSTR(STR_CUSTOMANIMATION_SAMPLE) ); mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSTYLE_POPUP ) ); mpControl = new DropdownMenuBox( pParent, mpEdit, mpMenu ); @@ -1121,12 +1120,12 @@ private: void updateControlStates(); void fillSoundListBox(); void clearSoundListBox(); - sal_Int32 getSoundObject( const String& rStr ); + sal_Int32 getSoundObject( const OUString& rStr ); void openSoundFileDialog(); void onSoundPreview(); private: - ::std::vector< String > maSoundList; + ::std::vector< OUString > maSoundList; sal_Bool mbHasText; const STLPropertySet* mpSet; @@ -1290,7 +1289,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con mpCLBDimColor->SelectEntryPos( nColorPos ); else mpCLBDimColor->SelectEntryPos( - mpCLBDimColor->InsertEntry( aColor, String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) ); + mpCLBDimColor->InsertEntry( aColor, SVX_RESSTR(RID_SVXSTR_COLOR_USER) ) ); } else { @@ -1357,13 +1356,11 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con if( !aSoundURL.isEmpty() ) { - const String aTmp( aSoundURL ); - sal_uLong i; for( i = 0; i < maSoundList.size(); i++ ) { - String aString = maSoundList[ i ]; - if( aString == aTmp ) + OUString aString = maSoundList[ i ]; + if( aString == aSoundURL ) { nPos = (sal_uInt16)i+2; break; @@ -1373,8 +1370,8 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con if( nPos == 0 ) { nPos = (sal_uInt16)maSoundList.size()+2; - maSoundList.push_back( String( aTmp ) ); - INetURLObject aURL( aTmp ); + maSoundList.push_back( aSoundURL ); + INetURLObject aURL( aSoundURL ); nPos = mpLBSound->InsertEntry( aURL.GetBase(), nPos ); } } @@ -1592,15 +1589,15 @@ void CustomAnimationEffectTabPage::fillSoundListBox() GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, maSoundList ); GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, maSoundList ); - mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_NO_SOUND ) ) ); - mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_STOP_PREVIOUS_SOUND ) ) ); + mpLBSound->InsertEntry( SD_RESSTR(STR_CUSTOMANIMATION_NO_SOUND) ); + mpLBSound->InsertEntry( SD_RESSTR(STR_CUSTOMANIMATION_STOP_PREVIOUS_SOUND) ); for( size_t i = 0; i < maSoundList.size(); i++ ) { - String aString = maSoundList[ i ]; + OUString aString = maSoundList[ i ]; INetURLObject aURL( aString ); mpLBSound->InsertEntry( aURL.GetBase() ); } - mpLBSound->InsertEntry( String( SdResId( STR_CUSTOMANIMATION_BROWSE_SOUND ) ) ); + mpLBSound->InsertEntry( SD_RESSTR(STR_CUSTOMANIMATION_BROWSE_SOUND) ); } void CustomAnimationEffectTabPage::clearSoundListBox() @@ -1609,19 +1606,13 @@ void CustomAnimationEffectTabPage::clearSoundListBox() mpLBSound->Clear(); } -sal_Int32 CustomAnimationEffectTabPage::getSoundObject( const String& rStr ) +sal_Int32 CustomAnimationEffectTabPage::getSoundObject( const OUString& rStr ) { - String aStrIn( rStr ); - aStrIn.ToLowerAscii(); - size_t i; const size_t nCount = maSoundList.size(); for( i = 0; i < nCount; i++ ) { - String aTmpStr( maSoundList[ i ] ); - aTmpStr.ToLowerAscii(); - - if( aTmpStr == aStrIn ) + if( maSoundList[ i ].equalsIgnoreAsciiCase(rStr) ) return i+2; } @@ -1632,7 +1623,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog() { SdOpenSoundFileDialog aFileDialog; - String aFile( SvtPathOptions().GetGraphicPath() ); + OUString aFile( SvtPathOptions().GetGraphicPath() ); aFileDialog.SetPath( aFile ); bool bValidSoundFile = false; @@ -1660,9 +1651,8 @@ void CustomAnimationEffectTabPage::openSoundFileDialog() } else { - String aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); - String aStr; aStr += sal_Unicode('%'); - aStrWarning.SearchAndReplace( aStr , aFile ); + OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE)); + aStrWarning = aStrWarning.replaceFirst("%", aFile); WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); aWarningBox.SetModalInputMode (sal_True); bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True; @@ -1888,7 +1878,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(Window* pParent, continue; } - String aDescription( getShapeDescription( xShape, true ) ); + OUString aDescription( getShapeDescription( xShape, true ) ); sal_uInt16 nPos = mpLBTrigger->InsertEntry( aDescription ); mpLBTrigger->SetEntryData( nPos, (void*)(sal_IntPtr)nShape ); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 35542492dc7c..1d06e7979b7c 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -664,7 +664,7 @@ void CustomAnimationList::update() { SvTreeListEntry* pLBoxEntry = new CustomAnimationListEntry; pLBoxEntry->AddItem( new SvLBoxContextBmp( pLBoxEntry, 0, Image(), Image(), 0)); - OUString aDescription = String( SdResId( STR_CUSTOMANIMATION_TRIGGER ) ); + OUString aDescription = SD_RESSTR(STR_CUSTOMANIMATION_TRIGGER); aDescription += ": "; aDescription += getShapeDescription( xShape, false ); pLBoxEntry->AddItem( new CustomAnimationTriggerEntryItem( pLBoxEntry, 0, aDescription ) ); @@ -1013,7 +1013,7 @@ void CustomAnimationList::Paint( const Rectangle& rRect ) aRect.Right() -= aOffset.X(); aRect.Bottom() -= aOffset.Y(); - DrawText( aRect, String( SdResId( STR_CUSTOMANIMATION_LIST_HELPTEXT ) ), + DrawText( aRect, SD_RESSTR(STR_CUSTOMANIMATION_LIST_HELPTEXT), TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK | TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER ); SetTextColor( aOldColor ); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 60da3850bb6f..f0b73138de5f 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -116,25 +116,25 @@ void fillDurationComboBox( ListBox* pBox ) static const double gdFast = 1.0; static const double gdVeryFast = 0.5; - String aVerySlow( SdResId( STR_CUSTOMANIMATION_DURATION_VERY_SLOW ) ); + OUString aVerySlow( SD_RESSTR( STR_CUSTOMANIMATION_DURATION_VERY_SLOW ) ); pBox->SetEntryData( pBox->InsertEntry( aVerySlow ), (void*)&gdVerySlow ); - String aSlow( SdResId( STR_CUSTOMANIMATION_DURATION_SLOW ) ); + OUString aSlow( SD_RESSTR( STR_CUSTOMANIMATION_DURATION_SLOW ) ); pBox->SetEntryData( pBox->InsertEntry( aSlow ), (void*)&gdSlow ); - String aNormal( SdResId( STR_CUSTOMANIMATION_DURATION_NORMAL ) ); + OUString aNormal( SD_RESSTR( STR_CUSTOMANIMATION_DURATION_NORMAL ) ); pBox->SetEntryData( pBox->InsertEntry( aNormal ), (void*)&gdNormal ); - String aFast( SdResId( STR_CUSTOMANIMATION_DURATION_FAST ) ); + OUString aFast( SD_RESSTR( STR_CUSTOMANIMATION_DURATION_FAST ) ); pBox->SetEntryData( pBox->InsertEntry( aFast ), (void*)&gdFast ); - String aVeryFast( SdResId( STR_CUSTOMANIMATION_DURATION_VERY_FAST ) ); + OUString aVeryFast( SD_RESSTR( STR_CUSTOMANIMATION_DURATION_VERY_FAST ) ); pBox->SetEntryData( pBox->InsertEntry( aVeryFast ), (void*)&gdVeryFast ); } void fillRepeatComboBox( ListBox* pBox ) { - String aNone( SdResId( STR_CUSTOMANIMATION_REPEAT_NONE ) ); + OUString aNone( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_NONE ) ); pBox->SetEntryData( pBox->InsertEntry( aNone ), (void*)((sal_Int32)0) ); pBox->SetEntryData( pBox->InsertEntry( OUString::number( 2 ) ), (void*)((sal_Int32)1) ); @@ -143,10 +143,10 @@ void fillRepeatComboBox( ListBox* pBox ) pBox->SetEntryData( pBox->InsertEntry( OUString::number( 5 ) ), (void*)((sal_Int32)5) ); pBox->SetEntryData( pBox->InsertEntry( OUString::number( 10 ) ), (void*)((sal_Int32)10) ); - String aUntilClick( SdResId( STR_CUSTOMANIMATION_REPEAT_UNTIL_NEXT_CLICK ) ); + OUString aUntilClick( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_UNTIL_NEXT_CLICK ) ); pBox->SetEntryData( pBox->InsertEntry( aUntilClick ), (void*)((sal_Int32)-1) ); - String aEndOfSlide( SdResId( STR_CUSTOMANIMATION_REPEAT_UNTIL_END_OF_SLIDE ) ); + OUString aEndOfSlide( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_UNTIL_END_OF_SLIDE ) ); pBox->SetEntryData( pBox->InsertEntry( aEndOfSlide ), (void*)((sal_Int32)-2) ); } @@ -408,59 +408,58 @@ OUString getPropertyName( sal_Int32 nPropertyType ) switch( nPropertyType ) { case nPropertyTypeDirection: - return OUString( String( SdResId( STR_CUSTOMANIMATION_DIRECTION_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_DIRECTION_PROPERTY); case nPropertyTypeSpokes: - return OUString( String( SdResId( STR_CUSTOMANIMATION_SPOKES_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_SPOKES_PROPERTY); case nPropertyTypeFirstColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FIRST_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FIRST_COLOR_PROPERTY); case nPropertyTypeSecondColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_SECOND_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_SECOND_COLOR_PROPERTY); case nPropertyTypeZoom: - return OUString( String( SdResId( STR_CUSTOMANIMATION_ZOOM_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_ZOOM_PROPERTY); case nPropertyTypeFillColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FILL_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FILL_COLOR_PROPERTY); case nPropertyTypeColorStyle: - return OUString( String( SdResId( STR_CUSTOMANIMATION_STYLE_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_STYLE_PROPERTY); case nPropertyTypeFont: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FONT_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FONT_PROPERTY); case nPropertyTypeCharHeight: - return OUString( String( SdResId( STR_CUSTOMANIMATION_SIZE_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_SIZE_PROPERTY); case nPropertyTypeCharColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FONT_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FONT_COLOR_PROPERTY); case nPropertyTypeCharHeightStyle: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FONT_SIZE_STYLE_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FONT_SIZE_STYLE_PROPERTY); case nPropertyTypeCharDecoration: - return OUString( String( SdResId( STR_CUSTOMANIMATION_FONT_STYLE_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_FONT_STYLE_PROPERTY); case nPropertyTypeLineColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_LINE_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_LINE_COLOR_PROPERTY); case nPropertyTypeRotate: - return OUString( String( SdResId( STR_CUSTOMANIMATION_AMOUNT_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_AMOUNT_PROPERTY); case nPropertyTypeColor: - return OUString( String( SdResId( STR_CUSTOMANIMATION_COLOR_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_COLOR_PROPERTY); case nPropertyTypeTransparency: - return OUString( String( SdResId( STR_CUSTOMANIMATION_AMOUNT_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_AMOUNT_PROPERTY); case nPropertyTypeScale: - return OUString( String( SdResId( STR_CUSTOMANIMATION_SCALE_PROPERTY ) ) ); + return SD_RESSTR(STR_CUSTOMANIMATION_SCALE_PROPERTY); } - OUString aStr; - return aStr; + return OUString(); } void CustomAnimationPane::updateControls() diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index 1f1c9b2338ae..489f13cc6c5d 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -147,8 +147,8 @@ private: PushButton* mpPBSlideShow; CheckBox* mpCBAutoPreview; - String maStrModify; - String maStrProperty; + OUString maStrModify; + OUString maStrProperty; sal_Int32 mnPropertyType; diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 0f8e7dee58dd..451194e71153 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -220,7 +220,7 @@ struct TransitionEffect double mfTime; PresChange mePresChange; sal_Bool mbSoundOn; - String maSound; + OUString maSound; bool mbLoopSound; bool mbStopSound; @@ -330,33 +330,33 @@ sal_uInt16 lcl_getTransitionEffectIndex( return pResult; } -struct lcl_EqualsSoundFileName : public ::std::unary_function< String, bool > +struct lcl_EqualsSoundFileName : public ::std::unary_function< OUString, bool > { - explicit lcl_EqualsSoundFileName( const String & rStr ) : + explicit lcl_EqualsSoundFileName( const OUString & rStr ) : maStr( rStr ) {} - bool operator() ( const String & rStr ) const + bool operator() ( const OUString & rStr ) const { // note: formerly this was a case insensitive search for all // platforms. It seems more sensible to do this platform-dependent #if defined( WNT ) - return maStr.EqualsIgnoreCaseAscii( rStr ); + return maStr.equalsIgnoreAsciiCase( rStr ); #else - return maStr.Equals( rStr ); + return maStr == rStr; #endif } private: - String maStr; + OUString maStr; }; // returns -1 if no object was found -bool lcl_findSoundInList( const ::std::vector< String > & rSoundList, - const String & rFileName, - ::std::vector< String >::size_type & rOutPosition ) +bool lcl_findSoundInList( const ::std::vector< OUString > & rSoundList, + const OUString & rFileName, + ::std::vector< OUString >::size_type & rOutPosition ) { - ::std::vector< String >::const_iterator aIt = + ::std::vector< OUString >::const_iterator aIt = ::std::find_if( rSoundList.begin(), rSoundList.end(), lcl_EqualsSoundFileName( rFileName )); if( aIt != rSoundList.end()) @@ -368,12 +368,10 @@ bool lcl_findSoundInList( const ::std::vector< String > & rSoundList, return false; } -String lcl_getSoundFileURL( - const ::std::vector< String > & rSoundList, +OUString lcl_getSoundFileURL( + const ::std::vector< OUString > & rSoundList, const ListBox & rListBox ) { - String aResult; - if( rListBox.GetSelectEntryCount() > 0 ) { sal_uInt16 nPos = rListBox.GetSelectEntryPos(); @@ -384,20 +382,20 @@ String lcl_getSoundFileURL( "Sound list-box is not synchronized to sound list" ); nPos -= 3; if( rSoundList.size() > nPos ) - aResult = rSoundList[ nPos ]; + return rSoundList[ nPos ]; } } - return aResult; + return OUString(); } -struct lcl_AppendSoundToListBox : public ::std::unary_function< String, void > +struct lcl_AppendSoundToListBox : public ::std::unary_function< OUString, void > { lcl_AppendSoundToListBox( ListBox & rListBox ) : mrListBox( rListBox ) {} - void operator() ( const String & rString ) const + void operator() ( const OUString & rString ) const { INetURLObject aURL( rString ); mrListBox.InsertEntry( aURL.GetBase(), LISTBOX_APPEND ); @@ -408,7 +406,7 @@ private: }; void lcl_FillSoundListBox( - const ::std::vector< String > & rSoundList, + const ::std::vector< OUString > & rSoundList, ListBox & rOutListBox ) { sal_uInt16 nCount = rOutListBox.GetEntryCount(); @@ -460,7 +458,7 @@ SlideTransitionPane::SlideTransitionPane( maFL_EMPTY2( this, SdResId( FL_EMPTY2 ) ), maCB_AUTO_PREVIEW( this, SdResId( CB_AUTO_PREVIEW ) ), - maSTR_NO_TRANSITION( SdResId( STR_NO_TRANSITION ) ), + maSTR_NO_TRANSITION( SD_RESSTR( STR_NO_TRANSITION ) ), mbHasSelection( false ), mbUpdatingControls( false ), mbIsMainViewChangePending( false ), @@ -845,16 +843,16 @@ void SlideTransitionPane::updateControls() if( aEffect.mbSoundAmbiguous ) { maLB_SOUND.SetNoSelection(); - maCurrentSoundFile.Erase(); + maCurrentSoundFile = ""; } else { - maCurrentSoundFile.Erase(); + maCurrentSoundFile = ""; if( aEffect.mbStopSound ) { maLB_SOUND.SelectEntryPos( 1 ); } - else if( aEffect.mbSoundOn && aEffect.maSound.Len() > 0 ) + else if( aEffect.mbSoundOn && !aEffect.maSound.isEmpty() ) { tSoundListType::size_type nPos = 0; if( lcl_findSoundInList( maSoundList, aEffect.maSound, nPos )) @@ -916,19 +914,10 @@ void SlideTransitionPane::updateControlState() void SlideTransitionPane::updateSoundList() { - ::std::vector< String > aSoundList; - - GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, aSoundList ); - GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, aSoundList ); - - size_t nCount = aSoundList.size(); maSoundList.clear(); - maSoundList.reserve( nCount ); - for( size_t i =0 ; i < nCount; ++i ) - { - // store copy of string in member list - maSoundList.push_back( aSoundList[ i ] ); - } + + GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, maSoundList ); + GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, maSoundList ); lcl_FillSoundListBox( maSoundList, maLB_SOUND ); } @@ -940,7 +929,7 @@ void SlideTransitionPane::openSoundFileDialog() SdOpenSoundFileDialog aFileDialog; - String aFile; + OUString aFile; DBG_ASSERT( maLB_SOUND.GetSelectEntryPos() == 2, "Dialog should only open when \"Other sound\" is selected" ); aFile = SvtPathOptions().GetGraphicPath(); @@ -974,9 +963,8 @@ void SlideTransitionPane::openSoundFileDialog() } else { - String aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); - OUString aStr('%'); - aStrWarning.SearchAndReplace( aStr , aFile ); + OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE)); + aStrWarning = aStrWarning.replaceFirst("%", aFile); WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); aWarningBox.SetModalInputMode (sal_True); bQuitLoop = (aWarningBox.Execute() != RET_RETRY); @@ -992,7 +980,7 @@ void SlideTransitionPane::openSoundFileDialog() if( ! bValidSoundFile ) { - if( maCurrentSoundFile.Len() > 0 ) + if( !maCurrentSoundFile.isEmpty() ) { tSoundListType::size_type nPos = 0; if( lcl_findSoundInList( maSoundList, maCurrentSoundFile, nPos )) @@ -1066,7 +1054,7 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co // sound if( maLB_SOUND.IsEnabled()) { - maCurrentSoundFile.Erase(); + maCurrentSoundFile = ""; if( maLB_SOUND.GetSelectEntryCount() > 0 ) { sal_uInt16 nPos = maLB_SOUND.GetSelectEntryPos(); diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx index 102d005417ba..523fc326ffda 100644 --- a/sd/source/ui/animations/SlideTransitionPane.hxx +++ b/sd/source/ui/animations/SlideTransitionPane.hxx @@ -120,7 +120,7 @@ private: FixedLine maFL_EMPTY2; CheckBox maCB_AUTO_PREVIEW; - String maSTR_NO_TRANSITION; + OUString maSTR_NO_TRANSITION; ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel; @@ -129,9 +129,9 @@ private: bool mbUpdatingControls; bool mbIsMainViewChangePending; - typedef ::std::vector< String > tSoundListType; + typedef ::std::vector< OUString > tSoundListType; tSoundListType maSoundList; - mutable String maCurrentSoundFile; + mutable OUString maCurrentSoundFile; typedef ::std::map< sal_uInt16, sal_uInt16 > tPresetIndexesType; tPresetIndexesType m_aPresetIndexes; |