diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-04-07 07:51:01 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-04-07 07:53:41 -0300 |
commit | 09d46a68510a14862226f48503bbef798b8426e9 (patch) | |
tree | d1b105fe190528dc2877471a1cb9cf18d1dffa87 /sd | |
parent | 6a7cb5088bc162c3bf2cadf6cd9e5b03865106e6 (diff) |
More refactoring at OUString explicit constructors in sd
Remove some explicit OUString constructors in sd/.../ui
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 38 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 24 |
3 files changed, 35 insertions, 40 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 99b0ec3b1ab2..8a51c20e9ead 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -419,7 +419,7 @@ namespace { if( mbImpress ) { vcl::PrinterOptionsHelper::UIControlOptions aPrintOpt; - aPrintOpt.maGroupHint = rtl::OUString( "JobPage" ); + aPrintOpt.maGroupHint = "JobPage" ; AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( String( SdResId(_STR_IMPRESS_PRINT_UI_PRINT_GROUP) ), "", @@ -427,7 +427,7 @@ namespace { ); aHelpIds.realloc( 1 ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ; AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( String( SdResId( _STR_IMPRESS_PRINT_UI_CONTENT ) ), aHelpIds, @@ -438,7 +438,7 @@ namespace { ) ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ; vcl::PrinterOptionsHelper::UIControlOptions aContentOpt( "PageContentType" , 1 ); AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( String( SdResId( _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE ) ), @@ -452,7 +452,7 @@ namespace { ) ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ; vcl::PrinterOptionsHelper::UIControlOptions aSlidesPerPageOpt( "SlidesPerPage" , -1, sal_True ); AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( String( SdResId( _STR_IMPRESS_PRINT_UI_ORDER ) ), @@ -514,9 +514,9 @@ namespace { String( SdResId(_STR_IMPRESS_PRINT_UI_QUALITY) ), "" ) ); aHelpIds.realloc( 3 ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ); - aHelpIds[1] = rtl::OUString( ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ); - aHelpIds[2] = rtl::OUString( ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ; + aHelpIds[1] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ; + aHelpIds[2] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ; AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( "", aHelpIds, @@ -530,10 +530,10 @@ namespace { String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS) ), "" ) ); aHelpIds.realloc( 4 ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:0" ); - aHelpIds[1] = rtl::OUString( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ); - aHelpIds[2] = rtl::OUString( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ); - aHelpIds[3] = rtl::OUString( ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:0" ; + aHelpIds[1] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ; + aHelpIds[2] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ; + aHelpIds[3] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ; if( mbImpress ) { // FIXME: additional dependency on PrintProspect = false @@ -567,7 +567,7 @@ namespace { } vcl::PrinterOptionsHelper::UIControlOptions aBrochureOpt; - aBrochureOpt.maGroupHint = OUString( "LayoutPage" ); + aBrochureOpt.maGroupHint = "LayoutPage" ; AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_SIDES) ), "", aBrochureOpt ) ); @@ -584,9 +584,9 @@ namespace { vcl::PrinterOptionsHelper::UIControlOptions aIncludeOpt( "PrintProspect" , -1, sal_False ); - aIncludeOpt.maGroupHint = OUString( "LayoutPage" ); + aIncludeOpt.maGroupHint = "LayoutPage" ; aHelpIds.realloc( 1 ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ; AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE) ), aHelpIds, @@ -601,7 +601,7 @@ namespace { // paper tray (on options page) vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt; - aPaperTrayOpt.maGroupHint = rtl::OUString( "OptionsPageOptGroup" ); + aPaperTrayOpt.maGroupHint = "OptionsPageOptGroup" ; AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY) ), ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" , @@ -613,7 +613,7 @@ namespace { // print range selection vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.mbInternalOnly = sal_True; - aPrintRangeOpt.maGroupHint = rtl::OUString( "PrintRange" ); + aPrintRangeOpt.maGroupHint = "PrintRange" ; AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( String( SdResId( _STR_IMPRESS_PRINT_UI_PAGE_RANGE ) ), "", @@ -623,9 +623,9 @@ namespace { // create a choice for the content to create rtl::OUString aPrintRangeName( "PrintContent" ); aHelpIds.realloc( 3 ); - aHelpIds[0] = rtl::OUString( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ); - aHelpIds[1] = rtl::OUString( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ); - aHelpIds[2] = rtl::OUString( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ); + aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ; + aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ; + aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ; AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( "", aHelpIds, aPrintRangeName, diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 339e808e9163..58d434ce6654 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -975,13 +975,11 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, svt::EmbeddedObjectRef::TryRunningState( xObj ); uno::Reference< beans::XPropertySet > xProps( xObj->getComponent(), uno::UNO_QUERY ); if ( xProps.is() && - ( xProps->getPropertyValue( ::rtl::OUString( "DisableDataTableDialog" ) ) >>= bDisableDataTableDialog ) && + ( xProps->getPropertyValue( "DisableDataTableDialog" ) >>= bDisableDataTableDialog ) && bDisableDataTableDialog ) { - xProps->setPropertyValue( ::rtl::OUString( "DisableDataTableDialog" ), - uno::makeAny( sal_False ) ); - xProps->setPropertyValue( ::rtl::OUString( "DisableComplexChartTypes" ), - uno::makeAny( sal_False ) ); + xProps->setPropertyValue( "DisableDataTableDialog" , uno::makeAny( sal_False ) ); + xProps->setPropertyValue( "DisableComplexChartTypes" , uno::makeAny( sal_False ) ); uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY ); if ( xModifiable.is() ) { @@ -1022,13 +1020,12 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, { uno::Reference< embed::XStorage > xTmpStor = ::comphelper::OStorageHelper::GetTemporaryStorage(); uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator( - ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString( "com.sun.star.embed.MSOLEObjectSystemCreator") ), + ::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.embed.MSOLEObjectSystemCreator"), uno::UNO_QUERY_THROW ); embed::InsertedObjectInfo aInfo = xClipboardCreator->createInstanceInitFromClipboard( xTmpStor, - ::rtl::OUString( "DummyName" ), + "DummyName" , uno::Sequence< beans::PropertyValue >() ); // TODO/LATER: in future InsertedObjectInfo will be used to get container related information diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 87c68397814f..afd7ac04bf98 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -828,6 +828,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) SfxViewShell* pViewShell = GetViewShell(); OSL_ASSERT (pViewShell!=NULL); bool bChangeDefaultsForChart = false; + rtl::OUString aName; uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef(); if ( !xObj.is() ) @@ -835,11 +836,11 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) /********************************************************** * Leeres OLE-Objekt mit OLE-Objekt versehen **********************************************************/ - String aName = pObj->GetProgName(); + aName = pObj->GetProgName(); ::rtl::OUString aObjName; SvGlobalName aClass; - if( aName.EqualsAscii( "StarChart" ) || aName.EqualsAscii("StarOrg") ) + if( aName == "StarChart" || aName == "StarOrg" ) { if( SvtModuleOptions().IsChart() ) { @@ -847,12 +848,12 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) bChangeDefaultsForChart = true; } } - else if( aName.EqualsAscii( "StarCalc" )) + else if( aName == "StarCalc" ) { if( SvtModuleOptions().IsCalc() ) aClass = SvGlobalName( SO3_SC_CLASSID ); } - else if( aName.EqualsAscii( "StarMath" )) + else if( aName == "StarMath" ) { if( SvtModuleOptions().IsMath() ) aClass = SvGlobalName( SO3_SM_CLASSID ); @@ -863,7 +864,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) if( !xObj.is() ) { - aName = String(); + aName = ""; // Dialog "OLE-Objekt einfuegen" aufrufen GetDocSh()->SetWaitCursor( sal_False ); @@ -891,7 +892,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) /****************************************************** * Das leere OLE-Objekt bekommt ein neues IPObj ******************************************************/ - if (aName.Len()) + if (!aName.isEmpty()) { pObj->SetObjRef(xObj); pObj->SetName(aObjName); @@ -1108,9 +1109,8 @@ void ViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < sal_uInt16 nViewID (IMPRESS_FACTORY_ID); if (GetViewShellBase().GetMainViewShell().get() != NULL) nViewID = GetViewShellBase().GetMainViewShell()->mpImpl->GetViewId(); - rSequence[nIndex].Name = rtl::OUString ( - RTL_CONSTASCII_USTRINGPARAM( sUNO_View_ViewId ) ); - rtl::OUStringBuffer sBuffer ( rtl::OUString( "view" ) ); + rSequence[nIndex].Name = rtl::OUString( sUNO_View_ViewId ); + rtl::OUStringBuffer sBuffer( "view" ); sBuffer.append( static_cast<sal_Int32>(nViewID)); rSequence[nIndex].Value <<= sBuffer.makeStringAndClear(); @@ -1186,12 +1186,10 @@ void ViewShell::AdaptDefaultsForChart( // set background to transparent (none) uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground()); if( xPageProp.is()) - xPageProp->setPropertyValue( ::rtl::OUString( "FillStyle" ), - uno::makeAny( drawing::FillStyle_NONE )); + xPageProp->setPropertyValue( "FillStyle" , uno::makeAny( drawing::FillStyle_NONE )); // set no border if( xPageProp.is()) - xPageProp->setPropertyValue( ::rtl::OUString( "LineStyle" ), - uno::makeAny( drawing::LineStyle_NONE )); + xPageProp->setPropertyValue( "LineStyle" , uno::makeAny( drawing::LineStyle_NONE )); } catch( const uno::Exception & ) { |