Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
9e0f8809
Kaydet (Commit)
9e0f8809
authored
Nis 15, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
let us use startsWith instead of indexOf
Change-Id: I185a5a6f1d85c9e3e7ee5115b100b724031b6c03
üst
43debfae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
xmlcondformat.cxx
sc/source/filter/xml/xmlcondformat.cxx
+25
-25
No files found.
sc/source/filter/xml/xmlcondformat.cxx
Dosyayı görüntüle @
9e0f8809
...
@@ -402,15 +402,15 @@ namespace {
...
@@ -402,15 +402,15 @@ namespace {
void
GetConditionData
(
const
OUString
&
rValue
,
ScConditionMode
&
eMode
,
OUString
&
rExpr1
,
OUString
&
rExpr2
)
void
GetConditionData
(
const
OUString
&
rValue
,
ScConditionMode
&
eMode
,
OUString
&
rExpr1
,
OUString
&
rExpr2
)
{
{
if
(
rValue
.
indexOf
(
"unique"
)
==
0
)
if
(
rValue
.
startsWith
(
"unique"
)
)
{
{
eMode
=
SC_COND_NOTDUPLICATE
;
eMode
=
SC_COND_NOTDUPLICATE
;
}
}
else
if
(
rValue
.
indexOf
(
"duplicate"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"duplicate"
)
)
{
{
eMode
=
SC_COND_DUPLICATE
;
eMode
=
SC_COND_DUPLICATE
;
}
}
else
if
(
rValue
.
indexOf
(
"between"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"between"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
8
;
const
sal_Unicode
*
pStart
=
pStr
+
8
;
...
@@ -419,7 +419,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -419,7 +419,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr2
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr2
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_BETWEEN
;
eMode
=
SC_COND_BETWEEN
;
}
}
else
if
(
rValue
.
indexOf
(
"not-between"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"not-between"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
12
;
const
sal_Unicode
*
pStart
=
pStr
+
12
;
...
@@ -428,37 +428,37 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -428,37 +428,37 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr2
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr2
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_NOTBETWEEN
;
eMode
=
SC_COND_NOTBETWEEN
;
}
}
else
if
(
rValue
.
indexOf
(
"<="
)
==
0
)
else
if
(
rValue
.
startsWith
(
"<="
)
)
{
{
rExpr1
=
rValue
.
copy
(
2
);
rExpr1
=
rValue
.
copy
(
2
);
eMode
=
SC_COND_EQLESS
;
eMode
=
SC_COND_EQLESS
;
}
}
else
if
(
rValue
.
indexOf
(
">="
)
==
0
)
else
if
(
rValue
.
startsWith
(
">="
)
)
{
{
rExpr1
=
rValue
.
copy
(
2
);
rExpr1
=
rValue
.
copy
(
2
);
eMode
=
SC_COND_EQGREATER
;
eMode
=
SC_COND_EQGREATER
;
}
}
else
if
(
rValue
.
indexOf
(
"!="
)
==
0
)
else
if
(
rValue
.
startsWith
(
"!="
)
)
{
{
rExpr1
=
rValue
.
copy
(
2
);
rExpr1
=
rValue
.
copy
(
2
);
eMode
=
SC_COND_NOTEQUAL
;
eMode
=
SC_COND_NOTEQUAL
;
}
}
else
if
(
rValue
.
indexOf
(
'<'
)
==
0
)
else
if
(
rValue
.
startsWith
(
"<"
)
)
{
{
rExpr1
=
rValue
.
copy
(
1
);
rExpr1
=
rValue
.
copy
(
1
);
eMode
=
SC_COND_LESS
;
eMode
=
SC_COND_LESS
;
}
}
else
if
(
rValue
.
indexOf
(
'='
)
==
0
)
else
if
(
rValue
.
startsWith
(
"="
)
)
{
{
rExpr1
=
rValue
.
copy
(
1
);
rExpr1
=
rValue
.
copy
(
1
);
eMode
=
SC_COND_EQUAL
;
eMode
=
SC_COND_EQUAL
;
}
}
else
if
(
rValue
.
indexOf
(
'>'
)
==
0
)
else
if
(
rValue
.
startsWith
(
">"
)
)
{
{
rExpr1
=
rValue
.
copy
(
1
);
rExpr1
=
rValue
.
copy
(
1
);
eMode
=
SC_COND_GREATER
;
eMode
=
SC_COND_GREATER
;
}
}
else
if
(
rValue
.
indexOf
(
"formula-is"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"formula-is"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
11
;
const
sal_Unicode
*
pStart
=
pStr
+
11
;
...
@@ -466,7 +466,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -466,7 +466,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_DIRECT
;
eMode
=
SC_COND_DIRECT
;
}
}
else
if
(
rValue
.
indexOf
(
"top-elements"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"top-elements"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
13
;
const
sal_Unicode
*
pStart
=
pStr
+
13
;
...
@@ -474,7 +474,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -474,7 +474,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_TOP10
;
eMode
=
SC_COND_TOP10
;
}
}
else
if
(
rValue
.
indexOf
(
"bottom-elements"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"bottom-elements"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
16
;
const
sal_Unicode
*
pStart
=
pStr
+
16
;
...
@@ -482,7 +482,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -482,7 +482,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_BOTTOM10
;
eMode
=
SC_COND_BOTTOM10
;
}
}
else
if
(
rValue
.
indexOf
(
"top-percent"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"top-percent"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
12
;
const
sal_Unicode
*
pStart
=
pStr
+
12
;
...
@@ -490,7 +490,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -490,7 +490,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_TOP_PERCENT
;
eMode
=
SC_COND_TOP_PERCENT
;
}
}
else
if
(
rValue
.
indexOf
(
"bottom-percent"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"bottom-percent"
)
)
{
{
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStart
=
pStr
+
15
;
const
sal_Unicode
*
pStart
=
pStr
+
15
;
...
@@ -498,31 +498,31 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -498,31 +498,31 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
eMode
=
SC_COND_BOTTOM_PERCENT
;
eMode
=
SC_COND_BOTTOM_PERCENT
;
}
}
else
if
(
rValue
.
indexOf
(
"above-average"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"above-average"
)
)
{
{
eMode
=
SC_COND_ABOVE_AVERAGE
;
eMode
=
SC_COND_ABOVE_AVERAGE
;
}
}
else
if
(
rValue
.
indexOf
(
"below-average"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"below-average"
)
)
{
{
eMode
=
SC_COND_BELOW_AVERAGE
;
eMode
=
SC_COND_BELOW_AVERAGE
;
}
}
else
if
(
rValue
.
indexOf
(
"above-equal-average"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"above-equal-average"
)
)
{
{
eMode
=
SC_COND_ABOVE_EQUAL_AVERAGE
;
eMode
=
SC_COND_ABOVE_EQUAL_AVERAGE
;
}
}
else
if
(
rValue
.
indexOf
(
"below-equal-average"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"below-equal-average"
)
)
{
{
eMode
=
SC_COND_BELOW_EQUAL_AVERAGE
;
eMode
=
SC_COND_BELOW_EQUAL_AVERAGE
;
}
}
else
if
(
rValue
.
indexOf
(
"is-error"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"is-error"
)
)
{
{
eMode
=
SC_COND_ERROR
;
eMode
=
SC_COND_ERROR
;
}
}
else
if
(
rValue
.
indexOf
(
"is-no-error"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"is-no-error"
)
)
{
{
eMode
=
SC_COND_NOERROR
;
eMode
=
SC_COND_NOERROR
;
}
}
else
if
(
rValue
.
indexOf
(
"begins-with"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"begins-with"
)
)
{
{
eMode
=
SC_COND_BEGINS_WITH
;
eMode
=
SC_COND_BEGINS_WITH
;
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
...
@@ -530,7 +530,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -530,7 +530,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
}
}
else
if
(
rValue
.
indexOf
(
"ends-with"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"ends-with"
)
)
{
{
eMode
=
SC_COND_ENDS_WITH
;
eMode
=
SC_COND_ENDS_WITH
;
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
...
@@ -538,7 +538,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -538,7 +538,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
}
}
else
if
(
rValue
.
indexOf
(
"contains-text"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"contains-text"
)
)
{
{
eMode
=
SC_COND_CONTAINS_TEXT
;
eMode
=
SC_COND_CONTAINS_TEXT
;
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
...
@@ -546,7 +546,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
...
@@ -546,7 +546,7 @@ void GetConditionData(const OUString& rValue, ScConditionMode& eMode, OUString&
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
const
sal_Unicode
*
pEnd
=
pStr
+
rValue
.
getLength
();
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
rExpr1
=
ScXMLConditionHelper
::
getExpression
(
pStart
,
pEnd
,
')'
);
}
}
else
if
(
rValue
.
indexOf
(
"not-contains-text"
)
==
0
)
else
if
(
rValue
.
startsWith
(
"not-contains-text"
)
)
{
{
eMode
=
SC_COND_NOT_CONTAINS_TEXT
;
eMode
=
SC_COND_NOT_CONTAINS_TEXT
;
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
const
sal_Unicode
*
pStr
=
rValue
.
getStr
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment