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