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
15#include <utility>
16
18{
19 return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
20}
21
23{
24 if (left.meStrType != right.meStrType)
25 return left.meStrType < right.meStrType;
26
27 if (left.meStrType == Value)
28 {
29 if (left.mfValue == right.mfValue)
30 return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
31 return left.mfValue < right.mfValue;
32 }
33
34 if (left.mbIsDate != right.mbIsDate)
35 return left.mbIsDate < right.mbIsDate;
36
37 sal_Int32 nEqual = ScGlobal::GetCaseCollator().compareString(
38 left.maStrValue, right.maStrValue);
39
40 if (!nEqual)
41 return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
42
43 return nEqual < 0;
44}
45
47{
48 if (left.meStrType != right.meStrType)
49 return left.meStrType < right.meStrType;
50
51 if (left.meStrType == Value)
52 {
53 if (left.mfValue == right.mfValue)
54 return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
55 return left.mfValue < right.mfValue;
56 }
57
58 if (left.mbIsDate != right.mbIsDate)
59 return left.mbIsDate < right.mbIsDate;
60
61 sal_Int32 nEqual = ScGlobal::GetCollator().compareString(
62 left.maStrValue, right.maStrValue);
63
64 if (!nEqual)
65 return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
66
67 return nEqual < 0;
68}
69
71{
72 if (left.meStrType != right.meStrType)
73 return false;
74
75 if (left.meStrType == Value && left.mfRoundedValue != right.mfRoundedValue)
76 return false;
77
78 if (left.mbIsDate != right.mbIsDate )
79 return false;
80
81 return ScGlobal::GetCaseTransliteration().isEqual(left.maStrValue, right.maStrValue);
82}
83
85{
86 if (left.meStrType != right.meStrType)
87 return false;
88
89 if (left.meStrType == Value && left.mfRoundedValue != right.mfRoundedValue)
90 return false;
91
92 if (left.mbIsDate != right.mbIsDate )
93 return false;
94
95 return ScGlobal::GetTransliteration().isEqual(left.maStrValue, right.maStrValue);
96}
97
99{
100 // Case insensitive comparison by default.
101 return LessCaseInsensitive()(*this, r);
102}
103
105 const OUString& rStr, double fVal, double fRVal, StringType nType, bool bDate, bool bIsHiddenByFilter ) :
106 maStrValue(rStr),
107 mfValue(fVal),
108 mfRoundedValue(fRVal),
110 mbIsDate( bDate ),
111 mbIsHiddenByFilter(bIsHiddenByFilter) {}
112
114 maVal(std::move(aVal)), mbCaseSens(bCaseSens) {}
115
117{
118 if (mbCaseSens)
119 {
121 }
122 else
123 {
125 }
126}
127
128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
FindTypedStrData(ScTypedStrData aVal, bool bCaseSens)
ScTypedStrData maVal
bool operator()(const ScTypedStrData &r) const
static SC_DLLPUBLIC CollatorWrapper & GetCollator()
case-insensitive collator
Definition: global.cxx:1095
::utl::TransliterationWrapper & GetCaseTransliteration()
Definition: global.cxx:1038
static SC_DLLPUBLIC ::utl::TransliterationWrapper & GetTransliteration()
Definition: global.cxx:1026
static CollatorWrapper & GetCaseCollator()
case-sensitive collator
Definition: global.cxx:1106
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, bool bIsHiddenByFilter=false)
bool isEqual(const OUString &rStr1, const OUString &rStr2) const
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
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
sal_uInt64 left