summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh1.cxx
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2013-09-11 09:06:24 +0200
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-23 10:44:20 -0400
commit759bdbbc348d320994813a9de1a7927b795580a3 (patch)
tree897cb53c217866ce6b365f76943390e3e6368529 /sc/source/ui/view/cellsh1.cxx
parentae88290f87acf693fed02140ca384ec15589616b (diff)
Re-implement cell note storage using mdds::multi_type_vector.
Change-Id: I34ea91e360e2a6b85d65f970c6e43db687d213ca
Diffstat (limited to 'sc/source/ui/view/cellsh1.cxx')
-rw-r--r--sc/source/ui/view/cellsh1.cxx35
1 files changed, 6 insertions, 29 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 75d4a8dfa88b..83901a69e971 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2113,7 +2113,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
ScDocument* pDoc = GetViewData()->GetDocument();
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
- if( ScPostIt* pNote = pDoc->GetNotes( aPos.Tab() )->findByAddress(aPos) )
+ if( ScPostIt* pNote = pDoc->GetNote(aPos) )
{
bool bShow;
const SfxPoolItem* pItem;
@@ -2148,7 +2148,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
// Check current cell
ScAddress aPos( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
- if( pDoc->GetNotes( aPos.Tab() )->findByAddress(aPos) )
+ if( pDoc->GetNote(aPos) )
{
pData->GetDocShell()->GetDocFunc().ShowNote( aPos, bShowNote );
bDone = true;
@@ -2173,35 +2173,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SCCOL nCol0 = pRange->aStart.Col();
const SCCOL nCol1 = pRange->aEnd.Col();
const SCTAB nRangeTab = pRange->aStart.Tab();
- const size_t nCellNumber = ( nRow1 - nRow0 ) * ( nCol1 - nCol0 );
- ScNotes *pNotes = pDoc->GetNotes(nRangeTab);
-
- if ( nCellNumber < pNotes->size() )
+ // Check by each cell
+ for ( SCROW nRow = nRow0; nRow <= nRow1; ++nRow )
{
- // Check by each cell
- for ( SCROW nRow = nRow0; nRow <= nRow1; ++nRow )
+ for ( SCCOL nCol = nCol0; nCol <= nCol1; ++nCol )
{
- for ( SCCOL nCol = nCol0; nCol <= nCol1; ++nCol )
- {
- ScPostIt* pNote = pNotes->findByAddress(nCol, nRow);
- if ( pNote && pDoc->IsBlockEditable( nRangeTab, nCol,nRow, nCol,nRow ) )
- {
- ScAddress aPos( nCol, nRow, nRangeTab );
- pData->GetDocShell()->GetDocFunc().ShowNote( aPos, bShowNote );
- bDone = true;
- }
- }
- }
- }
- else
- {
- // Check by each document note
- for (ScNotes::const_iterator itr = pNotes->begin(); itr != pNotes->end(); ++itr)
- {
- SCCOL nCol = itr->first.first;
- SCROW nRow = itr->first.second;
-
- if ( nCol <= nCol1 && nRow <= nRow1 && nCol >= nCol0 && nRow >= nRow0 )
+ if ( pDoc->HasNote(nCol, nRow, nRangeTab) && pDoc->IsBlockEditable( nRangeTab, nCol,nRow, nCol,nRow ) )
{
ScAddress aPos( nCol, nRow, nRangeTab );
pData->GetDocShell()->GetDocFunc().ShowNote( aPos, bShowNote );