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
504615c5
Kaydet (Commit)
504615c5
authored
May 14, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove duplicate code blocks.
Change-Id: I945c7ae834393c760d8a552043c391ff0eb9ce22
üst
81e1e8e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
77 deletions
+38
-77
formulacell.cxx
sc/source/core/data/formulacell.cxx
+38
-77
No files found.
sc/source/core/data/formulacell.cxx
Dosyayı görüntüle @
504615c5
...
@@ -3243,8 +3243,34 @@ void ScFormulaCell::StartListeningTo( ScDocument* pDoc )
...
@@ -3243,8 +3243,34 @@ void ScFormulaCell::StartListeningTo( ScDocument* pDoc )
SetNeedsListening
(
false
);
SetNeedsListening
(
false
);
}
}
// pArr gesetzt -> Referenzen von anderer Zelle nehmen
namespace
{
// Then aPos must also be commited
void
endListeningArea
(
ScFormulaCell
*
pCell
,
ScDocument
&
rDoc
,
const
ScAddress
&
rPos
,
const
ScToken
&
rToken
)
{
const
ScSingleRefData
&
rRef1
=
rToken
.
GetSingleRef
();
const
ScSingleRefData
&
rRef2
=
rToken
.
GetSingleRef2
();
ScAddress
aCell1
=
rRef1
.
toAbs
(
rPos
);
ScAddress
aCell2
=
rRef2
.
toAbs
(
rPos
);
if
(
aCell1
.
IsValid
()
&&
aCell2
.
IsValid
())
{
if
(
rToken
.
GetOpCode
()
==
ocColRowNameAuto
)
{
// automagically
if
(
rRef1
.
IsColRel
()
)
{
// ColName
aCell2
.
SetRow
(
MAXROW
);
}
else
{
// RowName
aCell2
.
SetCol
(
MAXCOL
);
}
}
rDoc
.
EndListeningArea
(
ScRange
(
aCell1
,
aCell2
),
pCell
);
}
}
}
void
ScFormulaCell
::
EndListeningTo
(
ScDocument
*
pDoc
,
ScTokenArray
*
pArr
,
void
ScFormulaCell
::
EndListeningTo
(
ScDocument
*
pDoc
,
ScTokenArray
*
pArr
,
ScAddress
aCellPos
)
ScAddress
aCellPos
)
...
@@ -3269,60 +3295,17 @@ void ScFormulaCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr,
...
@@ -3269,60 +3295,17 @@ void ScFormulaCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr,
ScToken
*
t
;
ScToken
*
t
;
while
(
(
t
=
static_cast
<
ScToken
*>
(
pArr
->
GetNextReferenceRPN
())
)
!=
NULL
)
while
(
(
t
=
static_cast
<
ScToken
*>
(
pArr
->
GetNextReferenceRPN
())
)
!=
NULL
)
{
{
StackVar
eType
=
t
->
GetType
();
switch
(
t
->
GetType
())
ScSingleRefData
&
rRef1
=
t
->
GetSingleRef
();
ScSingleRefData
&
rRef2
=
(
eType
==
svDoubleRef
?
t
->
GetDoubleRef
().
Ref2
:
rRef1
);
switch
(
eType
)
{
{
case
svSingleRef
:
case
svSingleRef
:
rRef1
.
CalcAbsIfRel
(
aCellPos
);
{
if
(
rRef1
.
Valid
()
)
ScAddress
aCell
=
t
->
GetSingleRef
().
toAbs
(
aPos
);
{
if
(
aCell
.
IsValid
())
pDoc
->
EndListeningCell
(
pDoc
->
EndListeningCell
(
aCell
,
this
);
ScAddress
(
rRef1
.
nCol
,
}
rRef1
.
nRow
,
rRef1
.
nTab
),
this
);
}
break
;
break
;
case
svDoubleRef
:
case
svDoubleRef
:
t
->
CalcAbsIfRel
(
aCellPos
);
endListeningArea
(
this
,
*
pDoc
,
aCellPos
,
*
t
);
if
(
rRef1
.
Valid
()
&&
rRef2
.
Valid
()
)
{
if
(
t
->
GetOpCode
()
==
ocColRowNameAuto
)
{
// automagically
if
(
rRef1
.
IsColRel
()
)
{
// ColName
pDoc
->
EndListeningArea
(
ScRange
(
rRef1
.
nCol
,
rRef1
.
nRow
,
rRef1
.
nTab
,
rRef2
.
nCol
,
MAXROW
,
rRef2
.
nTab
),
this
);
}
else
{
// RowName
pDoc
->
EndListeningArea
(
ScRange
(
rRef1
.
nCol
,
rRef1
.
nRow
,
rRef1
.
nTab
,
MAXCOL
,
rRef2
.
nRow
,
rRef2
.
nTab
),
this
);
}
}
else
{
pDoc
->
EndListeningArea
(
ScRange
(
rRef1
.
nCol
,
rRef1
.
nRow
,
rRef1
.
nTab
,
rRef2
.
nCol
,
rRef2
.
nRow
,
rRef2
.
nTab
),
this
);
}
}
break
;
break
;
default
:
default
:
;
// nothing
;
// nothing
...
@@ -3348,39 +3331,17 @@ void ScFormulaCell::EndListeningTo( sc::EndListeningContext& rCxt )
...
@@ -3348,39 +3331,17 @@ void ScFormulaCell::EndListeningTo( sc::EndListeningContext& rCxt )
ScToken
*
t
;
ScToken
*
t
;
while
(
(
t
=
static_cast
<
ScToken
*>
(
pCode
->
GetNextReferenceRPN
())
)
!=
NULL
)
while
(
(
t
=
static_cast
<
ScToken
*>
(
pCode
->
GetNextReferenceRPN
())
)
!=
NULL
)
{
{
StackVar
eType
=
t
->
GetType
();
switch
(
t
->
GetType
())
ScSingleRefData
&
rRef1
=
t
->
GetSingleRef
();
ScSingleRefData
&
rRef2
=
(
eType
==
svDoubleRef
?
t
->
GetDoubleRef
().
Ref2
:
rRef1
);
switch
(
eType
)
{
{
case
svSingleRef
:
case
svSingleRef
:
{
{
ScAddress
aCell
=
rRef1
.
toAbs
(
aPos
);
ScAddress
aCell
=
t
->
GetSingleRef
()
.
toAbs
(
aPos
);
if
(
aCell
.
IsValid
())
if
(
aCell
.
IsValid
())
rDoc
.
EndListeningCell
(
rCxt
,
aCell
,
*
this
);
rDoc
.
EndListeningCell
(
rCxt
,
aCell
,
*
this
);
}
}
break
;
break
;
case
svDoubleRef
:
case
svDoubleRef
:
{
endListeningArea
(
this
,
rDoc
,
aPos
,
*
t
);
ScAddress
aCell1
=
rRef1
.
toAbs
(
aPos
);
ScAddress
aCell2
=
rRef2
.
toAbs
(
aPos
);
if
(
aCell1
.
IsValid
()
&&
aCell2
.
IsValid
())
{
if
(
t
->
GetOpCode
()
==
ocColRowNameAuto
)
{
// automagically
if
(
rRef1
.
IsColRel
()
)
{
// ColName
aCell2
.
SetRow
(
MAXROW
);
}
else
{
// RowName
aCell2
.
SetCol
(
MAXCOL
);
}
}
rDoc
.
EndListeningArea
(
ScRange
(
aCell1
,
aCell2
),
this
);
}
}
break
;
break
;
default
:
default
:
;
// nothing
;
// nothing
...
...
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