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
daaa3026
Kaydet (Commit)
daaa3026
authored
Nis 21, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move cell notes too when sorting.
Change-Id: Ibb330aa6f515d756c5578296fd9c83aa235a59fd
üst
bac1e2dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
34 deletions
+59
-34
column.hxx
sc/inc/column.hxx
+3
-1
column.cxx
sc/source/core/data/column.cxx
+18
-27
column2.cxx
sc/source/core/data/column2.cxx
+11
-0
table3.cxx
sc/source/core/data/table3.cxx
+27
-6
No files found.
sc/inc/column.hxx
Dosyayı görüntüle @
daaa3026
...
...
@@ -526,6 +526,7 @@ public:
// cell notes
ScPostIt
*
GetCellNote
(
SCROW
nRow
);
const
ScPostIt
*
GetCellNote
(
SCROW
nRow
)
const
;
const
ScPostIt
*
GetCellNote
(
sc
::
ColumnBlockConstPosition
&
rBlockPos
,
SCROW
nRow
)
const
;
void
DeleteCellNotes
(
sc
::
ColumnBlockPosition
&
rBlockPos
,
SCROW
nRow1
,
SCROW
nRow2
);
bool
HasCellNotes
()
const
;
void
SetCellNote
(
SCROW
nRow
,
ScPostIt
*
pNote
);
...
...
@@ -548,7 +549,8 @@ public:
void
DuplicateNotes
(
SCROW
nStartRow
,
size_t
nDataSize
,
ScColumn
&
rDestCol
,
sc
::
ColumnBlockPosition
&
maDestBlockPos
,
bool
bCloneCaption
=
true
,
SCROW
nRowOffsetDest
=
0
)
const
;
void
UpdateNoteCaptions
();
void
UpdateNoteCaptions
(
SCROW
nRow1
,
SCROW
nRow2
);
void
InterpretDirtyCells
(
SCROW
nRow1
,
SCROW
nRow2
);
...
...
sc/source/core/data/column.cxx
Dosyayı görüntüle @
daaa3026
...
...
@@ -2234,34 +2234,25 @@ void resetColumnPosition(sc::CellStoreType& rCells, SCCOL nCol)
}
}
}
void
ScColumn
::
UpdateNoteCaptions
()
class
NoteCaptionUpdater
{
sc
::
CellNoteStoreType
::
const_iterator
itBlk
=
maCellNotes
.
begin
(),
itBlkEnd
=
maCellNotes
.
end
();
sc
::
cellnote_block
::
const_iterator
itData
,
itDataEnd
;
SCCOL
mnCol
;
SCTAB
mnTab
;
public
:
NoteCaptionUpdater
(
SCCOL
nCol
,
SCTAB
nTab
)
:
mnCol
(
nCol
),
mnTab
(
nTab
)
{}
SCROW
curRow
=
0
;
for
(;
itBlk
!=
itBlkEnd
;
++
itBlk
)
void
operator
()
(
size_t
nRow
,
ScPostIt
*
p
)
{
if
(
itBlk
->
data
)
{
// non empty block
itData
=
sc
::
cellnote_block
::
begin
(
*
itBlk
->
data
);
itDataEnd
=
sc
::
cellnote_block
::
end
(
*
itBlk
->
data
);
for
(;
itData
!=
itDataEnd
;
++
itData
)
{
ScPostIt
*
pNote
=
*
itData
;
pNote
->
UpdateCaptionPos
(
ScAddress
(
nCol
,
curRow
,
nTab
));
curRow
+=
1
;
}
}
else
{
// empty block
curRow
+=
itBlk
->
size
;
}
p
->
UpdateCaptionPos
(
ScAddress
(
mnCol
,
nRow
,
mnTab
));
}
};
}
void
ScColumn
::
UpdateNoteCaptions
(
SCROW
nRow1
,
SCROW
nRow2
)
{
NoteCaptionUpdater
aFunc
(
nCol
,
nTab
);
sc
::
ProcessNote
(
maCellNotes
.
begin
(),
maCellNotes
,
nRow1
,
nRow2
,
aFunc
);
}
void
ScColumn
::
SwapCol
(
ScColumn
&
rCol
)
...
...
@@ -2272,8 +2263,8 @@ void ScColumn::SwapCol(ScColumn& rCol)
maCellNotes
.
swap
(
rCol
.
maCellNotes
);
// notes update caption
UpdateNoteCaptions
();
rCol
.
UpdateNoteCaptions
();
UpdateNoteCaptions
(
0
,
MAXROW
);
rCol
.
UpdateNoteCaptions
(
0
,
MAXROW
);
ScAttrArray
*
pTempAttr
=
rCol
.
pAttrArray
;
rCol
.
pAttrArray
=
pAttrArray
;
...
...
@@ -2322,7 +2313,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
// move the notes to the destination column
maCellNotes
.
transfer
(
nStartRow
,
nEndRow
,
rCol
.
maCellNotes
,
nStartRow
);
UpdateNoteCaptions
();
UpdateNoteCaptions
(
0
,
MAXROW
);
// Re-group transferred formula cells.
aPos
=
rCol
.
maCells
.
position
(
nStartRow
);
...
...
sc/source/core/data/column2.cxx
Dosyayı görüntüle @
daaa3026
...
...
@@ -1848,6 +1848,17 @@ const ScPostIt* ScColumn::GetCellNote(SCROW nRow) const
return
maCellNotes
.
get
<
ScPostIt
*>
(
nRow
);
}
const
ScPostIt
*
ScColumn
::
GetCellNote
(
sc
::
ColumnBlockConstPosition
&
rBlockPos
,
SCROW
nRow
)
const
{
sc
::
CellNoteStoreType
::
const_position_type
aPos
=
maCellNotes
.
position
(
rBlockPos
.
miCellNotePos
,
nRow
);
rBlockPos
.
miCellNotePos
=
aPos
.
first
;
if
(
aPos
.
first
->
type
!=
sc
::
element_type_cellnote
)
return
NULL
;
return
sc
::
cellnote_block
::
at
(
*
aPos
.
first
->
data
,
aPos
.
second
);
}
void
ScColumn
::
SetCellNote
(
SCROW
nRow
,
ScPostIt
*
pNote
)
{
//pNote->UpdateCaptionPos(ScAddress(nCol, nRow, nTab)); // TODO notes usefull ? slow import with many notes
...
...
sc/source/core/data/table3.cxx
Dosyayı görüntüle @
daaa3026
...
...
@@ -228,8 +228,9 @@ public:
ScRefCellValue
maCell
;
const
sc
::
CellTextAttr
*
mpAttr
;
const
SvtBroadcaster
*
mpBroadcaster
;
const
ScPostIt
*
mpNote
;
Cell
()
:
mpAttr
(
NULL
),
mpBroadcaster
(
NULL
)
{}
Cell
()
:
mpAttr
(
NULL
),
mpBroadcaster
(
NULL
)
,
mpNote
(
NULL
)
{}
};
typedef
std
::
vector
<
Cell
>
RowType
;
...
...
@@ -356,6 +357,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 )
rCell
.
maCell
=
rCol
.
GetCellValue
(
aBlockPos
,
nRow
);
rCell
.
mpAttr
=
rCol
.
GetCellTextAttr
(
aBlockPos
,
nRow
);
rCell
.
mpBroadcaster
=
rCol
.
GetBroadcaster
(
aBlockPos
,
nRow
);
rCell
.
mpNote
=
rCol
.
GetCellNote
(
aBlockPos
,
nRow
);
}
}
}
...
...
@@ -383,11 +385,13 @@ struct SortedColumn : boost::noncopyable
sc
::
CellStoreType
maCells
;
sc
::
CellTextAttrStoreType
maCellTextAttrs
;
sc
::
BroadcasterStoreType
maBroadcasters
;
sc
::
CellNoteStoreType
maCellNotes
;
SortedColumn
(
size_t
nTopEmptyRows
)
:
maCells
(
nTopEmptyRows
),
maCellTextAttrs
(
nTopEmptyRows
),
maBroadcasters
(
nTopEmptyRows
)
{}
maBroadcasters
(
nTopEmptyRows
),
maCellNotes
(
nTopEmptyRows
)
{}
};
}
...
...
@@ -512,6 +516,13 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
rBCStore
.
push_back
(
const_cast
<
SvtBroadcaster
*>
(
rCell
.
mpBroadcaster
));
else
rBCStore
.
push_back_empty
();
// The same with cell note instances ...
sc
::
CellNoteStoreType
&
rNoteStore
=
aSortedCols
.
at
(
j
).
maCellNotes
;
if
(
rCell
.
mpNote
)
rNoteStore
.
push_back
(
const_cast
<
ScPostIt
*>
(
rCell
.
mpNote
));
else
rNoteStore
.
push_back_empty
();
}
if
(
pProgress
)
...
...
@@ -535,14 +546,24 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
}
{
sc
::
BroadcasterStoreType
&
rBCDest
=
aCol
[
nThisCol
].
maBroadcasters
;
sc
::
BroadcasterStoreType
&
rSrc
=
aSortedCols
[
i
].
maBroadcasters
;
sc
::
BroadcasterStoreType
&
rDest
=
aCol
[
nThisCol
].
maBroadcasters
;
// Release current broadcasters first, to prevent them from getting deleted.
r
BC
Dest
.
release_range
(
nRow1
,
aSortParam
.
nRow2
);
rDest
.
release_range
(
nRow1
,
aSortParam
.
nRow2
);
// Transfer sorted broadcaster segment to the document.
sc
::
BroadcasterStoreType
&
rBCSrc
=
aSortedCols
[
i
].
maBroadcasters
;
rBCSrc
.
transfer
(
nRow1
,
aSortParam
.
nRow2
,
rBCDest
,
nRow1
);
rSrc
.
transfer
(
nRow1
,
aSortParam
.
nRow2
,
rDest
,
nRow1
);
}
{
sc
::
CellNoteStoreType
&
rSrc
=
aSortedCols
[
i
].
maCellNotes
;
sc
::
CellNoteStoreType
&
rDest
=
aCol
[
nThisCol
].
maCellNotes
;
// Do the same as broadcaster storage transfer (to prevent double deletion).
rDest
.
release_range
(
nRow1
,
aSortParam
.
nRow2
);
rSrc
.
transfer
(
nRow1
,
aSortParam
.
nRow2
,
rDest
,
nRow1
);
aCol
[
nThisCol
].
UpdateNoteCaptions
(
nRow1
,
aSortParam
.
nRow2
);
}
aCol
[
nThisCol
].
CellStorageModified
();
...
...
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