Kaydet (Commit) 4cdd1c97 authored tarafından Sören Möller's avatar Sören Möller Kaydeden (comit) Kohei Yoshida

Changed String to OUString in public variables of ScFuncDesc

I have changed four public variables of ScFuncDesc in sc/inc/funcdesc.hxx from deprecated String to OUString and corrected all uses of these variables
üst f8d290f9
......@@ -38,6 +38,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase4.hxx>
#include <rtl/ustring.hxx>
class ScFunctionDescriptionObj;
......
......@@ -93,17 +93,17 @@ public:
suppressed). */
USHORT GetSuppressedArgCount() const;
String *pFuncName; // Function name
String *pFuncDesc; // Description of function
String **ppDefArgNames; // Parameter name(s)
String **ppDefArgDescs; // Description(s) of parameter(s)
ParameterFlags *pDefArgFlags; // Flags for each parameter
USHORT nFIndex; // Unique function index
USHORT nCategory; // Function category
USHORT nArgCount; // All parameter count, suppressed and unsuppressed
USHORT nHelpId; // HelpID of function
bool bIncomplete :1; // Incomplete argument info (set for add-in info from configuration)
bool bHasSuppressedArgs :1; // Whether there is any suppressed parameter.
::rtl::OUString *pFuncName; // Function name
::rtl::OUString *pFuncDesc; // Description of function
::rtl::OUString **ppDefArgNames; // Parameter name(s)
::rtl::OUString **ppDefArgDescs; // Description(s) of parameter(s)
ParameterFlags *pDefArgFlags; // Flags for each parameter
USHORT nFIndex; // Unique function index
USHORT nCategory; // Function category
USHORT nArgCount; // All parameter count, suppressed and unsuppressed
USHORT nHelpId; // HelpID of function
bool bIncomplete :1; // Incomplete argument info (set for add-in info from configuration)
bool bHasSuppressedArgs :1; // Whether there is any suppressed parameter.
};
//============================================================================
......
......@@ -1168,17 +1168,17 @@ ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
}
}
pDesc->pFuncName = new String( ScCompiler::GetNativeSymbol( static_cast<OpCode>( aRes.GetId())));
pDesc->pFuncDesc = new String(ScResId(1));
pDesc->pFuncName = new ::rtl::OUString( ScCompiler::GetNativeSymbol( static_cast<OpCode>( aRes.GetId())));
pDesc->pFuncDesc = (::rtl::OUString*)(new String(ScResId(1)));
if (nArgs)
{
pDesc->ppDefArgNames = new String*[nArgs];
pDesc->ppDefArgDescs = new String*[nArgs];
pDesc->ppDefArgNames = new ::rtl::OUString*[nArgs];
pDesc->ppDefArgDescs = new ::rtl::OUString*[nArgs];
for (USHORT i = 0; i < nArgs; i++)
{
pDesc->ppDefArgNames[i] = new String(ScResId(2*(i+1) ));
pDesc->ppDefArgDescs[i] = new String(ScResId(2*(i+1)+1));
pDesc->ppDefArgNames[i] = (::rtl::OUString*)(new String(ScResId(2*(i+1) )));
pDesc->ppDefArgDescs[i] = (::rtl::OUString*)(new String(ScResId(2*(i+1)+1)));
}
}
......@@ -1250,7 +1250,7 @@ ScFunctionList::ScFunctionList() :
pDesc->nFIndex = i;
aFunctionList.Insert( pDesc, LIST_APPEND );
nStrLen = (*(pDesc->pFuncName)).Len();
nStrLen = (*(pDesc->pFuncName)).getLength();
if (nStrLen > nMaxFuncNameLen)
nMaxFuncNameLen = nStrLen;
}
......@@ -1283,73 +1283,73 @@ ScFunctionList::ScFunctionList() :
pAddInFuncData->GetParamDesc( aArgName, aArgDesc, 0 );
pDesc->nFIndex = nNextId++; // ??? OpCode vergeben
pDesc->nCategory = ID_FUNCTION_GRP_ADDINS;
pDesc->pFuncName = new String(pAddInFuncData->GetInternalName());
pDesc->pFuncName->ToUpperAscii();
pDesc->pFuncDesc = new String( aArgDesc );
*(pDesc->pFuncDesc) += '\n';
pDesc->pFuncDesc->AppendAscii(RTL_CONSTASCII_STRINGPARAM( "( AddIn: " ));
pDesc->pFuncName = new ::rtl::OUString(pAddInFuncData->GetInternalName());
pDesc->pFuncName->toAsciiUpperCase();
pDesc->pFuncDesc = new ::rtl::OUString( aArgDesc );
*(pDesc->pFuncDesc) += *(new ::rtl::OUString( '\n' ));
*(pDesc->pFuncDesc) += ::rtl::OUString::createFromAscii("( AddIn: ");
*(pDesc->pFuncDesc) += pAddInFuncData->GetModuleName();
pDesc->pFuncDesc->AppendAscii(RTL_CONSTASCII_STRINGPARAM( " )" ));
*(pDesc->pFuncDesc) += ::rtl::OUString::createFromAscii( " )" );
pDesc->nArgCount = nArgs;
if (nArgs)
{
pDesc->pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgs];
pDesc->ppDefArgNames = new String*[nArgs];
pDesc->ppDefArgDescs = new String*[nArgs];
pDesc->ppDefArgNames = new ::rtl::OUString*[nArgs];
pDesc->ppDefArgDescs = new ::rtl::OUString*[nArgs];
for (j = 0; j < nArgs; j++)
{
pDesc->pDefArgFlags[j].bOptional = false;
pDesc->pDefArgFlags[j].bSuppress = false;
pAddInFuncData->GetParamDesc( aArgName, aArgDesc, j+1 );
if ( aArgName.Len() )
pDesc->ppDefArgNames[j] = new String( aArgName );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aArgName );
else
{
switch (pAddInFuncData->GetParamType(j+1))
{
case PTR_DOUBLE:
pDesc->ppDefArgNames[j] = new String( aDefArgNameValue );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameValue );
break;
case PTR_STRING:
pDesc->ppDefArgNames[j] = new String( aDefArgNameString );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameString );
break;
case PTR_DOUBLE_ARR:
pDesc->ppDefArgNames[j] = new String( aDefArgNameValues );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameValues );
break;
case PTR_STRING_ARR:
pDesc->ppDefArgNames[j] = new String( aDefArgNameStrings );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameStrings );
break;
case PTR_CELL_ARR:
pDesc->ppDefArgNames[j] = new String( aDefArgNameCells );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameCells );
break;
default:
pDesc->ppDefArgNames[j] = new String( aDefArgNameNone );
pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameNone );
break;
}
}
if ( aArgDesc.Len() )
pDesc->ppDefArgDescs[j] = new String( aArgDesc );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aArgDesc );
else
{
switch (pAddInFuncData->GetParamType(j+1))
{
case PTR_DOUBLE:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescValue );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescValue );
break;
case PTR_STRING:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescString );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescString );
break;
case PTR_DOUBLE_ARR:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescValues );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescValues );
break;
case PTR_STRING_ARR:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescStrings );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescStrings );
break;
case PTR_CELL_ARR:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescCells );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescCells );
break;
default:
pDesc->ppDefArgDescs[j] = new String( aDefArgDescNone );
pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescNone );
break;
}
}
......@@ -1357,7 +1357,7 @@ ScFunctionList::ScFunctionList() :
}
aFunctionList.Insert(pDesc, LIST_APPEND);
nStrLen = (*(pDesc->pFuncName)).Len();
nStrLen = (*(pDesc->pFuncName)).getLength();
if ( nStrLen > nMaxFuncNameLen)
nMaxFuncNameLen = nStrLen;
}
......@@ -1374,7 +1374,7 @@ ScFunctionList::ScFunctionList() :
if ( pUnoAddIns->FillFunctionDesc( nFunc, *pDesc ) )
{
aFunctionList.Insert(pDesc, LIST_APPEND);
nStrLen = (*(pDesc->pFuncName)).Len();
nStrLen = (*(pDesc->pFuncName)).getLength();
if (nStrLen > nMaxFuncNameLen)
nMaxFuncNameLen = nStrLen;
}
......@@ -1476,7 +1476,7 @@ String ScFuncDesc::GetParamList() const
else
{
nLastAdded = i;
aSig += *(ppDefArgNames[i]);
aSig += (String)*(ppDefArgNames[i]);
if ( i != nArgCount-1 )
{
aSig.Append(sep);
......@@ -1497,7 +1497,7 @@ String ScFuncDesc::GetParamList() const
{
if (!pDefArgFlags[nArg].bSuppress)
{
aSig += *(ppDefArgNames[nArg]);
aSig += (String)*(ppDefArgNames[nArg]);
aSig.Append(sep);
aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
}
......@@ -1506,11 +1506,11 @@ String ScFuncDesc::GetParamList() const
* there were, we'd have to cope with it here and above for the fix
* parameters. For now parameters are always added, so no special
* treatment of a trailing "; " necessary. */
aSig += *(ppDefArgNames[nFix]);
aSig += (String)*(ppDefArgNames[nFix]);
aSig += '1';
aSig.Append(sep);
aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
aSig += *(ppDefArgNames[nFix]);
aSig += (String)*(ppDefArgNames[nFix]);
aSig += '2';
aSig.Append(sep);
aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ... " ));
......@@ -1769,7 +1769,7 @@ const ScFuncDesc* ScFunctionMgr::Get( const String& rFName ) const
const ScFuncDesc* pDesc = NULL;
if (rFName.Len() <= pFuncList->GetMaxFuncNameLen())
for (pDesc = First(0); pDesc; pDesc = Next())
if (rFName.EqualsIgnoreCaseAscii(*(pDesc->pFuncName)))
if (rFName.EqualsIgnoreCaseAscii((String)(*(pDesc->pFuncName))))
break;
return pDesc;
}
......
......@@ -1048,7 +1048,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFuncData& rFuncData )
{
String aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
::rtl::OUString aCompare = (::rtl::OUString)rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
ULONG nCount = rFunctionList.GetCount();
for (ULONG nPos=0; nPos<nCount; nPos++)
......@@ -1328,14 +1328,14 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r
// nFIndex is set from outside
rDesc.pFuncName = new String( rFuncData.GetUpperLocal() ); //! upper?
rDesc.pFuncName = new ::rtl::OUString( rFuncData.GetUpperLocal() ); //! upper?
rDesc.nCategory = rFuncData.GetCategory();
rDesc.nHelpId = rFuncData.GetHelpId();
String aDesc = rFuncData.GetDescription();
if (!aDesc.Len())
aDesc = rFuncData.GetLocalName(); // use name if no description is available
rDesc.pFuncDesc = new String( aDesc );
rDesc.pFuncDesc = new ::rtl::OUString( aDesc );
// AddInArgumentType_CALLER is already left out in FuncData
......@@ -1345,18 +1345,18 @@ BOOL ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r
BOOL bMultiple = FALSE;
const ScAddInArgDesc* pArgs = rFuncData.GetArguments();
rDesc.ppDefArgNames = new String*[nArgCount];
rDesc.ppDefArgDescs = new String*[nArgCount];
rDesc.ppDefArgNames = new ::rtl::OUString*[nArgCount];
rDesc.ppDefArgDescs = new ::rtl::OUString*[nArgCount];
rDesc.pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgCount];
for ( long nArg=0; nArg<nArgCount; nArg++ )
{
rDesc.ppDefArgNames[nArg] = new String( pArgs[nArg].aName );
rDesc.ppDefArgDescs[nArg] = new String( pArgs[nArg].aDescription );
rDesc.ppDefArgNames[nArg] = new ::rtl::OUString( pArgs[nArg].aName );
rDesc.ppDefArgDescs[nArg] = new ::rtl::OUString( pArgs[nArg].aDescription );
rDesc.pDefArgFlags[nArg].bOptional = pArgs[nArg].bOptional;
rDesc.pDefArgFlags[nArg].bSuppress = false;
// no empty names...
if ( rDesc.ppDefArgNames[nArg]->Len() == 0 )
if ( rDesc.ppDefArgNames[nArg]->getLength() == 0 )
{
String aDefName( RTL_CONSTASCII_USTRINGPARAM("arg") );
aDefName += String::CreateFromInt32( nArg+1 );
......
......@@ -618,7 +618,7 @@ void ScFunctionDockWin::SetDescription()
aString += '\n';
}
aString+=*(pDesc->pFuncDesc);
aString+=(String)*(pDesc->pFuncDesc);
aFiFuncDesc.SetText(aString);
aFiFuncDesc.StateChanged(STATE_CHANGE_TEXT);
......
......@@ -952,7 +952,7 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const rtl::OUString& aName )
lang::WrappedTargetException, uno::RuntimeException)
{
SolarMutexGuard aGuard;
String aNameStr(aName);
::rtl::OUString aNameStr(aName);
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
......@@ -982,10 +982,10 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const rtl::OUString& aName )
sal_Int32 SAL_CALL ScFunctionListObj::getCount() throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
USHORT nCount = 0;
sal_Int32 nCount = 0;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
nCount = (USHORT)pFuncList->GetCount();
nCount = (sal_Int32)pFuncList->GetCount();
return nCount;
}
......@@ -1045,10 +1045,10 @@ uno::Sequence<rtl::OUString> SAL_CALL ScFunctionListObj::getElementNames() throw
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
USHORT nCount = (USHORT)pFuncList->GetCount();
sal_uInt32 nCount = pFuncList->GetCount();
uno::Sequence<rtl::OUString> aSeq(nCount);
rtl::OUString* pAry = aSeq.getArray();
for (USHORT nIndex=0; nIndex<nCount; nIndex++)
for (sal_uInt32 nIndex=0; nIndex<nCount; nIndex++)
{
const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex);
if ( pDesc && pDesc->pFuncName )
......@@ -1063,20 +1063,19 @@ sal_Bool SAL_CALL ScFunctionListObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
String aNameStr(aName);
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
USHORT nCount = (USHORT)pFuncList->GetCount();
for (USHORT nIndex=0; nIndex<nCount; nIndex++)
sal_uInt32 nCount = pFuncList->GetCount();
for (sal_uInt32 nIndex=0; nIndex<nCount; nIndex++)
{
const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex);
//! Case-insensitiv ???
if ( pDesc && pDesc->pFuncName && aNameStr == *pDesc->pFuncName )
return TRUE;
if ( pDesc && pDesc->pFuncName && aName == *pDesc->pFuncName )
return sal_True;
}
}
return FALSE;
return sal_False;
}
//------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment