/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
OOperandParam::OOperandParam(sal_Int32 _nPos)
: OOperandRow(static_cast<sal_uInt16>(_nPos), DataType::VARCHAR) // Standard-Type
{ //TODO: Actually do something here (the current state of OOperandParam appears to be "the // remains of the very beginnings of a never finished implementation of support for parameters // in this code", as Lionel put it in the comments at <https://gerrit.libreoffice.org/c/core/+/ // 116839/1#message-7b2bbf3543f559a0b67dc35cd940e2ab8829c274> "-Werror,-Wunused-but-set-variable // (Clang 13 trunk)").
}
// Comparison (depending on Data-type): switch (eDBType)
{ case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR:
{
OUString sLH = aLH.getString(), sRH = aRH.getString();
sal_Int32 nRes = sLH.compareToIgnoreAsciiCase(sRH); switch(aPredicateType)
{ case SQLFilterOperator::EQUAL: bResult = (nRes == 0); break; case SQLFilterOperator::NOT_EQUAL: bResult = (nRes != 0); break; case SQLFilterOperator::LESS: bResult = (nRes < 0); break; case SQLFilterOperator::LESS_EQUAL: bResult = (nRes <= 0); break; case SQLFilterOperator::GREATER: bResult = (nRes > 0); break; case SQLFilterOperator::GREATER_EQUAL: bResult = (nRes >= 0); break; default: bResult = false;
}
} break; case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: case DataType::DECIMAL: case DataType::NUMERIC: case DataType::REAL: case DataType::DOUBLE: case DataType::BIT: case DataType::TIMESTAMP: case DataType::DATE: case DataType::TIME:
{ double n = aLH.getDouble(), m = aRH.getDouble();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.