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
013abfd2
Kaydet (Commit)
013abfd2
authored
Eki 20, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Pass cells to CompareFunc, rather than the whole Compare struct.
Change-Id: I4d5554fc5783b123aa0f90b7c078e1fc0f0cd866
üst
1882a2b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
16 deletions
+12
-16
compare.hxx
sc/inc/compare.hxx
+1
-2
compare.cxx
sc/source/core/tool/compare.cxx
+7
-11
interpr1.cxx
sc/source/core/tool/interpr1.cxx
+3
-2
scmatrix.cxx
sc/source/core/tool/scmatrix.cxx
+1
-1
No files found.
sc/inc/compare.hxx
Dosyayı görüntüle @
013abfd2
...
@@ -53,7 +53,6 @@ struct CompareOptions
...
@@ -53,7 +53,6 @@ struct CompareOptions
ScQueryEntry
aQueryEntry
;
ScQueryEntry
aQueryEntry
;
bool
bRegEx
;
bool
bRegEx
;
bool
bMatchWholeCell
;
bool
bMatchWholeCell
;
bool
bIgnoreCase
;
CompareOptions
(
ScDocument
*
pDoc
,
const
ScQueryEntry
&
rEntry
,
bool
bReg
);
CompareOptions
(
ScDocument
*
pDoc
,
const
ScQueryEntry
&
rEntry
,
bool
bReg
);
private
:
private
:
...
@@ -66,7 +65,7 @@ private:
...
@@ -66,7 +65,7 @@ private:
/** @param pOptions
/** @param pOptions
NULL means case sensitivity document option is to be used!
NULL means case sensitivity document option is to be used!
*/
*/
double
CompareFunc
(
const
Compare
&
rComp
,
CompareOptions
*
pOptions
=
NULL
);
double
CompareFunc
(
const
Compare
::
Cell
&
rCell1
,
const
Compare
::
Cell
&
rCell2
,
bool
bIgnoreCase
,
CompareOptions
*
pOptions
=
NULL
);
}
}
...
...
sc/source/core/tool/compare.cxx
Dosyayı görüntüle @
013abfd2
...
@@ -35,8 +35,7 @@ Compare::Compare() :
...
@@ -35,8 +35,7 @@ Compare::Compare() :
CompareOptions
::
CompareOptions
(
ScDocument
*
pDoc
,
const
ScQueryEntry
&
rEntry
,
bool
bReg
)
:
CompareOptions
::
CompareOptions
(
ScDocument
*
pDoc
,
const
ScQueryEntry
&
rEntry
,
bool
bReg
)
:
aQueryEntry
(
rEntry
),
aQueryEntry
(
rEntry
),
bRegEx
(
bReg
),
bRegEx
(
bReg
),
bMatchWholeCell
(
pDoc
->
GetDocOptions
().
IsMatchWholeCell
()),
bMatchWholeCell
(
pDoc
->
GetDocOptions
().
IsMatchWholeCell
())
bIgnoreCase
(
true
)
{
{
bRegEx
=
(
bRegEx
&&
(
aQueryEntry
.
eOp
==
SC_EQUAL
||
aQueryEntry
.
eOp
==
SC_NOT_EQUAL
));
bRegEx
=
(
bRegEx
&&
(
aQueryEntry
.
eOp
==
SC_EQUAL
||
aQueryEntry
.
eOp
==
SC_NOT_EQUAL
));
// Interpreter functions usually are case insensitive, except the simple
// Interpreter functions usually are case insensitive, except the simple
...
@@ -44,11 +43,8 @@ CompareOptions::CompareOptions( ScDocument* pDoc, const ScQueryEntry& rEntry, bo
...
@@ -44,11 +43,8 @@ CompareOptions::CompareOptions( ScDocument* pDoc, const ScQueryEntry& rEntry, bo
// struct if needed.
// struct if needed.
}
}
double
CompareFunc
(
const
Compare
&
rComp
,
CompareOptions
*
pOptions
)
double
CompareFunc
(
const
Compare
::
Cell
&
rCell1
,
const
Compare
::
Cell
&
rCell2
,
bool
bIgnoreCase
,
CompareOptions
*
pOptions
)
{
{
const
Compare
::
Cell
&
rCell1
=
rComp
.
maCells
[
0
];
const
Compare
::
Cell
&
rCell2
=
rComp
.
maCells
[
1
];
// Keep DoubleError if encountered
// Keep DoubleError if encountered
// #i40539# if bEmpty is set, bVal/nVal are uninitialized
// #i40539# if bEmpty is set, bVal/nVal are uninitialized
if
(
!
rCell1
.
mbEmpty
&&
rCell1
.
mbValue
&&
!
rtl
::
math
::
isFinite
(
rCell1
.
mfValue
))
if
(
!
rCell1
.
mbEmpty
&&
rCell1
.
mbValue
&&
!
rtl
::
math
::
isFinite
(
rCell1
.
mfValue
))
...
@@ -138,7 +134,7 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
...
@@ -138,7 +134,7 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
sal_Int32
nStart
=
0
;
sal_Int32
nStart
=
0
;
sal_Int32
nStop
=
rCell1
.
maStr
.
getLength
();
sal_Int32
nStop
=
rCell1
.
maStr
.
getLength
();
bool
bMatch
=
rEntry
.
GetSearchTextPtr
(
bool
bMatch
=
rEntry
.
GetSearchTextPtr
(
!
pOptions
->
bIgnoreCase
)
->
SearchForward
(
!
bIgnoreCase
)
->
SearchForward
(
rCell1
.
maStr
.
getString
(),
&
nStart
,
&
nStop
);
rCell1
.
maStr
.
getString
(),
&
nStart
,
&
nStop
);
if
(
bMatch
&&
pOptions
->
bMatchWholeCell
&&
(
nStart
!=
0
||
nStop
!=
rCell1
.
maStr
.
getLength
()))
if
(
bMatch
&&
pOptions
->
bMatchWholeCell
&&
(
nStart
!=
0
||
nStop
!=
rCell1
.
maStr
.
getLength
()))
bMatch
=
false
;
// RegEx must match entire string.
bMatch
=
false
;
// RegEx must match entire string.
...
@@ -147,12 +143,12 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
...
@@ -147,12 +143,12 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
else
if
(
rEntry
.
eOp
==
SC_EQUAL
||
rEntry
.
eOp
==
SC_NOT_EQUAL
)
else
if
(
rEntry
.
eOp
==
SC_EQUAL
||
rEntry
.
eOp
==
SC_NOT_EQUAL
)
{
{
::
utl
::
TransliterationWrapper
*
pTransliteration
=
::
utl
::
TransliterationWrapper
*
pTransliteration
=
(
pOptions
->
bIgnoreCase
?
ScGlobal
::
GetpTransliteration
()
:
(
bIgnoreCase
?
ScGlobal
::
GetpTransliteration
()
:
ScGlobal
::
GetCaseTransliteration
());
ScGlobal
::
GetCaseTransliteration
());
bool
bMatch
=
false
;
bool
bMatch
=
false
;
if
(
pOptions
->
bMatchWholeCell
)
if
(
pOptions
->
bMatchWholeCell
)
{
{
if
(
pOptions
->
bIgnoreCase
)
if
(
bIgnoreCase
)
bMatch
=
rCell1
.
maStr
.
getDataIgnoreCase
()
==
rCell2
.
maStr
.
getDataIgnoreCase
();
bMatch
=
rCell1
.
maStr
.
getDataIgnoreCase
()
==
rCell2
.
maStr
.
getDataIgnoreCase
();
else
else
bMatch
=
rCell1
.
maStr
.
getData
()
==
rCell2
.
maStr
.
getData
();
bMatch
=
rCell1
.
maStr
.
getData
()
==
rCell2
.
maStr
.
getData
();
...
@@ -169,14 +165,14 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
...
@@ -169,14 +165,14 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
}
}
fRes
=
(
bMatch
?
0
:
1
);
fRes
=
(
bMatch
?
0
:
1
);
}
}
else
if
(
pOptions
->
bIgnoreCase
)
else
if
(
bIgnoreCase
)
fRes
=
(
double
)
ScGlobal
::
GetCollator
()
->
compareString
(
fRes
=
(
double
)
ScGlobal
::
GetCollator
()
->
compareString
(
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
else
else
fRes
=
(
double
)
ScGlobal
::
GetCaseCollator
()
->
compareString
(
fRes
=
(
double
)
ScGlobal
::
GetCaseCollator
()
->
compareString
(
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
}
}
else
if
(
rComp
.
m
bIgnoreCase
)
else
if
(
bIgnoreCase
)
fRes
=
(
double
)
ScGlobal
::
GetCollator
()
->
compareString
(
fRes
=
(
double
)
ScGlobal
::
GetCollator
()
->
compareString
(
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
rCell1
.
maStr
.
getString
(),
rCell2
.
maStr
.
getString
());
else
else
...
...
sc/source/core/tool/interpr1.cxx
Dosyayı görüntüle @
013abfd2
...
@@ -876,7 +876,7 @@ double ScInterpreter::Compare()
...
@@ -876,7 +876,7 @@ double ScInterpreter::Compare()
if
(
nGlobalError
)
if
(
nGlobalError
)
return
0
;
return
0
;
nCurFmtType
=
nFuncFmtType
=
NUMBERFORMAT_LOGICAL
;
nCurFmtType
=
nFuncFmtType
=
NUMBERFORMAT_LOGICAL
;
return
sc
::
CompareFunc
(
aComp
);
return
sc
::
CompareFunc
(
aComp
.
maCells
[
0
],
aComp
.
maCells
[
1
],
aComp
.
mbIgnoreCase
);
}
}
...
@@ -986,7 +986,8 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO
...
@@ -986,7 +986,8 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO
rCell
.
mbEmpty
=
false
;
rCell
.
mbEmpty
=
false
;
}
}
}
}
aRes
.
mpMat
->
PutDouble
(
sc
::
CompareFunc
(
aComp
,
pOptions
),
j
,
k
);
aRes
.
mpMat
->
PutDouble
(
sc
::
CompareFunc
(
aComp
.
maCells
[
0
],
aComp
.
maCells
[
1
],
aComp
.
mbIgnoreCase
,
pOptions
),
j
,
k
);
}
}
else
else
aRes
.
mpMat
->
PutString
(
mrStrPool
.
intern
(
ScGlobal
::
GetRscString
(
STR_NO_VALUE
)),
j
,
k
);
aRes
.
mpMat
->
PutString
(
mrStrPool
.
intern
(
ScGlobal
::
GetRscString
(
STR_NO_VALUE
)),
j
,
k
);
...
...
sc/source/core/tool/scmatrix.cxx
Dosyayı görüntüle @
013abfd2
...
@@ -1227,7 +1227,7 @@ class CompareMatrixFunc : std::unary_function<MatrixImplType::element_block_type
...
@@ -1227,7 +1227,7 @@ class CompareMatrixFunc : std::unary_function<MatrixImplType::element_block_type
void
compare
()
void
compare
()
{
{
double
fVal
=
sc
::
CompareFunc
(
mrComp
,
mpOptions
);
double
fVal
=
sc
::
CompareFunc
(
mrComp
.
maCells
[
0
],
mrComp
.
maCells
[
1
],
mrComp
.
mbIgnoreCase
,
mpOptions
);
bool
bRes
=
false
;
bool
bRes
=
false
;
switch
(
mrComp
.
meOp
)
switch
(
mrComp
.
meOp
)
{
{
...
...
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