diff options
26 files changed, 713 insertions, 730 deletions
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index 097b9aa2e54a..b675a6435197 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -138,8 +138,8 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert throw uno::RuntimeException(); sal_Bool bSuccess = false; - String aNameStr(aPropertyName); - if ( aNameStr.EqualsAscii( SC_UNONAME_ADDRESS ) ) + OUString aNameStr(aPropertyName); + if ( aNameStr.equalsAscii( SC_UNONAME_ADDRESS ) ) { // read the cell/range address from API struct if ( bIsRange ) @@ -161,7 +161,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert } } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_REFSHEET ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_REFSHEET ) ) { // set the reference sheet sal_Int32 nIntVal = 0; @@ -171,38 +171,38 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert bSuccess = sal_True; } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_UIREPR ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_UIREPR ) ) { // parse the UI representation string OUString sRepresentation; if (aValue >>= sRepresentation) { - String aUIString = sRepresentation; + OUString aUIString = sRepresentation; bSuccess = ParseUIString( aUIString ); } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_PERSREPR ) || aNameStr.equalsAscii( SC_UNONAME_XLA1REPR ) ) { - ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ? + ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.equalsAscii( SC_UNONAME_XLA1REPR ) ? ::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO; // parse the file format string OUString sRepresentation; if (aValue >>= sRepresentation) { - String aUIString(sRepresentation); + OUString aUIString(sRepresentation); // cell or range: strip a single "." at the start - if ( aUIString.GetChar(0) == (sal_Unicode) '.' ) - aUIString.Erase( 0, 1 ); + if ( aUIString[0]== (sal_Unicode) '.' ) + aUIString = aUIString.copy( 1 ); if ( bIsRange ) { // range: also strip a "." after the last colon sal_Int32 nColon = OUString(aUIString).lastIndexOf( (sal_Unicode) ':' ); - if ( nColon >= 0 && nColon < aUIString.Len() - 1 && - aUIString.GetChar((xub_StrLen)nColon+1) == (sal_Unicode) '.' ) - aUIString.Erase( (xub_StrLen)nColon+1, 1 ); + if ( nColon >= 0 && nColon < aUIString.getLength() - 1 && + aUIString[nColon+1] == '.' ) + aUIString = aUIString.replaceAt( nColon+1, 1, "" ); } // parse the rest like a UI string @@ -226,8 +226,8 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro ScDocument* pDoc = pDocShell->GetDocument(); uno::Any aRet; - String aNameStr(aPropertyName); - if ( aNameStr.EqualsAscii( SC_UNONAME_ADDRESS ) ) + OUString aNameStr(aPropertyName); + if ( aNameStr.equalsAscii( SC_UNONAME_ADDRESS ) ) { if ( bIsRange ) { @@ -242,11 +242,11 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro aRet <<= aCellAddress; } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_REFSHEET ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_REFSHEET ) ) { aRet <<= nRefSheet; } - else if ( aNameStr.EqualsAscii( SC_UNONAME_UIREPR ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_UIREPR ) ) { // generate UI representation string - include sheet only if different from ref sheet OUString aFormatStr; @@ -259,22 +259,22 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro aFormatStr = aRange.aStart.Format(nFlags, pDoc); aRet <<= aFormatStr; } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) + else if ( aNameStr.equalsAscii( SC_UNONAME_PERSREPR ) || aNameStr.equalsAscii( SC_UNONAME_XLA1REPR ) ) { - ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ? + ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.equalsAscii( SC_UNONAME_XLA1REPR ) ? ::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO; // generate file format string - always include sheet - String aFormatStr(aRange.aStart.Format(SCA_VALID | SCA_TAB_3D, pDoc, eConv)); + OUString aFormatStr(aRange.aStart.Format(SCA_VALID | SCA_TAB_3D, pDoc, eConv)); if ( bIsRange ) { // manually concatenate range so both parts always have the sheet name - aFormatStr.Append( (sal_Unicode) ':' ); + aFormatStr += ":"; sal_uInt16 nFlags = SCA_VALID; if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 ) nFlags |= SCA_TAB_3D; OUString aSecond(aRange.aEnd.Format(nFlags, pDoc, eConv)); - aFormatStr.Append( aSecond ); + aFormatStr += aSecond ; } aRet <<= OUString( aFormatStr ); } @@ -296,8 +296,8 @@ OUString SAL_CALL ScAddressConversionObj::getImplementationName() throw(uno::Run sal_Bool SAL_CALL ScAddressConversionObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( bIsRange ? SC_SERVICENAME_RANGEADDRESS + OUString aServiceStr( rServiceName ); + return aServiceStr.equalsAscii( bIsRange ? SC_SERVICENAME_RANGEADDRESS : SC_SERVICENAME_CELLADDRESS ); } diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index 091661cddb2e..91e960d4709d 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -218,7 +218,7 @@ ScAutoFormatObj* ScAutoFormatsObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName) { - String aString(aName); + OUString aString(aName); sal_uInt16 nIndex; if (lcl_FindAutoFormatIndex( *ScGlobal::GetOrCreateAutoFormat(), aString, nIndex )) @@ -241,7 +241,7 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno:: ScAutoFormatObj* pFormatObj = ScAutoFormatObj::getImplementation( xInterface ); if ( pFormatObj && !pFormatObj->IsInserted() ) // noch nicht eingefuegt? { - String aNameStr(aName); + OUString aNameStr(aName); ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); sal_uInt16 nDummy; @@ -385,7 +385,7 @@ sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const OUString& aName ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aName); + OUString aString(aName); sal_uInt16 nDummy; return lcl_FindAutoFormatIndex( *ScGlobal::GetOrCreateAutoFormat(), aString, nDummy ); @@ -533,7 +533,7 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aNewString(aNewName); + OUString aNewString(aNewName); ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); sal_uInt16 nDummy; @@ -594,19 +594,19 @@ void SAL_CALL ScAutoFormatObj::setPropertyValue( ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex); OSL_ENSURE(pData,"AutoFormat Daten nicht da"); - String aPropString(aPropertyName); + OUString aPropString(aPropertyName); sal_Bool bBool = sal_Bool(); - if (aPropString.EqualsAscii( SC_UNONAME_INCBACK ) && (aValue >>= bBool)) + if (aPropString.equalsAscii( SC_UNONAME_INCBACK ) && (aValue >>= bBool)) pData->SetIncludeBackground( bBool ); - else if (aPropString.EqualsAscii( SC_UNONAME_INCBORD ) && (aValue >>= bBool)) + else if (aPropString.equalsAscii( SC_UNONAME_INCBORD ) && (aValue >>= bBool)) pData->SetIncludeFrame( bBool ); - else if (aPropString.EqualsAscii( SC_UNONAME_INCFONT ) && (aValue >>= bBool)) + else if (aPropString.equalsAscii( SC_UNONAME_INCFONT ) && (aValue >>= bBool)) pData->SetIncludeFont( bBool ); - else if (aPropString.EqualsAscii( SC_UNONAME_INCJUST ) && (aValue >>= bBool)) + else if (aPropString.equalsAscii( SC_UNONAME_INCJUST ) && (aValue >>= bBool)) pData->SetIncludeJustify( bBool ); - else if (aPropString.EqualsAscii( SC_UNONAME_INCNUM ) && (aValue >>= bBool)) + else if (aPropString.equalsAscii( SC_UNONAME_INCNUM ) && (aValue >>= bBool)) pData->SetIncludeValueFormat( bBool ); - else if (aPropString.EqualsAscii( SC_UNONAME_INCWIDTH ) && (aValue >>= bBool)) + else if (aPropString.equalsAscii( SC_UNONAME_INCWIDTH ) && (aValue >>= bBool)) pData->SetIncludeWidthHeight( bBool ); // else Fehler @@ -632,18 +632,17 @@ uno::Any SAL_CALL ScAutoFormatObj::getPropertyValue( const OUString& aPropertyNa sal_Bool bValue; sal_Bool bError = false; - String aPropString(aPropertyName); - if (aPropString.EqualsAscii( SC_UNONAME_INCBACK )) + if (aPropertyName.equalsAscii( SC_UNONAME_INCBACK )) bValue = pData->GetIncludeBackground(); - else if (aPropString.EqualsAscii( SC_UNONAME_INCBORD )) + else if (aPropertyName.equalsAscii( SC_UNONAME_INCBORD )) bValue = pData->GetIncludeFrame(); - else if (aPropString.EqualsAscii( SC_UNONAME_INCFONT )) + else if (aPropertyName.equalsAscii( SC_UNONAME_INCFONT )) bValue = pData->GetIncludeFont(); - else if (aPropString.EqualsAscii( SC_UNONAME_INCJUST )) + else if (aPropertyName.equalsAscii( SC_UNONAME_INCJUST )) bValue = pData->GetIncludeJustify(); - else if (aPropString.EqualsAscii( SC_UNONAME_INCNUM )) + else if (aPropertyName.equalsAscii( SC_UNONAME_INCNUM )) bValue = pData->GetIncludeValueFormat(); - else if (aPropString.EqualsAscii( SC_UNONAME_INCWIDTH )) + else if (aPropertyName.equalsAscii( SC_UNONAME_INCWIDTH )) bValue = pData->GetIncludeWidthHeight(); else bError = sal_True; // unbekannte Property diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 852c23897751..afe8288635f6 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -448,7 +448,7 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); ScModule* pScMod = SC_MOD(); ScAppOptions aAppOpt(pScMod->GetAppOptions()); @@ -457,72 +457,72 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue( sal_Bool bSaveInp = false; // print options aren't loaded until needed - if (aString.EqualsAscii( SC_UNONAME_DOAUTOCP )) + if (aString.equalsAscii( SC_UNONAME_DOAUTOCP )) { aAppOpt.SetAutoComplete( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveApp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_ENTERED )) + else if (aString.equalsAscii( SC_UNONAME_ENTERED )) { aInpOpt.SetEnterEdit( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_EXPREF )) + else if (aString.equalsAscii( SC_UNONAME_EXPREF )) { aInpOpt.SetExpandRefs( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_EXTFMT )) + else if (aString.equalsAscii( SC_UNONAME_EXTFMT )) { aInpOpt.SetExtendFormat( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_LINKUPD )) + else if (aString.equalsAscii( SC_UNONAME_LINKUPD )) { aAppOpt.SetLinkMode( (ScLkUpdMode) ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); bSaveApp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_MARKHDR )) + else if (aString.equalsAscii( SC_UNONAME_MARKHDR )) { aInpOpt.SetMarkHeader( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_MOVESEL )) + else if (aString.equalsAscii( SC_UNONAME_MOVESEL )) { aInpOpt.SetMoveSelection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_RANGEFIN )) + else if (aString.equalsAscii( SC_UNONAME_RANGEFIN )) { aInpOpt.SetRangeFinder( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_USETABCOL )) + else if (aString.equalsAscii( SC_UNONAME_USETABCOL )) { aInpOpt.SetUseTabCol( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_PRMETRICS )) + else if (aString.equalsAscii( SC_UNONAME_PRMETRICS )) { aInpOpt.SetTextWysiwyg( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_REPLWARN )) + else if (aString.equalsAscii( SC_UNONAME_REPLWARN )) { aInpOpt.SetReplaceCellsWarn( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_METRIC )) + else if (aString.equalsAscii( SC_UNONAME_METRIC )) { aAppOpt.SetAppMetric( (FieldUnit) ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); bSaveApp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_MOVEDIR )) + else if (aString.equalsAscii( SC_UNONAME_MOVEDIR )) { aInpOpt.SetMoveDir( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); bSaveInp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_SCALE )) + else if (aString.equalsAscii( SC_UNONAME_SCALE )) { short nVal = ScUnoHelpFunctions::GetInt16FromAny( aValue ); if ( nVal < 0 ) @@ -543,12 +543,12 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue( } bSaveApp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_STBFUNC )) + else if (aString.equalsAscii( SC_UNONAME_STBFUNC )) { aAppOpt.SetStatusFunc( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); bSaveApp = sal_True; } - else if (aString.EqualsAscii( SC_UNONAME_ULISTS )) + else if (aString.equalsAscii( SC_UNONAME_ULISTS )) { ScUserList* pUserList = ScGlobal::GetUserList(); uno::Sequence<OUString> aSeq; @@ -562,20 +562,20 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue( const OUString* pAry = aSeq.getConstArray(); for (sal_uInt16 i=0; i<nCount; i++) { - String aEntry = pAry[i]; + OUString aEntry = pAry[i]; ScUserListData* pData = new ScUserListData(aEntry); pUserList->push_back(pData); } bSaveApp = sal_True; // Liste wird mit den App-Optionen gespeichert } } - else if (aString.EqualsAscii( SC_UNONAME_PRALLSH )) + else if (aString.equalsAscii( SC_UNONAME_PRALLSH )) { ScPrintOptions aPrintOpt(pScMod->GetPrintOptions()); aPrintOpt.SetAllSheets( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); pScMod->SetPrintOptions( aPrintOpt ); } - else if (aString.EqualsAscii( SC_UNONAME_PREMPTY )) + else if (aString.equalsAscii( SC_UNONAME_PREMPTY )) { ScPrintOptions aPrintOpt(pScMod->GetPrintOptions()); aPrintOpt.SetSkipEmpty( !ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); // reversed @@ -594,7 +594,7 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp uno::RuntimeException) { SolarMutexGuard aGuard; - String aString = aPropertyName; + OUString aString = aPropertyName; uno::Any aRet; ScModule* pScMod = SC_MOD(); @@ -602,21 +602,21 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp ScInputOptions aInpOpt = pScMod->GetInputOptions(); // print options aren't loaded until needed - if (aString.EqualsAscii( SC_UNONAME_DOAUTOCP )) ScUnoHelpFunctions::SetBoolInAny( aRet, aAppOpt.GetAutoComplete() ); - else if (aString.EqualsAscii( SC_UNONAME_ENTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetEnterEdit() ); - else if (aString.EqualsAscii( SC_UNONAME_EXPREF )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExpandRefs() ); - else if (aString.EqualsAscii( SC_UNONAME_EXTFMT )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExtendFormat() ); - else if (aString.EqualsAscii( SC_UNONAME_LINKUPD )) aRet <<= (sal_Int16) aAppOpt.GetLinkMode(); - else if (aString.EqualsAscii( SC_UNONAME_MARKHDR )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMarkHeader() ); - else if (aString.EqualsAscii( SC_UNONAME_MOVESEL )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMoveSelection() ); - else if (aString.EqualsAscii( SC_UNONAME_RANGEFIN )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetRangeFinder() ); - else if (aString.EqualsAscii( SC_UNONAME_USETABCOL )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetUseTabCol() ); - else if (aString.EqualsAscii( SC_UNONAME_PRMETRICS )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetTextWysiwyg() ); - else if (aString.EqualsAscii( SC_UNONAME_REPLWARN )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetReplaceCellsWarn() ); - else if (aString.EqualsAscii( SC_UNONAME_METRIC )) aRet <<= (sal_Int16) aAppOpt.GetAppMetric(); - else if (aString.EqualsAscii( SC_UNONAME_MOVEDIR )) aRet <<= (sal_Int16) aInpOpt.GetMoveDir(); - else if (aString.EqualsAscii( SC_UNONAME_STBFUNC )) aRet <<= (sal_Int16) aAppOpt.GetStatusFunc(); - else if (aString.EqualsAscii( SC_UNONAME_SCALE )) + if (aString.equalsAscii( SC_UNONAME_DOAUTOCP )) ScUnoHelpFunctions::SetBoolInAny( aRet, aAppOpt.GetAutoComplete() ); + else if (aString.equalsAscii( SC_UNONAME_ENTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetEnterEdit() ); + else if (aString.equalsAscii( SC_UNONAME_EXPREF )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExpandRefs() ); + else if (aString.equalsAscii( SC_UNONAME_EXTFMT )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExtendFormat() ); + else if (aString.equalsAscii( SC_UNONAME_LINKUPD )) aRet <<= (sal_Int16) aAppOpt.GetLinkMode(); + else if (aString.equalsAscii( SC_UNONAME_MARKHDR )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMarkHeader() ); + else if (aString.equalsAscii( SC_UNONAME_MOVESEL )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMoveSelection() ); + else if (aString.equalsAscii( SC_UNONAME_RANGEFIN )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetRangeFinder() ); + else if (aString.equalsAscii( SC_UNONAME_USETABCOL )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetUseTabCol() ); + else if (aString.equalsAscii( SC_UNONAME_PRMETRICS )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetTextWysiwyg() ); + else if (aString.equalsAscii( SC_UNONAME_REPLWARN )) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetReplaceCellsWarn() ); + else if (aString.equalsAscii( SC_UNONAME_METRIC )) aRet <<= (sal_Int16) aAppOpt.GetAppMetric(); + else if (aString.equalsAscii( SC_UNONAME_MOVEDIR )) aRet <<= (sal_Int16) aInpOpt.GetMoveDir(); + else if (aString.equalsAscii( SC_UNONAME_STBFUNC )) aRet <<= (sal_Int16) aAppOpt.GetStatusFunc(); + else if (aString.equalsAscii( SC_UNONAME_SCALE )) { sal_Int16 nZoomVal = 0; switch ( aAppOpt.GetZoomType() ) @@ -632,7 +632,7 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp } aRet <<= (sal_Int16) nZoomVal; } - else if (aString.EqualsAscii( SC_UNONAME_ULISTS )) + else if (aString.equalsAscii( SC_UNONAME_ULISTS )) { ScUserList* pUserList = ScGlobal::GetUserList(); if (pUserList) @@ -642,15 +642,15 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp OUString* pAry = aSeq.getArray(); for (size_t i=0; i<nCount; ++i) { - String aEntry((*pUserList)[i]->GetString()); + OUString aEntry((*pUserList)[i]->GetString()); pAry[i] = aEntry; } aRet <<= aSeq; } } - else if (aString.EqualsAscii( SC_UNONAME_PRALLSH )) + else if (aString.equalsAscii( SC_UNONAME_PRALLSH )) ScUnoHelpFunctions::SetBoolInAny( aRet, pScMod->GetPrintOptions().GetAllSheets() ); - else if (aString.EqualsAscii( SC_UNONAME_PREMPTY )) + else if (aString.equalsAscii( SC_UNONAME_PREMPTY )) ScUnoHelpFunctions::SetBoolInAny( aRet, !pScMod->GetPrintOptions().GetSkipEmpty() ); // reversed return aRet; @@ -818,9 +818,9 @@ static void lcl_FillSequence( uno::Sequence<beans::PropertyValue>& rSequence, co { if (!rDesc.pDefArgFlags[i].bSuppress) { - String aArgName; + OUString aArgName; if (rDesc.ppDefArgNames[i]) aArgName = *rDesc.ppDefArgNames[i]; - String aArgDesc; + OUString aArgDesc; if (rDesc.ppDefArgDescs[i]) aArgDesc = *rDesc.ppDefArgDescs[i]; sheet::FunctionArgument aArgument; aArgument.Name = aArgName; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 31ecee7ed9f0..19c1e8150f2d 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -133,14 +133,14 @@ using namespace com::sun::star; class ScNamedEntry { - String aName; - ScRange aRange; + OUString aName; + ScRange aRange; public: - ScNamedEntry(const String& rN, const ScRange& rR) : + ScNamedEntry(const OUString& rN, const ScRange& rR) : aName(rN), aRange(rR) {} - const String& GetName() const { return aName; } + const OUString& GetName() const { return aName; } const ScRange& GetRange() const { return aRange; } }; @@ -1288,7 +1288,7 @@ static sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRang const OUString* pColArr = rColSeq.getConstArray(); for (long nCol=0; nCol<nCols; nCol++) { - String aText(pColArr[nCol]); + OUString aText(pColArr[nCol]); ScAddress aPos( nDocCol, nDocRow, nTab ); ScInputStringType aRes = @@ -1385,16 +1385,16 @@ static OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos, sal if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT ) { double fDummy; - String aTempString = aVal; + OUString aTempString = aVal; sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aTempString, nNumFmt, fDummy)); if ( bIsNumberFormat ) - aTempString.Insert('\'',0); - else if ( aTempString.Len() && aTempString.GetChar(0) == '\'' ) + aTempString = "'" + aTempString; + else if ( !aTempString.isEmpty() && aTempString[0] == '\'' ) { // if the string starts with a "'", add another one because setFormula // strips one (like text input, except for "text" number formats) if ( bEnglish || ( pFormatter->GetType(nNumFmt) != NUMBERFORMAT_TEXT ) ) - aTempString.Insert('\'',0); + aTempString = "'" + aTempString; } aVal = aTempString; } @@ -2009,7 +2009,7 @@ void SAL_CALL ScCellRangesBase::setPropertyToDefault( const OUString& aPropertyN bChartRowAsHdr = false; else if ( pEntry->nWID == SC_WID_UNO_CELLSTYL ) { - String aStyleName( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ) ); + OUString aStyleName( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ) ); pDocShell->GetDocFunc().ApplyStyle( *GetMarkData(), aStyleName, sal_True, sal_True ); } } @@ -2348,7 +2348,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE { OUString aStrVal; aValue >>= aStrVal; - String aString(ScStyleNameConversion::ProgrammaticToDisplayName( + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aStrVal, SFX_STYLE_FAMILY_PARA )); pDocShell->GetDocFunc().ApplyStyle( *GetMarkData(), aString, sal_True, sal_True ); } @@ -2513,7 +2513,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE break; case SC_WID_UNO_CELLSTYL: { - String aStyleName; + OUString aStyleName; const ScStyleSheet* pStyle = pDocShell->GetDocument()->GetSelectionStyle(*GetMarkData()); if (pStyle) aStyleName = pStyle->GetName(); @@ -3051,7 +3051,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const } if (!xChartRanges.Is()) // sonst Ranges direkt uebernehmen xChartRanges = new ScRangeList(aRanges); - ScChartArray aArr( pDocShell->GetDocument(), xChartRanges, String() ); + ScChartArray aArr( pDocShell->GetDocument(), xChartRanges, OUString() ); // RowAsHdr = ColHeaders und umgekehrt aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); @@ -3134,7 +3134,7 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub if ( pDocShell && xChartRanges.Is() ) { ScDocument* pDoc = pDocShell->GetDocument(); - ScChartArray aArr( pDoc, xChartRanges, String() ); + ScChartArray aArr( pDoc, xChartRanges, OUString() ); aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders const ScChartPositionMap* pPosMap = aArr.GetPositionMap(); if (pPosMap) @@ -3208,7 +3208,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions( if ( pDocShell && xChartRanges.Is() ) { ScDocument* pDoc = pDocShell->GetDocument(); - ScChartArray aArr( pDoc, xChartRanges, String() ); + ScChartArray aArr( pDoc, xChartRanges, OUString() ); aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders const ScChartPositionMap* pPosMap = aArr.GetPositionMap(); if (pPosMap) @@ -3280,7 +3280,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions( if ( pDocShell && xChartRanges.Is() ) { ScDocument* pDoc = pDocShell->GetDocument(); - ScChartArray aArr( pDoc, xChartRanges, String() ); + ScChartArray aArr( pDoc, xChartRanges, OUString() ); aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders const ScChartPositionMap* pPosMap = aArr.GetPositionMap(); if (pPosMap) @@ -4408,7 +4408,7 @@ void SAL_CALL ScCellRangesObj::removeRangeAddresses( const uno::Sequence<table:: // XNameContainer -static void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const String& rName ) +static void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const OUString& rName ) { sal_uInt16 nCount = rNamedEntries.size(); for ( sal_uInt16 n=nCount; n--; ) @@ -4434,8 +4434,8 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A { // if explicit name is given and already existing, throw exception - String aNamStr(aName); - if ( aNamStr.Len() ) + OUString aNamStr(aName); + if ( !aNamStr.isEmpty() ) { size_t nNamedCount = m_pImpl->m_aNamedEntries.size(); for (size_t n = 0; n < nNamedCount; n++) @@ -4473,11 +4473,11 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A } static sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh, - const String& rName, size_t& rIndex ) + const OUString& rName, size_t& rIndex ) { if (pDocSh) { - String aRangeStr; + OUString aRangeStr; ScDocument* pDoc = pDocSh->GetDocument(); for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ ) { @@ -4494,7 +4494,7 @@ static sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDo static sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries, const ScRangeList& rRanges, ScDocShell* pDocSh, - const String& rName, ScRange& rFound ) + const OUString& rName, ScRange& rFound ) { // exact range in list? @@ -4551,7 +4551,7 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName ) { SolarMutexGuard aGuard; sal_Bool bDone = false; - String aNameStr(aName); + OUString aNameStr(aName); ScDocShell* pDocSh = GetDocShell(); const ScRangeList& rRanges = GetRangeList(); size_t nIndex = 0; @@ -4629,7 +4629,7 @@ uno::Any SAL_CALL ScCellRangesObj::getByName( const OUString& aName ) SolarMutexGuard aGuard; uno::Any aRet; - String aNameStr(aName); + OUString aNameStr(aName); ScDocShell* pDocSh = GetDocShell(); const ScRangeList& rRanges = GetRangeList(); ScRange aRange; @@ -4649,7 +4649,7 @@ uno::Any SAL_CALL ScCellRangesObj::getByName( const OUString& aName ) } static sal_Bool lcl_FindEntryName( const ScNamedEntryArr_Impl& rNamedEntries, - const ScRange& rRange, String& rName ) + const ScRange& rRange, OUString& rName ) { sal_uInt16 nCount = rNamedEntries.size(); for (sal_uInt16 i=0; i<nCount; i++) @@ -4670,7 +4670,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getElementNames() const ScRangeList& rRanges = GetRangeList(); if (pDocSh) { - String aRangeStr; + OUString aRangeStr; ScDocument* pDoc = pDocSh->GetDocument(); size_t nCount = rRanges.size(); @@ -4696,7 +4696,7 @@ sal_Bool SAL_CALL ScCellRangesObj::hasByName( const OUString& aName ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameStr(aName); + OUString aNameStr(aName); ScDocShell* pDocSh = GetDocShell(); const ScRangeList& rRanges = GetRangeList(); ScRange aRange; @@ -4757,11 +4757,11 @@ OUString SAL_CALL ScCellRangesObj::getImplementationName() throw(uno::RuntimeExc sal_Bool SAL_CALL ScCellRangesObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( SCSHEETCELLRANGES_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCCHARPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCPARAPROPERTIES_SERVICE ); + OUString aServiceStr(rServiceName); + return aServiceStr.equalsAscii( SCSHEETCELLRANGES_SERVICE ) || + aServiceStr.equalsAscii( SCCELLPROPERTIES_SERVICE ) || + aServiceStr.equalsAscii( SCCHARPROPERTIES_SERVICE ) || + aServiceStr.equalsAscii( SCPARAPROPERTIES_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getSupportedServiceNames() @@ -4983,7 +4983,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName( ScRange aCellRange; sal_Bool bFound = false; - String aString(aName); + OUString aString(aName); sal_uInt16 nParse = aCellRange.ParseAny( aString, pDoc, rDetails ); if ( nParse & SCA_VALID ) { @@ -6048,12 +6048,11 @@ OUString SAL_CALL ScCellRangeObj::getImplementationName() throw(uno::RuntimeExce sal_Bool SAL_CALL ScCellRangeObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCSHEETCELLRANGE_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLRANGE_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCCHARPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCPARAPROPERTIES_SERVICE ); + return rServiceName.equalsAscii( SCSHEETCELLRANGE_SERVICE ) || + rServiceName.equalsAscii( SCCELLRANGE_SERVICE ) || + rServiceName.equalsAscii( SCCELLPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCCHARPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCPARAPROPERTIES_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScCellRangeObj::getSupportedServiceNames() @@ -6195,7 +6194,7 @@ OUString ScCellObj::GetInputString_Impl(bool bEnglish) const // fuer getFor { if (GetDocShell()) return lcl_GetInputString( GetDocShell()->GetDocument(), aCellPos, bEnglish ); - return String(); + return OUString(); } OUString ScCellObj::GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aCellPos) @@ -6283,7 +6282,7 @@ void ScCellObj::InputEnglishString( const OUString& rText ) if (!pDocSh) return; - String aString(rText); + OUString aString(rText); ScDocument* pDoc = pDocSh->GetDocument(); SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); sal_uInt32 nOldFormat = pDoc->GetNumberFormat( aCellPos ); @@ -6373,12 +6372,12 @@ OUString SAL_CALL ScCellObj::getString() throw(uno::RuntimeException) void SAL_CALL ScCellObj::setString( const OUString& aText ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aText); + OUString aString(aText); SetString_Impl(aString, false, false); // immer Text // don't create pUnoText here if not there if (mxUnoText.is()) - mxUnoText->SetSelection(ESelection( 0,0, 0,aString.Len() )); + mxUnoText->SetSelection(ESelection( 0,0, 0,aString.getLength() )); } void SAL_CALL ScCellObj::insertString( const uno::Reference<text::XTextRange>& xRange, @@ -6519,7 +6518,7 @@ OUString SAL_CALL ScCellObj::getFormula() throw(uno::RuntimeException) void SAL_CALL ScCellObj::setFormula( const OUString& aFormula ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aFormula); + OUString aString(aFormula); SetString_Impl(aString, sal_True, sal_True); // Interpret as English } @@ -6732,7 +6731,7 @@ void ScCellObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, c { OUString aStrVal; aValue >>= aStrVal; - String aString(aStrVal); + OUString aString(aStrVal); SetString_Impl(aString, sal_True, false); // lokal interpretieren } else if ( pEntry->nWID == SC_WID_UNO_FORMRT ) @@ -6785,14 +6784,13 @@ sal_Bool SAL_CALL ScCellObj::supportsService( const OUString& rServiceName ) // but ScCellObj is used instead of ScCellRangeObj in CellRanges collections, // so it must support them - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( SCSHEETCELL_SERVICE ) || - aServiceStr.EqualsAscii( SCCELL_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCCHARPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCPARAPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCSHEETCELLRANGE_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLRANGE_SERVICE ); + return rServiceName.equalsAscii( SCSHEETCELL_SERVICE ) || + rServiceName.equalsAscii( SCCELL_SERVICE ) || + rServiceName.equalsAscii( SCCELLPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCCHARPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCPARAPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCSHEETCELLRANGE_SERVICE ) || + rServiceName.equalsAscii( SCCELLRANGE_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScCellObj::getSupportedServiceNames() @@ -7251,7 +7249,7 @@ void SAL_CALL ScTableSheetObj::setName( const OUString& aNewName ) ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { - String aString(aNewName); + OUString aString(aNewName); pDocSh->GetDocFunc().RenameTable( GetTab_Impl(), aString, sal_True, sal_True ); } } @@ -7677,7 +7675,7 @@ void SAL_CALL ScTableSheetObj::setLinkMode( sheet::SheetLinkMode nLinkMode ) OUString SAL_CALL ScTableSheetObj::getLinkUrl() throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aFile; + OUString aFile; ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) aFile = pDocSh->GetDocument()->GetLinkDoc( GetTab_Impl() ); @@ -7701,7 +7699,7 @@ void SAL_CALL ScTableSheetObj::setLinkUrl( const OUString& aLinkUrl ) OUString SAL_CALL ScTableSheetObj::getLinkSheetName() throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aSheet; + OUString aSheet; ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) aSheet = pDocSh->GetDocument()->GetLinkTab( GetTab_Impl() ); @@ -7993,7 +7991,7 @@ void SAL_CALL ScTableSheetObj::protect( const OUString& aPassword ) // #i108245# if already protected, don't change anything if ( pDocSh && !pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() ) ) { - String aString(aPassword); + OUString aString(aPassword); pDocSh->GetDocFunc().Protect( GetTab_Impl(), aString, sal_True ); } } @@ -8005,7 +8003,7 @@ void SAL_CALL ScTableSheetObj::unprotect( const OUString& aPassword ) ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { - String aString(aPassword); + OUString aString(aPassword); sal_Bool bDone = pDocSh->GetDocFunc().Unprotect( GetTab_Impl(), aString, sal_True ); if (!bDone) throw lang::IllegalArgumentException(); @@ -8067,7 +8065,7 @@ void SAL_CALL ScTableSheetObj::setScenarioComment( const OUString& aScenarioComm pDoc->GetName( nTab, aName ); pDoc->GetScenarioData( nTab, aComment, aColor, nFlags ); - aComment = String( aScenarioComment ); + aComment = aScenarioComment; pDocSh->ModifyScenario( nTab, aName, aComment, aColor, nFlags ); } @@ -8179,8 +8177,8 @@ void ScTableSheetObj::setExternalName( const OUString& aUrl, const OUString& aSh if ( pDoc ) { const SCTAB nTab = GetTab_Impl(); - const String aAbsDocName( ScGlobal::GetAbsDocName( aUrl, pDocSh ) ); - const String aDocTabName( ScGlobal::GetDocTabName( aAbsDocName, aSheetName ) ); + const OUString aAbsDocName( ScGlobal::GetAbsDocName( aUrl, pDocSh ) ); + const OUString aDocTabName( ScGlobal::GetDocTabName( aAbsDocName, aSheetName ) ); if ( !pDoc->RenameTab( nTab, aDocTabName, false /*bUpdateRef*/, sal_True /*bExternalDocument*/ ) ) { throw container::ElementExistException( OUString(), *this ); @@ -8703,14 +8701,13 @@ OUString SAL_CALL ScTableSheetObj::getImplementationName() throw(uno::RuntimeExc sal_Bool SAL_CALL ScTableSheetObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCSPREADSHEET_SERVICE ) || - aServiceStr.EqualsAscii( SCSHEETCELLRANGE_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLRANGE_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCCHARPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCPARAPROPERTIES_SERVICE ) || - aServiceStr.EqualsAscii( SCLINKTARGET_SERVICE ); + return rServiceName.equalsAscii( SCSPREADSHEET_SERVICE ) || + rServiceName.equalsAscii( SCSHEETCELLRANGE_SERVICE ) || + rServiceName.equalsAscii( SCCELLRANGE_SERVICE ) || + rServiceName.equalsAscii( SCCELLPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCCHARPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCPARAPROPERTIES_SERVICE ) || + rServiceName.equalsAscii( SCLINKTARGET_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScTableSheetObj::getSupportedServiceNames() diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 28cb882892d8..85450d4024b3 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1123,7 +1123,7 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScTokenRef>& rRefTokens, SCTAB nTab = 0; sal_uInt16 nFileId = 0; - String aExtTabName; + OUString aExtTabName; bool bExternal = false; vector<ScTokenRef>::const_iterator itr = rRefTokens.begin(), itrEnd = rRefTokens.end(); @@ -2265,15 +2265,15 @@ OUString SAL_CALL ScChart2DataProvider::convertRangeFromXML( const OUString& sXM { // convert one address (remove dots) - String aUIString(sToken); + OUString aUIString(sToken); sal_Int32 nIndex = ScRangeStringConverter::IndexOf( sToken, ':', 0, cQuote ); - if ( nIndex >= 0 && nIndex < aUIString.Len() - 1 && - aUIString.GetChar((xub_StrLen)nIndex + 1) == (sal_Unicode) '.' ) - aUIString.Erase( (xub_StrLen)nIndex + 1, 1 ); + if ( nIndex >= 0 && nIndex < aUIString.getLength() - 1 && + aUIString[nIndex + 1] == '.' ) + aUIString = aUIString.replaceAt( nIndex + 1, 1, "" ); - if ( aUIString.GetChar(0) == (sal_Unicode) '.' ) - aUIString.Erase( 0, 1 ); + if ( aUIString[0] == '.' ) + aUIString = aUIString.copy( 1 ); if( !sRet.isEmpty() ) sRet.append( (sal_Unicode) ';' ); @@ -2659,7 +2659,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke return 0; sal_uInt16 nFileId = pToken->GetIndex(); - const String& rTabName = pToken->GetString(); + const OUString& rTabName = pToken->GetString(); ScExternalRefCache::TokenArrayRef pArray = pRefMgr->getDoubleRefTokens(nFileId, rTabName, aRange, NULL); if (!pArray) // no external data exists for this range. @@ -3156,8 +3156,8 @@ public: { if ( meOrigin != chart2::data::LabelOrigin_LONG_SIDE) { - String aString = ScGlobal::GetRscString(STR_COLUMN); - aString += ' '; + OUString aString = ScGlobal::GetRscString(STR_COLUMN); + aString += " "; ScAddress aPos( nCol, 0, 0 ); OUString aColStr(aPos.Format(SCA_VALID_COL, NULL)); aString += aColStr; diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 94f5e8e37cf9..31ef9da291fd 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -118,7 +118,7 @@ void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const { - String aName; + OUString aName; if ( pDocShell ) { ScDocument* pDoc = pDocShell->GetDocument(); @@ -151,7 +151,7 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const } } - if (aName.Len()) + if (!aName.isEmpty()) return new ScChartObj( pDocShell, nTab, aName ); return NULL; } @@ -416,7 +416,7 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::Runti { if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart(pObject) ) { - String aName; + OUString aName; uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef(); if ( xObj.is() ) aName = pDocShell->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj ); @@ -501,15 +501,15 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( "CellRangeRepresentation" )) + if (aPropName.equalsAscii( "CellRangeRepresentation" )) rProp.Value >>= aRanges; - else if (aPropName.EqualsAscii( "DataRowSource" )) + else if (aPropName.equalsAscii( "DataRowSource" )) eDataRowSource = (chart::ChartDataRowSource)ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( "HasCategories" )) + else if (aPropName.equalsAscii( "HasCategories" )) bHasCategories = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( "FirstCellAsLabel" )) + else if (aPropName.equalsAscii( "FirstCellAsLabel" )) bFirstCellAsLabel = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); } diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 741d7958f996..ad06a9dc9d66 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -152,7 +152,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( sal_Int64 nColor = 0; if (aValue >>= nColor) { - String aColorName; + OUString aColorName; Color aColor(static_cast<sal_uInt32>(nColor)); aViewOpt.SetGridColor(aColor, aColorName); } @@ -473,9 +473,8 @@ OUString SAL_CALL ScDocumentConfiguration::getImplementationName() throw(uno::Ru sal_Bool SAL_CALL ScDocumentConfiguration::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCCOMPSCPREADSHEETSETTINGS_SERVICE ) || - aServiceStr.EqualsAscii( SCDOCUMENTSETTINGS_SERVICE ); + return rServiceName.equalsAscii( SCCOMPSCPREADSHEETSETTINGS_SERVICE ) || + rServiceName.equalsAscii( SCDOCUMENTSETTINGS_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScDocumentConfiguration::getSupportedServiceNames() diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index 546d0fcfeaca..691ee3ea8657 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -464,9 +464,8 @@ OUString SAL_CALL ScCellCursorObj::getImplementationName() throw(uno::RuntimeExc sal_Bool SAL_CALL ScCellCursorObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCSHEETCELLCURSOR_SERVICE ) || - aServiceStr.EqualsAscii( SCCELLCURSOR_SERVICE ) || + return rServiceName.equalsAscii( SCSHEETCELLCURSOR_SERVICE ) || + rServiceName.equalsAscii( SCCELLCURSOR_SERVICE ) || ScCellRangeObj::supportsService(rServiceName); } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 0ef5a183675d..2794d9e7028e 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -267,7 +267,7 @@ static ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUS return NULL; // nicht gefunden } -static String lcl_CreatePivotName( ScDocShell* pDocShell ) +static OUString lcl_CreatePivotName( ScDocShell* pDocShell ) { if (pDocShell) { @@ -276,7 +276,7 @@ static String lcl_CreatePivotName( ScDocShell* pDocShell ) if ( pColl ) return pColl->CreateNewName(); } - return String(); // sollte nicht vorkommen + return OUString(); // sollte nicht vorkommen } static sal_Int32 lcl_GetObjectIndex( ScDPObject* pDPObj, const ScFieldIdentifier& rFieldId ) @@ -342,7 +342,7 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd { if ( nFound == nIndex ) { - String aName = pDPObj->GetName(); + OUString aName = pDPObj->GetName(); return new ScDataPilotTableObj( pDocShell, nTab, aName ); } ++nFound; @@ -429,11 +429,11 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName, ScRange aOutputRange((SCCOL)aOutputAddress.Column, (SCROW)aOutputAddress.Row, (SCTAB)aOutputAddress.Sheet, (SCCOL)aOutputAddress.Column, (SCROW)aOutputAddress.Row, (SCTAB)aOutputAddress.Sheet); pNewObj->SetOutRange(aOutputRange); - String aName = aNewName; - if (!aName.Len()) + OUString aName = aNewName; + if (aName.isEmpty()) aName = lcl_CreatePivotName( pDocShell ); pNewObj->SetName(aName); - String aTag = xDescriptor->getTag(); + OUString aTag = xDescriptor->getTag(); pNewObj->SetTag(aTag); // todo: handle double fields (for more information see ScDPObject @@ -451,7 +451,7 @@ void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName ) throw(RuntimeException) { SolarMutexGuard aGuard; - String aNameStr(aName); + OUString aNameStr(aName); ScDPObject* pDPObj = lcl_GetDPObject( pDocShell, nTab, aNameStr ); if (pDPObj && pDocShell) { @@ -781,38 +781,38 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp { ScDPSaveData aNewData( *pOldData ); - String aNameString = aPropertyName; - if ( aNameString.EqualsAscii( SC_UNO_DP_COLGRAND ) ) + OUString aNameString = aPropertyName; + if ( aNameString.equalsAscii( SC_UNO_DP_COLGRAND ) ) { aNewData.SetColumnGrand(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_IGNORE_EMPTYROWS ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_IGNORE_EMPTYROWS ) ) { aNewData.SetIgnoreEmptyRows(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_REPEATEMPTY ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_REPEATEMPTY ) ) { aNewData.SetRepeatIfEmpty(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_ROWGRAND ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_ROWGRAND ) ) { aNewData.SetRowGrand(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SHOWFILTER ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SHOWFILTER ) ) { aNewData.SetFilterButton(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_DRILLDOWN ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_DRILLDOWN ) ) { aNewData.SetDrillDown(::cppu::any2bool( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_GRANDTOTAL_NAME ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_GRANDTOTAL_NAME ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) aNewData.SetGrandTotalName(aStrVal); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_IMPORTDESC ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_IMPORTDESC ) ) { uno::Sequence<beans::PropertyValue> aArgSeq; if ( aValue >>= aArgSeq ) @@ -844,12 +844,12 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp pDPObject->SetImportDesc( aImportDesc ); } } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SOURCESERVICE ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SOURCESERVICE ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) { - String aEmpty; + OUString aEmpty; ScDPServiceDesc aServiceDesc(aEmpty, aEmpty, aEmpty, aEmpty, aEmpty); const ScDPServiceDesc* pOldDesc = pDPObject->GetDPServiceDesc(); @@ -861,12 +861,12 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp pDPObject->SetServiceData( aServiceDesc ); } } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SERVICEARG ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SERVICEARG ) ) { uno::Sequence<beans::PropertyValue> aArgSeq; if ( aValue >>= aArgSeq ) { - String aEmpty; + OUString aEmpty; ScDPServiceDesc aServiceDesc(aEmpty, aEmpty, aEmpty, aEmpty, aEmpty); const ScDPServiceDesc* pOldDesc = pDPObject->GetDPServiceDesc(); @@ -878,24 +878,24 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp for (sal_Int32 nArgPos=0; nArgPos<nArgs; ++nArgPos) { const beans::PropertyValue& rProp = aArgSeq[nArgPos]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNO_DP_SOURCENAME )) + if (aPropName.equalsAscii( SC_UNO_DP_SOURCENAME )) { if ( rProp.Value >>= aStrVal ) aServiceDesc.aParSource = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNO_DP_OBJECTNAME )) + else if (aPropName.equalsAscii( SC_UNO_DP_OBJECTNAME )) { if ( rProp.Value >>= aStrVal ) aServiceDesc.aParName = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNO_DP_USERNAME )) + else if (aPropName.equalsAscii( SC_UNO_DP_USERNAME )) { if ( rProp.Value >>= aStrVal ) aServiceDesc.aParUser = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNO_DP_PASSWORD )) + else if (aPropName.equalsAscii( SC_UNO_DP_PASSWORD )) { if ( rProp.Value >>= aStrVal ) aServiceDesc.aParPass = aStrVal; @@ -930,38 +930,38 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope { ScDPSaveData aNewData( *pOldData ); - String aNameString = aPropertyName; - if ( aNameString.EqualsAscii( SC_UNO_DP_COLGRAND ) ) + OUString aNameString = aPropertyName; + if ( aNameString.equalsAscii( SC_UNO_DP_COLGRAND ) ) { aRet = ::cppu::bool2any( aNewData.GetColumnGrand() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_IGNORE_EMPTYROWS ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_IGNORE_EMPTYROWS ) ) { aRet = ::cppu::bool2any( aNewData.GetIgnoreEmptyRows() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_REPEATEMPTY ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_REPEATEMPTY ) ) { aRet = ::cppu::bool2any( aNewData.GetRepeatIfEmpty() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_ROWGRAND ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_ROWGRAND ) ) { aRet = ::cppu::bool2any( aNewData.GetRowGrand() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SHOWFILTER ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SHOWFILTER ) ) { aRet = ::cppu::bool2any( aNewData.GetFilterButton() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_DRILLDOWN ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_DRILLDOWN ) ) { aRet = ::cppu::bool2any( aNewData.GetDrillDown() ); } - else if ( aNameString.EqualsAscii( SC_UNO_DP_GRANDTOTAL_NAME ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_GRANDTOTAL_NAME ) ) { const OUString* pGrandTotalName = aNewData.GetGrandTotalName(); if (pGrandTotalName) aRet <<= *pGrandTotalName; // same behavior as in ScDPSource } - else if ( aNameString.EqualsAscii( SC_UNO_DP_IMPORTDESC ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_IMPORTDESC ) ) { const ScImportSourceDesc* pImportDesc = pDPObject->GetImportSourceDesc(); if ( pImportDesc ) @@ -986,7 +986,7 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope aRet <<= aEmpty; } } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SOURCESERVICE ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SOURCESERVICE ) ) { OUString aServiceName; const ScDPServiceDesc* pServiceDesc = pDPObject->GetDPServiceDesc(); @@ -994,7 +994,7 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope aServiceName = pServiceDesc->aServiceName; aRet <<= aServiceName; // empty string if no ServiceDesc set } - else if ( aNameString.EqualsAscii( SC_UNO_DP_SERVICEARG ) ) + else if ( aNameString.equalsAscii( SC_UNO_DP_SERVICEARG ) ) { const ScDPServiceDesc* pServiceDesc = pDPObject->GetDPServiceDesc(); if (pServiceDesc) @@ -1207,7 +1207,7 @@ void SAL_CALL ScDataPilotTableObj::setName( const OUString& aNewName ) { //! test for existing names !!! - String aString(aNewName); + OUString aString(aNewName); pDPObj->SetName( aString ); //! Undo - DBDocFunc ??? aName = aString; @@ -1232,8 +1232,8 @@ void SAL_CALL ScDataPilotTableObj::setTag( const OUString& aNewTag ) ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName); if (pDPObj) { - String aString(aNewTag); - pDPObj->SetTag( aString ); //! Undo - DBDocFunc ??? + OUString aString(aNewTag); + pDPObj->SetTag( aNewTag ); //! Undo - DBDocFunc ??? // DataPilotUpdate would do too much (output table is not changed) GetDocShell()->SetDocumentModified(); @@ -1872,8 +1872,7 @@ void SAL_CALL ScDataPilotFieldObj::setName( const OUString& rName ) throw(Runtim ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ); if( pDim && !pDim->IsDataLayout() ) { - String aName( rName ); - pDim->SetLayoutName(aName); + pDim->SetLayoutName(rName); SetDPObject( pDPObj ); } } @@ -1893,93 +1892,93 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); - if ( aNameString.EqualsAscii( SC_UNONAME_FUNCTION ) ) + OUString aNameString(aPropertyName); + if ( aNameString.equalsAscii( SC_UNONAME_FUNCTION ) ) { // #i109350# use GetEnumFromAny because it also allows sal_Int32 GeneralFunction eFunction = (GeneralFunction) ScUnoHelpFunctions::GetEnumFromAny( aValue ); setFunction( eFunction ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_SUBTOTALS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SUBTOTALS ) ) { Sequence< GeneralFunction > aSubtotals; if( aValue >>= aSubtotals ) setSubtotals( aSubtotals ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_ORIENT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_ORIENT ) ) { //! test for correct enum type? DataPilotFieldOrientation eOrient = (DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumFromAny( aValue ); setOrientation( eOrient ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_SELPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SELPAGE ) ) { OUString sCurrentPage; if (aValue >>= sCurrentPage) setCurrentPage(sCurrentPage); } - else if ( aNameString.EqualsAscii( SC_UNONAME_USESELPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_USESELPAGE ) ) { setUseCurrentPage(cppu::any2bool(aValue)); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASAUTOSHOW ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASAUTOSHOW ) ) { if (!cppu::any2bool(aValue)) setAutoShowInfo(NULL); } - else if ( aNameString.EqualsAscii( SC_UNONAME_AUTOSHOW ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_AUTOSHOW ) ) { DataPilotFieldAutoShowInfo aInfo; if (aValue >>= aInfo) setAutoShowInfo(&aInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASLAYOUTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASLAYOUTINFO ) ) { if (!cppu::any2bool(aValue)) setLayoutInfo(NULL); } - else if ( aNameString.EqualsAscii( SC_UNONAME_LAYOUTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_LAYOUTINFO ) ) { DataPilotFieldLayoutInfo aInfo; if (aValue >>= aInfo) setLayoutInfo(&aInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASREFERENCE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASREFERENCE ) ) { if (!cppu::any2bool(aValue)) setReference(NULL); } - else if ( aNameString.EqualsAscii( SC_UNONAME_REFERENCE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFERENCE ) ) { DataPilotFieldReference aRef; if (aValue >>= aRef) setReference(&aRef); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASSORTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASSORTINFO ) ) { if (!cppu::any2bool(aValue)) setSortInfo(NULL); } - else if ( aNameString.EqualsAscii( SC_UNONAME_SORTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SORTINFO ) ) { DataPilotFieldSortInfo aInfo; if (aValue >>= aInfo) setSortInfo(&aInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_ISGROUP ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_ISGROUP ) ) { if (!cppu::any2bool(aValue)) setGroupInfo(NULL); } - else if ( aNameString.EqualsAscii( SC_UNONAME_GROUPINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_GROUPINFO ) ) { DataPilotFieldGroupInfo aInfo; if (aValue >>= aInfo) setGroupInfo(&aInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_SHOWEMPTY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SHOWEMPTY ) ) { setShowEmpty(cppu::any2bool(aValue)); } @@ -1989,58 +1988,58 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); Any aRet; - if ( aNameString.EqualsAscii( SC_UNONAME_FUNCTION ) ) + if ( aNameString.equalsAscii( SC_UNONAME_FUNCTION ) ) aRet <<= getFunction(); - else if ( aNameString.EqualsAscii( SC_UNONAME_SUBTOTALS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SUBTOTALS ) ) aRet <<= getSubtotals(); - else if ( aNameString.EqualsAscii( SC_UNONAME_ORIENT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_ORIENT ) ) aRet <<= getOrientation(); - else if ( aNameString.EqualsAscii( SC_UNONAME_SELPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SELPAGE ) ) aRet <<= getCurrentPage(); - else if ( aNameString.EqualsAscii( SC_UNONAME_USESELPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_USESELPAGE ) ) aRet <<= getUseCurrentPage(); - else if ( aNameString.EqualsAscii( SC_UNONAME_HASAUTOSHOW ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASAUTOSHOW ) ) aRet = ::cppu::bool2any(getAutoShowInfo() != NULL); - else if ( aNameString.EqualsAscii( SC_UNONAME_AUTOSHOW ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_AUTOSHOW ) ) { const DataPilotFieldAutoShowInfo* pInfo = getAutoShowInfo(); if (pInfo) aRet <<= DataPilotFieldAutoShowInfo(*pInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASLAYOUTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASLAYOUTINFO ) ) aRet = ::cppu::bool2any(getLayoutInfo() != NULL); - else if ( aNameString.EqualsAscii( SC_UNONAME_LAYOUTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_LAYOUTINFO ) ) { const DataPilotFieldLayoutInfo* pInfo = getLayoutInfo(); if (pInfo) aRet <<= DataPilotFieldLayoutInfo(*pInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASREFERENCE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASREFERENCE ) ) aRet = ::cppu::bool2any(getReference() != NULL); - else if ( aNameString.EqualsAscii( SC_UNONAME_REFERENCE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFERENCE ) ) { const DataPilotFieldReference* pRef = getReference(); if (pRef) aRet <<= DataPilotFieldReference(*pRef); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HASSORTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HASSORTINFO ) ) aRet = ::cppu::bool2any(getSortInfo() != NULL); - else if ( aNameString.EqualsAscii( SC_UNONAME_SORTINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SORTINFO ) ) { const DataPilotFieldSortInfo* pInfo = getSortInfo(); if (pInfo) aRet <<= DataPilotFieldSortInfo(*pInfo); } - else if ( aNameString.EqualsAscii( SC_UNONAME_ISGROUP ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_ISGROUP ) ) aRet = ::cppu::bool2any(hasGroupInfo()); - else if ( aNameString.EqualsAscii( SC_UNONAME_GROUPINFO ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_GROUPINFO ) ) { aRet <<= getGroupInfo(); } - else if ( aNameString.EqualsAscii( SC_UNONAME_SHOWEMPTY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_SHOWEMPTY ) ) aRet <<= getShowEmpty(); return aRet; @@ -2632,7 +2631,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons OUString aGroupDimName = pGroupDimension->GetGroupDimName(); //! localized prefix string - OUString aGroupName = pGroupDimension->CreateGroupName( String( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) ); + OUString aGroupName = pGroupDimension->CreateGroupName( OUString( "Group" ) ); ScDPSaveGroupItem aGroup( aGroupName ); Reference< XNameAccess > xMembers = GetMembers(); if (!xMembers.is()) @@ -2643,7 +2642,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons for (nEntry=0; nEntry<nEntryCount; nEntry++) { - String aEntryName(rItems[nEntry]); + OUString aEntryName(rItems[nEntry]); if (!xMembers->hasByName(aEntryName)) { @@ -2726,7 +2725,7 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con if( rInfo.Step >= ((rInfo.GroupBy == DAYS) ? 32768.0 : 1.0) ) throw IllegalArgumentException(); - String aGroupDimName; + OUString aGroupDimName; ScDPObject* pDPObj = 0; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { @@ -2764,7 +2763,7 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con // first remove all named group dimensions while( pGroupDim ) { - String aGroupDimName2 = pGroupDim->GetGroupDimName(); + OUString aGroupDimName2 = pGroupDim->GetGroupDimName(); // find next group dimension before deleting this group pGroupDim = rDimData.GetNextNamedGroupDim( aGroupDimName2 ); // remove from dimension save data @@ -2811,14 +2810,15 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con // return the UNO object of the new dimension, after writing back saved data Reference< XDataPilotField > xRet; - if( aGroupDimName.Len() > 0 ) try - { - Reference< XNameAccess > xFields( mrParent.getDataPilotFields(), UNO_QUERY_THROW ); - xRet.set( xFields->getByName( aGroupDimName ), UNO_QUERY ); - } - catch( Exception& ) - { - } + if( !aGroupDimName.isEmpty() ) + try + { + Reference< XNameAccess > xFields( mrParent.getDataPilotFields(), UNO_QUERY_THROW ); + xRet.set( xFields->getByName( aGroupDimName ), UNO_QUERY ); + } + catch( Exception& ) + { + } return xRet; } @@ -3425,7 +3425,7 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam if( mnIndex < nCount ) { Reference<XNamed> xMember(xMembersIndex->getByIndex(mnIndex), UNO_QUERY); - String sName(xMember->getName()); + OUString sName(xMember->getName()); ScDPSaveMember* pMember = pDim->GetMemberByName(sName); if (pMember) { @@ -3478,7 +3478,7 @@ Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName if( mnIndex < nCount ) { Reference< XNamed > xMember( xMembersIndex->getByIndex( mnIndex ), UNO_QUERY ); - String sName( xMember->getName() ); + OUString sName( xMember->getName() ); ScDPSaveMember* pMember = pDim->GetExistingMemberByName( sName ); if ( aPropertyName == SC_UNONAME_SHOWDETAIL ) { diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 8a264dbde4fc..56a7e80ce3ad 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -217,26 +217,26 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNONAME_ISNATIVE )) + if (aPropName.equalsAscii( SC_UNONAME_ISNATIVE )) rParam.bNative = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_DBNAME )) + else if (aPropName.equalsAscii( SC_UNONAME_DBNAME )) { if ( rProp.Value >>= aStrVal ) rParam.aDBName = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_CONRES )) + else if (aPropName.equalsAscii( SC_UNONAME_CONRES )) { if ( rProp.Value >>= aStrVal ) rParam.aDBName = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_SRCOBJ )) + else if (aPropName.equalsAscii( SC_UNONAME_SRCOBJ )) { if ( rProp.Value >>= aStrVal ) rParam.aStatement = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_SRCTYPE )) + else if (aPropName.equalsAscii( SC_UNONAME_SRCTYPE )) { //! test for correct enum type? sheet::DataImportMode eMode = (sheet::DataImportMode) @@ -350,22 +350,22 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b for (long nProp = 0; nProp < nPropCount; nProp++) { const beans::PropertyValue& rProp = pPropArray[nProp]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNONAME_ORIENT )) + if (aPropName.equalsAscii( SC_UNONAME_ORIENT )) { //! test for correct enum type? table::TableOrientation eOrient = (table::TableOrientation) ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ); rParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS ); } - else if (aPropName.EqualsAscii( SC_UNONAME_ISSORTCOLUMNS )) + else if (aPropName.equalsAscii( SC_UNONAME_ISSORTCOLUMNS )) { rParam.bByRow = !::cppu::any2bool(rProp.Value); } - else if (aPropName.EqualsAscii( SC_UNONAME_CONTHDR )) + else if (aPropName.equalsAscii( SC_UNONAME_CONTHDR )) rParam.bHasHeader = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_MAXFLD )) + else if (aPropName.equalsAscii( SC_UNONAME_MAXFLD )) { sal_Int32 nVal; if ( (rProp.Value >>= nVal) && nVal > nSortSize ) @@ -374,7 +374,7 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b //! throw lang::IllegalArgumentException(); } } - else if (aPropName.EqualsAscii( SC_UNONAME_SORTFLD )) + else if (aPropName.equalsAscii( SC_UNONAME_SORTFLD )) { uno::Sequence<util::SortField> aSeq; uno::Sequence<table::TableSortField> aNewSeq; @@ -426,15 +426,15 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b rParam.maKeyState[i].bDoSort = false; } } - else if (aPropName.EqualsAscii( SC_UNONAME_ISCASE )) + else if (aPropName.equalsAscii( SC_UNONAME_ISCASE )) { rParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); } - else if (aPropName.EqualsAscii( SC_UNONAME_BINDFMT )) + else if (aPropName.equalsAscii( SC_UNONAME_BINDFMT )) rParam.bIncludePattern = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_COPYOUT )) + else if (aPropName.equalsAscii( SC_UNONAME_COPYOUT )) rParam.bInplace = !ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_OUTPOS )) + else if (aPropName.equalsAscii( SC_UNONAME_OUTPOS )) { table::CellAddress aAddress; if ( rProp.Value >>= aAddress ) @@ -444,19 +444,19 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b rParam.nDestRow = (SCROW)aAddress.Row; } } - else if (aPropName.EqualsAscii( SC_UNONAME_ISULIST )) + else if (aPropName.equalsAscii( SC_UNONAME_ISULIST )) rParam.bUserDef = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_UINDEX )) + else if (aPropName.equalsAscii( SC_UNONAME_UINDEX )) { sal_Int32 nVal = 0; if ( rProp.Value >>= nVal ) rParam.nUserIndex = (sal_uInt16)nVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_COLLLOC )) + else if (aPropName.equalsAscii( SC_UNONAME_COLLLOC )) { rProp.Value >>= rParam.aCollatorLocale; } - else if (aPropName.EqualsAscii( SC_UNONAME_COLLALG )) + else if (aPropName.equalsAscii( SC_UNONAME_COLLALG )) { OUString sStr; if ( rProp.Value >>= sStr ) @@ -708,29 +708,29 @@ void SAL_CALL ScSubTotalDescriptorBase::setPropertyValue( ScSubTotalParam aParam; GetData(aParam); - String aString(aPropertyName); + OUString aString(aPropertyName); // some old property names are for 5.2 compatibility - if (aString.EqualsAscii( SC_UNONAME_CASE ) || aString.EqualsAscii( SC_UNONAME_ISCASE )) + if (aString.equalsAscii( SC_UNONAME_CASE ) || aString.equalsAscii( SC_UNONAME_ISCASE )) aParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_FORMATS ) || aString.EqualsAscii( SC_UNONAME_BINDFMT )) + else if (aString.equalsAscii( SC_UNONAME_FORMATS ) || aString.equalsAscii( SC_UNONAME_BINDFMT )) aParam.bIncludePattern = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_ENABSORT )) + else if (aString.equalsAscii( SC_UNONAME_ENABSORT )) aParam.bDoSort = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_SORTASC )) + else if (aString.equalsAscii( SC_UNONAME_SORTASC )) aParam.bAscending = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_INSBRK )) + else if (aString.equalsAscii( SC_UNONAME_INSBRK )) aParam.bPagebreak = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_ULIST ) || aString.EqualsAscii( SC_UNONAME_ENUSLIST )) + else if (aString.equalsAscii( SC_UNONAME_ULIST ) || aString.equalsAscii( SC_UNONAME_ENUSLIST )) aParam.bUserDef = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_UINDEX ) || aString.EqualsAscii( SC_UNONAME_USINDEX )) + else if (aString.equalsAscii( SC_UNONAME_UINDEX ) || aString.equalsAscii( SC_UNONAME_USINDEX )) { sal_Int32 nVal = 0; if ( aValue >>= nVal ) aParam.nUserIndex = (sal_uInt16)nVal; } - else if (aString.EqualsAscii( SC_UNONAME_MAXFLD )) + else if (aString.equalsAscii( SC_UNONAME_MAXFLD )) { sal_Int32 nVal = 0; if ( (aValue >>= nVal) && nVal > sal::static_int_cast<sal_Int32>(MAXSUBTOTAL) ) @@ -750,26 +750,26 @@ uno::Any SAL_CALL ScSubTotalDescriptorBase::getPropertyValue( const OUString& aP ScSubTotalParam aParam; GetData(aParam); - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; // some old property names are for 5.2 compatibility - if (aString.EqualsAscii( SC_UNONAME_CASE ) || aString.EqualsAscii( SC_UNONAME_ISCASE )) + if (aString.equalsAscii( SC_UNONAME_CASE ) || aString.equalsAscii( SC_UNONAME_ISCASE )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bCaseSens ); - else if (aString.EqualsAscii( SC_UNONAME_FORMATS ) || aString.EqualsAscii( SC_UNONAME_BINDFMT )) + else if (aString.equalsAscii( SC_UNONAME_FORMATS ) || aString.equalsAscii( SC_UNONAME_BINDFMT )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bIncludePattern ); - else if (aString.EqualsAscii( SC_UNONAME_ENABSORT )) + else if (aString.equalsAscii( SC_UNONAME_ENABSORT )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bDoSort ); - else if (aString.EqualsAscii( SC_UNONAME_SORTASC )) + else if (aString.equalsAscii( SC_UNONAME_SORTASC )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bAscending ); - else if (aString.EqualsAscii( SC_UNONAME_INSBRK )) + else if (aString.equalsAscii( SC_UNONAME_INSBRK )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bPagebreak ); - else if (aString.EqualsAscii( SC_UNONAME_ULIST ) || aString.EqualsAscii( SC_UNONAME_ENUSLIST )) + else if (aString.equalsAscii( SC_UNONAME_ULIST ) || aString.equalsAscii( SC_UNONAME_ENUSLIST )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bUserDef ); - else if (aString.EqualsAscii( SC_UNONAME_UINDEX ) || aString.EqualsAscii( SC_UNONAME_USINDEX )) + else if (aString.equalsAscii( SC_UNONAME_UINDEX ) || aString.equalsAscii( SC_UNONAME_USINDEX )) aRet <<= (sal_Int32) aParam.nUserIndex; - else if (aString.EqualsAscii( SC_UNONAME_MAXFLD )) + else if (aString.equalsAscii( SC_UNONAME_MAXFLD )) aRet <<= (sal_Int32) MAXSUBTOTAL; return aRet; @@ -1456,25 +1456,25 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue( ScQueryParam aParam; GetData(aParam); - String aString(aPropertyName); - if (aString.EqualsAscii( SC_UNONAME_CONTHDR )) + OUString aString(aPropertyName); + if (aString.equalsAscii( SC_UNONAME_CONTHDR )) aParam.bHasHeader = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_COPYOUT )) + else if (aString.equalsAscii( SC_UNONAME_COPYOUT )) aParam.bInplace = !(ScUnoHelpFunctions::GetBoolFromAny( aValue )); - else if (aString.EqualsAscii( SC_UNONAME_ISCASE )) + else if (aString.equalsAscii( SC_UNONAME_ISCASE )) aParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_MAXFLD )) + else if (aString.equalsAscii( SC_UNONAME_MAXFLD )) { // silently ignored } - else if (aString.EqualsAscii( SC_UNONAME_ORIENT )) + else if (aString.equalsAscii( SC_UNONAME_ORIENT )) { //! test for correct enum type? table::TableOrientation eOrient = (table::TableOrientation) ScUnoHelpFunctions::GetEnumFromAny( aValue ); aParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS ); } - else if (aString.EqualsAscii( SC_UNONAME_OUTPOS )) + else if (aString.equalsAscii( SC_UNONAME_OUTPOS )) { table::CellAddress aAddress; if ( aValue >>= aAddress ) @@ -1484,11 +1484,11 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue( aParam.nDestRow = (SCROW)aAddress.Row; } } - else if (aString.EqualsAscii( SC_UNONAME_SAVEOUT )) + else if (aString.equalsAscii( SC_UNONAME_SAVEOUT )) aParam.bDestPers = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if (aString.EqualsAscii( SC_UNONAME_SKIPDUP )) + else if (aString.equalsAscii( SC_UNONAME_SKIPDUP )) aParam.bDuplicate = !(ScUnoHelpFunctions::GetBoolFromAny( aValue )); - else if (aString.EqualsAscii( SC_UNONAME_USEREGEX )) + else if (aString.equalsAscii( SC_UNONAME_USEREGEX )) aParam.bRegExp = ScUnoHelpFunctions::GetBoolFromAny( aValue ); PutData(aParam); @@ -1502,24 +1502,24 @@ uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const OUString& aPro ScQueryParam aParam; GetData(aParam); - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; - if (aString.EqualsAscii( SC_UNONAME_CONTHDR )) + if (aString.equalsAscii( SC_UNONAME_CONTHDR )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bHasHeader ); - else if (aString.EqualsAscii( SC_UNONAME_COPYOUT )) + else if (aString.equalsAscii( SC_UNONAME_COPYOUT )) ScUnoHelpFunctions::SetBoolInAny( aRet, !(aParam.bInplace) ); - else if (aString.EqualsAscii( SC_UNONAME_ISCASE )) + else if (aString.equalsAscii( SC_UNONAME_ISCASE )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bCaseSens ); - else if (aString.EqualsAscii( SC_UNONAME_MAXFLD )) + else if (aString.equalsAscii( SC_UNONAME_MAXFLD )) aRet <<= (sal_Int32) aParam.GetEntryCount(); - else if (aString.EqualsAscii( SC_UNONAME_ORIENT )) + else if (aString.equalsAscii( SC_UNONAME_ORIENT )) { table::TableOrientation eOrient = aParam.bByRow ? table::TableOrientation_ROWS : table::TableOrientation_COLUMNS; aRet <<= eOrient; } - else if (aString.EqualsAscii( SC_UNONAME_OUTPOS )) + else if (aString.equalsAscii( SC_UNONAME_OUTPOS )) { table::CellAddress aOutPos; aOutPos.Sheet = aParam.nDestTab; @@ -1527,11 +1527,11 @@ uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const OUString& aPro aOutPos.Row = aParam.nDestRow; aRet <<= aOutPos; } - else if (aString.EqualsAscii( SC_UNONAME_SAVEOUT )) + else if (aString.equalsAscii( SC_UNONAME_SAVEOUT )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bDestPers ); - else if (aString.EqualsAscii( SC_UNONAME_SKIPDUP )) + else if (aString.equalsAscii( SC_UNONAME_SKIPDUP )) ScUnoHelpFunctions::SetBoolInAny( aRet, !(aParam.bDuplicate) ); - else if (aString.EqualsAscii( SC_UNONAME_USEREGEX )) + else if (aString.equalsAscii( SC_UNONAME_USEREGEX )) ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bRegExp ); return aRet; @@ -1720,7 +1720,7 @@ void SAL_CALL ScDatabaseRangeObj::setName( const OUString& aNewName ) if (pDocShell) { ScDBDocFunc aFunc(*pDocShell); - String aNewStr(aNewName); + OUString aNewStr(aNewName); sal_Bool bOk = aFunc.RenameDBRange( aName, aNewStr ); if (bOk) aName = aNewStr; @@ -2031,14 +2031,14 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( ScDBData aNewData( *pData ); sal_Bool bDo = sal_True; - String aString(aPropertyName); - if ( aString.EqualsAscii( SC_UNONAME_KEEPFORM ) ) + OUString aString(aPropertyName); + if ( aString.equalsAscii( SC_UNONAME_KEEPFORM ) ) aNewData.SetKeepFmt( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNONAME_MOVCELLS ) ) + else if ( aString.equalsAscii( SC_UNONAME_MOVCELLS ) ) aNewData.SetDoSize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNONAME_STRIPDAT ) ) + else if ( aString.equalsAscii( SC_UNONAME_STRIPDAT ) ) aNewData.SetStripData( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNONAME_AUTOFLT )) + else if (aString.equalsAscii( SC_UNONAME_AUTOFLT )) { sal_Bool bAutoFilter(ScUnoHelpFunctions::GetBoolFromAny( aValue )); aNewData.SetAutoFilter(bAutoFilter); @@ -2057,7 +2057,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( aPaintRange.aEnd.SetRow(aPaintRange.aStart.Row()); pDocShell->PostPaint(aPaintRange, PAINT_GRID); } - else if (aString.EqualsAscii( SC_UNONAME_USEFLTCRT )) + else if (aString.equalsAscii( SC_UNONAME_USEFLTCRT )) { if (ScUnoHelpFunctions::GetBoolFromAny( aValue )) { @@ -2068,7 +2068,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( else aNewData.SetAdvancedQuerySource(NULL); } - else if (aString.EqualsAscii( SC_UNONAME_FLTCRT )) + else if (aString.equalsAscii( SC_UNONAME_FLTCRT )) { table::CellRangeAddress aRange; if (aValue >>= aRange) @@ -2079,11 +2079,11 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( aNewData.SetAdvancedQuerySource(&aCoreRange); } } - else if (aString.EqualsAscii( SC_UNONAME_FROMSELECT )) + else if (aString.equalsAscii( SC_UNONAME_FROMSELECT )) { aNewData.SetImportSelection(::cppu::any2bool(aValue)); } - else if (aString.EqualsAscii( SC_UNONAME_REFPERIOD )) + else if (aString.equalsAscii( SC_UNONAME_REFPERIOD )) { sal_Int32 nRefresh = 0; if (aValue >>= nRefresh) @@ -2097,7 +2097,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( } } } - else if (aString.EqualsAscii( SC_UNONAME_CONRES )) + else if (aString.equalsAscii( SC_UNONAME_CONRES )) { } else @@ -2120,40 +2120,40 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const OUString& aPropert ScDBData* pData = GetDBData_Impl(); if ( pData ) { - String aString(aPropertyName); - if ( aString.EqualsAscii( SC_UNONAME_KEEPFORM ) ) + OUString aString(aPropertyName); + if ( aString.equalsAscii( SC_UNONAME_KEEPFORM ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsKeepFmt() ); - else if ( aString.EqualsAscii( SC_UNONAME_MOVCELLS ) ) + else if ( aString.equalsAscii( SC_UNONAME_MOVCELLS ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsDoSize() ); - else if ( aString.EqualsAscii( SC_UNONAME_STRIPDAT ) ) + else if ( aString.equalsAscii( SC_UNONAME_STRIPDAT ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsStripData() ); - else if ( aString.EqualsAscii( SC_UNONAME_ISUSER ) ) + else if ( aString.equalsAscii( SC_UNONAME_ISUSER ) ) { // all database ranges except "unnamed" are user defined ScUnoHelpFunctions::SetBoolInAny( aRet, !pData->GetName().equalsAscii(STR_DB_LOCAL_NONAME)); } - else if ( aString.EqualsAscii( SC_UNO_LINKDISPBIT ) ) + else if ( aString.equalsAscii( SC_UNO_LINKDISPBIT ) ) { // no target bitmaps for individual entries (would be all equal) // ScLinkTargetTypeObj::SetLinkTargetBitmap( aRet, SC_LINKTARGETTYPE_DBAREA ); } - else if ( aString.EqualsAscii( SC_UNO_LINKDISPNAME ) ) + else if ( aString.equalsAscii( SC_UNO_LINKDISPNAME ) ) aRet <<= OUString( aName ); - else if (aString.EqualsAscii( SC_UNONAME_AUTOFLT )) + else if (aString.equalsAscii( SC_UNONAME_AUTOFLT )) { sal_Bool bAutoFilter(GetDBData_Impl()->HasAutoFilter()); ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoFilter ); } - else if (aString.EqualsAscii( SC_UNONAME_USEFLTCRT )) + else if (aString.equalsAscii( SC_UNONAME_USEFLTCRT )) { ScRange aRange; sal_Bool bIsAdvancedSource(GetDBData_Impl()->GetAdvancedQuerySource(aRange)); ScUnoHelpFunctions::SetBoolInAny( aRet, bIsAdvancedSource ); } - else if (aString.EqualsAscii( SC_UNONAME_FLTCRT )) + else if (aString.equalsAscii( SC_UNONAME_FLTCRT )) { table::CellRangeAddress aRange; ScRange aCoreRange; @@ -2162,19 +2162,19 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const OUString& aPropert aRet <<= aRange; } - else if (aString.EqualsAscii( SC_UNONAME_FROMSELECT )) + else if (aString.equalsAscii( SC_UNONAME_FROMSELECT )) { ScUnoHelpFunctions::SetBoolInAny( aRet, GetDBData_Impl()->HasImportSelection() ); } - else if (aString.EqualsAscii( SC_UNONAME_REFPERIOD )) + else if (aString.equalsAscii( SC_UNONAME_REFPERIOD )) { sal_Int32 nRefresh(GetDBData_Impl()->GetRefreshDelay()); aRet <<= nRefresh; } - else if (aString.EqualsAscii( SC_UNONAME_CONRES )) + else if (aString.equalsAscii( SC_UNONAME_CONRES )) { } - else if (aString.EqualsAscii( SC_UNONAME_TOKENINDEX )) + else if (aString.equalsAscii( SC_UNONAME_TOKENINDEX )) { // get index for use in formula tokens (read-only) aRet <<= static_cast<sal_Int32>(GetDBData_Impl()->GetIndex()); @@ -2195,9 +2195,8 @@ OUString SAL_CALL ScDatabaseRangeObj::getImplementationName() throw(uno::Runtime sal_Bool SAL_CALL ScDatabaseRangeObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCDATABASERANGEOBJ_SERVICE ) || - aServiceStr.EqualsAscii( SCLINKTARGET_SERVICE ); + return rServiceName.equalsAscii( SCDATABASERANGEOBJ_SERVICE ) || + rServiceName.equalsAscii( SCLINKTARGET_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScDatabaseRangeObj::getSupportedServiceNames() @@ -2259,7 +2258,7 @@ ScDatabaseRangeObj* ScDatabaseRangesObj::GetObjectByName_Impl(const OUString& aN { if ( pDocShell && hasByName(aName) ) { - String aString(aName); + OUString aString(aName); return new ScDatabaseRangeObj( pDocShell, aString ); } return NULL; @@ -2276,7 +2275,7 @@ void SAL_CALL ScDatabaseRangesObj::addNewByName( const OUString& aName, { ScDBDocFunc aFunc(*pDocShell); - String aString(aName); + OUString aString(aName); ScRange aNameRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet, (SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet ); bDone = aFunc.AddDBRange( aString, aNameRange, sal_True ); @@ -2293,7 +2292,7 @@ void SAL_CALL ScDatabaseRangesObj::removeByName( const OUString& aName ) if (pDocShell) { ScDBDocFunc aFunc(*pDocShell); - String aString(aName); + OUString aString(aName); bDone = aFunc.DeleteDBRange( aString ); } if (!bDone) @@ -2447,7 +2446,7 @@ void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRan throw lang::IndexOutOfBoundsException(); ScDBDocFunc aFunc(*pDocShell); - String aString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)); + OUString aString(STR_DB_LOCAL_NONAME); ScRange aUnnamedRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet, (SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet ); bDone = aFunc.AddDBRange( aString, aUnnamedRange, sal_True ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 1be316cf7da5..0050395ecf45 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -243,9 +243,8 @@ ScPrintUIOptions::ScPrintUIOptions() // create Section for spreadsheet (results in an extra tab page in dialog) SvtModuleOptions aOpt; - String aAppGroupname( aStrings.GetString( 9 ) ); - aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), - aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); + OUString aAppGroupname( aStrings.GetString( 9 ) ); + aAppGroupname = aAppGroupname.replaceFirst( "%s", aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, OUString()); // show subgroup for pages @@ -666,9 +665,9 @@ static OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyVal for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNONAME_RENDERDEV )) + if (aPropName.equalsAscii( SC_UNONAME_RENDERDEV )) { uno::Reference<awt::XDevice> xRenderDevice(rProp.Value, uno::UNO_QUERY); if ( xRenderDevice.is() ) @@ -685,7 +684,7 @@ static OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyVal return pRet; } -static bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Rectangle& rTargetRect, +static bool lcl_ParseTarget( const OUString& rTarget, ScRange& rTargetRange, Rectangle& rTargetRect, bool& rIsSheet, ScDocument* pDoc, SCTAB nSourceTab ) { // test in same order as in SID_CURRENTCELL execute @@ -713,7 +712,7 @@ static bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Recta bRangeValid = true; // named range or database range } else if ( comphelper::string::isdigitAsciiString(rTarget) && - ( nNumeric = rTarget.ToInt32() ) > 0 && nNumeric <= MAXROW+1 ) + ( nNumeric = rTarget.toInt32() ) > 0 && nNumeric <= MAXROW+1 ) { // row number is always mapped to cell A(row) on the same sheet rTargetRange = ScAddress( 0, (SCROW)(nNumeric-1), nSourceTab ); // target row number is 1-based @@ -975,9 +974,9 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection, return nSelectCount; } -static sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const String& rPagesStr, sal_Int32 nTotalPages ) +static sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const OUString& rPagesStr, sal_Int32 nTotalPages ) { - if ( !rPagesStr.Len() ) + if ( rPagesStr.isEmpty() ) return nSelRenderer; StringRangeEnumerator aRangeEnum( rPagesStr, 0, nTotalPages-1 ); @@ -1212,7 +1211,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec { // try to resolve internal link - String aTarget( aBookmark.copy( 1 ) ); + OUString aTarget( aBookmark.copy( 1 ) ); ScRange aTargetRange; Rectangle aTargetRect; // 1/100th mm @@ -1429,7 +1428,7 @@ void SAL_CALL ScModelObj::protect( const OUString& aPassword ) throw(uno::Runtim // #i108245# if already protected, don't change anything if ( pDocShell && !pDocShell->GetDocument()->IsDocProtected() ) { - String aString(aPassword); + OUString aString(aPassword); pDocShell->GetDocFunc().Protect( TABLEID_DOC, aString, sal_True ); } } @@ -1440,7 +1439,7 @@ void SAL_CALL ScModelObj::unprotect( const OUString& aPassword ) SolarMutexGuard aGuard; if (pDocShell) { - String aString(aPassword); + OUString aString(aPassword); sal_Bool bDone = pDocShell->GetDocFunc().Unprotect( TABLEID_DOC, aString, sal_True ); if (!bDone) throw lang::IllegalArgumentException(); @@ -1483,7 +1482,7 @@ sheet::GoalResult SAL_CALL ScModelObj::seekGoal( if (pDocShell) { WaitObject aWait( pDocShell->GetActiveDialogParent() ); - String aGoalString(aGoalValue); + OUString aGoalString(aGoalValue); ScDocument* pDoc = pDocShell->GetDocument(); double fValue = 0.0; sal_Bool bFound = pDoc->Solver( @@ -1596,7 +1595,7 @@ void SAL_CALL ScModelObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); if (pDocShell) { @@ -1611,12 +1610,12 @@ void SAL_CALL ScModelObj::setPropertyValue( if (bOpt) { // done... - if ( aString.EqualsAscii( SC_UNO_IGNORECASE ) || - aString.EqualsAscii( SC_UNONAME_REGEXP ) || - aString.EqualsAscii( SC_UNO_LOOKUPLABELS ) ) + if ( aString.equalsAscii( SC_UNO_IGNORECASE ) || + aString.equalsAscii( SC_UNONAME_REGEXP ) || + aString.equalsAscii( SC_UNO_LOOKUPLABELS ) ) bHardRecalc = false; } - else if ( aString.EqualsAscii( SC_UNONAME_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNONAME_CLOCAL ) ) { lang::Locale aLocale; if ( aValue >>= aLocale ) @@ -1627,13 +1626,13 @@ void SAL_CALL ScModelObj::setPropertyValue( pDoc->SetLanguage( eLatin, eCjk, eCtl ); } } - else if ( aString.EqualsAscii( SC_UNO_CODENAME ) ) + else if ( aString.equalsAscii( SC_UNO_CODENAME ) ) { OUString sCodeName; if ( aValue >>= sCodeName ) pDoc->SetCodeName( sCodeName ); } - else if ( aString.EqualsAscii( SC_UNO_CJK_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNO_CJK_CLOCAL ) ) { lang::Locale aLocale; if ( aValue >>= aLocale ) @@ -1644,7 +1643,7 @@ void SAL_CALL ScModelObj::setPropertyValue( pDoc->SetLanguage( eLatin, eCjk, eCtl ); } } - else if ( aString.EqualsAscii( SC_UNO_CTL_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNO_CTL_CLOCAL ) ) { lang::Locale aLocale; if ( aValue >>= aLocale ) @@ -1655,7 +1654,7 @@ void SAL_CALL ScModelObj::setPropertyValue( pDoc->SetLanguage( eLatin, eCjk, eCtl ); } } - else if ( aString.EqualsAscii( SC_UNO_APPLYFMDES ) ) + else if ( aString.equalsAscii( SC_UNO_APPLYFMDES ) ) { // model is created if not there ScDrawLayer* pModel = pDocShell->MakeDrawLayer(); @@ -1665,7 +1664,7 @@ void SAL_CALL ScModelObj::setPropertyValue( if (pBindings) pBindings->Invalidate( SID_FM_OPEN_READONLY ); } - else if ( aString.EqualsAscii( SC_UNO_AUTOCONTFOC ) ) + else if ( aString.equalsAscii( SC_UNO_AUTOCONTFOC ) ) { // model is created if not there ScDrawLayer* pModel = pDocShell->MakeDrawLayer(); @@ -1675,11 +1674,11 @@ void SAL_CALL ScModelObj::setPropertyValue( if (pBindings) pBindings->Invalidate( SID_FM_AUTOCONTROLFOCUS ); } - else if ( aString.EqualsAscii( SC_UNO_ISLOADED ) ) + else if ( aString.equalsAscii( SC_UNO_ISLOADED ) ) { pDocShell->SetEmpty( !ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); } - else if ( aString.EqualsAscii( SC_UNO_ISUNDOENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISUNDOENABLED ) ) { sal_Bool bUndoEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue ); pDoc->EnableUndo( bUndoEnabled ); @@ -1687,33 +1686,33 @@ void SAL_CALL ScModelObj::setPropertyValue( bUndoEnabled ? officecfg::Office::Common::Undo::Steps::get() : 0); } - else if ( aString.EqualsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) ) { bool bOldAdjustHeightEnabled = pDoc->IsAdjustHeightEnabled(); bool bAdjustHeightEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue ); if( bOldAdjustHeightEnabled != bAdjustHeightEnabled ) pDoc->EnableAdjustHeight( bAdjustHeightEnabled ); } - else if ( aString.EqualsAscii( SC_UNO_ISEXECUTELINKENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISEXECUTELINKENABLED ) ) { pDoc->EnableExecuteLink( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); } - else if ( aString.EqualsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) ) { pDoc->EnableChangeReadOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); } - else if ( aString.EqualsAscii( "BuildId" ) ) + else if ( aString.equalsAscii( "BuildId" ) ) { aValue >>= maBuildId; } - else if ( aString.EqualsAscii( "SavedObject" ) ) // set from chart after saving + else if ( aString.equalsAscii( "SavedObject" ) ) // set from chart after saving { OUString aObjName; aValue >>= aObjName; if ( !aObjName.isEmpty() ) pDoc->RestoreChartListener( aObjName ); } - else if ( aString.EqualsAscii( SC_UNO_INTEROPGRABBAG ) ) + else if ( aString.equalsAscii( SC_UNO_INTEROPGRABBAG ) ) { setGrabBagItem(aValue); } @@ -1734,7 +1733,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; if (pDocShell) @@ -1746,7 +1745,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) { // done... } - else if ( aString.EqualsAscii( SC_UNONAME_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNONAME_CLOCAL ) ) { LanguageType eLatin, eCjk, eCtl; pDoc->GetLanguage( eLatin, eCjk, eCtl ); @@ -1755,13 +1754,13 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) ScUnoConversion::FillLocale( aLocale, eLatin ); aRet <<= aLocale; } - else if ( aString.EqualsAscii( SC_UNO_CODENAME ) ) + else if ( aString.equalsAscii( SC_UNO_CODENAME ) ) { OUString sCodeName = pDoc->GetCodeName(); aRet <<= sCodeName; } - else if ( aString.EqualsAscii( SC_UNO_CJK_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNO_CJK_CLOCAL ) ) { LanguageType eLatin, eCjk, eCtl; pDoc->GetLanguage( eLatin, eCjk, eCtl ); @@ -1770,7 +1769,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) ScUnoConversion::FillLocale( aLocale, eCjk ); aRet <<= aLocale; } - else if ( aString.EqualsAscii( SC_UNO_CTL_CLOCAL ) ) + else if ( aString.equalsAscii( SC_UNO_CTL_CLOCAL ) ) { LanguageType eLatin, eCjk, eCtl; pDoc->GetLanguage( eLatin, eCjk, eCtl ); @@ -1779,73 +1778,73 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) ScUnoConversion::FillLocale( aLocale, eCtl ); aRet <<= aLocale; } - else if ( aString.EqualsAscii( SC_UNO_NAMEDRANGES ) ) + else if ( aString.equalsAscii( SC_UNO_NAMEDRANGES ) ) { aRet <<= uno::Reference<sheet::XNamedRanges>(new ScGlobalNamedRangesObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_DATABASERNG ) ) + else if ( aString.equalsAscii( SC_UNO_DATABASERNG ) ) { aRet <<= uno::Reference<sheet::XDatabaseRanges>(new ScDatabaseRangesObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_UNNAMEDDBRNG ) ) + else if ( aString.equalsAscii( SC_UNO_UNNAMEDDBRNG ) ) { aRet <<= uno::Reference<sheet::XUnnamedDatabaseRanges>(new ScUnnamedDatabaseRangesObj(pDocShell)); } - else if ( aString.EqualsAscii( SC_UNO_COLLABELRNG ) ) + else if ( aString.equalsAscii( SC_UNO_COLLABELRNG ) ) { aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, sal_True )); } - else if ( aString.EqualsAscii( SC_UNO_ROWLABELRNG ) ) + else if ( aString.equalsAscii( SC_UNO_ROWLABELRNG ) ) { aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, false )); } - else if ( aString.EqualsAscii( SC_UNO_AREALINKS ) ) + else if ( aString.equalsAscii( SC_UNO_AREALINKS ) ) { aRet <<= uno::Reference<sheet::XAreaLinks>(new ScAreaLinksObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_DDELINKS ) ) + else if ( aString.equalsAscii( SC_UNO_DDELINKS ) ) { aRet <<= uno::Reference<container::XNameAccess>(new ScDDELinksObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_EXTERNALDOCLINKS ) ) + else if ( aString.equalsAscii( SC_UNO_EXTERNALDOCLINKS ) ) { aRet <<= uno::Reference<sheet::XExternalDocLinks>(new ScExternalDocLinksObj(pDocShell)); } - else if ( aString.EqualsAscii( SC_UNO_SHEETLINKS ) ) + else if ( aString.equalsAscii( SC_UNO_SHEETLINKS ) ) { aRet <<= uno::Reference<container::XNameAccess>(new ScSheetLinksObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_APPLYFMDES ) ) + else if ( aString.equalsAscii( SC_UNO_APPLYFMDES ) ) { // default for no model is TRUE ScDrawLayer* pModel = pDoc->GetDrawLayer(); sal_Bool bOpenInDesign = pModel ? pModel->GetOpenInDesignMode() : sal_True; ScUnoHelpFunctions::SetBoolInAny( aRet, bOpenInDesign ); } - else if ( aString.EqualsAscii( SC_UNO_AUTOCONTFOC ) ) + else if ( aString.equalsAscii( SC_UNO_AUTOCONTFOC ) ) { // default for no model is FALSE ScDrawLayer* pModel = pDoc->GetDrawLayer(); sal_Bool bAutoControlFocus = pModel ? pModel->GetAutoControlFocus() : false; ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoControlFocus ); } - else if ( aString.EqualsAscii( SC_UNO_FORBIDDEN ) ) + else if ( aString.equalsAscii( SC_UNO_FORBIDDEN ) ) { aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell )); } - else if ( aString.EqualsAscii( SC_UNO_HASDRAWPAGES ) ) + else if ( aString.equalsAscii( SC_UNO_HASDRAWPAGES ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument()->GetDrawLayer() != 0) ); } - else if ( aString.EqualsAscii( SC_UNO_BASICLIBRARIES ) ) + else if ( aString.equalsAscii( SC_UNO_BASICLIBRARIES ) ) { aRet <<= pDocShell->GetBasicContainer(); } - else if ( aString.EqualsAscii( SC_UNO_DIALOGLIBRARIES ) ) + else if ( aString.equalsAscii( SC_UNO_DIALOGLIBRARIES ) ) { aRet <<= pDocShell->GetDialogContainer(); } - else if ( aString.EqualsAscii( SC_UNO_VBAGLOBNAME ) ) + else if ( aString.equalsAscii( SC_UNO_VBAGLOBNAME ) ) { /* #i111553# This property provides the name of the constant that will be used to store this model in the global Basic manager. @@ -1854,49 +1853,49 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) constant can co-exist, as required by VBA. */ aRet <<= OUString( "ThisExcelDoc" ); } - else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) ) + else if ( aString.equalsAscii( SC_UNO_RUNTIMEUID ) ) { aRet <<= getRuntimeUID(); } - else if ( aString.EqualsAscii( SC_UNO_HASVALIDSIGNATURES ) ) + else if ( aString.equalsAscii( SC_UNO_HASVALIDSIGNATURES ) ) { aRet <<= hasValidSignatures(); } - else if ( aString.EqualsAscii( SC_UNO_ISLOADED ) ) + else if ( aString.equalsAscii( SC_UNO_ISLOADED ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, !pDocShell->IsEmpty() ); } - else if ( aString.EqualsAscii( SC_UNO_ISUNDOENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISUNDOENABLED ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsUndoEnabled() ); } - else if ( aString.EqualsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsAdjustHeightEnabled() ); } - else if ( aString.EqualsAscii( SC_UNO_ISEXECUTELINKENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISEXECUTELINKENABLED ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsExecuteLinkEnabled() ); } - else if ( aString.EqualsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) ) + else if ( aString.equalsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsChangeReadOnlyEnabled() ); } - else if ( aString.EqualsAscii( SC_UNO_REFERENCEDEVICE ) ) + else if ( aString.equalsAscii( SC_UNO_REFERENCEDEVICE ) ) { VCLXDevice* pXDev = new VCLXDevice(); pXDev->SetOutputDevice( pDoc->GetRefDevice() ); aRet <<= uno::Reference< awt::XDevice >( pXDev ); } - else if ( aString.EqualsAscii( "BuildId" ) ) + else if ( aString.equalsAscii( "BuildId" ) ) { aRet <<= maBuildId; } - else if ( aString.EqualsAscii( "InternalDocument" ) ) + else if ( aString.equalsAscii( "InternalDocument" ) ) { ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SFX_CREATE_MODE_INTERNAL) ); } - else if ( aString.EqualsAscii( SC_UNO_INTEROPGRABBAG ) ) + else if ( aString.equalsAscii( SC_UNO_INTEROPGRABBAG ) ) { getGrabBagItem(aRet); } @@ -1915,7 +1914,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance( { SolarMutexGuard aGuard; uno::Reference<uno::XInterface> xRet; - String aNameStr(aServiceSpecifier); + OUString aNameStr(aServiceSpecifier); sal_uInt16 nType = ScServiceProvider::GetProviderType(aNameStr); if ( nType != SC_SERVICE_INVALID ) { @@ -2035,10 +2034,9 @@ OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeExceptio sal_Bool SAL_CALL ScModelObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( SCMODELOBJ_SERVICE ) || - aServiceStr.EqualsAscii( SCDOCSETTINGS_SERVICE ) || - aServiceStr.EqualsAscii( SCDOC_SERVICE ); + return rServiceName.equalsAscii( SCMODELOBJ_SERVICE ) || + rServiceName.equalsAscii( SCDOCSETTINGS_SERVICE ) || + rServiceName.equalsAscii( SCDOC_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScModelObj::getSupportedServiceNames() @@ -2444,7 +2442,7 @@ void SAL_CALL ScTableSheetsObj::insertNewByName( const OUString& aName, sal_Int1 sal_Bool bDone = false; if (pDocShell) { - String aNamStr(aName); + OUString aNamStr(aName); bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr, sal_True, sal_True ); } if (!bDone) @@ -2474,7 +2472,7 @@ void SAL_CALL ScTableSheetsObj::copyByName( const OUString& aName, sal_Bool bDone = false; if (pDocShell) { - String aNewStr(aCopy); + OUString aNewStr(aCopy); SCTAB nSource; if ( pDocShell->GetDocument()->GetTable( aName, nSource ) ) { @@ -2515,7 +2513,7 @@ void SAL_CALL ScTableSheetsObj::insertByName( const OUString& aName, const uno:: if ( pSheetObj && !pSheetObj->GetDocShell() ) // noch nicht eingefuegt? { ScDocument* pDoc = pDocShell->GetDocument(); - String aNamStr(aName); + OUString aNamStr(aName); SCTAB nDummy; if ( pDoc->GetTable( aNamStr, nDummy ) ) { @@ -2572,7 +2570,7 @@ void SAL_CALL ScTableSheetsObj::replaceByName( const OUString& aName, const uno: if ( pDocShell->GetDocFunc().DeleteTable( nPosition, sal_True, sal_True ) ) { // InsertTable kann jetzt eigentlich nicht schiefgehen... - String aNamStr(aName); + OUString aNamStr(aName); bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr, sal_True, sal_True ); if (bDone) pSheetObj->InitInsertSheet( pDocShell, nPosition ); @@ -2842,7 +2840,7 @@ ScTableColumnObj* ScTableColumnsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) con ScTableColumnObj* ScTableColumnsObj::GetObjectByName_Impl(const OUString& aName) const { SCCOL nCol = 0; - String aString(aName); + OUString aString(aName); if ( ::AlphaToCol( nCol, aString) ) if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol ) return new ScTableColumnObj( pDocShell, nCol, nTab ); @@ -2953,7 +2951,7 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasByName( const OUString& aName ) { SolarMutexGuard aGuard; SCCOL nCol = 0; - String aString(aName); + OUString aString(aName); if ( ::AlphaToCol( nCol, aString) ) if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol ) return sal_True; @@ -2985,24 +2983,24 @@ void SAL_CALL ScTableColumnsObj::setPropertyValue( SCCOLROW nColArr[2]; nColArr[0] = nStartCol; nColArr[1] = nEndCol; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); ScDocFunc& rFunc = pDocShell->GetDocFunc(); - if ( aNameString.EqualsAscii( SC_UNONAME_CELLWID ) ) + if ( aNameString.equalsAscii( SC_UNONAME_CELLWID ) ) { sal_Int32 nNewWidth = 0; if ( aValue >>= nNewWidth ) rFunc.SetWidthOrHeight( sal_True, 1, nColArr, nTab, SC_SIZE_ORIGINAL, (sal_uInt16)HMMToTwips(nNewWidth), sal_True, sal_True ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) ) { sal_Bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue ); ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT; rFunc.SetWidthOrHeight( sal_True, 1, nColArr, nTab, eMode, 0, sal_True, sal_True ); // SC_SIZE_DIRECT with size 0: hide } - else if ( aNameString.EqualsAscii( SC_UNONAME_OWIDTH ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_OWIDTH ) ) { sal_Bool bOpt = ScUnoHelpFunctions::GetBoolFromAny( aValue ); if (bOpt) @@ -3010,7 +3008,7 @@ void SAL_CALL ScTableColumnsObj::setPropertyValue( SC_SIZE_OPTIMAL, STD_EXTRA_WIDTH, sal_True, sal_True ); // sal_False for columns currently has no effect } - else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE ) || aNameString.EqualsAscii( SC_UNONAME_MANPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE ) || aNameString.equalsAscii( SC_UNONAME_MANPAGE ) ) { //! single function to set/remove all breaks? sal_Bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue ); @@ -3031,33 +3029,33 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const OUString& aProperty throw uno::RuntimeException(); ScDocument* pDoc = pDocShell->GetDocument(); - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); uno::Any aAny; //! loop over all columns for current state? - if ( aNameString.EqualsAscii( SC_UNONAME_CELLWID ) ) + if ( aNameString.equalsAscii( SC_UNONAME_CELLWID ) ) { // for hidden column, return original height sal_uInt16 nWidth = pDoc->GetOriginalWidth( nStartCol, nTab ); aAny <<= (sal_Int32)TwipsToHMM(nWidth); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) ) { bool bVis = !pDoc->ColHidden(nStartCol, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, bVis ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_OWIDTH ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_OWIDTH ) ) { sal_Bool bOpt = !(pDoc->GetColFlags( nStartCol, nTab ) & CR_MANUALSIZE); ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE ) ) { ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_MANPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_MANPAGE ) ) { ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) ); @@ -3208,9 +3206,9 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( SCCOLROW nRowArr[2]; nRowArr[0] = nStartRow; nRowArr[1] = nEndRow; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); - if ( aNameString.EqualsAscii( SC_UNONAME_OHEIGHT ) ) + if ( aNameString.equalsAscii( SC_UNONAME_OHEIGHT ) ) { sal_Int32 nNewHeight = 0; if ( pDoc->IsImportingXML() && ( aValue >>= nNewHeight ) ) @@ -3232,7 +3230,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLHGT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLHGT ) ) { sal_Int32 nNewHeight = 0; if ( aValue >>= nNewHeight ) @@ -3250,20 +3248,20 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( (sal_uInt16)HMMToTwips(nNewHeight), sal_True, sal_True ); } } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) ) { sal_Bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue ); ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT; rFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True ); // SC_SIZE_DIRECT with size 0: hide } - else if ( aNameString.EqualsAscii( SC_UNONAME_VISFLAG ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_VISFLAG ) ) { // #i116460# Shortcut to only set the flag, without drawing layer update etc. // Should only be used from import filters. pDoc->SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue )); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLFILT ) ) { //! undo etc. if (ScUnoHelpFunctions::GetBoolFromAny( aValue )) @@ -3271,7 +3269,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( else pDoc->SetRowFiltered(nStartRow, nEndRow, nTab, false); } - else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE) || aNameString.EqualsAscii( SC_UNONAME_MANPAGE) ) + else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE) || aNameString.equalsAscii( SC_UNONAME_MANPAGE) ) { //! single function to set/remove all breaks? sal_Bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue ); @@ -3281,7 +3279,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( else rFunc.RemovePageBreak( false, ScAddress(0,nRow,nTab), sal_True, sal_True, sal_True ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLBACK ) || aNameString.EqualsAscii( SC_UNONAME_CELLTRAN ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLBACK ) || aNameString.equalsAscii( SC_UNONAME_CELLTRAN ) ) { // #i57867# Background color is specified for row styles in the file format, // so it has to be supported along with the row properties (import only). @@ -3304,44 +3302,44 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam throw uno::RuntimeException(); ScDocument* pDoc = pDocShell->GetDocument(); - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); uno::Any aAny; //! loop over all rows for current state? - if ( aNameString.EqualsAscii( SC_UNONAME_CELLHGT ) ) + if ( aNameString.equalsAscii( SC_UNONAME_CELLHGT ) ) { // for hidden row, return original height sal_uInt16 nHeight = pDoc->GetOriginalHeight( nStartRow, nTab ); aAny <<= (sal_Int32)TwipsToHMM(nHeight); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) ) { SCROW nLastRow; bool bVis = !pDoc->RowHidden(nStartRow, nTab, NULL, &nLastRow); ScUnoHelpFunctions::SetBoolInAny( aAny, bVis ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLFILT ) ) { bool bVis = pDoc->RowFiltered(nStartRow, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, bVis ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_OHEIGHT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_OHEIGHT ) ) { sal_Bool bOpt = !(pDoc->GetRowFlags( nStartRow, nTab ) & CR_MANUALSIZE); ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE ) ) { ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_MANPAGE ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_MANPAGE ) ) { ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab); ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_CELLBACK ) || aNameString.EqualsAscii( SC_UNONAME_CELLTRAN ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_CELLBACK ) || aNameString.equalsAscii( SC_UNONAME_CELLTRAN ) ) { // Use ScCellRangeObj to get the property from the cell range // (for completeness only, this is not used by the XML filter). @@ -3635,8 +3633,8 @@ void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName, } } - String aNameStr(aName); - String aCommStr(aComment); + OUString aNameStr(aName); + OUString aCommStr(aComment); Color aColor( COL_LIGHTGRAY ); // Default sal_uInt16 nFlags = SC_SCENARIO_SHOWFRAME | SC_SCENARIO_PRINTFRAME | SC_SCENARIO_TWOWAY | SC_SCENARIO_PROTECT; diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 6f6b3ddc04f4..a94b73f351dd 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -167,15 +167,15 @@ void SAL_CALL ScFilterOptionsObj::setPropertyValues( const uno::Sequence<beans:: for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if ( aPropName.EqualsAscii( SC_UNONAME_FILENAME ) ) + if ( aPropName.equalsAscii( SC_UNONAME_FILENAME ) ) rProp.Value >>= aFileName; - else if ( aPropName.EqualsAscii( SC_UNONAME_FILTERNAME ) ) + else if ( aPropName.equalsAscii( SC_UNONAME_FILTERNAME ) ) rProp.Value >>= aFilterName; - else if ( aPropName.EqualsAscii( SC_UNONAME_FILTEROPTIONS ) ) + else if ( aPropName.equalsAscii( SC_UNONAME_FILTEROPTIONS ) ) rProp.Value >>= aFilterOptions; - else if ( aPropName.EqualsAscii( SC_UNONAME_INPUTSTREAM ) ) + else if ( aPropName.equalsAscii( SC_UNONAME_INPUTSTREAM ) ) rProp.Value >>= xInputStream; } } @@ -191,7 +191,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) { sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL; - String aFilterString( aFilterName ); + OUString aFilterString( aFilterName ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); @@ -201,7 +201,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) // ascii import is special... INetURLObject aURL( aFileName ); - String aPrivDatName(aURL.getName()); + OUString aPrivDatName(aURL.getName()); SvStream* pInStream = NULL; if ( xInputStream.is() ) pInStream = utl::UcbStreamHelper::CreateStream( xInputStream ); diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 301c4b025468..3470065db668 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -312,7 +312,7 @@ void SAL_CALL ScTableConditionalFormat::addNew( { OUString aStrVal; if ( rProp.Value >>= aStrVal ) - aEntry.maPosStr = String( aStrVal ); + aEntry.maPosStr = aStrVal; } else if ( rProp.Name == SC_UNONAME_STYLENAME ) { @@ -568,7 +568,7 @@ void SAL_CALL ScTableConditionalEntry::setFormula1( const OUString& aFormula1 ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - aData.maExpr1 = String( aFormula1 ); + aData.maExpr1 = aFormula1; } OUString SAL_CALL ScTableConditionalEntry::getFormula2() throw(uno::RuntimeException) @@ -581,7 +581,7 @@ void SAL_CALL ScTableConditionalEntry::setFormula2( const OUString& aFormula2 ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - aData.maExpr2 = String( aFormula2 ); + aData.maExpr2 = aFormula2; } table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(uno::RuntimeException) @@ -766,7 +766,7 @@ void SAL_CALL ScTableValidationObj::setFormula1( const OUString& aFormula1 ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - aExpr1 = String( aFormula1 ); + aExpr1 = aFormula1; } OUString SAL_CALL ScTableValidationObj::getFormula2() throw(uno::RuntimeException) @@ -779,7 +779,7 @@ void SAL_CALL ScTableValidationObj::setFormula2( const OUString& aFormula2 ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - aExpr2 = String( aFormula2 ); + aExpr2 = aFormula2; } table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno::RuntimeException) @@ -849,37 +849,37 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); - if ( aString.EqualsAscii( SC_UNONAME_SHOWINP ) ) bShowInput = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if ( aString.EqualsAscii( SC_UNONAME_SHOWERR ) ) bShowError = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if ( aString.EqualsAscii( SC_UNONAME_IGNOREBL ) ) bIgnoreBlank = ScUnoHelpFunctions::GetBoolFromAny( aValue ); - else if ( aString.EqualsAscii( SC_UNONAME_SHOWLIST ) ) aValue >>= nShowList; - else if ( aString.EqualsAscii( SC_UNONAME_INPTITLE ) ) + if ( aString.equalsAscii( SC_UNONAME_SHOWINP ) ) bShowInput = ScUnoHelpFunctions::GetBoolFromAny( aValue ); + else if ( aString.equalsAscii( SC_UNONAME_SHOWERR ) ) bShowError = ScUnoHelpFunctions::GetBoolFromAny( aValue ); + else if ( aString.equalsAscii( SC_UNONAME_IGNOREBL ) ) bIgnoreBlank = ScUnoHelpFunctions::GetBoolFromAny( aValue ); + else if ( aString.equalsAscii( SC_UNONAME_SHOWLIST ) ) aValue >>= nShowList; + else if ( aString.equalsAscii( SC_UNONAME_INPTITLE ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) - aInputTitle = String( aStrVal ); + aInputTitle = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_INPMESS ) ) + else if ( aString.equalsAscii( SC_UNONAME_INPMESS ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) - aInputMessage = String( aStrVal ); + aInputMessage = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_ERRTITLE ) ) + else if ( aString.equalsAscii( SC_UNONAME_ERRTITLE ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) - aErrorTitle = String( aStrVal ); + aErrorTitle = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_ERRMESS ) ) + else if ( aString.equalsAscii( SC_UNONAME_ERRMESS ) ) { OUString aStrVal; if ( aValue >>= aStrVal ) - aErrorMessage = String( aStrVal ); + aErrorMessage = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_TYPE ) ) + else if ( aString.equalsAscii( SC_UNONAME_TYPE ) ) { sheet::ValidationType eType = (sheet::ValidationType) ScUnoHelpFunctions::GetEnumFromAny( aValue ); @@ -899,7 +899,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( } } } - else if ( aString.EqualsAscii( SC_UNONAME_ERRALSTY ) ) + else if ( aString.equalsAscii( SC_UNONAME_ERRALSTY ) ) { sheet::ValidationAlertStyle eStyle = (sheet::ValidationAlertStyle) ScUnoHelpFunctions::GetEnumFromAny( aValue ); @@ -915,15 +915,15 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( } } } - else if ( aString.EqualsAscii( SC_UNONAME_SOURCESTR ) ) + else if ( aString.equalsAscii( SC_UNONAME_SOURCESTR ) ) { // internal - only for XML filter, not in PropertySetInfo, only set OUString aStrVal; if ( aValue >>= aStrVal ) - aPosString = String( aStrVal ); + aPosString = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_FORMULANMSP1 ) ) + else if ( aString.equalsAscii( SC_UNONAME_FORMULANMSP1 ) ) { // internal - only for XML filter, not in PropertySetInfo, only set @@ -931,7 +931,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( if ( aValue >>= aStrVal ) maExprNmsp1 = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_FORMULANMSP2 ) ) + else if ( aString.equalsAscii( SC_UNONAME_FORMULANMSP2 ) ) { // internal - only for XML filter, not in PropertySetInfo, only set @@ -939,7 +939,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( if ( aValue >>= aStrVal ) maExprNmsp2 = aStrVal; } - else if ( aString.EqualsAscii( SC_UNONAME_GRAMMAR1 ) ) + else if ( aString.equalsAscii( SC_UNONAME_GRAMMAR1 ) ) { // internal - only for XML filter, not in PropertySetInfo, only set @@ -947,7 +947,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue( if ( aValue >>= nVal ) meGrammar1 = static_cast< FormulaGrammar::Grammar >(nVal); } - else if ( aString.EqualsAscii( SC_UNONAME_GRAMMAR2 ) ) + else if ( aString.equalsAscii( SC_UNONAME_GRAMMAR2 ) ) { // internal - only for XML filter, not in PropertySetInfo, only set @@ -962,18 +962,18 @@ uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const OUString& aPrope uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; - if ( aString.EqualsAscii( SC_UNONAME_SHOWINP ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowInput ); - else if ( aString.EqualsAscii( SC_UNONAME_SHOWERR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowError ); - else if ( aString.EqualsAscii( SC_UNONAME_IGNOREBL ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bIgnoreBlank ); - else if ( aString.EqualsAscii( SC_UNONAME_SHOWLIST ) ) aRet <<= nShowList; - else if ( aString.EqualsAscii( SC_UNONAME_INPTITLE ) ) aRet <<= OUString( aInputTitle ); - else if ( aString.EqualsAscii( SC_UNONAME_INPMESS ) ) aRet <<= OUString( aInputMessage ); - else if ( aString.EqualsAscii( SC_UNONAME_ERRTITLE ) ) aRet <<= OUString( aErrorTitle ); - else if ( aString.EqualsAscii( SC_UNONAME_ERRMESS ) ) aRet <<= OUString( aErrorMessage ); - else if ( aString.EqualsAscii( SC_UNONAME_TYPE ) ) + if ( aString.equalsAscii( SC_UNONAME_SHOWINP ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowInput ); + else if ( aString.equalsAscii( SC_UNONAME_SHOWERR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowError ); + else if ( aString.equalsAscii( SC_UNONAME_IGNOREBL ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, bIgnoreBlank ); + else if ( aString.equalsAscii( SC_UNONAME_SHOWLIST ) ) aRet <<= nShowList; + else if ( aString.equalsAscii( SC_UNONAME_INPTITLE ) ) aRet <<= OUString( aInputTitle ); + else if ( aString.equalsAscii( SC_UNONAME_INPMESS ) ) aRet <<= OUString( aInputMessage ); + else if ( aString.equalsAscii( SC_UNONAME_ERRTITLE ) ) aRet <<= OUString( aErrorTitle ); + else if ( aString.equalsAscii( SC_UNONAME_ERRMESS ) ) aRet <<= OUString( aErrorMessage ); + else if ( aString.equalsAscii( SC_UNONAME_TYPE ) ) { sheet::ValidationType eType = sheet::ValidationType_ANY; switch (nValMode) @@ -989,7 +989,7 @@ uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const OUString& aPrope } aRet <<= eType; } - else if ( aString.EqualsAscii( SC_UNONAME_ERRALSTY ) ) + else if ( aString.equalsAscii( SC_UNONAME_ERRALSTY ) ) { sheet::ValidationAlertStyle eStyle = sheet::ValidationAlertStyle_STOP; switch (nErrorStyle) diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 1fd2840313c0..7d63cf2e3702 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -243,9 +243,8 @@ OUString SAL_CALL ScFunctionAccess::getImplementationName() throw(uno::RuntimeEx sal_Bool SAL_CALL ScFunctionAccess::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( SCFUNCTIONACCESS_SERVICE ) || - aServiceStr.EqualsAscii( SCDOCSETTINGS_SERVICE ); + return rServiceName.equalsAscii( SCFUNCTIONACCESS_SERVICE ) || + rServiceName.equalsAscii( SCDOCSETTINGS_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScFunctionAccess::getSupportedServiceNames() diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 744c1e45505c..2f78d3ff9c8b 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -218,30 +218,30 @@ void SAL_CALL ScSheetLinkObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); OUString aValStr; - if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) ) + if ( aNameString.equalsAscii( SC_UNONAME_LINKURL ) ) { if ( aValue >>= aValStr ) setFileName( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTER ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTER ) ) { if ( aValue >>= aValStr ) setFilter( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTOPT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTOPT ) ) { if ( aValue >>= aValStr ) setFilterOptions( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_REFPERIOD ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFPERIOD ) ) { sal_Int32 nRefresh = 0; if ( aValue >>= nRefresh ) setRefreshDelay( nRefresh ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_REFDELAY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFDELAY ) ) { sal_Int32 nRefresh = 0; if ( aValue >>= nRefresh ) @@ -254,17 +254,17 @@ uno::Any SAL_CALL ScSheetLinkObj::getPropertyValue( const OUString& aPropertyNam uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); uno::Any aRet; - if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) ) + if ( aNameString.equalsAscii( SC_UNONAME_LINKURL ) ) aRet <<= getFileName(); - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTER ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTER ) ) aRet <<= getFilter(); - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTOPT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTOPT ) ) aRet <<= getFilterOptions(); - else if ( aNameString.EqualsAscii( SC_UNONAME_REFPERIOD ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFPERIOD ) ) aRet <<= getRefreshDelay(); - else if ( aNameString.EqualsAscii( SC_UNONAME_REFDELAY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFDELAY ) ) aRet <<= getRefreshDelay(); return aRet; } @@ -288,7 +288,7 @@ void ScSheetLinkObj::setFileName(const OUString& rNewName) // pLink->Refresh mit neuem Dateinamen bringt sfx2::LinkManager durcheinander // darum per Hand die Tabellen umsetzen und Link per UpdateLinks neu erzeugen - String aNewStr(ScGlobal::GetAbsDocName( String(rNewName), pDocShell )); + OUString aNewStr(ScGlobal::GetAbsDocName( rNewName, pDocShell )); // zuerst Tabellen umsetzen @@ -332,7 +332,7 @@ void ScSheetLinkObj::setFilter(const OUString& Filter) ScTableLink* pLink = GetLink_Impl(); if (pLink) { - String aFilterStr(Filter); + OUString aFilterStr(Filter); pLink->Refresh( aFileName, aFilterStr, NULL, pLink->GetRefreshDelay() ); } } @@ -435,7 +435,7 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName) if (pDocShell) { - String aNameStr(aName); + OUString aNameStr(aName); ScDocument* pDoc = pDocShell->GetDocument(); SCTAB nTabCount = pDoc->GetTableCount(); @@ -443,7 +443,7 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName) if (pDoc->IsLinked(nTab)) { //! case-insensitiv ??? - String aLinkDoc = pDoc->GetLinkDoc( nTab ); + OUString aLinkDoc = pDoc->GetLinkDoc( nTab ); if ( aLinkDoc == aNameStr ) return new ScSheetLinkObj( pDocShell, aNameStr ); } @@ -533,7 +533,7 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName ) if (pDocShell) { - String aNameStr(aName); + OUString aNameStr(aName); ScDocument* pDoc = pDocShell->GetDocument(); SCTAB nTabCount = pDoc->GetTableCount(); @@ -541,7 +541,7 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName ) if (pDoc->IsLinked(nTab)) { //! case-insensitiv ??? - String aLinkDoc(pDoc->GetLinkDoc( nTab )); + OUString aLinkDoc(pDoc->GetLinkDoc( nTab )); if ( aLinkDoc == aNameStr ) return sal_True; } @@ -649,10 +649,10 @@ void ScAreaLinkObj::Modify_Impl( const OUString* pNewFile, const OUString* pNewF ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos); if (pLink) { - String aFile (pLink->GetFile()); - String aFilter (pLink->GetFilter()); - String aOptions (pLink->GetOptions()); - String aSource (pLink->GetSource()); + OUString aFile (pLink->GetFile()); + OUString aFilter (pLink->GetFilter()); + OUString aOptions (pLink->GetOptions()); + OUString aSource (pLink->GetSource()); ScRange aDest (pLink->GetDestArea()); sal_uLong nRefresh = pLink->GetRefreshDelay(); @@ -666,15 +666,15 @@ void ScAreaLinkObj::Modify_Impl( const OUString* pNewFile, const OUString* pNewF sal_Bool bFitBlock = sal_True; // verschieben, wenn durch Update Groesse geaendert if (pNewFile) { - aFile = String( *pNewFile ); + aFile = *pNewFile; aFile = ScGlobal::GetAbsDocName( aFile, pDocShell ); //! in InsertAreaLink? } if (pNewFilter) - aFilter = String( *pNewFilter ); + aFilter = *pNewFilter; if (pNewOptions) - aOptions = String( *pNewOptions ); + aOptions = *pNewOptions; if (pNewSource) - aSource = String( *pNewSource ); + aSource = *pNewSource; if (pNewDest) { ScUnoConversion::FillScRange( aDest, *pNewDest ); @@ -764,30 +764,30 @@ void SAL_CALL ScAreaLinkObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); OUString aValStr; - if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) ) + if ( aNameString.equalsAscii( SC_UNONAME_LINKURL ) ) { if ( aValue >>= aValStr ) setFileName( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTER ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTER ) ) { if ( aValue >>= aValStr ) setFilter( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTOPT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTOPT ) ) { if ( aValue >>= aValStr ) setFilterOptions( aValStr ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_REFPERIOD ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFPERIOD ) ) { sal_Int32 nRefresh = 0; if ( aValue >>= nRefresh ) setRefreshDelay( nRefresh ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_REFDELAY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFDELAY ) ) { sal_Int32 nRefresh = 0; if ( aValue >>= nRefresh ) @@ -800,17 +800,17 @@ uno::Any SAL_CALL ScAreaLinkObj::getPropertyValue( const OUString& aPropertyName uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); uno::Any aRet; - if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) ) + if ( aNameString.equalsAscii( SC_UNONAME_LINKURL ) ) aRet <<= getFileName(); - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTER ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTER ) ) aRet <<= getFilter(); - else if ( aNameString.EqualsAscii( SC_UNONAME_FILTOPT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_FILTOPT ) ) aRet <<= getFilterOptions(); - else if ( aNameString.EqualsAscii( SC_UNONAME_REFPERIOD ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFPERIOD ) ) aRet <<= getRefreshDelay(); - else if ( aNameString.EqualsAscii( SC_UNONAME_REFDELAY ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_REFDELAY ) ) aRet <<= getRefreshDelay(); return aRet; } @@ -964,10 +964,10 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP SolarMutexGuard aGuard; if (pDocShell) { - String aFileStr (aFileName); - String aFilterStr (aFilter); - String aOptionStr (aFilterOptions); - String aSourceStr (aSourceArea); + OUString aFileStr (aFileName); + OUString aFilterStr (aFilter); + OUString aOptionStr (aFilterOptions); + OUString aSourceStr (aSourceArea); ScAddress aDestAddr( (SCCOL)aDestPos.Column, (SCROW)aDestPos.Row, aDestPos.Sheet ); aFileStr = ScGlobal::GetAbsDocName( aFileStr, pDocShell ); //! in InsertAreaLink ??? @@ -1084,14 +1084,10 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) // XNamed -static String lcl_BuildDDEName( const String& rAppl, const String& rTopic, const String& rItem ) +static OUString lcl_BuildDDEName( const OUString& rAppl, const OUString& rTopic, const OUString& rItem ) { // Appl|Topic!Item (wie Excel) - String aRet = rAppl; - aRet += '|'; - aRet += rTopic; - aRet += '!'; - aRet += rItem; + OUString aRet = rAppl + "|" + rTopic + "!" + rItem; return aRet; } @@ -1300,7 +1296,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName) { if (pDocShell) { - String aNamStr(aName); + OUString aNamStr(aName); OUString aAppl, aTopic, aItem; ScDocument* pDoc = pDocShell->GetDocument(); @@ -1399,7 +1395,7 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName ) SolarMutexGuard aGuard; if (pDocShell) { - String aNamStr(aName); + OUString aNamStr(aName); OUString aAppl, aTopic, aItem; ScDocument* pDoc = pDocShell->GetDocument(); diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index a2e706dac7df..38936d70ba3c 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -172,7 +172,7 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray* ScRangeName* pNewRanges = new ScRangeName(*pNames); - String aInsName = pOld->GetName(); + OUString aInsName = pOld->GetName(); if (pNewName) aInsName = *pNewName; @@ -862,7 +862,7 @@ ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByName_Impl(const OUString& aName) { if ( pDocShell && hasByName(aName) ) - return new ScNamedRangeObj(this, pDocShell, String(aName)); + return new ScNamedRangeObj(this, pDocShell, aName); return NULL; } @@ -893,7 +893,7 @@ ScLocalNamedRangesObj::~ScLocalNamedRangesObj() ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByName_Impl(const OUString& aName) { if ( pDocShell && hasByName( aName ) ) - return new ScNamedRangeObj( this, pDocShell, String(aName), mxSheet); + return new ScNamedRangeObj( this, pDocShell, aName, mxSheet); return NULL; } diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx index 6107e503fac7..2f36768e4aff 100644 --- a/sc/source/ui/unoobj/pageuno.cxx +++ b/sc/source/ui/unoobj/pageuno.cxx @@ -52,8 +52,7 @@ OUString SAL_CALL ScPageObj::getImplementationName() sal_Bool SAL_CALL ScPageObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( "com.sun.star.sheet.SpreadsheetDrawPage" ); + return rServiceName.equalsAscii( "com.sun.star.sheet.SpreadsheetDrawPage" ); } uno::Sequence<OUString> SAL_CALL ScPageObj::getSupportedServiceNames() diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index ffdb7ea5bf0a..401ee34a384a 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -290,8 +290,8 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l uno::Reference< XInteractionHandler > xInteraction; String aURL; OUString sTemp; - String aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection) - String aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) + OUString aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection) + OUString aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) OUString aDocumentTitle; // interesting only if set in this method @@ -323,7 +323,7 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; } - else if( !aURL.Len() && lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileName")) ) + else if( !aURL.Len() && lDescriptor[nProperty].Name == "FileName" ) { lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; @@ -374,21 +374,21 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l bWasReadOnly = pItem && pItem->GetValue(); const SfxFilter* pFilter = 0; - String aPrefix = OUString( "private:factory/" ); - if( aURL.Match( aPrefix ) == aPrefix.Len() ) + OUString aPrefix = OUString( "private:factory/" ); + if( aURL.Match( aPrefix ) == aPrefix.getLength() ) { - String aPattern( aPrefix ); - aPattern += OUString("scalc"); - if ( aURL.Match( aPattern ) >= aPattern.Len() ) + OUString aPattern( aPrefix ); + aPattern += "scalc"; + if ( aURL.Match( aPattern ) >= aPattern.getLength() ) pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL ); } else { // container for Calc filters SfxFilterMatcher aMatcher("scalc"); - if ( aPreselectedFilterName.Len() ) + if ( !aPreselectedFilterName.isEmpty() ) pFilter = SfxFilter::GetFilterByName( aPreselectedFilterName ); - else if( aTypeName.Len() ) + else if( !aTypeName.isEmpty() ) pFilter = aMatcher.GetFilter4EA( aTypeName ); // ctor of SfxMedium uses owner transition of ItemSet @@ -450,7 +450,7 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l packages::zip::ZipIOException aZipException; // repairing is done only if this type is requested from outside - if ( ( aWrap.TargetException >>= aZipException ) && aTypeName.Len() ) + if ( ( aWrap.TargetException >>= aZipException ) && !aTypeName.isEmpty() ) { if ( xInteraction.is() ) { @@ -477,7 +477,7 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l } if ( !bRepairAllowed ) - aTypeName.Erase(); + aTypeName = ""; } } catch( uno::RuntimeException& ) @@ -486,10 +486,10 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l } catch( uno::Exception& ) { - aTypeName.Erase(); + aTypeName = ""; } - if ( aTypeName.Len() ) + if ( !aTypeName.isEmpty() ) pFilter = SfxFilterMatcher("scalc").GetFilter4EA( aTypeName ); } } diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index aa8eb5d0790d..0347209f7e52 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -469,10 +469,10 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( } break; case SC_SERVICE_CELLSTYLE: - xRet.set((style::XStyle*)new ScStyleObj( NULL, SFX_STYLE_FAMILY_PARA, String() )); + xRet.set((style::XStyle*)new ScStyleObj( NULL, SFX_STYLE_FAMILY_PARA, OUString() )); break; case SC_SERVICE_PAGESTYLE: - xRet.set((style::XStyle*)new ScStyleObj( NULL, SFX_STYLE_FAMILY_PAGE, String() )); + xRet.set((style::XStyle*)new ScStyleObj( NULL, SFX_STYLE_FAMILY_PAGE, OUString() )); break; case SC_SERVICE_AUTOFORMAT: xRet.set((container::XIndexAccess*)new ScAutoFormatObj( SC_AFMTOBJ_INVALID )); diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index ba34f21787a7..898f2a3d4a53 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -338,9 +338,9 @@ void SAL_CALL ScShapeObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); - if ( aNameString.EqualsAscii( SC_UNONAME_ANCHOR ) ) + if ( aNameString.equalsAscii( SC_UNONAME_ANCHOR ) ) { uno::Reference<sheet::XCellRangeAddressable> xRangeAdd(aValue, uno::UNO_QUERY); if (xRangeAdd.is()) @@ -448,7 +448,7 @@ void SAL_CALL ScShapeObj::setPropertyValue( else throw lang::IllegalArgumentException("only XCell or XSpreadsheet objects allowed", static_cast<cppu::OWeakObject*>(this), 0); } - else if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_IMAGEMAP ) ) { SdrObject* pObj = GetSdrObject(); if ( pObj ) @@ -472,7 +472,7 @@ void SAL_CALL ScShapeObj::setPropertyValue( } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_HORIPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HORIPOS ) ) { sal_Int32 nPos = 0; if (aValue >>= nPos) @@ -570,7 +570,7 @@ void SAL_CALL ScShapeObj::setPropertyValue( } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_VERTPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_VERTPOS ) ) { sal_Int32 nPos = 0; if (aValue >>= nPos) @@ -639,15 +639,15 @@ void SAL_CALL ScShapeObj::setPropertyValue( } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) || - aNameString.EqualsAscii( SC_UNONAME_URL) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HYPERLINK ) || + aNameString.equalsAscii( SC_UNONAME_URL) ) { OUString sHlink; ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this, true); if ( ( aValue >>= sHlink ) && pInfo ) pInfo->SetHlink( sHlink ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_MOVEPROTECT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_MOVEPROTECT ) ) { if( SdrObject* pObj = this->GetSdrObject() ) { @@ -669,10 +669,10 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString = aPropertyName; + OUString aNameString = aPropertyName; uno::Any aAny; - if ( aNameString.EqualsAscii( SC_UNONAME_ANCHOR ) ) + if ( aNameString.equalsAscii( SC_UNONAME_ANCHOR ) ) { SdrObject *pObj = GetSdrObject(); if (pObj) @@ -703,7 +703,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_IMAGEMAP ) ) { uno::Reference< uno::XInterface > xImageMap; SdrObject* pObj = GetSdrObject(); @@ -720,7 +720,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } aAny <<= uno::Reference< container::XIndexContainer >::query( xImageMap ); } - else if ( aNameString.EqualsAscii( SC_UNONAME_HORIPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HORIPOS ) ) { SdrObject *pObj = GetSdrObject(); if (pObj) @@ -779,7 +779,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_VERTPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_VERTPOS ) ) { SdrObject *pObj = GetSdrObject(); if (pObj) @@ -824,15 +824,15 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } } } - else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) || - aNameString.EqualsAscii( SC_UNONAME_URL ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HYPERLINK ) || + aNameString.equalsAscii( SC_UNONAME_URL ) ) { OUString sHlink; if ( ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this) ) sHlink = pInfo->GetHlink(); aAny <<= sHlink; } - else if ( aNameString.EqualsAscii( SC_UNONAME_MOVEPROTECT ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_MOVEPROTECT ) ) { sal_Bool aProt = false; if ( SdrObject* pObj = this->GetSdrObject() ) @@ -916,22 +916,22 @@ beans::PropertyState SAL_CALL ScShapeObj::getPropertyState( const OUString& aPro throw(beans::UnknownPropertyException, uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; - if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + if ( aNameString.equalsAscii( SC_UNONAME_IMAGEMAP ) ) { // ImageMap is always "direct" } - else if ( aNameString.EqualsAscii( SC_UNONAME_ANCHOR ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_ANCHOR ) ) { // Anchor is always "direct" } - else if ( aNameString.EqualsAscii( SC_UNONAME_HORIPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_HORIPOS ) ) { // HoriPos is always "direct" } - else if ( aNameString.EqualsAscii( SC_UNONAME_VERTPOS ) ) + else if ( aNameString.equalsAscii( SC_UNONAME_VERTPOS ) ) { // VertPos is always "direct" } @@ -965,9 +965,9 @@ void SAL_CALL ScShapeObj::setPropertyToDefault( const OUString& aPropertyName ) throw(beans::UnknownPropertyException, uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString(aPropertyName); + OUString aNameString(aPropertyName); - if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + if ( aNameString.equalsAscii( SC_UNONAME_IMAGEMAP ) ) { SdrObject* pObj = GetSdrObject(); if ( pObj ) @@ -997,10 +997,10 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const OUString& aPropertyName uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameString = aPropertyName; + OUString aNameString = aPropertyName; uno::Any aAny; - if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + if ( aNameString.equalsAscii( SC_UNONAME_IMAGEMAP ) ) { // default: empty ImageMap uno::Reference< uno::XInterface > xImageMap(SvUnoImageMap_createInstance( GetSupportedMacroItems() )); diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index 6e9cb8042705..d1022920f81c 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -145,21 +145,21 @@ void SAL_CALL ScCellSearchObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); - - if (aString.EqualsAscii( SC_UNO_SRCHBACK )) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHBYROW )) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHCASE )) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHREGEXP )) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIM )) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMREL )) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSTYLES )) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHWORDS )) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMADD )) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) pSearchItem->SetCellType( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); + OUString aString(aPropertyName); + + if (aString.equalsAscii( SC_UNO_SRCHBACK )) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHBYROW )) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHCASE )) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHREGEXP )) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSIM )) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMREL )) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSTYLES )) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHWORDS )) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMADD )) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMEX )) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMREM )) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHTYPE )) pSearchItem->SetCellType( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aString.equalsAscii( SC_UNO_SRCHFILTERED )) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); } uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyName ) @@ -167,22 +167,22 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyNa uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; - if (aString.EqualsAscii( SC_UNO_SRCHBACK )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() ); - else if (aString.EqualsAscii( SC_UNO_SRCHBYROW )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() ); - else if (aString.EqualsAscii( SC_UNO_SRCHCASE )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() ); - else if (aString.EqualsAscii( SC_UNO_SRCHREGEXP )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIM )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMREL )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() ); - else if (aString.EqualsAscii( SC_UNO_SRCHSTYLES )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() ); - else if (aString.EqualsAscii( SC_UNO_SRCHWORDS )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() ); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMADD )) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger(); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) aRet <<= (sal_Int16) pSearchItem->GetLEVOther(); - else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter(); - else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) aRet <<= (sal_Int16) pSearchItem->GetCellType(); - else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() ); + if (aString.equalsAscii( SC_UNO_SRCHBACK )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() ); + else if (aString.equalsAscii( SC_UNO_SRCHBYROW )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() ); + else if (aString.equalsAscii( SC_UNO_SRCHCASE )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() ); + else if (aString.equalsAscii( SC_UNO_SRCHREGEXP )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() ); + else if (aString.equalsAscii( SC_UNO_SRCHSIM )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMREL )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() ); + else if (aString.equalsAscii( SC_UNO_SRCHSTYLES )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() ); + else if (aString.equalsAscii( SC_UNO_SRCHWORDS )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() ); + else if (aString.equalsAscii( SC_UNO_SRCHSIMADD )) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger(); + else if (aString.equalsAscii( SC_UNO_SRCHSIMEX )) aRet <<= (sal_Int16) pSearchItem->GetLEVOther(); + else if (aString.equalsAscii( SC_UNO_SRCHSIMREM )) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter(); + else if (aString.equalsAscii( SC_UNO_SRCHTYPE )) aRet <<= (sal_Int16) pSearchItem->GetCellType(); + else if (aString.equalsAscii( SC_UNO_SRCHFILTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() ); return aRet; } @@ -199,9 +199,8 @@ OUString SAL_CALL ScCellSearchObj::getImplementationName() throw(uno::RuntimeExc sal_Bool SAL_CALL ScCellSearchObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr(rServiceName); - return aServiceStr.EqualsAscii( SCSEARCHDESCRIPTOR_SERVICE ) || - aServiceStr.EqualsAscii( SCREPLACEDESCRIPTOR_SERVICE ); + return rServiceName.equalsAscii( SCSEARCHDESCRIPTOR_SERVICE ) || + rServiceName.equalsAscii( SCREPLACEDESCRIPTOR_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScCellSearchObj::getSupportedServiceNames() diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 88af941cc8a6..24a74901c3a4 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -459,10 +459,10 @@ ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName { if ( pDocShell ) { - String aNameStr( aName ); - if ( aNameStr.EqualsAscii( SC_FAMILYNAME_CELL ) ) + OUString aNameStr( aName ); + if ( aNameStr.equalsAscii( SC_FAMILYNAME_CELL ) ) return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA ); - else if ( aNameStr.EqualsAscii( SC_FAMILYNAME_PAGE ) ) + else if ( aNameStr.equalsAscii( SC_FAMILYNAME_PAGE ) ) return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE ); } // no assertion - called directly from getByName @@ -531,8 +531,8 @@ sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const OUString& aName ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aNameStr( aName ); - return ( aNameStr.EqualsAscii( SC_FAMILYNAME_CELL ) || aNameStr.EqualsAscii( SC_FAMILYNAME_PAGE ) ); + OUString aNameStr( aName ); + return ( aNameStr.equalsAscii( SC_FAMILYNAME_CELL ) || aNameStr.equalsAscii( SC_FAMILYNAME_PAGE ) ); } // style::XStyleLoader @@ -562,13 +562,13 @@ void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const OUString& aURL, for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNONAME_OVERWSTL )) + if (aPropName.equalsAscii( SC_UNONAME_OVERWSTL )) bLoadReplace = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_LOADCELL )) + else if (aPropName.equalsAscii( SC_UNONAME_LOADCELL )) bLoadCellStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_LOADPAGE )) + else if (aPropName.equalsAscii( SC_UNONAME_LOADPAGE )) bLoadPageStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); } @@ -638,7 +638,7 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) SfxStyleSheetBase* pStyle = aIter[(sal_uInt16)nIndex]; if ( pStyle ) { - return new ScStyleObj( pDocShell, eFamily, String (pStyle->GetName()) ); + return new ScStyleObj( pDocShell, eFamily, pStyle->GetName() ); } } } @@ -649,7 +649,7 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName) { if ( pDocShell ) { - String aString(aName); + OUString aString(aName); ScDocument* pDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); @@ -673,7 +673,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno:: if ( pStyleObj && pStyleObj->GetFamily() == eFamily && !pStyleObj->IsInserted() ) // noch nicht eingefuegt? { - String aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); ScDocument* pDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); @@ -723,7 +723,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) bool bFound = false; if ( pDocShell ) { - String aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); ScDocument* pDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); @@ -862,7 +862,7 @@ sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName ) SolarMutexGuard aGuard; if ( pDocShell ) { - String aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); ScDocument* pDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); @@ -1067,7 +1067,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) //! DocFunc-Funktion?? //! Undo ????????????? - String aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, sal::static_int_cast<sal_uInt16>(eFamily) )); sal_Bool bOk = pStyle->SetParent( aString ); if (bOk) { @@ -1123,7 +1123,7 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName ) //! DocFunc-Funktion?? //! Undo ????????????? - String aString(aNewName); + OUString aString(aNewName); sal_Bool bOk = pStyle->SetName( aString ); if (bOk) { diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index fe1de8d019cf..bc209a8bf59d 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -76,7 +76,7 @@ ScLinkTargetTypesObj::ScLinkTargetTypesObj(ScDocShell* pDocSh) : pDocShell->GetDocument()->AddUnoObject(*this); for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++) - aNames[i] = String( ScResId( nTypeResIds[i] ) ); + aNames[i] = ScResId( nTypeResIds[i] ); } ScLinkTargetTypesObj::~ScLinkTargetTypesObj() @@ -98,7 +98,7 @@ uno::Any SAL_CALL ScLinkTargetTypesObj::getByName(const OUString& aName) { if (pDocShell) { - String aNameStr(aName); + OUString aNameStr(aName); for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++) if ( aNames[i] == aNameStr ) return uno::makeAny(uno::Reference< beans::XPropertySet >(new ScLinkTargetTypeObj( pDocShell, i ))); @@ -118,7 +118,7 @@ uno::Sequence<OUString> SAL_CALL ScLinkTargetTypesObj::getElementNames(void) thr sal_Bool SAL_CALL ScLinkTargetTypesObj::hasByName(const OUString& aName) throw( uno::RuntimeException ) { - String aNameStr = aName; + OUString aNameStr = aName; for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++) if ( aNames[i] == aNameStr ) return sal_True; @@ -144,7 +144,7 @@ ScLinkTargetTypeObj::ScLinkTargetTypeObj(ScDocShell* pDocSh, sal_uInt16 nT) : nType( nT ) { pDocShell->GetDocument()->AddUnoObject(*this); - aName = String( ScResId( nTypeResIds[nType] ) ); //! on demand? + aName = ScResId( nTypeResIds[nType] ); //! on demand? } ScLinkTargetTypeObj::~ScLinkTargetTypeObj() @@ -238,10 +238,10 @@ uno::Any SAL_CALL ScLinkTargetTypeObj::getPropertyValue(const OUString& Property throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { uno::Any aRet; - String aNameStr(PropertyName); - if ( aNameStr.EqualsAscii( SC_UNO_LINKDISPBIT ) ) + OUString aNameStr(PropertyName); + if ( aNameStr.equalsAscii( SC_UNO_LINKDISPBIT ) ) SetLinkTargetBitmap( aRet, nType ); - else if ( aNameStr.EqualsAscii( SC_UNO_LINKDISPNAME ) ) + else if ( aNameStr.equalsAscii( SC_UNO_LINKDISPNAME ) ) aRet <<= OUString( aName ); return aRet; diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index fd49c4129d69..b8328207ed11 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -364,7 +364,7 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException void SAL_CALL ScHeaderFooterTextObj::setString( const OUString& aText ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aText); + OUString aString(aText); // for pure text, no font info is needed in pool defaults ScHeaderEditEngine aEditEngine(EditEngine::CreatePool(), true); diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 4271ce836dab..19b1237c7eba 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -193,12 +193,12 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); - if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) ) + OUString aString(aPropertyName); + if ( aString.equalsAscii( SC_UNO_COMPILEFAP ) ) { aValue >>= mbCompileFAP; } - else if ( aString.EqualsAscii( SC_UNO_COMPILEENGLISH ) ) + else if ( aString.equalsAscii( SC_UNO_COMPILEENGLISH ) ) { bool bOldEnglish = mbEnglish; if (aValue >>= mbEnglish) @@ -217,15 +217,15 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( else throw lang::IllegalArgumentException(); } - else if ( aString.EqualsAscii( SC_UNO_FORMULACONVENTION ) ) + else if ( aString.equalsAscii( SC_UNO_FORMULACONVENTION ) ) { aValue >>= mnConv; } - else if ( aString.EqualsAscii( SC_UNO_IGNORELEADING ) ) + else if ( aString.equalsAscii( SC_UNO_IGNORELEADING ) ) { aValue >>= mbIgnoreSpaces; } - else if ( aString.EqualsAscii( SC_UNO_OPCODEMAP ) ) + else if ( aString.equalsAscii( SC_UNO_OPCODEMAP ) ) { if (aValue >>= maOpCodeMapping) { @@ -237,7 +237,7 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( else throw lang::IllegalArgumentException(); } - else if ( aString.EqualsAscii( SC_UNO_EXTERNALLINKS ) ) + else if ( aString.equalsAscii( SC_UNO_EXTERNALLINKS ) ) { if (!(aValue >>= maExternalLinks)) throw lang::IllegalArgumentException(); @@ -252,28 +252,28 @@ uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const OUString& aPropert { SolarMutexGuard aGuard; uno::Any aRet; - String aString(aPropertyName); - if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) ) + OUString aString(aPropertyName); + if ( aString.equalsAscii( SC_UNO_COMPILEFAP ) ) { aRet <<= mbCompileFAP; } - else if ( aString.EqualsAscii( SC_UNO_COMPILEENGLISH ) ) + else if ( aString.equalsAscii( SC_UNO_COMPILEENGLISH ) ) { aRet <<= mbEnglish; } - else if ( aString.EqualsAscii( SC_UNO_FORMULACONVENTION ) ) + else if ( aString.equalsAscii( SC_UNO_FORMULACONVENTION ) ) { aRet <<= mnConv; } - else if ( aString.EqualsAscii( SC_UNO_IGNORELEADING ) ) + else if ( aString.equalsAscii( SC_UNO_IGNORELEADING ) ) { aRet <<= mbIgnoreSpaces; } - else if ( aString.EqualsAscii( SC_UNO_OPCODEMAP ) ) + else if ( aString.equalsAscii( SC_UNO_OPCODEMAP ) ) { aRet <<= maOpCodeMapping; } - else if ( aString.EqualsAscii( SC_UNO_EXTERNALLINKS ) ) + else if ( aString.equalsAscii( SC_UNO_EXTERNALLINKS ) ) { aRet <<= maExternalLinks; } diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index b718006649d4..ea7bb416bdb4 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1822,9 +1822,9 @@ void SAL_CALL ScTabViewObj::setPropertyValue( uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); - if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) + if ( aString.equalsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) { bFilteredRangeSelection = ScUnoHelpFunctions::GetBoolFromAny(aValue); return; @@ -1837,33 +1837,33 @@ void SAL_CALL ScTabViewObj::setPropertyValue( const ScViewOptions& rOldOpt = pViewSh->GetViewData()->GetOptions(); ScViewOptions aNewOpt(rOldOpt); - if ( aString.EqualsAscii( SC_UNO_COLROWHDR ) || aString.EqualsAscii( OLD_UNO_COLROWHDR ) ) + if ( aString.equalsAscii( SC_UNO_COLROWHDR ) || aString.equalsAscii( OLD_UNO_COLROWHDR ) ) aNewOpt.SetOption( VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_HORSCROLL ) || aString.EqualsAscii( OLD_UNO_HORSCROLL ) ) + else if ( aString.equalsAscii( SC_UNO_HORSCROLL ) || aString.equalsAscii( OLD_UNO_HORSCROLL ) ) aNewOpt.SetOption( VOPT_HSCROLL, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_OUTLSYMB ) || aString.EqualsAscii( OLD_UNO_OUTLSYMB ) ) + else if ( aString.equalsAscii( SC_UNO_OUTLSYMB ) || aString.equalsAscii( OLD_UNO_OUTLSYMB ) ) aNewOpt.SetOption( VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHEETTABS ) || aString.EqualsAscii( OLD_UNO_SHEETTABS ) ) + else if ( aString.equalsAscii( SC_UNO_SHEETTABS ) || aString.equalsAscii( OLD_UNO_SHEETTABS ) ) aNewOpt.SetOption( VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWANCHOR ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWANCHOR ) ) aNewOpt.SetOption( VOPT_ANCHOR, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWFORM ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWFORM ) ) aNewOpt.SetOption( VOPT_FORMULAS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWGRID ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWGRID ) ) aNewOpt.SetOption( VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWHELP ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWHELP ) ) aNewOpt.SetOption( VOPT_HELPLINES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWNOTES ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWNOTES ) ) aNewOpt.SetOption( VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWPAGEBR ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWPAGEBR ) ) aNewOpt.SetOption( VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWZERO ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWZERO ) ) aNewOpt.SetOption( VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_VALUEHIGH ) || aString.EqualsAscii( OLD_UNO_VALUEHIGH ) ) + else if ( aString.equalsAscii( SC_UNO_VALUEHIGH ) || aString.equalsAscii( OLD_UNO_VALUEHIGH ) ) aNewOpt.SetOption( VOPT_SYNTAX, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_VERTSCROLL ) || aString.EqualsAscii( OLD_UNO_VERTSCROLL ) ) + else if ( aString.equalsAscii( SC_UNO_VERTSCROLL ) || aString.equalsAscii( OLD_UNO_VERTSCROLL ) ) aNewOpt.SetOption( VOPT_VSCROLL, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWOBJ ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWOBJ ) ) { sal_Int16 nIntVal = 0; if ( aValue >>= nIntVal ) @@ -1874,7 +1874,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue( aNewOpt.SetObjMode( VOBJ_TYPE_OLE, (ScVObjMode)nIntVal); } } - else if ( aString.EqualsAscii( SC_UNO_SHOWCHARTS ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWCHARTS ) ) { sal_Int16 nIntVal = 0; if ( aValue >>= nIntVal ) @@ -1885,7 +1885,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue( aNewOpt.SetObjMode( VOBJ_TYPE_CHART, (ScVObjMode)nIntVal); } } - else if ( aString.EqualsAscii( SC_UNO_SHOWDRAW ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWDRAW ) ) { sal_Int16 nIntVal = 0; if ( aValue >>= nIntVal ) @@ -1896,19 +1896,19 @@ void SAL_CALL ScTabViewObj::setPropertyValue( aNewOpt.SetObjMode( VOBJ_TYPE_DRAW, (ScVObjMode)nIntVal); } } - else if ( aString.EqualsAscii( SC_UNO_GRIDCOLOR ) ) + else if ( aString.equalsAscii( SC_UNO_GRIDCOLOR ) ) { sal_Int32 nIntVal = 0; if ( aValue >>= nIntVal ) - aNewOpt.SetGridColor( nIntVal, String() ); + aNewOpt.SetGridColor( nIntVal, OUString() ); } - else if ( aString.EqualsAscii( SC_UNO_ZOOMTYPE ) ) + else if ( aString.equalsAscii( SC_UNO_ZOOMTYPE ) ) { sal_Int16 nIntVal = 0; if ( aValue >>= nIntVal ) SetZoomType(nIntVal); } - else if ( aString.EqualsAscii( SC_UNO_ZOOMVALUE ) ) + else if ( aString.equalsAscii( SC_UNO_ZOOMVALUE ) ) { sal_Int16 nIntVal = 0; if ( aValue >>= nIntVal ) @@ -1945,10 +1945,10 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName uno::RuntimeException) { SolarMutexGuard aGuard; - String aString(aPropertyName); + OUString aString(aPropertyName); uno::Any aRet; - if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) + if ( aString.equalsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) { ScUnoHelpFunctions::SetBoolInAny(aRet, bFilteredRangeSelection); return aRet; @@ -1959,33 +1959,33 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName { const ScViewOptions& rOpt = pViewSh->GetViewData()->GetOptions(); - if ( aString.EqualsAscii( SC_UNO_COLROWHDR ) || aString.EqualsAscii( OLD_UNO_COLROWHDR ) ) + if ( aString.equalsAscii( SC_UNO_COLROWHDR ) || aString.equalsAscii( OLD_UNO_COLROWHDR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HEADER ) ); - else if ( aString.EqualsAscii( SC_UNO_HORSCROLL ) || aString.EqualsAscii( OLD_UNO_HORSCROLL ) ) + else if ( aString.equalsAscii( SC_UNO_HORSCROLL ) || aString.equalsAscii( OLD_UNO_HORSCROLL ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HSCROLL ) ); - else if ( aString.EqualsAscii( SC_UNO_OUTLSYMB ) || aString.EqualsAscii( OLD_UNO_OUTLSYMB ) ) + else if ( aString.equalsAscii( SC_UNO_OUTLSYMB ) || aString.equalsAscii( OLD_UNO_OUTLSYMB ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_OUTLINER ) ); - else if ( aString.EqualsAscii( SC_UNO_SHEETTABS ) || aString.EqualsAscii( OLD_UNO_SHEETTABS ) ) + else if ( aString.equalsAscii( SC_UNO_SHEETTABS ) || aString.equalsAscii( OLD_UNO_SHEETTABS ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_TABCONTROLS ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWANCHOR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_ANCHOR ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWFORM ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_FORMULAS ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWGRID ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_GRID ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWHELP ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HELPLINES ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWNOTES ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NOTES ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWPAGEBR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_PAGEBREAKS ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWZERO ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NULLVALS ) ); - else if ( aString.EqualsAscii( SC_UNO_VALUEHIGH ) || aString.EqualsAscii( OLD_UNO_VALUEHIGH ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWANCHOR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_ANCHOR ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWFORM ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_FORMULAS ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWGRID ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_GRID ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWHELP ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HELPLINES ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWNOTES ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NOTES ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWPAGEBR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_PAGEBREAKS ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWZERO ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NULLVALS ) ); + else if ( aString.equalsAscii( SC_UNO_VALUEHIGH ) || aString.equalsAscii( OLD_UNO_VALUEHIGH ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_SYNTAX ) ); - else if ( aString.EqualsAscii( SC_UNO_VERTSCROLL ) || aString.EqualsAscii( OLD_UNO_VERTSCROLL ) ) + else if ( aString.equalsAscii( SC_UNO_VERTSCROLL ) || aString.equalsAscii( OLD_UNO_VERTSCROLL ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_VSCROLL ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWOBJ ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_OLE ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWCHARTS ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_CHART ) ); - else if ( aString.EqualsAscii( SC_UNO_SHOWDRAW ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_DRAW ) ); - else if ( aString.EqualsAscii( SC_UNO_GRIDCOLOR ) ) aRet <<= (sal_Int32)( rOpt.GetGridColor().GetColor() ); - else if ( aString.EqualsAscii( SC_UNO_VISAREA ) ) aRet <<= GetVisArea(); - else if ( aString.EqualsAscii( SC_UNO_ZOOMTYPE ) ) aRet <<= GetZoomType(); - else if ( aString.EqualsAscii( SC_UNO_ZOOMVALUE ) ) aRet <<= GetZoom(); - else if ( aString.EqualsAscii( SC_UNO_VISAREASCREEN ) ) + else if ( aString.equalsAscii( SC_UNO_SHOWOBJ ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_OLE ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWCHARTS ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_CHART ) ); + else if ( aString.equalsAscii( SC_UNO_SHOWDRAW ) ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_DRAW ) ); + else if ( aString.equalsAscii( SC_UNO_GRIDCOLOR ) ) aRet <<= (sal_Int32)( rOpt.GetGridColor().GetColor() ); + else if ( aString.equalsAscii( SC_UNO_VISAREA ) ) aRet <<= GetVisArea(); + else if ( aString.equalsAscii( SC_UNO_ZOOMTYPE ) ) aRet <<= GetZoomType(); + else if ( aString.equalsAscii( SC_UNO_ZOOMVALUE ) ) aRet <<= GetZoom(); + else if ( aString.equalsAscii( SC_UNO_VISAREASCREEN ) ) { ScViewData* pViewData = pViewSh->GetViewData(); Window* pActiveWin = ( pViewData ? pViewData->GetActiveWin() : NULL ); @@ -2064,7 +2064,7 @@ void SAL_CALL ScTabViewObj::startRangeSelection( ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { - String aInitVal, aTitle; + OUString aInitVal, aTitle; sal_Bool bCloseOnButtonUp = false; sal_Bool bSingleCell = false; sal_Bool bMultiSelection = false; @@ -2075,23 +2075,23 @@ void SAL_CALL ScTabViewObj::startRangeSelection( for (long i = 0; i < nPropCount; i++) { const beans::PropertyValue& rProp = pPropArray[i]; - String aPropName(rProp.Name); + OUString aPropName(rProp.Name); - if (aPropName.EqualsAscii( SC_UNONAME_CLOSEONUP )) + if (aPropName.equalsAscii( SC_UNONAME_CLOSEONUP )) bCloseOnButtonUp = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_TITLE )) + else if (aPropName.equalsAscii( SC_UNONAME_TITLE )) { if ( rProp.Value >>= aStrVal ) - aTitle = String( aStrVal ); + aTitle = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_INITVAL )) + else if (aPropName.equalsAscii( SC_UNONAME_INITVAL )) { if ( rProp.Value >>= aStrVal ) - aInitVal = String( aStrVal ); + aInitVal = aStrVal; } - else if (aPropName.EqualsAscii( SC_UNONAME_SINGLECELL )) + else if (aPropName.equalsAscii( SC_UNONAME_SINGLECELL )) bSingleCell = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); - else if (aPropName.EqualsAscii( SC_UNONAME_MULTISEL )) + else if (aPropName.equalsAscii( SC_UNONAME_MULTISEL )) bMultiSelection = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value ); } @@ -2208,9 +2208,8 @@ OUString SAL_CALL ScTabViewObj::getImplementationName() throw(uno::RuntimeExcept sal_Bool SAL_CALL ScTabViewObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - String aServiceStr( rServiceName ); - return aServiceStr.EqualsAscii( SCTABVIEWOBJ_SERVICE ) || - aServiceStr.EqualsAscii( SCVIEWSETTINGS_SERVICE ); + return rServiceName.equalsAscii( SCTABVIEWOBJ_SERVICE ) || + rServiceName.equalsAscii( SCVIEWSETTINGS_SERVICE ); } uno::Sequence<OUString> SAL_CALL ScTabViewObj::getSupportedServiceNames() |