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
17b00767
Kaydet (Commit)
17b00767
authored
Ock 07, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#72645: Case-insensitive string comparison in GETPIVOTDATA.
Change-Id: Ibdb2b7ab2bae03875a3462816e860f58d9076457
üst
8728f8e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
13 deletions
+46
-13
pivot-getpivotdata.xls
sc/qa/unit/data/xls/pivot-getpivotdata.xls
+0
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+18
-0
dpobject.cxx
sc/source/core/data/dpobject.cxx
+7
-5
dpresfilter.cxx
sc/source/core/data/dpresfilter.cxx
+21
-8
No files found.
sc/qa/unit/data/xls/pivot-getpivotdata.xls
0 → 100644
Dosyayı görüntüle @
17b00767
File added
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
17b00767
...
...
@@ -140,6 +140,7 @@ public:
void
testPivotTableBasicODS
();
void
testPivotTableSharedCacheGroupODS
();
void
testGetPivotDataXLS
();
void
testFormulaDependency
();
...
...
@@ -202,6 +203,7 @@ public:
CPPUNIT_TEST
(
testPivotTableBasicODS
);
CPPUNIT_TEST
(
testPivotTableSharedCacheGroupODS
);
CPPUNIT_TEST
(
testGetPivotDataXLS
);
CPPUNIT_TEST
(
testRowHeightODS
);
CPPUNIT_TEST
(
testFormulaDependency
);
CPPUNIT_TEST
(
testRichTextContentODS
);
...
...
@@ -1719,6 +1721,22 @@ void ScFiltersTest::testPivotTableSharedCacheGroupODS()
xDocSh
->
DoClose
();
}
void
ScFiltersTest
::
testGetPivotDataXLS
()
{
ScDocShellRef
xDocSh
=
loadDoc
(
"pivot-getpivotdata."
,
XLS
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to load file"
,
xDocSh
.
Is
());
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
pDoc
->
CalcAll
();
// Check GETPIVOTDATA results in E3:E20. Expected results are given in
// F3:F20.
for
(
SCROW
nRow
=
2
;
nRow
<=
19
;
++
nRow
)
CPPUNIT_ASSERT_EQUAL
(
pDoc
->
GetValue
(
ScAddress
(
4
,
nRow
,
1
)),
pDoc
->
GetValue
(
ScAddress
(
5
,
nRow
,
1
)));
xDocSh
->
DoClose
();
}
void
ScFiltersTest
::
testRowHeightODS
()
{
ScDocShellRef
xDocSh
=
loadDoc
(
"row-height-import."
,
ODS
);
...
...
sc/source/core/data/dpobject.cxx
Dosyayı görüntüle @
17b00767
...
...
@@ -1321,24 +1321,24 @@ namespace {
class
FindByName
:
std
::
unary_function
<
const
ScDPSaveDimension
*
,
bool
>
{
OUString
maName
;
OUString
maName
;
// must be all uppercase.
public
:
FindByName
(
const
OUString
&
rName
)
:
maName
(
rName
)
{}
bool
operator
()
(
const
ScDPSaveDimension
*
pDim
)
const
{
// Layout name takes precedence.
const
OUString
*
pLayoutName
=
pDim
->
GetLayoutName
();
if
(
pLayoutName
&&
*
pLayoutName
==
maName
)
if
(
pLayoutName
&&
ScGlobal
::
pCharClass
->
uppercase
(
*
pLayoutName
)
==
maName
)
return
true
;
sheet
::
GeneralFunction
eGenFunc
=
static_cast
<
sheet
::
GeneralFunction
>
(
pDim
->
GetFunction
());
ScSubTotalFunc
eFunc
=
ScDPUtil
::
toSubTotalFunc
(
eGenFunc
);
OUString
aSrcName
=
ScDPUtil
::
getSourceDimensionName
(
pDim
->
GetName
());
OUString
aFuncName
=
ScDPUtil
::
getDisplayedMeasureName
(
aSrcName
,
eFunc
);
if
(
maName
==
aFuncName
)
if
(
maName
==
ScGlobal
::
pCharClass
->
uppercase
(
aFuncName
)
)
return
true
;
return
maName
==
aSrcName
;
return
maName
==
ScGlobal
::
pCharClass
->
uppercase
(
aSrcName
)
;
}
};
...
...
@@ -1382,7 +1382,9 @@ double ScDPObject::GetPivotData(const OUString& rDataFieldName, std::vector<shee
return
fRet
;
std
::
vector
<
const
ScDPSaveDimension
*>::
iterator
it
=
std
::
find_if
(
aDataDims
.
begin
(),
aDataDims
.
end
(),
FindByName
(
rDataFieldName
));
aDataDims
.
begin
(),
aDataDims
.
end
(),
FindByName
(
ScGlobal
::
pCharClass
->
uppercase
(
rDataFieldName
)));
if
(
it
==
aDataDims
.
end
())
return
fRet
;
...
...
sc/source/core/data/dpresfilter.cxx
Dosyayı görüntüle @
17b00767
...
...
@@ -10,6 +10,7 @@
#include "dpresfilter.hxx"
#include "global.hxx"
#include <unotools/charclass.hxx>
#include <rtl/math.hxx>
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
...
...
@@ -113,12 +114,13 @@ void ScDPResultTree::add(
// See if this dimension exists.
DimensionsType
&
rDims
=
pMemNode
->
maChildDimensions
;
DimensionsType
::
iterator
itDim
=
rDims
.
find
(
filter
.
maDimName
);
OUString
aUpperName
=
ScGlobal
::
pCharClass
->
uppercase
(
filter
.
maDimName
);
DimensionsType
::
iterator
itDim
=
rDims
.
find
(
aUpperName
);
if
(
itDim
==
rDims
.
end
())
{
// New dimenison. Insert it.
std
::
pair
<
DimensionsType
::
iterator
,
bool
>
r
=
rDims
.
insert
(
DimensionsType
::
value_type
(
filter
.
maDim
Name
,
new
DimensionNode
(
pMemNode
)));
rDims
.
insert
(
DimensionsType
::
value_type
(
aUpper
Name
,
new
DimensionNode
(
pMemNode
)));
if
(
!
r
.
second
)
// Insertion failed!
...
...
@@ -132,13 +134,14 @@ void ScDPResultTree::add(
// Now, see if this dimension member exists.
DimensionNode
*
pDim
=
itDim
->
second
;
MembersType
&
rMembers
=
pDim
->
maChildMembers
;
MembersType
::
iterator
itMem
=
rMembers
.
find
(
filter
.
maValue
);
aUpperName
=
ScGlobal
::
pCharClass
->
uppercase
(
filter
.
maValue
);
MembersType
::
iterator
itMem
=
rMembers
.
find
(
aUpperName
);
if
(
itMem
==
rMembers
.
end
())
{
// New member. Insert it.
std
::
pair
<
MembersType
::
iterator
,
bool
>
r
=
rMembers
.
insert
(
MembersType
::
value_type
(
filter
.
maValu
e
,
new
MemberNode
(
pDim
)));
MembersType
::
value_type
(
aUpperNam
e
,
new
MemberNode
(
pDim
)));
if
(
!
r
.
second
)
// Insertion failed!
...
...
@@ -153,7 +156,10 @@ void ScDPResultTree::add(
if
(
pDimName
&&
pMemName
)
{
NamePairType
aNames
(
*
pDimName
,
*
pMemName
);
NamePairType
aNames
(
ScGlobal
::
pCharClass
->
uppercase
(
*
pDimName
),
ScGlobal
::
pCharClass
->
uppercase
(
*
pMemName
));
LeafValuesType
::
iterator
it
=
maLeafValues
.
find
(
aNames
);
if
(
it
==
maLeafValues
.
end
())
{
...
...
@@ -197,13 +203,17 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults(
const
MemberNode
*
pMember
=
mpRoot
;
for
(;
p
!=
pEnd
;
++
p
)
{
DimensionsType
::
const_iterator
itDim
=
pMember
->
maChildDimensions
.
find
(
p
->
FieldName
);
DimensionsType
::
const_iterator
itDim
=
pMember
->
maChildDimensions
.
find
(
ScGlobal
::
pCharClass
->
uppercase
(
p
->
FieldName
));
if
(
itDim
==
pMember
->
maChildDimensions
.
end
())
// Specified dimension not found.
return
NULL
;
const
DimensionNode
*
pDim
=
itDim
->
second
;
MembersType
::
const_iterator
itMem
=
pDim
->
maChildMembers
.
find
(
p
->
MatchValue
);
MembersType
::
const_iterator
itMem
=
pDim
->
maChildMembers
.
find
(
ScGlobal
::
pCharClass
->
uppercase
(
p
->
MatchValue
));
if
(
itMem
==
pDim
->
maChildMembers
.
end
())
// Specified member not found.
return
NULL
;
...
...
@@ -216,7 +226,10 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults(
double
ScDPResultTree
::
getLeafResult
(
const
com
::
sun
::
star
::
sheet
::
DataPilotFieldFilter
&
rFilter
)
const
{
NamePairType
aPair
(
rFilter
.
FieldName
,
rFilter
.
MatchValue
);
NamePairType
aPair
(
ScGlobal
::
pCharClass
->
uppercase
(
rFilter
.
FieldName
),
ScGlobal
::
pCharClass
->
uppercase
(
rFilter
.
MatchValue
));
LeafValuesType
::
const_iterator
it
=
maLeafValues
.
find
(
aPair
);
if
(
it
!=
maLeafValues
.
end
())
// Found!
...
...
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