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
200b4539
Kaydet (Commit)
200b4539
authored
Eki 04, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some attempt to store string ID's into query items.
Change-Id: I8db7cd327728be0974405eabb0fd58156ba231d6
üst
f54cdb59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
5 deletions
+56
-5
queryentry.hxx
sc/inc/queryentry.hxx
+2
-1
interpr1.cxx
sc/source/core/tool/interpr1.cxx
+53
-3
queryentry.cxx
sc/source/core/tool/queryentry.cxx
+1
-1
No files found.
sc/inc/queryentry.hxx
Dosyayı görüntüle @
200b4539
...
...
@@ -42,8 +42,9 @@ struct SC_DLLPUBLIC ScQueryEntry
QueryType
meType
;
double
mfVal
;
OUString
maString
;
sal_uIntPtr
mnStrId
;
Item
()
:
meType
(
ByValue
),
mfVal
(
0.0
)
{}
Item
()
:
meType
(
ByValue
),
mfVal
(
0.0
)
,
mnStrId
(
0
)
{}
bool
operator
==
(
const
Item
&
r
)
const
;
};
...
...
sc/source/core/tool/interpr1.cxx
Dosyayı görüntüle @
200b4539
...
...
@@ -60,6 +60,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include "svl/stringpool.hxx"
#include <stdlib.h>
#include <string.h>
...
...
@@ -6448,6 +6449,43 @@ void ScInterpreter::ScHLookup()
CalculateLookup
(
true
);
}
namespace
{
#if 1
bool
isFilterByEqualString
(
const
ScQueryParam
&
)
{
return
false
;
}
#else
bool
isFilterByEqualString
(
const
ScQueryParam
&
rParam
)
{
if
(
rParam
.
bRegExp
)
// filter by regular expression.
return
false
;
if
(
!
rParam
.
GetEntryCount
())
// No entries.
return
false
;
const
ScQueryEntry
&
rEntry
=
rParam
.
GetEntry
(
0
);
if
(
rEntry
.
eOp
!=
SC_EQUAL
)
return
false
;
const
ScQueryEntry
::
QueryItemsType
&
rItems
=
rEntry
.
GetQueryItems
();
if
(
rItems
.
size
()
!=
1
)
// Multi-item query is not supported.
return
false
;
if
(
rItems
[
0
].
meType
!=
ScQueryEntry
::
ByString
)
// Not by string equality.
return
false
;
return
true
;
}
#endif
}
void
ScInterpreter
::
CalculateLookup
(
bool
bHLookup
)
{
sal_uInt8
nParamCount
=
GetByte
();
...
...
@@ -6684,9 +6722,18 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
}
else
{
ScAddress
aResultPos
(
nCol1
,
nRow1
,
nTab1
);
bFound
=
LookupQueryWithCache
(
aResultPos
,
aParam
);
nRow
=
aResultPos
.
Row
();
if
(
isFilterByEqualString
(
aParam
))
{
nRow
=
nRow1
;
bFound
=
true
;
}
else
{
ScAddress
aResultPos
(
nCol1
,
nRow1
,
nTab1
);
bFound
=
LookupQueryWithCache
(
aResultPos
,
aParam
);
nRow
=
aResultPos
.
Row
();
}
nCol
=
nSpIndex
;
}
...
...
@@ -6716,6 +6763,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
const
OUString
&
sStr
=
GetString
();
rItem
.
meType
=
ScQueryEntry
::
ByString
;
rItem
.
maString
=
sStr
;
rItem
.
mnStrId
=
pDok
->
GetCellStringPool
().
getIdentifierIgnoreCase
(
rItem
.
maString
);
}
break
;
case
svDoubleRef
:
...
...
@@ -6740,6 +6788,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
GetCellString
(
aStr
,
aCell
);
rItem
.
meType
=
ScQueryEntry
::
ByString
;
rItem
.
maString
=
aStr
;
rItem
.
mnStrId
=
pDok
->
GetCellStringPool
().
getIdentifierIgnoreCase
(
rItem
.
maString
);
}
}
break
;
...
...
@@ -6748,6 +6797,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
OUString
aStr
;
const
ScMatValType
nType
=
GetDoubleOrStringFromMatrix
(
rItem
.
mfVal
,
aStr
);
rItem
.
maString
=
aStr
;
rItem
.
mnStrId
=
pDok
->
GetCellStringPool
().
getIdentifierIgnoreCase
(
rItem
.
maString
);
rItem
.
meType
=
ScMatrix
::
IsNonValueType
(
nType
)
?
ScQueryEntry
::
ByString
:
ScQueryEntry
::
ByValue
;
}
...
...
sc/source/core/tool/queryentry.cxx
Dosyayı görüntüle @
200b4539
...
...
@@ -32,7 +32,7 @@
bool
ScQueryEntry
::
Item
::
operator
==
(
const
Item
&
r
)
const
{
return
meType
==
r
.
meType
&&
mfVal
==
r
.
mfVal
&&
maString
.
equals
(
r
.
maString
);
return
meType
==
r
.
meType
&&
mfVal
==
r
.
mfVal
&&
maString
.
equals
(
r
.
maString
)
&&
mnStrId
==
r
.
mnStrId
;
}
ScQueryEntry
::
ScQueryEntry
()
:
...
...
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