LibreOffice Module sc (master) 1
typedstrdata.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <typedstrdata.hxx>
11#include <global.hxx>
12
14
16{
17 if (left.meStrType != right.meStrType)
18 return left.meStrType < right.meStrType;
19
20 if (left.meStrType == Value)
21 return left.mfValue < right.mfValue;
22
23 if (left.mbIsDate != right.mbIsDate)
24 return left.mbIsDate < right.mbIsDate;
25
27 left.maStrValue, right.maStrValue) < 0;
28}
29
31{
32 if (left.meStrType != right.meStrType)
33 return left.meStrType < right.meStrType;
34
35 if (left.meStrType == Value)
36 return left.mfValue < right.mfValue;
37
38 if (left.mbIsDate != right.mbIsDate)
39 return left.mbIsDate < right.mbIsDate;
40
42 left.maStrValue, right.maStrValue) < 0;
43}
44
46{
47 if (left.meStrType != right.meStrType)
48 return false;
49
50 if (left.meStrType == Value && left.mfRoundedValue != right.mfRoundedValue)
51 return false;
52
53 if (left.mbIsDate != right.mbIsDate )
54 return false;
55
57 left.maStrValue, right.maStrValue) == 0;
58}
59
61{
62 if (left.meStrType != right.meStrType)
63 return false;
64
65 if (left.meStrType == Value && left.mfRoundedValue != right.mfRoundedValue)
66 return false;
67
68 if (left.mbIsDate != right.mbIsDate )
69 return false;
70
72 left.maStrValue, right.maStrValue) == 0;
73}
74
76{
77 // Case insensitive comparison by default.
78 return LessCaseInsensitive()(*this, r);
79}
80
82 const OUString& rStr, double fVal, double fRVal, StringType nType, bool bDate ) :
83 maStrValue(rStr),
84 mfValue(fVal),
85 mfRoundedValue(fRVal),
87 mbIsDate( bDate ) {}
88
90 maVal(rVal), mbCaseSens(bCaseSens) {}
91
93{
94 if (mbCaseSens)
95 {
97 }
98 else
99 {
101 }
102}
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
FindTypedStrData(const ScTypedStrData &rVal, bool bCaseSens)
ScTypedStrData maVal
bool operator()(const ScTypedStrData &r) const
static SC_DLLPUBLIC CollatorWrapper & GetCollator()
case-insensitive collator
Definition: global.cxx:1055
static CollatorWrapper & GetCaseCollator()
case-sensitive collator
Definition: global.cxx:1066
double mfRoundedValue
OUString maStrValue
StringType meStrType
bool operator<(const ScTypedStrData &r) const
ScTypedStrData(OUString &&rStr, double fVal=0.0, double fRVal=0.0, StringType nType=Standard, bool bDate=false)
OString right
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
sal_uInt64 left