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.mfValue != right.mfValue)
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.mfValue != right.mfValue)
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 nVal, StringType nType, bool bDate ) :
83  maStrValue(rStr),
84  mfValue(nVal),
85  meStrType(nType),
86  mbIsDate( bDate ) {}
87 
88 FindTypedStrData::FindTypedStrData(const ScTypedStrData& rVal, bool bCaseSens) :
89  maVal(rVal), mbCaseSens(bCaseSens) {}
90 
92 {
93  if (mbCaseSens)
94  {
96  }
97  else
98  {
100  }
101 }
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
ScTypedStrData(const OUString &rStr, double nVal=0.0, StringType eType=Standard, bool bDate=false)
static SC_DLLPUBLIC CollatorWrapper * GetCollator()
Definition: global.cxx:1029
FindTypedStrData(const ScTypedStrData &rVal, bool bCaseSens)
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
OUString maStrValue
ScTypedStrData maVal
bool operator<(const ScTypedStrData &r) const
static CollatorWrapper * GetCaseCollator()
Definition: global.cxx:1039
StringType meStrType
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
bool operator()(const ScTypedStrData &r) const
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const
bool operator()(const ScTypedStrData &left, const ScTypedStrData &right) const