From da5eb782cb28f806a8ca08ef8ebf21772363307d Mon Sep 17 00:00:00 2001 From: Ivan Timofeev Date: Fri, 16 Aug 2013 20:35:59 +0400 Subject: String->OUString Change-Id: Ibb7483e12d1c14b01cbcff64f881eb88e6c48265 --- sd/inc/sdabstdlg.hxx | 2 +- sd/source/ui/annotations/annotationmanager.cxx | 37 ++--- sd/source/ui/annotations/annotationtag.cxx | 2 +- sd/source/ui/annotations/annotationwindow.cxx | 2 +- sd/source/ui/app/sdmod1.cxx | 14 +- sd/source/ui/app/sdmod2.cxx | 16 +- sd/source/ui/app/sdpopup.cxx | 20 +-- sd/source/ui/app/sdxfer.cxx | 10 +- sd/source/ui/app/tmplctrl.cxx | 2 +- sd/source/ui/controller/slidelayoutcontroller.cxx | 10 +- sd/source/ui/dlg/LayerTabBar.cxx | 36 ++--- sd/source/ui/dlg/PaneChildWindows.cxx | 2 +- sd/source/ui/dlg/RemoteDialogClientBox.cxx | 12 +- sd/source/ui/dlg/animobjs.cxx | 6 +- sd/source/ui/dlg/brkdlg.cxx | 10 +- sd/source/ui/dlg/copydlg.cxx | 18 +-- sd/source/ui/dlg/custsdlg.cxx | 6 +- sd/source/ui/dlg/diactrl.cxx | 12 +- sd/source/ui/dlg/dlgass.cxx | 180 +++++++++++----------- sd/source/ui/dlg/sddlgfact.cxx | 2 +- sd/source/ui/dlg/sddlgfact.hxx | 2 +- sd/source/ui/inc/dlgass.hxx | 2 +- 22 files changed, 196 insertions(+), 207 deletions(-) (limited to 'sd') diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 21c78b7aadba..4d5111fe5e9a 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -81,7 +81,7 @@ public: virtual OutputType GetOutputMedium() const = 0; virtual sal_Bool IsSummary() const = 0; virtual StartType GetStartType() const = 0; - virtual String GetDocPath() const = 0; + virtual OUString GetDocPath() const = 0; virtual sal_Bool GetStartWithFlag() const = 0; virtual sal_Bool IsDocEmpty() const = 0; virtual com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > GetPassword() = 0; diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index a6128cb9f0e8..099b860df468 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -113,8 +113,7 @@ SfxItemPool* GetAnnotationPool() mpAnnotationPool->SetPoolDefaultItem(SvxFontHeightItem(423,100,EE_CHAR_FONTHEIGHT)); Font aAppFont( Application::GetSettings().GetStyleSettings().GetAppFont() ); - String EMPTYSTRING; - mpAnnotationPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamily(),aAppFont.GetName(), EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); + mpAnnotationPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamily(),aAppFont.GetName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); } return mpAnnotationPool; @@ -365,7 +364,7 @@ void AnnotationManagerImpl::InsertAnnotation() if( pPage ) { if( mpDoc->IsUndoEnabled() ) - mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_INSERT ) ) ); + mpDoc->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_INSERT ) ); // find free space for new annotation int y = 0, x = 0; @@ -458,27 +457,24 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq ) mpDoc->SetCalcFieldValueHdl( pOutliner.get() ); pOutliner->SetUpdateMode( sal_True ); - String aStr(SdResId(STR_ANNOTATION_REPLY)); + OUString aStr(SD_RESSTR(STR_ANNOTATION_REPLY)); OUString sAuthor( xAnnotation->getAuthor() ); if( sAuthor.isEmpty() ) - sAuthor = String( SdResId( STR_ANNOTATION_NOAUTHOR ) ); + sAuthor = SD_RESSTR( STR_ANNOTATION_NOAUTHOR ); - aStr.SearchAndReplaceAscii("%1", sAuthor); + aStr = aStr.replaceFirst("%1", sAuthor); - aStr.Append( OUString(" (") ); - aStr.Append( OUString( getAnnotationDateTimeString( xAnnotation ) ) ); - aStr.Append( OUString("): \"") ); + aStr += " (" + getAnnotationDateTimeString( xAnnotation ) + "): \""; OUString sQuote( pTextApi->GetText() ); if( sQuote.isEmpty() ) sQuote = "..."; - aStr.Append( sQuote ); - aStr.Append( OUString("\"\n") ); + aStr += sQuote + "\"\n"; sal_Int32 nParaCount = comphelper::string::getTokenCount(aStr, '\n'); for( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ ) - pOutliner->Insert( aStr.GetToken( nPara, '\n' ), EE_PARA_APPEND, -1 ); + pOutliner->Insert( aStr.getToken( nPara, '\n' ), EE_PARA_APPEND, -1 ); if( pOutliner->GetParagraphCount() > 1 ) { @@ -515,7 +511,7 @@ void AnnotationManagerImpl::DeleteAnnotation( Reference< XAnnotation > xAnnotati if( xAnnotation.is() && pPage ) { if( mpDoc->IsUndoEnabled() ) - mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) ); + mpDoc->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_DELETE ) ); pPage->removeAnnotation( xAnnotation ); @@ -529,7 +525,7 @@ void AnnotationManagerImpl::DeleteAnnotation( Reference< XAnnotation > xAnnotati void AnnotationManagerImpl::DeleteAnnotationsByAuthor( const OUString& sAuthor ) { if( mpDoc->IsUndoEnabled() ) - mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) ); + mpDoc->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_DELETE ) ); SdPage* pPage = 0; do @@ -559,7 +555,7 @@ void AnnotationManagerImpl::DeleteAnnotationsByAuthor( const OUString& sAuthor ) void AnnotationManagerImpl::DeleteAllAnnotations() { if( mpDoc->IsUndoEnabled() ) - mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) ); + mpDoc->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_DELETE ) ); SdPage* pPage = 0; do @@ -730,7 +726,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward) // Pop up question box that asks the user whether to wrap arround. // The dialog is made modal with respect to the whole application. - QueryBox aQuestionBox ( NULL, (WB_YES_NO | WB_DEF_YES), String(SdResId(nStringId))); + QueryBox aQuestionBox ( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId)); aQuestionBox.SetImage (QueryBox::GetStandardImage()); short nBoxResult = aQuestionBox.Execute(); if (nBoxResult != RET_YES) @@ -976,10 +972,11 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation OUString sCurrentAuthor( aUserOptions.GetFullName() ); OUString sAuthor( xAnnotation->getAuthor() ); - String aStr( pMenu->GetItemText( SID_DELETEALLBYAUTHOR_POSTIT ) ), aReplace( sAuthor ); - if( aReplace.Len() == 0 ) - aReplace = String( SdResId( STR_ANNOTATION_NOAUTHOR ) ); - aStr.SearchAndReplaceAscii("%1", aReplace); + OUString aStr( pMenu->GetItemText( SID_DELETEALLBYAUTHOR_POSTIT ) ); + OUString aReplace( sAuthor ); + if( aReplace.isEmpty() ) + aReplace = SD_RESSTR( STR_ANNOTATION_NOAUTHOR ); + aStr = aStr.replaceFirst("%1", aReplace); pMenu->SetItemText( SID_DELETEALLBYAUTHOR_POSTIT, aStr ); pMenu->EnableItem( SID_REPLYTO_POSTIT, (sAuthor != sCurrentAuthor) && !bReadOnly ); pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? sal_True : sal_False ); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 53b6f7de2d53..d60c467535d1 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -417,7 +417,7 @@ void AnnotationTag::Move( int nDX, int nDY ) if( mxAnnotation.is() ) { if( mrManager.GetDoc()->IsUndoEnabled() ) - mrManager.GetDoc()->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_MOVE ) ) ); + mrManager.GetDoc()->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_MOVE ) ); RealPoint2D aPosition( mxAnnotation->getPosition() ); aPosition.X += (double)nDX / 100.0; diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index ff0ac65c9cdc..40db29168aa4 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -633,7 +633,7 @@ void AnnotationWindow::Deactivate() if( pOPO ) { if( mpDoc->IsUndoEnabled() ) - mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_EDIT ) ) ); + mpDoc->BegUndo( SD_RESSTR( STR_ANNOTATION_UNDO_EDIT ) ); pTextApi->SetText( *pOPO ); delete pOPO; diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 42802ea8cd38..361124f3c590 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -239,7 +239,7 @@ void SdModule::Execute(SfxRequest& rReq) } else { - ErrorBox(NULL, WB_OK, String(SdResId(STR_CANT_PERFORM_IN_LIVEMODE))).Execute(); + ErrorBox(NULL, WB_OK, SD_RESSTR(STR_CANT_PERFORM_IN_LIVEMODE)).Execute(); SFX_REQUEST_ARG( rReq, pLinkItem, SfxLinkItem, SID_DONELINK, sal_False ); if( pLinkItem ) @@ -573,7 +573,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) // Open the Pilot if( pPilotDlg.get() && pPilotDlg->Execute()==RET_OK ) { - const String aDocPath( pPilotDlg->GetDocPath()); + const OUString aDocPath( pPilotDlg->GetDocPath()); const sal_Bool bIsDocEmpty = pPilotDlg->IsDocEmpty(); // So that you can open the document without AutoLayout-Dialog @@ -583,10 +583,10 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) if( pPilotDlg->GetStartType() == ST_OPEN ) { - String aFileToOpen = aDocPath; + OUString aFileToOpen = aDocPath; - DBG_ASSERT( aFileToOpen.Len()!=0, "The autopilot should have asked for a file itself already!" ); - if(aFileToOpen.Len() != 0) + DBG_ASSERT( !aFileToOpen.isEmpty(), "The autopilot should have asked for a file itself already!" ); + if (!aFileToOpen.isEmpty()) { com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > aPasswrd( pPilotDlg->GetPassword() ); @@ -688,7 +688,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) AddSummaryPage(pViewFrame, pDoc); // empty document - if((aDocPath.Len() == 0) && pViewFrame && pViewFrame->GetDispatcher()) + if (aDocPath.isEmpty() && pViewFrame && pViewFrame->GetDispatcher()) { SfxBoolItem aIsChangedItem(SID_MODIFYPAGE, !bIsDocEmpty); SfxUInt32Item eAutoLayout( ID_VAL_WHATLAYOUT, (sal_uInt32) AUTOLAYOUT_TITLE ); @@ -1005,7 +1005,7 @@ void OutlineToImpressFinalizer::operator() (bool) sd::OutlineView* pView = static_cast(pOutlineShell->GetView()); // mba: the stream can't contain any relative URLs, because we don't // have any information about a BaseURL! - if ( pOutlineShell->Read(*mpStream, String(), EE_FORMAT_RTF) == 0 ) + if ( pOutlineShell->Read(*mpStream, OUString(), EE_FORMAT_RTF) == 0 ) { } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index e07fd6e9c9ff..18514985cfc2 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -187,7 +187,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) { if( pDocShell && (pExtFileField->GetType() != SVXFILETYPE_FIX) ) { - String aName; + OUString aName; if( pDocShell->HasName() ) aName = pDocShell->GetMedium()->GetName(); else @@ -214,8 +214,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) } else if( dynamic_cast< const SvxPageField* >(pField) ) { - String aRepresentation; - aRepresentation += sal_Unicode( ' ' ); + OUString aRepresentation(" "); ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; if(pViewSh == NULL) @@ -251,8 +250,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) } else if( dynamic_cast< const SvxPagesField* >(pField) ) { - String aRepresentation; - aRepresentation += sal_Unicode( ' ' ); + OUString aRepresentation(" "); ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; if(pViewSh == NULL) @@ -302,7 +300,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) break; } - String aURL = pURLField->GetURL(); + OUString aURL = pURLField->GetURL(); svtools::ColorConfig aConfig; svtools::ColorConfigEntry eEntry = @@ -315,7 +313,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) } else { - String aRepresentation; + OUString aRepresentation; bool bHeaderField = dynamic_cast< const SvxHeaderField* >( pField ) != 0; bool bFooterField = !bHeaderField && (dynamic_cast< const SvxFooterField* >( pField ) != 0 ); @@ -369,8 +367,8 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) OSL_FAIL("sd::SdModule::CalcFieldValueHdl(), unknown field type!"); } - if( aRepresentation.Len() == 0 ) // TODO: Edit engine doesn't handle empty fields? - aRepresentation += sal_Unicode( ' ' ); + if( aRepresentation.isEmpty() ) // TODO: Edit engine doesn't handle empty fields? + aRepresentation = " "; pInfo->SetRepresentation( aRepresentation ); } } diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 110254775a52..880bd3132ec1 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -51,8 +51,8 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) { sal_uInt16 nID = 1; sal_uInt16 nStyle = MIB_RADIOCHECK | MIB_AUTOCHECK; - InsertItem( nID++, String( SdResId( STR_FIX ) ), nStyle ); - InsertItem( nID++, String( SdResId( STR_VAR ) ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_FIX ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_VAR ), nStyle ); InsertSeparator(); if( pField->ISA( SvxDateField ) ) @@ -67,8 +67,8 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SVXDATEFORMAT_APPDEFAULT, // is not used //SVXDATEFORMAT_SYSTEM, // is not used - InsertItem( nID++, String( SdResId( STR_STANDARD_SMALL ) ), nStyle ); - InsertItem( nID++, String( SdResId( STR_STANDARD_BIG ) ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_STANDARD_SMALL ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_STANDARD_BIG ), nStyle ); SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); aDateField.SetFormat( SVXDATEFORMAT_A ); // 13.02.96 @@ -99,7 +99,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SVXTIMEFORMAT_APPDEFAULT, // is not used //SVXTIMEFORMAT_SYSTEM, // is not used - InsertItem( nID++, String( SdResId( STR_STANDARD_NORMAL ) ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_STANDARD_NORMAL ), nStyle ); SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49 @@ -131,10 +131,10 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) else CheckItem( 2 ); - InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME_EXT ) ), nStyle ); - InsertItem( nID++, String( SdResId( STR_FILEFORMAT_FULLPATH ) ), nStyle ); - InsertItem( nID++, String( SdResId( STR_FILEFORMAT_PATH ) ), nStyle ); - InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME ) ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_NAME_EXT ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_FULLPATH ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_PATH ), nStyle ); + InsertItem( nID++, SD_RESSTR( STR_FILEFORMAT_NAME ), nStyle ); CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 ); } @@ -262,7 +262,7 @@ SvxFieldData* SdFieldPopup::GetField() { SvxExtFileField aFileField( *pFileField ); - String aName; + OUString aName; if( pDocSh->HasName() ) aName = pDocSh->GetMedium()->GetName(); diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index b13af5d097b8..24d850c0aa11 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -205,7 +205,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) xPropSet->getPropertyValue( "Label" ) >>= aLabel; xPropSet->getPropertyValue( "TargetURL" ) >>= aURL; - mpBookmark = new INetBookmark( String( aURL ), String( aLabel ) ); + mpBookmark = new INetBookmark( aURL, aLabel ); } } } @@ -288,14 +288,16 @@ void SdTransferable::CreateData() SdStyleSheetPool* pOldStylePool = (SdStyleSheetPool*) pOldModel->GetStyleSheetPool(); SdStyleSheetPool* pNewStylePool = (SdStyleSheetPool*) mpSdDrawDocumentIntern->GetStyleSheetPool(); SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD ); - String aOldLayoutName( pOldPage->GetLayoutName() ); + OUString aOldLayoutName( pOldPage->GetLayoutName() ); pPage->SetSize( pOldPage->GetSize() ); pPage->SetLayoutName( aOldLayoutName ); pNewStylePool->CopyGraphicSheets( *pOldStylePool ); pNewStylePool->CopyCellSheets( *pOldStylePool ); pNewStylePool->CopyTableStyles( *pOldStylePool ); - aOldLayoutName.Erase( aOldLayoutName.SearchAscii( SD_LT_SEPARATOR ) ); + sal_Int32 nPos = aOldLayoutName.indexOf( SD_LT_SEPARATOR ); + if( nPos != -1 ) + aOldLayoutName = aOldLayoutName.copy( 0, nPos ); SdStyleSheetVector aCreatedSheets; pNewStylePool->CopyLayoutSheets( aOldLayoutName, *pOldStylePool, aCreatedSheets ); } @@ -608,7 +610,7 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject // write document storage pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, sal_False ); // mba: no relative ULRs for clipboard! - SfxMedium aMedium( xWorkStore, String() ); + SfxMedium aMedium( xWorkStore, OUString() ); bRet = pEmbObj->DoSaveObjectAs( aMedium, sal_False ); pEmbObj->DoSaveCompleted(); diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index 78bec5393804..606bc1696fbf 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -82,7 +82,7 @@ void SdTemplateControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) ) - GetStatusBar().SetItemText( GetId(), String() ); + GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { msTemplate = ((SfxStringItem*)pState)->GetValue(); diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index a2e83d387261..38626bbce054 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -148,7 +148,7 @@ static void fillLayoutValueSet( ValueSet* pValue, snewfoil_value_info* pInfo ) Size aLayoutItemSize; for( ; pInfo->mnBmpResId; pInfo++ ) { - String aText( SdResId( pInfo->mnStrResId ) ); + OUString aText( SD_RESSTR( pInfo->mnStrResId ) ); BitmapEx aBmp( SdResId( pInfo->mnBmpResId ) ); pValue->InsertItem( static_cast(pInfo->maAutoLayout)+1, aBmp, aText ); @@ -187,8 +187,8 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const const sal_Int32 LAYOUT_BORDER_PIX = 7; - String aTitle1( SdResId( STR_GLUE_ESCDIR_HORZ ) ); - String aTitle2( SdResId( STR_GLUE_ESCDIR_VERT ) ); + OUString aTitle1( SD_RESSTR( STR_GLUE_ESCDIR_HORZ ) ); + OUString aTitle2( SD_RESSTR( STR_GLUE_ESCDIR_VERT ) ); SvtLanguageOptions aLanguageOptions; const bool bVerticalEnabled = aLanguageOptions.IsVerticalTextEnabled(); @@ -255,11 +255,11 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const sSlotStr = ".uno:Undo"; aSlotImage = ::GetImage( mxFrame, sSlotStr, sal_False ); - String sSlotTitle; + OUString sSlotTitle; if( bInsertPage ) sSlotTitle = ImplRetrieveLabelFromCommand( mxFrame, sSlotStr ); else - sSlotTitle = String( SdResId( STR_RESET_LAYOUT ) ); + sSlotTitle = SD_RESSTR( STR_RESET_LAYOUT ); appendEntry( 2, sSlotTitle, aSlotImage); } } diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 26ba6f57873c..a27b4885c9f4 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -99,7 +99,7 @@ void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt) else if (rMEvt.IsShift()) { // Toggle between layer visible / hidden - String aName(GetPageText(aLayerId)); + OUString aName(GetPageText(aLayerId)); SdrPageView* pPV = pDrViewSh->GetView()->GetSdrPageView(); sal_Bool bVisible = pPV->IsLayerVisible(aName); pPV->SetLayerVisible(aName, !bVisible); @@ -177,12 +177,12 @@ void LayerTabBar::Command(const CommandEvent& rCEvt) long LayerTabBar::StartRenaming() { sal_Bool bOK = sal_True; - String aLayerName = GetPageText( GetEditPageId() ); - String aLayoutLayer ( SdResId(STR_LAYER_LAYOUT) ); - String aControlsLayer ( SdResId(STR_LAYER_CONTROLS) ); - String aMeasureLinesLayer ( SdResId(STR_LAYER_MEASURELINES) ); - String aBackgroundLayer( SdResId(STR_LAYER_BCKGRND) ); - String aBackgroundObjLayer( SdResId(STR_LAYER_BCKGRNDOBJ) ); + OUString aLayerName = GetPageText( GetEditPageId() ); + OUString aLayoutLayer = SD_RESSTR(STR_LAYER_LAYOUT); + OUString aControlsLayer = SD_RESSTR(STR_LAYER_CONTROLS); + OUString aMeasureLinesLayer = SD_RESSTR(STR_LAYER_MEASURELINES); + OUString aBackgroundLayer = SD_RESSTR(STR_LAYER_BCKGRND); + OUString aBackgroundObjLayer = SD_RESSTR(STR_LAYER_BCKGRNDOBJ); if ( aLayerName == aLayoutLayer || aLayerName == aControlsLayer || aLayerName == aMeasureLinesLayer || @@ -211,27 +211,27 @@ long LayerTabBar::AllowRenaming() // Check if names already exists ::sd::View* pView = pDrViewSh->GetView(); SdDrawDocument& rDoc = pView->GetDoc(); - String aLayerName = pView->GetActiveLayer(); + OUString aLayerName = pView->GetActiveLayer(); SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); - String aNewName( GetEditText() ); + OUString aNewName( GetEditText() ); - if ( aNewName.Len() == 0 || + if (aNewName.isEmpty() || (rLayerAdmin.GetLayer( aNewName, sal_False ) && aLayerName != aNewName) ) { // Name already exists WarningBox aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ), - String(SdResId( STR_WARN_NAME_DUPLICATE ) ) ); + SD_RESSTR( STR_WARN_NAME_DUPLICATE ) ); aWarningBox.Execute(); bOK = sal_False; } if (bOK) { - String aLayoutLayer ( SdResId(STR_LAYER_LAYOUT) ); - String aControlsLayer ( SdResId(STR_LAYER_CONTROLS) ); - String aMeasureLinesLayer ( SdResId(STR_LAYER_MEASURELINES) ); - String aBackgroundLayer( SdResId(STR_LAYER_BCKGRND) ); - String aBackgroundObjLayer( SdResId(STR_LAYER_BCKGRNDOBJ) ); + OUString aLayoutLayer = SD_RESSTR(STR_LAYER_LAYOUT); + OUString aControlsLayer = SD_RESSTR(STR_LAYER_CONTROLS); + OUString aMeasureLinesLayer = SD_RESSTR(STR_LAYER_MEASURELINES); + OUString aBackgroundLayer = SD_RESSTR(STR_LAYER_BCKGRND); + OUString aBackgroundObjLayer = SD_RESSTR(STR_LAYER_BCKGRNDOBJ); if ( aNewName == aLayoutLayer || aNewName == aControlsLayer || aNewName == aMeasureLinesLayer || @@ -253,13 +253,13 @@ void LayerTabBar::EndRenaming() DrawView* pDrView = PTR_CAST( DrawView, pView ); SdDrawDocument& rDoc = pView->GetDoc(); - String aLayerName = pView->GetActiveLayer(); + OUString aLayerName = pView->GetActiveLayer(); SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False); if (pLayer) { - String aNewName( GetEditText() ); + OUString aNewName( GetEditText() ); DBG_ASSERT( pDrView, "Rename layer undo action is only working with a SdDrawView" ); if( pDrView ) diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 30e5b2fac961..c82a32679f51 100644 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -65,7 +65,7 @@ PaneChildWindow::PaneChildWindow ( this, pParentWindow, SdResId( nDockWinTitleResId ), - String( SdResId( nTitleBarResId ) ) ); + SD_RESSTR( nTitleBarResId ) ); eChildAlignment = eAlignment; static_cast(pWindow)->Initialize(pInfo); SetHideNotDelete(sal_True); diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index bc9b508feed2..d7b00033f394 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -84,7 +84,7 @@ ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer, m_pScrollBar->EnableDrag(); m_aPinBox.SetUseThousandSep(false); -// m_aPinDescription.SetText( String( SdResId( STR_ENTER_PIN ) ) ); +// m_aPinDescription.SetText( SD_RESSTR( STR_ENTER_PIN ) ); SetPaintTransparent( true ); SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) ); @@ -308,15 +308,15 @@ void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry ) long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET; nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN ); - long aTitleWidth = GetTextWidth( String( pEntry->m_pClientInfo->mName ) ) + (aTextHeight / 3); + long aTitleWidth = GetTextWidth( pEntry->m_pClientInfo->mName ) + (aTextHeight / 3); aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET ); if ( aTitleWidth > nMaxTitleWidth ) { aTitleWidth = nMaxTitleWidth - (aTextHeight / 3); - String aShortTitle = GetEllipsisString( pEntry->m_pClientInfo->mName, - aTitleWidth ); + OUString aShortTitle = GetEllipsisString( pEntry->m_pClientInfo->mName, + aTitleWidth ); DrawText( aPos, aShortTitle ); aTitleWidth += (aTextHeight / 3); } @@ -337,9 +337,9 @@ void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry ) aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() ); // m_aPinDescription.SetPosPixel( aBtnPos ); DrawText( Rectangle( aBtnPos.X(), aBtnPos.Y(), rRect.Right(), rRect.Bottom() - TOP_OFFSET), - String( SdResId( STR_ENTER_PIN ) ), 0 ); + SD_RESSTR( STR_ENTER_PIN ), 0 ); - aBtnPos = Point( aRect.Left() + GetTextWidth( String( SdResId( STR_ENTER_PIN ) ) ), + aBtnPos = Point( aRect.Left() + GetTextWidth( SD_RESSTR( STR_ENTER_PIN ) ), aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() ); m_aPinBox.SetPosPixel( aBtnPos ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 0d81e9e02d15..53db5b9c1c0c 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -161,7 +161,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings, pBindings ( pInBindings ) { - aCtlDisplay.SetAccessibleName(String (SdResId(STR_DISPLAY))); + aCtlDisplay.SetAccessibleName(SD_RESSTR(STR_DISPLAY)); FreeResource(); //undo SfxDockingWindow HelpId clear hack reverseUniqueHelpIdHack(*this); @@ -385,7 +385,7 @@ IMPL_LINK( AnimationWindow, ClickRbtHdl, void *, p ) { if (m_FrameList.empty() || p == &aRbtGroup || aRbtGroup.IsChecked()) { - aTimeField.SetText( String() ); + aTimeField.SetText( OUString() ); aTimeField.Enable( sal_False ); aLbLoopCount.Enable( sal_False ); } @@ -451,7 +451,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn ) } else // delete everything { - WarningBox aWarnBox( this, WB_YES_NO, String( SdResId( STR_ASK_DELETE_ALL_PICTURES ) ) ); + WarningBox aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) ); short nReturn = aWarnBox.Execute(); if( nReturn == RET_YES ) diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx index e548bb7e0797..57d98ba620c5 100644 --- a/sd/source/ui/dlg/brkdlg.cxx +++ b/sd/source/ui/dlg/brkdlg.cxx @@ -58,7 +58,7 @@ BreakDlg::BreakDlg( { aBtnCancel.SetClickHdl( LINK( this, BreakDlg, CancelButtonHdl)); - mpProgress = new SfxProgress( pShell, String(SdResId(STR_BREAK_METAFILE)), nSumActionCount*3 ); + mpProgress = new SfxProgress( pShell, SD_RESSTR(STR_BREAK_METAFILE), nSumActionCount*3 ); pProgrInfo = new SvdProgressInfo( &aLink ); // every action is editedt 3 times in DoImport() @@ -95,15 +95,13 @@ IMPL_LINK_NOARG(BreakDlg, CancelButtonHdl) */ IMPL_LINK( BreakDlg, UpDate, void*, nInit ) { - String aEmptyStr; - if(pProgrInfo == NULL) return 1L; // update status bar or show a error message? if(nInit == (void*)1L) { - ErrorBox aErrBox( this, WB_OK, String( SdResId( STR_BREAK_FAIL ) ) ); + ErrorBox aErrBox( this, WB_OK, SD_RESSTR( STR_BREAK_FAIL ) ); aErrBox.Execute(); } else @@ -121,7 +119,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit ) // how many actions are started? if(pProgrInfo->GetActionCount() == 0) { - aFiActInfo.SetText( aEmptyStr ); + aFiActInfo.SetText( OUString() ); } else { @@ -134,7 +132,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit ) // and inserted???? if(pProgrInfo->GetInsertCount() == 0) { - aFiInsInfo.SetText( aEmptyStr ); + aFiInsInfo.SetText( OUString() ); } else { diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 4f8baa3c5e67..ca4f23856b37 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -119,7 +119,7 @@ CopyDlg::~CopyDlg() void CopyDlg::Reset() { const SfxPoolItem* pPoolItem = NULL; - String aStr( GetExtraData() ); + OUString aStr( GetExtraData() ); if (comphelper::string::getTokenCount(aStr, TOKEN) < 8) { @@ -170,28 +170,28 @@ void CopyDlg::Reset() else { long nTmp; - nTmp = (long)aStr.GetToken( 0, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 0, TOKEN ).toInt32(); m_pNumFldCopies->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 1, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 1, TOKEN ).toInt32(); m_pMtrFldMoveX->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 2, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 2, TOKEN ).toInt32(); m_pMtrFldMoveY->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 3, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 3, TOKEN ).toInt32(); m_pMtrFldAngle->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 4, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 4, TOKEN ).toInt32(); m_pMtrFldWidth->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 5, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 5, TOKEN ).toInt32(); m_pMtrFldHeight->SetValue( nTmp ); - nTmp = (long)aStr.GetToken( 6, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 6, TOKEN ).toInt32(); m_pLbStartColor->SelectEntry( Color( nTmp ) ); - nTmp = (long)aStr.GetToken( 7, TOKEN ).ToInt32(); + nTmp = (long)aStr.getToken( 7, TOKEN ).toInt32(); m_pLbEndColor->SelectEntry( Color( nTmp ) ); } diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 75e91aa79182..ac564ee7da1e 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -475,7 +475,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() } // compare name and set name if necessary - String aStr( m_pEdtName->GetText() ); + OUString aStr( m_pEdtName->GetText() ); if( rpCustomShow->GetName() != aStr ) { rpCustomShow->SetName( aStr ); @@ -493,7 +493,7 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl) SdCustomShowList* pCustomShowList = rDoc.GetCustomShowList(); if( pCustomShowList ) { - String aName( m_pEdtName->GetText() ); + OUString aName( m_pEdtName->GetText() ); SdCustomShow* pCustomShow; long nPosToSelect = pCustomShowList->GetCurPos(); @@ -516,7 +516,7 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl) else { WarningBox( this, WinBits( WB_OK ), - String( SdResId( STR_WARN_NAME_DUPLICATE ) ) ).Execute(); + SD_RESSTR( STR_WARN_NAME_DUPLICATE ) ).Execute(); m_pEdtName->GrabFocus(); } diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx index 46d112901767..f6b0988476a7 100644 --- a/sd/source/ui/dlg/diactrl.cxx +++ b/sd/source/ui/dlg/diactrl.cxx @@ -48,11 +48,11 @@ SdPagesField::SdPagesField( Window* pParent, SvxMetricField ( pParent, rFrame, nBits ), m_xFrame ( rFrame ) { - String aStr( SdResId( STR_SLIDE_PLURAL ) ); + OUString aStr( SD_RESSTR( STR_SLIDE_PLURAL ) ); SetCustomUnitText( aStr ); // set size - aStr.AppendAscii( "XXX" ); + aStr += "XXX"; Size aSize( GetTextWidth( aStr )+20, GetTextHeight()+6 ); @@ -84,12 +84,12 @@ void SdPagesField::UpdatePagesField( const SfxUInt16Item* pItem ) long nValue = (long) pItem->GetValue(); SetValue( nValue ); if( nValue == 1 ) - SetCustomUnitText( String( SdResId( STR_SLIDE_SINGULAR ) ) ); + SetCustomUnitText( SD_RESSTR( STR_SLIDE_SINGULAR ) ); else - SetCustomUnitText( String( SdResId( STR_SLIDE_PLURAL ) ) ); + SetCustomUnitText( SD_RESSTR( STR_SLIDE_PLURAL ) ); } else - SetText( String() ); + SetText( OUString() ); } // ----------------------------------------------------------------------- @@ -130,7 +130,7 @@ void SdTbxCtlDiaPages::StateChanged( sal_uInt16, if ( eState == SFX_ITEM_DISABLED ) { pFld->Disable(); - pFld->SetText( String() ); + pFld->SetText( OUString() ); } else { diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 0b362ca942e4..3bedd262cd2b 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -103,7 +103,7 @@ class PasswordEntry { public: uno::Sequence< beans::NamedValue > aEncryptionData; - String maPath; + OUString maPath; }; // ==================================================================== @@ -190,21 +190,21 @@ public: ::Window* mpWindow; - void SavePassword( SfxObjectShellLock xDoc, const String& rPath ); - void RestorePassword( SfxItemSet* pSet, const String& rPath ); - uno::Sequence < beans::NamedValue > GetPassword( const String rPath ); + void SavePassword( SfxObjectShellLock xDoc, const OUString& rPath ); + void RestorePassword( SfxItemSet* pSet, const OUString& rPath ); + uno::Sequence < beans::NamedValue > GetPassword( const OUString& rPath ); void DeletePasswords(); boost::ptr_vector< PasswordEntry > maPasswordList; - String maDocFile; - String maLayoutFile; + OUString maDocFile; + OUString maLayoutFile; - String GetDocFileName(); - String GetLayoutFileName(); + OUString GetDocFileName(); + OUString GetLayoutFileName(); /// List of URLs of recently used impress files. - std::vector maOpenFilesList; + std::vector maOpenFilesList; /// List of folders containing data about impress templates. std::vector maPresentList; @@ -232,13 +232,13 @@ public: sal_uLong mnTemplate; - String maPageListFile; + OUString maPageListFile; void UpdatePreview( sal_Bool bDocPreview ); void UpdatePageList(); void UpdateUserData(); - sal_Bool IsOwnFormat( const String& rPath ); + bool IsOwnFormat( const OUString& rPath ); // dlg status void EndDialog( long nResult = 0 ); @@ -246,14 +246,14 @@ public: void SetStartType( StartType eType ); StartType GetStartType(); - void SelectTemplateRegion( const String& rRegion ); - void SelectLayoutRegion( const String& rRegion ); + void SelectTemplateRegion( const OUString& rRegion ); + void SelectLayoutRegion( const OUString& rRegion ); void UpdatePage(); void ChangePage(); void LeavePage(); - String GetUiTextForCommand (const OUString& aCommandURL); + OUString GetUiTextForCommand (const OUString& aCommandURL); Image GetUiIconForCommand (const OUString& aCommandURL); DECL_LINK( StartScanHdl, void * ); @@ -285,8 +285,8 @@ public: OKButton maFinishButton; SdDocPreviewWin maPreview; - String maCreateStr; - String maOpenStr; + OUString maCreateStr; + OUString maOpenStr; // page 1 FixedBitmap* mpPage1FB; @@ -371,7 +371,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, maCreateStr(SdResId(STR_CREATE)), maOpenStr(SdResId(STR_OPEN)) { - maPageListFile += sal_Unicode('?'), + maPageListFile = "?"; mbRecentDocumentsReady = sal_False; mbTemplatesReady = sal_False; mbPreviewUpdating = sal_False; @@ -422,11 +422,11 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, // Set text and icon of the 'Open...' button. { - String sText (GetUiTextForCommand(".uno:Open")); + OUString sText (GetUiTextForCommand(".uno:Open")); // Remove the mnemonic and add a leading space so that icon and text // are not too close together. - sText.SearchAndReplaceAll(OUString("~"),String()); - sText.Insert(OUString(" "),0); + sText = sText.replaceAll("~", ""); + sText = " " + sText; mpPage1OpenPB->SetText(sText); // Place icon left of text and both centered in the button. mpPage1OpenPB->SetModeImage( @@ -443,7 +443,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, mpPage1RegionLB->SetDropDownLineCount( 6 ); mpPage1TemplateLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectTemplateHdl)); mpPage1TemplateLB->SetStyle(mpPage1TemplateLB->GetStyle() | WB_SORT); - mpPage1TemplateLB->InsertEntry(String(SdResId(STR_ISLOADING))); + mpPage1TemplateLB->InsertEntry(SD_RESSTR(STR_ISLOADING)); mpPage1EmptyRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl)); mpPage1TemplateRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl)); @@ -484,7 +484,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, mpPage2RegionLB->SetDropDownLineCount( 6 ); mpPage2LayoutLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectLayoutHdl)); mpPage2LayoutLB->SetStyle(mpPage2LayoutLB->GetStyle() | WB_SORT); - mpPage2LayoutLB->InsertEntry(String(SdResId(STR_ISLOADING))); + mpPage2LayoutLB->InsertEntry(SD_RESSTR(STR_ISLOADING)); // page 3 maAssistentFunc.InsertControl(3, &maPreview ); @@ -522,9 +522,9 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, mpPage3EffectLB->SetSelectHdl( LINK(this,AssistentDlgImpl,SelectEffectHdl )); mpPage3EffectLB->SetDropDownLineCount( 12 ); - mpPage3SpeedLB->InsertEntry( String( SdResId(STR_SLOW) )); - mpPage3SpeedLB->InsertEntry( String( SdResId(STR_MEDIUM) )); - mpPage3SpeedLB->InsertEntry( String( SdResId(STR_FAST) )); + mpPage3SpeedLB->InsertEntry( SD_RESSTR(STR_SLOW) ); + mpPage3SpeedLB->InsertEntry( SD_RESSTR(STR_MEDIUM) ); + mpPage3SpeedLB->InsertEntry( SD_RESSTR(STR_FAST) ); mpPage3SpeedLB->SetDropDownLineCount( 3 ); mpPage3SpeedLB->SetSelectHdl( LINK(this,AssistentDlgImpl,SelectEffectHdl )); mpPage3SpeedLB->SelectEntryPos( 1 ); @@ -620,8 +620,8 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, //check whether we should start with a template document initialy and preselect it const OUString aServiceName( "com.sun.star.presentation.PresentationDocument" ); - String aStandardTemplate( SfxObjectFactory::GetStandardTemplate( aServiceName ) ); - if( aStandardTemplate.Len() ) + OUString aStandardTemplate( SfxObjectFactory::GetStandardTemplate( aServiceName ) ); + if( !aStandardTemplate.isEmpty() ) { ProvideTemplates(); @@ -733,11 +733,6 @@ AssistentDlgImpl::~AssistentDlgImpl() delete mpPage5PageListFT; delete mpPage5PageListCT; delete mpPage5SummaryCB; - - // Delete the file history list. - std::vector::iterator I2; - for (I2=maOpenFilesList.begin(); I2!=maOpenFilesList.end(); ++I2) - delete *I2; } void AssistentDlgImpl::CloseDocShell() @@ -827,7 +822,7 @@ void AssistentDlgImpl::ScanDocmenu (void) // The password is set only when it is not empty. if (!sPassword.isEmpty()) aURL.SetPass (sPassword); - maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE ))); + maOpenFilesList.push_back (aURL.GetMainURL(INetURLObject::NO_DECODE)); mpPage1OpenLB->InsertEntry (sTitle); break; } @@ -968,18 +963,18 @@ StartType AssistentDlgImpl::GetStartType() return ST_OPEN; } -String AssistentDlgImpl::GetDocFileName() +OUString AssistentDlgImpl::GetDocFileName() { - String aTitle; + OUString aTitle; if(mpWindow) { aTitle = mpWindow->GetText(); - sal_uInt16 nPos = aTitle.Search(sal_Unicode('(')); - if(nPos != STRING_NOTFOUND) - aTitle.Erase( nPos-1 ); + sal_Int32 nPos = aTitle.indexOf('('); + if (nPos != -1) + aTitle = aTitle.copy( 0, nPos-1 ); } - String aDocFile; + OUString aDocFile; if( GetStartType() == ST_TEMPLATE ) { const sal_uInt16 nEntry = mpPage1TemplateLB->GetSelectEntryPos(); @@ -991,16 +986,16 @@ String AssistentDlgImpl::GetDocFileName() { aDocFile = pEntry->msPath; - aTitle.AppendAscii( " (" ); - aTitle.Append( pEntry->msTitle ); - aTitle.Append( sal_Unicode(')') ); + aTitle += " ("; + aTitle += pEntry->msTitle; + aTitle += ")"; } } else if( GetStartType() == ST_OPEN ) { const sal_uInt16 nEntry = mpPage1OpenLB->GetSelectEntryPos(); if(nEntry != (sal_uInt16)-1 ) - aDocFile = *maOpenFilesList[nEntry]; + aDocFile = maOpenFilesList[nEntry]; } if(mpWindow) @@ -1009,18 +1004,18 @@ String AssistentDlgImpl::GetDocFileName() return aDocFile; } -String AssistentDlgImpl::GetLayoutFileName() +OUString AssistentDlgImpl::GetLayoutFileName() { - String aFile; + OUString aFile; const sal_uInt16 nEntry = mpPage2LayoutLB->GetSelectEntryPos(); TemplateEntry* pEntry = NULL; if(nEntry != (sal_uInt16)-1 && nEntry > 0) pEntry = mpLayoutRegion->maEntries[nEntry-1]; if(pEntry) - aFile = pEntry->msPath; + return pEntry->msPath; - return aFile; + return OUString(); } SfxObjectShellLock AssistentDlgImpl::GetDocument() @@ -1329,10 +1324,10 @@ IMPL_LINK_NOARG(AssistentDlgImpl, LastPageHdl) IMPL_LINK_NOARG(AssistentDlgImpl, PresTypeHdl) { - if(maDocFile.Len() == 0) - { + if (maDocFile.isEmpty()) + { maNextPageButton.Enable(false); - } + } sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); mpPage3PresTimeFT->Enable(bKiosk); @@ -1346,12 +1341,12 @@ IMPL_LINK_NOARG(AssistentDlgImpl, PresTypeHdl) IMPL_LINK_NOARG(AssistentDlgImpl, UpdateUserDataHdl) { mbUserDataDirty = sal_True; - String aTopic = mpPage4AskTopicEDT->GetText(); - String aName = mpPage4AskNameEDT->GetText(); - String aInfo = mpPage4AskInfoEDT->GetText(); + OUString aTopic = mpPage4AskTopicEDT->GetText(); + OUString aName = mpPage4AskNameEDT->GetText(); + OUString aInfo = mpPage4AskInfoEDT->GetText(); - if(aTopic.Len() == 0 && aName.Len() == 0 && aInfo.Len() == 0) - maDocFile.Erase(); + if (aTopic.isEmpty() && aName.isEmpty() && aInfo.isEmpty()) + maDocFile = ""; return 0; } @@ -1359,7 +1354,7 @@ IMPL_LINK_NOARG(AssistentDlgImpl, UpdateUserDataHdl) // ******************************************************************** // ******************************************************************** -void AssistentDlgImpl::SelectTemplateRegion( const String& rRegion ) +void AssistentDlgImpl::SelectTemplateRegion( const OUString& rRegion ) { mpPage1TemplateLB->Clear(); std::vector::iterator I; @@ -1383,10 +1378,10 @@ void AssistentDlgImpl::SelectTemplateRegion( const String& rRegion ) } } -void AssistentDlgImpl::SelectLayoutRegion( const String& rRegion ) +void AssistentDlgImpl::SelectLayoutRegion( const OUString& rRegion ) { mpPage2LayoutLB->Clear(); - mpPage2LayoutLB->InsertEntry(String(SdResId(STR_WIZARD_ORIGINAL))); + mpPage2LayoutLB->InsertEntry(SD_RESSTR(STR_WIZARD_ORIGINAL)); std::vector::iterator I; for (I=maPresentList.begin(); I!=maPresentList.end(); ++I) { @@ -1406,23 +1401,23 @@ void AssistentDlgImpl::SelectLayoutRegion( const String& rRegion ) void AssistentDlgImpl::UpdateUserData() { - String aTopic = mpPage4AskTopicEDT->GetText(); - String aName = mpPage4AskNameEDT->GetText(); - String aInfo = mpPage4AskInfoEDT->GetText(); + OUString aTopic = mpPage4AskTopicEDT->GetText(); + OUString aName = mpPage4AskNameEDT->GetText(); + OUString aInfo = mpPage4AskInfoEDT->GetText(); SfxObjectShell* pShell = xDocShell; DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; SdPage* pPage = pDoc?pDoc->GetSdPage(0, PK_STANDARD):NULL; - if(pPage && ( aTopic.Len() != 0 || aName.Len() != 0 || aInfo.Len() != 0 ) ) + if (pPage && (!aTopic.isEmpty() || !aName.isEmpty() || !aInfo.isEmpty())) { if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE ) pPage->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True); SdrTextObj* pObj; - if( aTopic.Len() ) + if (!aTopic.isEmpty()) { pObj = dynamic_cast( pPage->GetPresObj( PRESOBJ_TITLE ) ); if( pObj ) @@ -1434,12 +1429,12 @@ void AssistentDlgImpl::UpdateUserData() } - if ( aName.Len() || aInfo.Len() ) + if (!aName.isEmpty() || !aInfo.isEmpty()) { - String aStrTmp( aName ); - if( aName.Len() ) - aStrTmp.AppendAscii( "\n\n" ); - aStrTmp.Append( aInfo ); + OUString aStrTmp( aName ); + if (!aName.isEmpty()) + aStrTmp += "\n\n"; + aStrTmp += aInfo; pObj = dynamic_cast( pPage->GetPresObj( PRESOBJ_OUTLINE ) ); if( pObj ) @@ -1500,18 +1495,17 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) return; } - String aDocFile = GetDocFileName(); - String aLayoutFile = GetLayoutFileName(); - String aEmptyStr; + OUString aDocFile = GetDocFileName(); + OUString aLayoutFile = GetLayoutFileName(); SfxApplication *pSfxApp = SFX_APP(); sal_uLong lErr; - sal_Bool bChangeMaster = aLayoutFile.Len() != 0; + sal_Bool bChangeMaster = !aLayoutFile.isEmpty(); - if( aDocFile.Len() == 0 ) + if (aDocFile.isEmpty()) { - if( !xDocShell.Is() || maDocFile.Len() != 0 || - (maDocFile.Len() == 0 && maLayoutFile.Len() != 0 && aLayoutFile.Len() == 0 )) + if (!xDocShell.Is() || !maDocFile.isEmpty() || + (maDocFile.isEmpty() && !maLayoutFile.isEmpty() && aLayoutFile.isEmpty())) { CloseDocShell(); @@ -1527,7 +1521,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) mbUserDataDirty = sal_True; } else - bChangeMaster = (aLayoutFile.Len() != 0) && (maLayoutFile != aLayoutFile); + bChangeMaster = !aLayoutFile.isEmpty() && (maLayoutFile != aLayoutFile); } else if( aDocFile == maDocFile && ( mbDocPreview == bDocPreview || bDocPreview ) ) { @@ -1568,7 +1562,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) { SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() ); aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile )); - aReq.AppendItem( SfxStringItem( SID_REFERER, aEmptyStr ) ); + aReq.AppendItem( SfxStringItem( SID_REFERER, OUString() ) ); aReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) ); aReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) ); aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) ); @@ -1622,7 +1616,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) if( pDoc && pLayoutDoc ) { - pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, sal_True, sal_False ); + pDoc->SetMasterPage(0, OUString(), pLayoutDoc, sal_True, sal_False ); } else { @@ -1646,7 +1640,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) mbPreviewUpdating = sal_False; } -void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPath ) +void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const OUString& rPath ) { if(xDoc.Is()) { @@ -1687,7 +1681,7 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPat } } -void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const String& rPath ) +void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const OUString& rPath ) { uno::Sequence < beans::NamedValue > aEncryptionData( GetPassword( rPath ) ); @@ -1695,7 +1689,7 @@ void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const String& rPath ) pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) ); } -uno::Sequence < beans::NamedValue > AssistentDlgImpl::GetPassword( const String rPath ) +uno::Sequence < beans::NamedValue > AssistentDlgImpl::GetPassword( const OUString& rPath ) { for ( size_t i = 0, n = maPasswordList.size(); i < n; ++i ) { @@ -1711,22 +1705,22 @@ void AssistentDlgImpl::DeletePasswords() maPasswordList.clear(); } -sal_Bool AssistentDlgImpl::IsOwnFormat( const String& rPath ) +bool AssistentDlgImpl::IsOwnFormat( const OUString& rPath ) { INetURLObject aURL( rPath ); - String aExt( aURL.GetFileExtension() ); + OUString aExt( aURL.GetFileExtension() ); DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - return !aExt.EqualsIgnoreCaseAscii( "ppt" ); + return !aExt.equalsIgnoreAsciiCase( "ppt" ); } -String AssistentDlgImpl::GetUiTextForCommand (const OUString& sCommandURL) +OUString AssistentDlgImpl::GetUiTextForCommand (const OUString& sCommandURL) { - String sLabel; + OUString sLabel; Reference xUICommandLabels; try @@ -1847,8 +1841,8 @@ IMPL_LINK_NOARG(AssistentDlg, FinishHdl) if( GetStartType() == ST_OPEN ) { //if we do not have a file here asked for one before ending the dialog - String aFileToOpen = GetDocPath(); - if(aFileToOpen.Len() == 0) + OUString aFileToOpen = GetDocPath(); + if (aFileToOpen.isEmpty()) { sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, 0, @@ -1856,7 +1850,7 @@ IMPL_LINK_NOARG(AssistentDlg, FinishHdl) if ( aFileDlg.Execute() == ERRCODE_NONE ) aFileToOpen = aFileDlg.GetPath(); - if( aFileToOpen.Len() == 0) + if (aFileToOpen.isEmpty()) return 1; else { @@ -1865,7 +1859,7 @@ IMPL_LINK_NOARG(AssistentDlg, FinishHdl) INetURLObject aURL; aURL.SetSmartURL(aFileToOpen); - mpImpl->maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE ))); + mpImpl->maOpenFilesList.push_back (aURL.GetMainURL(INetURLObject::NO_DECODE)); sal_uInt16 nNewPos = mpImpl->mpPage1OpenLB->InsertEntry(aURL.getName()); mpImpl->mpPage1OpenLB->SelectEntryPos(nNewPos); } @@ -1915,7 +1909,7 @@ StartType AssistentDlg::GetStartType() const return mpImpl->GetStartType(); } -String AssistentDlg::GetDocPath() const +OUString AssistentDlg::GetDocPath() const { return mpImpl->GetDocFileName(); } @@ -1927,8 +1921,8 @@ sal_Bool AssistentDlg::GetStartWithFlag() const sal_Bool AssistentDlg::IsDocEmpty() const { - return mpImpl->GetDocFileName().Len() == 0 && - mpImpl->GetLayoutFileName().Len() == 0; + return mpImpl->GetDocFileName().isEmpty() && + mpImpl->GetLayoutFileName().isEmpty(); } uno::Sequence< beans::NamedValue > AssistentDlg::GetPassword() diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 0103a32b7ac2..24ef7403c35a 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -212,7 +212,7 @@ StartType AbstractAssistentDlg_Impl::GetStartType() const { return pDlg->GetStartType(); } -String AbstractAssistentDlg_Impl::GetDocPath() const +OUString AbstractAssistentDlg_Impl::GetDocPath() const { return pDlg->GetDocPath(); } diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index bd44d54e5022..d4d2049ce2e8 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -128,7 +128,7 @@ class AbstractAssistentDlg_Impl : public AbstractAssistentDlg virtual OutputType GetOutputMedium() const; virtual sal_Bool IsSummary() const; virtual StartType GetStartType() const; - virtual String GetDocPath() const; + virtual OUString GetDocPath() const; virtual sal_Bool GetStartWithFlag() const; virtual sal_Bool IsDocEmpty() const; virtual com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > GetPassword(); diff --git a/sd/source/ui/inc/dlgass.hxx b/sd/source/ui/inc/dlgass.hxx index 5b7f487ba3c8..5625d9d98af0 100644 --- a/sd/source/ui/inc/dlgass.hxx +++ b/sd/source/ui/inc/dlgass.hxx @@ -50,7 +50,7 @@ public: OutputType GetOutputMedium() const; sal_Bool IsSummary() const; StartType GetStartType() const; - String GetDocPath() const; + OUString GetDocPath() const; sal_Bool GetStartWithFlag() const; sal_Bool IsDocEmpty() const; -- cgit