Kaydet (Commit) 6815354b authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

Typo: isAggreateFunction + isNumericOrAggreateFunction

Change-Id: Ief40b8f83defb223c9f6cba4bab89486e1c73f99
Reviewed-on: https://gerrit.libreoffice.org/67605
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 16f15322
......@@ -109,12 +109,12 @@ namespace dbaui
sal_Int32 GetFunctionType() const { return m_eFunctionType; }
sal_uInt16 GetColumnId() const { return m_nColumnId;}
bool isAggreateFunction() const { return (m_eFunctionType & FKT_AGGREGATE) == FKT_AGGREGATE; }
bool isAggregateFunction() const { return (m_eFunctionType & FKT_AGGREGATE) == FKT_AGGREGATE; }
bool isOtherFunction() const { return (m_eFunctionType & FKT_OTHER) == FKT_OTHER; }
bool isNumeric() const { return (m_eFunctionType & FKT_NUMERIC) == FKT_NUMERIC; }
bool isNoneFunction() const { return m_eFunctionType == FKT_NONE; }
bool isCondition() const { return (m_eFunctionType & FKT_CONDITION) == FKT_CONDITION; }
bool isNumericOrAggreateFunction() const { return isNumeric() || isAggreateFunction(); }
bool isNumericOrAggregateFunction() const { return isNumeric() || isAggregateFunction(); }
bool HasCriteria() const
{
......
......@@ -659,7 +659,7 @@ namespace
else
aTmpStr.append(rFieldName);
if ( field->isAggreateFunction() )
if ( field->isAggregateFunction() )
{
OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-(");
OUStringBuffer aTmpStr2( field->GetFunction());
......@@ -671,7 +671,7 @@ namespace
if (!rFieldAlias.isEmpty() &&
(rFieldName.toChar() != '*' ||
field->isNumericOrAggreateFunction() ||
field->isNumericOrAggregateFunction() ||
field->isOtherFunction()))
{
aTmpStr.append(" AS ");
......@@ -750,14 +750,14 @@ namespace
else
aWork += ::dbtools::quoteName(aQuote, aFieldName);
if ( field->isAggreateFunction() || field->IsGroupBy() )
if ( field->isAggregateFunction() || field->IsGroupBy() )
{
if (aHavingStr.isEmpty()) // no more criteria
aHavingStr += "("; // bracket
else
aHavingStr += C_AND;
if ( field->isAggreateFunction() )
if ( field->isAggregateFunction() )
{
OSL_ENSURE(!field->GetFunction().isEmpty(),"No function name for aggregate given!");
aHavingStr += field->GetFunction() + "(" + aWork + ")"; // bracket
......@@ -904,7 +904,7 @@ namespace
{
aWorkStr += ::dbtools::quoteName(aQuote, field->GetFieldAlias());
}
else if ( field->isNumericOrAggreateFunction() )
else if ( field->isNumericOrAggregateFunction() )
{
OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name cannot be empty! ;-(");
aWorkStr += field->GetFunction() + "("
......@@ -2916,14 +2916,14 @@ std::unique_ptr<OSQLParseNode> OQueryDesignView::getPredicateTreeFromEntry(const
{
// we have a function here so we have to distinguish the type of return vOUalue
OUString sFunction;
if ( pEntry->isNumericOrAggreateFunction() )
if ( pEntry->isNumericOrAggregateFunction() )
sFunction = pEntry->GetFunction().getToken(0, '(');
if ( sFunction.isEmpty() )
sFunction = pEntry->GetField().getToken(0, '(');
sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sFunction,&rParser.getContext());
if ( nType == DataType::OTHER || (sFunction.isEmpty() && pEntry->isNumericOrAggreateFunction()) )
if ( nType == DataType::OTHER || (sFunction.isEmpty() && pEntry->isNumericOrAggregateFunction()) )
{
// first try the international version
OUString sSql;
......
......@@ -683,7 +683,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef co
OUString sQuotedFullFieldName(::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), _sFieldName ));
OUString sFullFieldName(_sFieldName);
if ( _pEntry->isAggreateFunction() )
if ( _pEntry->isAggregateFunction() )
{
OSL_ENSURE(!_pEntry->GetFunction().isEmpty(),"No empty Function name allowed here! ;-(");
sQuotedFullFieldName = _pEntry->GetFunction() + "(" + sQuotedFullFieldName + ")";
......@@ -1648,7 +1648,7 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo )
pEntry->GetFunctionType() == rInfo->GetFunctionType() &&
pEntry->GetFunction() == rInfo->GetFunction())
{
if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() )
if ( pEntry->isNumericOrAggregateFunction() && rInfo->IsGroupBy() )
{
pEntry->SetGroupBy(false);
// we do want to consider that bAllFieldsSearched still true here
......@@ -1673,7 +1673,7 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo )
if (bAllFieldsSearched)
{
OTableFieldDescRef pTmp = InsertField(rInfo, BROWSER_INVALIDID, false, false );
if ( pTmp->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) // the GroupBy is inherited from rInfo
if ( pTmp->isNumericOrAggregateFunction() && rInfo->IsGroupBy() ) // the GroupBy is inherited from rInfo
pTmp->SetGroupBy(false);
}
}
......@@ -1723,7 +1723,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const O
pEntry->GetFunction() == rInfo->GetFunction() &&
pEntry->IsGroupBy() == rInfo->IsGroupBy() )
{
if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() )
if ( pEntry->isNumericOrAggregateFunction() && rInfo->IsGroupBy() )
pEntry->SetGroupBy(false);
else
{
......@@ -1769,7 +1769,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const O
else if (bAllFieldsSearched)
{
OTableFieldDescRef pTmp = InsertField(rInfo, BROWSER_INVALIDID, false, false );
if ( pTmp->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) // the GroupBy was inherited from rInfo
if ( pTmp->isNumericOrAggregateFunction() && rInfo->IsGroupBy() ) // the GroupBy was inherited from rInfo
pTmp->SetGroupBy(false);
if ( pTmp.is() )
{
......@@ -2129,7 +2129,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const
// we always show the group function at first
if ( pEntry->IsGroupBy() )
aText = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);
else if ( pEntry->isNumericOrAggreateFunction() )
else if ( pEntry->isNumericOrAggregateFunction() )
aText = pEntry->GetFunction();
break;
default:
......
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