diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-25 21:15:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-26 12:18:08 +0100 |
commit | 8a539e49c4fba49bbd810a90747e1993e69a9942 (patch) | |
tree | 77b2c2c6c132c1d2ecc7e3433b9b0a77d1bd424d | |
parent | ad5c3b475306241fac55058aa390053f596f83d6 (diff) |
ditch some UniStrings and intermediate temporaries
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 6 | ||||
-rw-r--r-- | framework/source/services/mediatypedetectionhelper.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 4 | ||||
-rw-r--r-- | tools/bootstrp/cppdep.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/jobset.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/mnemonic.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/generic/app/i18n_ic.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.hxx | 2 |
12 files changed, 38 insertions, 34 deletions
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index c68923c24079..bd30c2b78ba3 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -2179,7 +2179,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property HANDLE_SQL_ERRORS( xParser->setOrder(::rtl::OUString()); xParser->appendOrderByColumn(xField, bSortUp), bParserSuccess, - UniString(ModuleRes(SBA_BROWSER_SETTING_ORDER)), + ResId::toString(ModuleRes(SBA_BROWSER_SETTING_ORDER)), "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !" ) @@ -2251,7 +2251,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property HANDLE_SQL_ERRORS( xParser->appendHavingClauseByColumn(xField,sal_True,nOp), bParserSuccess, - UniString(ModuleRes(SBA_BROWSER_SETTING_FILTER)), + ResId::toString(ModuleRes(SBA_BROWSER_SETTING_FILTER)), "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !" ) } @@ -2260,7 +2260,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property HANDLE_SQL_ERRORS( xParser->appendFilterByColumn(xField,sal_True,nOp), bParserSuccess, - UniString(ModuleRes(SBA_BROWSER_SETTING_FILTER)), + ResId::toString(ModuleRes(SBA_BROWSER_SETTING_FILTER)), "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !" ) } diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx index 3848cf0b5465..ef9e3a219bca 100644 --- a/framework/source/services/mediatypedetectionhelper.cxx +++ b/framework/source/services/mediatypedetectionhelper.cxx @@ -95,8 +95,8 @@ sal_Bool SAL_CALL MediaTypeDetectionHelper::mapStrings( OUString& rUrl = rSeq[i]; INetContentType eType = INetContentTypes::GetContentTypeFromURL( rUrl ); - UniString aType( INetContentTypes::GetContentType( eType ) ); - if( aType.Len() ) + rtl::OUString aType( INetContentTypes::GetContentType( eType ) ); + if (!aType.isEmpty()) { rUrl = aType; bModified = sal_True; diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 6ce9cf2561c7..61e4c1610228 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -756,8 +756,8 @@ void OReportDefinition::init() m_pImpl->m_pReportModel->SetScaleUnit( MAP_100TH_MM ); SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin(); rAdmin.NewStandardLayer(RPT_LAYER_FRONT); - rAdmin.NewLayer(UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "back" ) ), RPT_LAYER_BACK ); - rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), RPT_LAYER_HIDDEN ); + rAdmin.NewLayer(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("back")), RPT_LAYER_BACK); + rAdmin.NewLayer(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenLayer")), RPT_LAYER_HIDDEN); m_pImpl->m_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex ); m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() ); diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx index 50165d136798..c5677cde2869 100644 --- a/tools/bootstrp/cppdep.cxx +++ b/tools/bootstrp/cppdep.cxx @@ -76,7 +76,7 @@ sal_Bool CppDep::Search(const rtl::OString &rFileName) SvFileStream aFile; rtl::OString aReadLine; - UniString suFileName(rtl::OStringToOUString(rFileName, osl_getThreadTextEncoding())); + rtl::OUString suFileName(rtl::OStringToOUString(rFileName, osl_getThreadTextEncoding())); aFile.Open( suFileName, STREAM_READ ); while ( aFile.ReadLine( aReadLine )) diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 86a9b4816684..ad33e824736f 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1167,7 +1167,7 @@ Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const // Breite if ( nColumns ) - aSz.Width() = nColumns * GetTextWidth( UniString( 'X' ) ); + aSz.Width() = nColumns * GetTextWidth(rtl::OUString(static_cast<sal_Unicode>('X'))); else aSz.Width() = aMinSz.Width(); @@ -1190,7 +1190,7 @@ Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - long nCharWidth = GetTextWidth( UniString( 'x' ) ); + long nCharWidth = GetTextWidth(rtl::OUString(static_cast<sal_Unicode>('x'))); if ( !IsDropDownBox() ) { Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel(); diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 9d2f7aaba3c8..c7729c43af58 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1424,7 +1424,7 @@ Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - long nCharWidth = GetTextWidth( UniString( 'x' ) ); + long nCharWidth = GetTextWidth( rtl::OUString(static_cast<sal_Unicode>('x')) ); if ( !IsDropDownBox() ) { Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel(); diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 2415500a905a..dfe78b2e1330 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -306,8 +306,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup ) rJobSetup.mpData = new ImplJobSetup; ImplJobSetup* pJobData = rJobSetup.mpData; - pJobData->maPrinterName = UniString( pData->cPrinterName, aStreamEncoding ); - pJobData->maDriver = UniString( pData->cDriverName, aStreamEncoding ); + pJobData->maPrinterName = UniString(pData->cPrinterName, aStreamEncoding); + pJobData->maDriver = UniString(pData->cDriverName, aStreamEncoding); // Sind es unsere neuen JobSetup-Daten? if ( nSystem == JOBSET_FILE364_SYSTEM || diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx index 21e7cbdf8850..daeae8ba3b04 100644 --- a/vcl/source/window/mnemonic.cxx +++ b/vcl/source/window/mnemonic.cxx @@ -295,10 +295,9 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey ) if ( maMnemonics[nMnemonicIndex] ) { maMnemonics[nMnemonicIndex] = 0; - UniString aStr( '(' ); - aStr += MNEMONIC_CHAR; - aStr += c; - aStr += ')'; + rtl::OUString aStr = rtl::OUStringBuffer(). + append('(').append(MNEMONIC_CHAR).append(c). + append(')').makeStringAndClear(); nIndex = rKey.Len(); if( nIndex >= 2 ) { diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index fad955c0a238..0ee7073ef96f 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -577,7 +577,7 @@ SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, sal_Size nLength) aTextEvent.mnTime = 0; aTextEvent.mpTextAttr = 0; aTextEvent.mnCursorPos = nLength; - aTextEvent.maText = UniString(pText, nLength); + aTextEvent.maText = rtl::OUString(pText, nLength); aTextEvent.mnCursorFlags = 0; aTextEvent.mnDeltaStart = 0; aTextEvent.mbOnlyCursor = False; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8d8187381645..5ba7ddcd2d51 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2404,10 +2404,9 @@ void DomainMapper_Impl::handleToc if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue )) { bFromOutline = true; - UniString sParam( sValue ); - xub_StrLen nIndex = 0; - sParam.GetToken( 0, '-', nIndex ); - nMaxLevel = sal_Int16( sParam.Copy( nIndex ).ToInt32( ) ); + sal_Int32 nIndex = 0; + sValue.getToken( 0, '-', nIndex ); + nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? sValue.copy(nIndex).toInt32() : 0); } // \p Defines the separator between the table entry and its page number if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue )) diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 2d65bbb46b66..780917fe2e62 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -1284,15 +1284,23 @@ void SdXMLStylesContext::EndElement() // void SdXMLStylesContext::SetMasterPageStyles(SdXMLMasterPageContext& rMaster) const { - UniString sPrefix(rMaster.GetDisplayName()); - sPrefix += sal_Unicode('-'); + const uno::Reference<container::XNameAccess>& rStyleFamilies = + GetSdImport().GetLocalDocStyleFamilies(); - if(GetSdImport().GetLocalDocStyleFamilies().is() && GetSdImport().GetLocalDocStyleFamilies()->hasByName(rMaster.GetDisplayName())) try + if (!rStyleFamilies.is()) + return; + + if (!rStyleFamilies->hasByName(rMaster.GetDisplayName())) + return; + + try { - uno::Reference< container::XNameAccess > xMasterPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName(rMaster.GetDisplayName()), UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xMasterPageStyles( rStyleFamilies->getByName(rMaster.GetDisplayName()), UNO_QUERY_THROW ); + rtl::OUString sPrefix(rMaster.GetDisplayName()); + sPrefix += rtl::OUString(static_cast<sal_Unicode>('-')); ImpSetGraphicStyles(xMasterPageStyles, XML_STYLE_FAMILY_SD_PRESENTATION_ID, sPrefix); } - catch( uno::Exception& ) + catch (const uno::Exception&) { OSL_FAIL( "xmloff::SdXMLStylesContext::SetMasterPageStyles(), exception caught!" ); } @@ -1309,8 +1317,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles() const const OUString sGraphicStyleName(OUString(RTL_CONSTASCII_USTRINGPARAM("graphics"))); uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName(sGraphicStyleName), uno::UNO_QUERY_THROW ); - UniString aPrefix; - ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, aPrefix); + ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, rtl::OUString()); } catch( uno::Exception& ) { @@ -1325,8 +1332,7 @@ void SdXMLStylesContext::ImpSetCellStyles() const const OUString sCellStyleName(OUString(RTL_CONSTASCII_USTRINGPARAM("cell"))); uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName(sCellStyleName), uno::UNO_QUERY_THROW ); - UniString aPrefix; - ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_TABLE_CELL, aPrefix); + ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_TABLE_CELL, rtl::OUString()); } catch( uno::Exception& ) { @@ -1337,9 +1343,9 @@ void SdXMLStylesContext::ImpSetCellStyles() const ////////////////////////////////////////////////////////////////////////////// // help function used by ImpSetGraphicStyles() and ImpSetMasterPageStyles() // -void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAccess >& xPageStyles, sal_uInt16 nFamily, const UniString& rPrefix) const +void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAccess >& xPageStyles, sal_uInt16 nFamily, const rtl::OUString& rPrefix) const { - xub_StrLen nPrefLen(rPrefix.Len()); + sal_Int32 nPrefLen(rPrefix.getLength()); sal_uInt32 a; diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index fc8cfcf25142..f166c89b0779 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -213,7 +213,7 @@ class SdXMLStylesContext : public SvXMLStylesContext void ImpSetGraphicStyles() const; void ImpSetCellStyles() const; void ImpSetGraphicStyles( com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xPageStyles, - sal_uInt16 nFamily, const UniString& rPrefix) const; + sal_uInt16 nFamily, const rtl::OUString& rPrefix) const; protected: virtual SvXMLStyleContext* CreateStyleChildContext( |