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
0075402e
Kaydet (Commit)
0075402e
authored
Mar 25, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Another one involving cell data validation in detective functionality.
Change-Id: I1987f45e436744d4029f8b7af812867ebcfb09c4
üst
04e265e9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
4 deletions
+98
-4
dociter.hxx
sc/inc/dociter.hxx
+3
-0
validat.hxx
sc/inc/validat.hxx
+3
-0
dociter.cxx
sc/source/core/data/dociter.cxx
+5
-0
validat.cxx
sc/source/core/data/validat.cxx
+85
-0
detfunc.cxx
sc/source/core/tool/detfunc.cxx
+2
-4
No files found.
sc/inc/dociter.hxx
Dosyayı görüntüle @
0075402e
...
...
@@ -256,6 +256,9 @@ public:
bool
first
();
bool
next
();
// TODO: Remove this later.
ScBaseCell
*
getHackedBaseCell
();
};
class
ScQueryCellIterator
// walk through all non-empty cells in an area
...
...
sc/inc/validat.hxx
Dosyayı görüntüle @
0075402e
...
...
@@ -29,6 +29,7 @@ namespace ValidListType = ::com::sun::star::sheet::TableValidationVisibility;
class
ScPatternAttr
;
class
ScTokenArray
;
class
ScTypedStrData
;
class
ScCellIterator
;
enum
ScValidationMode
{
...
...
@@ -129,6 +130,8 @@ public:
const
ScAddress
&
rPos
)
const
;
sal_Bool
IsDataValid
(
ScBaseCell
*
pCell
,
const
ScAddress
&
rPos
)
const
;
bool
IsDataValid
(
ScCellIterator
&
rIter
)
const
;
// TRUE -> break
sal_Bool
DoError
(
Window
*
pParent
,
const
String
&
rInput
,
const
ScAddress
&
rPos
)
const
;
void
DoCalcError
(
ScFormulaCell
*
pCell
)
const
;
...
...
sc/source/core/data/dociter.cxx
Dosyayı görüntüle @
0075402e
...
...
@@ -1326,6 +1326,11 @@ bool ScCellIterator::next()
return
getCurrent
();
}
ScBaseCell
*
ScCellIterator
::
getHackedBaseCell
()
{
return
mpDoc
->
GetCell
(
maCurPos
);
}
//-------------------------------------------------------------------------------
ScQueryCellIterator
::
ScQueryCellIterator
(
ScDocument
*
pDocument
,
SCTAB
nTable
,
...
...
sc/source/core/data/validat.cxx
Dosyayı görüntüle @
0075402e
...
...
@@ -40,6 +40,7 @@
#include "rangenam.hxx"
#include "dbdata.hxx"
#include "typedstrdata.hxx"
#include "dociter.hxx"
#include <math.h>
#include <memory>
...
...
@@ -545,6 +546,90 @@ sal_Bool ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos
return
bOk
;
}
bool
ScValidationData
::
IsDataValid
(
ScCellIterator
&
rIter
)
const
{
const
ScAddress
&
rPos
=
rIter
.
GetPos
();
if
(
eDataMode
==
SC_VALID_LIST
)
{
ScBaseCell
*
pBC
=
rIter
.
getHackedBaseCell
();
return
IsListValid
(
pBC
,
rPos
);
}
double
fVal
=
0.0
;
OUString
aString
;
bool
bIsVal
=
true
;
switch
(
rIter
.
getType
())
{
case
CELLTYPE_VALUE
:
fVal
=
rIter
.
getValue
();
break
;
case
CELLTYPE_STRING
:
case
CELLTYPE_EDIT
:
aString
=
rIter
.
getString
();
bIsVal
=
false
;
break
;
case
CELLTYPE_FORMULA
:
{
ScFormulaCell
*
pFCell
=
rIter
.
getFormulaCell
();
bIsVal
=
pFCell
->
IsValue
();
if
(
bIsVal
)
fVal
=
pFCell
->
GetValue
();
else
aString
=
pFCell
->
GetString
();
}
break
;
default
:
// Notizen, Broadcaster
return
IsIgnoreBlank
();
// wie eingestellt
}
bool
bOk
=
true
;
switch
(
eDataMode
)
{
// SC_VALID_ANY schon oben
case
SC_VALID_WHOLE
:
case
SC_VALID_DECIMAL
:
case
SC_VALID_DATE
:
// Date/Time ist nur Formatierung
case
SC_VALID_TIME
:
bOk
=
bIsVal
;
if
(
bOk
&&
eDataMode
==
SC_VALID_WHOLE
)
bOk
=
::
rtl
::
math
::
approxEqual
(
fVal
,
floor
(
fVal
+
0.5
)
);
// ganze Zahlen
if
(
bOk
)
{
ScBaseCell
*
pBC
=
rIter
.
getHackedBaseCell
();
bOk
=
IsCellValid
(
pBC
,
rPos
);
}
break
;
case
SC_VALID_CUSTOM
:
{
// fuer Custom muss eOp == SC_COND_DIRECT sein
//! der Wert muss im Dokument stehen !!!!!!!!!!!!!!!!!!!!
ScBaseCell
*
pBC
=
rIter
.
getHackedBaseCell
();
bOk
=
IsCellValid
(
pBC
,
rPos
);
}
break
;
case
SC_VALID_TEXTLEN
:
bOk
=
!
bIsVal
;
// nur Text
if
(
bOk
)
{
double
nLenVal
=
(
double
)
aString
.
getLength
();
ScValueCell
*
pTmpCell
=
new
ScValueCell
(
nLenVal
);
bOk
=
IsCellValid
(
pTmpCell
,
rPos
);
pTmpCell
->
Delete
();
}
break
;
default
:
OSL_FAIL
(
"not yet done"
);
break
;
}
return
bOk
;
}
// ----------------------------------------------------------------------------
namespace
{
...
...
sc/source/core/tool/detfunc.cxx
Dosyayı görüntüle @
0075402e
...
...
@@ -1357,8 +1357,7 @@ sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow)
SCROW
nNextRow
=
nRow1
;
SCROW
nRow
;
ScCellIterator
aCellIter
(
pDoc
,
nCol
,
nRow1
,
nTab
,
nCol
,
nRow2
,
nTab
);
ScBaseCell
*
pCell
=
aCellIter
.
GetFirst
();
while
(
pCell
&&
nInsCount
<
SC_DET_MAXCIRCLE
)
for
(
bool
bHas
=
aCellIter
.
first
();
bHas
&&
nInsCount
<
SC_DET_MAXCIRCLE
;
bHas
=
aCellIter
.
next
())
{
SCROW
nCellRow
=
aCellIter
.
GetPos
().
Row
();
if
(
bMarkEmpty
)
...
...
@@ -1367,13 +1366,12 @@ sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow)
DrawCircle
(
nCol
,
nRow
,
aData
);
++
nInsCount
;
}
if
(
!
pData
->
IsDataValid
(
pCell
,
ScAddress
(
nCol
,
nCellRow
,
nTab
)
)
)
if
(
!
pData
->
IsDataValid
(
aCellIter
)
)
{
DrawCircle
(
nCol
,
nCellRow
,
aData
);
++
nInsCount
;
}
nNextRow
=
nCellRow
+
1
;
pCell
=
aCellIter
.
GetNext
();
}
if
(
bMarkEmpty
)
for
(
nRow
=
nNextRow
;
nRow
<=
nRow2
&&
nInsCount
<
SC_DET_MAXCIRCLE
;
nRow
++
)
...
...
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