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
1735044e
Kaydet (Commit)
1735044e
authored
May 18, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adjust sheet fields in cells when sheet structure changes.
Change-Id: I0aff738968e286df57ef7dd5b67780108cdc6c89
üst
dd15b51d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
45 deletions
+106
-45
cell.hxx
sc/inc/cell.hxx
+3
-0
column.hxx
sc/inc/column.hxx
+4
-4
cell2.cxx
sc/source/core/data/cell2.cxx
+7
-3
column.cxx
sc/source/core/data/column.cxx
+92
-38
No files found.
sc/inc/cell.hxx
Dosyayı görüntüle @
1735044e
...
...
@@ -258,6 +258,9 @@ public:
/** Removes character attribute based on new pattern attributes. */
void
RemoveCharAttribs
(
const
ScPatternAttr
&
rAttr
);
/** Update field items if any. */
void
UpdateFields
(
SCTAB
nTab
);
};
class
ScEditDataArray
...
...
sc/inc/column.hxx
Dosyayı görüntüle @
1735044e
...
...
@@ -281,9 +281,9 @@ public:
SCCOL
nCol2
,
SCROW
nRow2
,
SCTAB
nTab2
,
SCsCOL
nDx
,
SCsROW
nDy
,
SCsTAB
nDz
,
ScDocument
*
pUndoDoc
=
NULL
);
void
UpdateInsertTab
(
SCTAB
nTable
,
SCTAB
nNewSheets
=
1
);
void
UpdateInsertTabOnlyCells
(
SCTAB
nTable
,
SCTAB
nNewSheets
=
1
);
void
UpdateDeleteTab
(
SCTAB
nTable
,
bool
bIsMove
,
ScColumn
*
pRefUndo
=
NULL
,
SCTAB
nSheets
=
1
);
void
UpdateInsertTab
(
SCTAB
nInsPos
,
SCTAB
nNewSheets
=
1
);
void
UpdateInsertTabOnlyCells
(
SCTAB
nInsPos
,
SCTAB
nNewSheets
=
1
);
void
UpdateDeleteTab
(
SCTAB
nDelPos
,
bool
bIsMove
,
ScColumn
*
pRefUndo
=
NULL
,
SCTAB
nSheets
=
1
);
void
UpdateMoveTab
(
SCTAB
nOldPos
,
SCTAB
nNewPos
,
SCTAB
nTabNo
);
void
UpdateCompile
(
bool
bForceIfNameInUse
=
false
);
void
UpdateTranspose
(
const
ScRange
&
rSource
,
const
ScAddress
&
rDest
,
...
...
@@ -373,7 +373,7 @@ public:
void
GetFilterEntries
(
SCROW
nStartRow
,
SCROW
nEndRow
,
std
::
vector
<
ScTypedStrData
>&
rStrings
,
bool
&
rHasDates
);
bool
GetDataEntries
(
SCROW
nRow
,
std
::
set
<
ScTypedStrData
>&
rStrings
,
bool
bLimit
);
void
UpdateInsertTabAbs
(
SCTAB
nNewPos
);
void
UpdateInsertTabAbs
(
SCTAB
nNewPos
);
bool
TestTabRefAbs
(
SCTAB
nTable
);
bool
GetNextSpellingCell
(
SCROW
&
nRow
,
bool
bInSel
,
const
ScMarkData
&
rData
)
const
;
...
...
sc/source/core/data/cell2.cxx
Dosyayı görüntüle @
1735044e
...
...
@@ -78,9 +78,7 @@ ScEditCell::ScEditCell(const ScEditCell& rCell, ScDocument& rDoc, const ScAddres
ScBaseCell
(
rCell
),
pString
(
NULL
),
pDoc
(
&
rDoc
)
{
SetTextObject
(
rCell
.
pData
,
rCell
.
pDoc
->
GetEditPool
()
);
editeng
::
FieldUpdater
aUpdater
=
pData
->
GetFieldUpdater
();
aUpdater
.
updateTableFields
(
rDestPos
.
Tab
());
UpdateFields
(
rDestPos
.
Tab
());
}
ScEditCell
::
ScEditCell
(
const
rtl
::
OUString
&
rString
,
ScDocument
*
pDocP
)
:
...
...
@@ -166,6 +164,12 @@ void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr )
}
}
void
ScEditCell
::
UpdateFields
(
SCTAB
nTab
)
{
editeng
::
FieldUpdater
aUpdater
=
pData
->
GetFieldUpdater
();
aUpdater
.
updateTableFields
(
nTab
);
}
void
ScEditCell
::
SetTextObject
(
const
EditTextObject
*
pObject
,
const
SfxItemPool
*
pFromPool
)
{
...
...
sc/source/core/data/column.cxx
Dosyayı görüntüle @
1735044e
...
...
@@ -1668,72 +1668,102 @@ void ScColumn::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY )
}
void
ScColumn
::
UpdateInsertTab
(
SCTAB
nTable
,
SCTAB
nNewSheets
)
void
ScColumn
::
UpdateInsertTab
(
SCTAB
nInsPos
,
SCTAB
nNewSheets
)
{
if
(
nTab
>=
n
Table
)
if
(
nTab
>=
n
InsPos
)
{
nTab
+=
nNewSheets
;
pAttrArray
->
SetTab
(
nTab
);
}
if
(
!
maItems
.
empty
()
)
UpdateInsertTabOnlyCells
(
nTable
,
nNewSheets
);
}
UpdateInsertTabOnlyCells
(
nInsPos
,
nNewSheets
);
}
void
ScColumn
::
UpdateInsertTabOnlyCells
(
SCTAB
nTable
,
SCTAB
nNewSheets
)
void
ScColumn
::
UpdateInsertTabOnlyCells
(
SCTAB
nInsPos
,
SCTAB
nNewSheets
)
{
if
(
!
maItems
.
empty
()
)
for
(
SCSIZE
i
=
0
;
i
<
maItems
.
size
();
i
++
)
if
(
maItems
.
empty
())
return
;
for
(
size_t
i
=
0
;
i
<
maItems
.
size
();
++
i
)
{
switch
(
maItems
[
i
].
pCell
->
GetCellType
())
{
ScFormulaCell
*
pCell
=
(
ScFormulaCell
*
)
maItems
[
i
].
pCell
;
if
(
pCell
->
GetCellType
()
==
CELLTYPE_FORMULA
)
case
CELLTYPE_FORMULA
:
{
SCROW
nRow
=
maItems
[
i
].
nRow
;
pCell
->
UpdateInsertTab
(
nTable
,
nNewSheets
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener geloescht/eingefuegt?
ScFormulaCell
*
p
=
static_cast
<
ScFormulaCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateInsertTab
(
nInsPos
,
nNewSheets
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener deleted/inserted?
}
break
;
case
CELLTYPE_EDIT
:
{
ScEditCell
*
p
=
static_cast
<
ScEditCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateFields
(
nTab
);
}
break
;
default
:
;
}
}
}
void
ScColumn
::
UpdateInsertTabAbs
(
SCTAB
nTable
)
void
ScColumn
::
UpdateInsertTabAbs
(
SCTAB
nNewPos
)
{
if
(
!
maItems
.
empty
()
)
for
(
SCSIZE
i
=
0
;
i
<
maItems
.
size
();
i
++
)
if
(
maItems
.
empty
())
return
;
for
(
size_t
i
=
0
;
i
<
maItems
.
size
();
++
i
)
{
switch
(
maItems
[
i
].
pCell
->
GetCellType
())
{
ScFormulaCell
*
pCell
=
(
ScFormulaCell
*
)
maItems
[
i
].
pCell
;
if
(
pCell
->
GetCellType
()
==
CELLTYPE_FORMULA
)
case
CELLTYPE_FORMULA
:
{
SCROW
nRow
=
maItems
[
i
].
nRow
;
pCell
->
UpdateInsertTabAbs
(
nTable
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener geloescht/eingefuegt?
ScFormulaCell
*
p
=
static_cast
<
ScFormulaCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateInsertTabAbs
(
nNewPos
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener deleted/inserted?
}
break
;
case
CELLTYPE_EDIT
:
{
ScEditCell
*
p
=
static_cast
<
ScEditCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateFields
(
nTab
);
}
break
;
default
:
;
}
}
}
void
ScColumn
::
UpdateDeleteTab
(
SCTAB
nTable
,
bool
bIsMove
,
ScColumn
*
pRefUndo
,
SCTAB
nSheets
)
void
ScColumn
::
UpdateDeleteTab
(
SCTAB
nDelPos
,
bool
bIsMove
,
ScColumn
*
pRefUndo
,
SCTAB
nSheets
)
{
if
(
nTab
>
n
Table
)
if
(
nTab
>
n
DelPos
)
{
nTab
-=
nSheets
;
pAttrArray
->
SetTab
(
nTab
);
}
if
(
!
maItems
.
empty
()
)
for
(
SCSIZE
i
=
0
;
i
<
maItems
.
size
();
i
++
)
if
(
maItems
[
i
].
pCell
->
GetCellType
()
==
CELLTYPE_FORMULA
)
if
(
maItems
.
empty
())
return
;
for
(
size_t
i
=
0
;
i
<
maItems
.
size
();
++
i
)
{
switch
(
maItems
[
i
].
pCell
->
GetCellType
())
{
case
CELLTYPE_FORMULA
:
{
SCROW
nRow
=
maItems
[
i
].
nRow
;
ScFormulaCell
*
pOld
=
(
ScFormulaCell
*
)
maItems
[
i
].
pCell
;
ScFormulaCell
*
pOld
=
static_cast
<
ScFormulaCell
*>
(
maItems
[
i
].
pCell
)
;
/* Do not copy cell note to the undo document. Undo will copy
back the formula cell while keeping the original note. */
ScBaseCell
*
pSave
=
pRefUndo
?
pOld
->
Clone
(
*
pDocument
)
:
0
;
bool
bChanged
=
pOld
->
UpdateDeleteTab
(
n
Table
,
bIsMove
,
nSheets
);
bool
bChanged
=
pOld
->
UpdateDeleteTab
(
n
DelPos
,
bIsMove
,
nSheets
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener geloescht/eingefuegt?
...
...
@@ -1745,25 +1775,49 @@ void ScColumn::UpdateDeleteTab( SCTAB nTable, bool bIsMove, ScColumn* pRefUndo,
pSave
->
Delete
();
}
}
break
;
case
CELLTYPE_EDIT
:
{
ScEditCell
*
p
=
static_cast
<
ScEditCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateFields
(
nTab
);
}
break
;
default
:
;
}
}
}
void
ScColumn
::
UpdateMoveTab
(
SCTAB
nOldPos
,
SCTAB
nNewPos
,
SCTAB
nTabNo
)
{
nTab
=
nTabNo
;
pAttrArray
->
SetTab
(
nTabNo
);
if
(
!
maItems
.
empty
()
)
for
(
SCSIZE
i
=
0
;
i
<
maItems
.
size
();
i
++
)
if
(
maItems
.
empty
())
return
;
for
(
size_t
i
=
0
;
i
<
maItems
.
size
();
++
i
)
{
switch
(
maItems
[
i
].
pCell
->
GetCellType
())
{
ScFormulaCell
*
pCell
=
(
ScFormulaCell
*
)
maItems
[
i
].
pCell
;
if
(
pCell
->
GetCellType
()
==
CELLTYPE_FORMULA
)
case
CELLTYPE_FORMULA
:
{
ScFormulaCell
*
p
=
static_cast
<
ScFormulaCell
*>
(
maItems
[
i
].
pCell
);
SCROW
nRow
=
maItems
[
i
].
nRow
;
p
Cell
->
UpdateMoveTab
(
nOldPos
,
nNewPos
,
nTabNo
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener geloescht/eingefuegt
?
p
->
UpdateMoveTab
(
nOldPos
,
nNewPos
,
nTabNo
);
if
(
nRow
!=
maItems
[
i
].
nRow
)
Search
(
nRow
,
i
);
// Listener deleted/inserted
?
}
break
;
case
CELLTYPE_EDIT
:
{
ScEditCell
*
p
=
static_cast
<
ScEditCell
*>
(
maItems
[
i
].
pCell
);
p
->
UpdateFields
(
nTab
);
}
break
;
default
:
;
}
}
}
...
...
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