summaryrefslogtreecommitdiff
path: root/binfilter/bf_sc/source/core/data/sc_column3.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-23 15:10:15 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-23 15:10:15 +0200
commit5c22c7b613228daf8f46baf70928ae7da6485289 (patch)
tree75ae8ba4d004cdfbf539762aa8fd819d4760b56a /binfilter/bf_sc/source/core/data/sc_column3.cxx
parent62479cc5aa788ddebf9fa23e0124a0dc2495426c (diff)
recreated tag libreoffice-3.3.1.1 which had these commits:
commit 1163151cf51a15a68700eda522ba7a789e378361 (tag: refs/tags/libreoffice-3.3.1.1) Author: Petr Mladek <pmladek@suse.cz> Date: Tue Feb 8 18:07:43 2011 +0100 Version 3.3.1.1, tag libreoffice-3.3.1.1 (3.3.1-rc1) commit 3d8f2d6ee7f86ec048ffca70a7dd59efb64ab90c Author: Jan Holesovsky <kendy@suse.cz> Date: Mon Feb 7 21:23:24 2011 +0100 Branch libreoffice-3-3-1 This is 'libreoffice-3-3-1' - the stable branch for the 3.3.1 release. Only very safe changes, reviewed by three people are allowed. If you want to commit more complicated fix for the next 3.3.x release, please use the 'libreoffice-3-3' branch. If you want to build something cool, unstable, and risky, use master. commit 4d86423be75125185f7e220877839c68934bfedc Author: Joseph Powers <jpowers27@cox.net> Date: Mon Feb 7 16:32:57 2011 +0000 cherry picked from 0679158ebb6c84863e6e0e2fe877ea06eba4a2d4 Move XServiceInfo.hpp from DEBUG to main. Now that XServiceInfo is always used, it would be nice to always include if defination. This fixes a compile error on mac. PS: Also some trailing white space. The changed code all appears at the top of the patch. Signed-off-by: Noel Power <noel.power@novell.com> writerfilter/source/dmapper/DomainMapper_Impl.cxx | 144 ++++++++++---------- 1 files changed, 72 insertions(+), 72 deletions(-) commit 8efa2697b2a2737ee5951358878a17203073ac49 Author: Noel Power <noel.power@novell.com> Date: Mon Feb 7 12:01:46 2011 +0000 fix for bnc#655763 cherry picked from ae5d018c49d3ab61416cde7fb09c37bcce7d9566 reviewed in bug https://bugzilla.novell.com/show_bug.cgi?id=655763#c6 Signed-off-by: Cedric Bosdonnat <cbosdonnat@novell.com> writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) commit 780535edc21bc230a859d672b7408f10e2691a38 Author: Petr Mladek <pmladek@suse.cz> Date: Wed Feb 2 17:09:03 2011 +0100 RTF export crasher (bnc#656503) Signed off by Cedric filter/source/msfilter/escherex.cxx | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) commit ecda6f3b42d84e88d35d4d6bd4ea5cc32b9b8c89 Author: Takeshi Kurosawa <taken.spc@gmail.com> Date: Thu Jan 27 14:31:57 2011 +0900 Use product name for EPS Creator header (cherry picked from commit 2d07f1d678dc868687a9ae8c326b766e7def21c2) Signed-off-by: Thorsten Behrens <tbehrens@novell.com> filter/source/graphicfilter/eps/eps.cxx | 16 +++++++++++++++- filter/source/graphicfilter/eps/makefile.mk | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) commit dd73734f0440787d84ddbe5737e7f996803dacf2 Author: Takeshi Kurosawa <taken.spc@gmail.com> Date: Thu Jan 27 13:45:16 2011 +0900 Parse 'color' property (fdo#33551) Parse 'color' property and store the value as currentColor. (cherry picked from commit d4bac116d0c35d8811a048fdd991363a32df14ca) Signed-off-by: Thorsten Behrens <tbehrens@novell.com> filter/source/svg/svgreader.cxx | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) commit 9a7fcfcf49e393c02e8d115dfa4a40811582375f Author: Fridrich Štrba <fridrich.strba@bluewin.ch> Date: Sun Jan 30 10:22:38 2011 +0100 Use double instead of float (cherry picked from commit c90c5d503543a960a05b43752a5dff9ccf4bcd30) Signed-off-by: Caolán McNamara <caolanm@redhat.com> writerperfect/source/filter/DocumentCollector.cxx | 2 +- writerperfect/source/filter/DocumentCollector.hxx | 2 +- writerperfect/source/filter/FilterInternal.hxx | 6 +++--- writerperfect/source/filter/ListStyle.cxx | 12 ++++++------ writerperfect/source/filter/SectionStyle.cxx | 2 +- writerperfect/source/filter/TextRunStyle.cxx | 6 +++--- writerperfect/source/filter/WriterProperties.hxx | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) commit 9fd267985820db81454cce1b4a76752769b471b7 Author: Thomas Klausner <wiz@NetBSD.org> Date: Sat Nov 6 00:30:42 2010 +0100 Use PYTHON as passed through by set_soenv.in. filter/source/config/fragments/makefile.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 82102abd307f911c400735eb6f9b43fa69d221d8 Author: Noel Power <noel.power@novell.com> Date: Tue Jan 18 12:58:17 2011 +0000 fdo#33237 remove debug line writerfilter/source/dmapper/DomainMapper_Impl.cxx | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) commit 9c976ba4f8e1fd2bcd40412873e22728ed83d5bd Author: Noel Power <noel.power@novell.com> Date: Tue Jan 18 12:43:50 2011 +0000 fdo#33237# fix ole object import for writer (docx) writerfilter/source/dmapper/DomainMapper_Impl.cxx | 41 +++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) commit 8383f008c60c0615005f4bb22ae9ddaeca4540cf Author: Fridrich Štrba <fridrich.strba@bluewin.ch> Date: Tue Jan 18 11:12:52 2011 +0100 Fix a typo SolarMuexGuard -> SolarMutexGuard signoff: Jan Holesovsky <kendy@suse.cz> signoff: Thorsten Behrens <thb@documentfoundation.org> signoff: Tor Lillqvist <tlillqvist@novell.com> signoff: Petr Mladek <pmladek@suse.cz> binfilter/bf_so3/source/ole/socli.cxx | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit 247a91f1df71614fc8d9b2264d10f0952055c611 Author: Petr Mladek <pmladek@suse.cz> Date: Tue Jan 11 23:05:56 2011 +0100 Please, ignore the previous message; it was for the libreoffice-3-3-0 branch This is 'libreoffice-3-3' - the stable branch for the 3.3.x releases. Only safe changes, reviewed by anoter person are allowed. If you want to build something cool, unstable, and risky, use master. commit 9628deac573830fdfbce2c402f8574379ac71a35 Author: Petr Mladek <pmladek@suse.cz> Date: Tue Jan 11 22:39:07 2011 +0100 Branch libreoffice-3-3-0 This is 'libreoffice-3-3-0' - the stable branch for the 3.3.0 release. Only very safe changes, reviewed by three people are allowed. If you want to commit more complicated fix for the next 3.3.x release, please use the 'libreoffice-3-3' branch. If you want to build something cool, unstable, and risky, use master.
Notes
split repo tag: filters_libreoffice-3.3.1.1 split repo tag: filters_libreoffice-3.3.1.2
Diffstat (limited to 'binfilter/bf_sc/source/core/data/sc_column3.cxx')
-rw-r--r--binfilter/bf_sc/source/core/data/sc_column3.cxx1060
1 files changed, 1060 insertions, 0 deletions
diff --git a/binfilter/bf_sc/source/core/data/sc_column3.cxx b/binfilter/bf_sc/source/core/data/sc_column3.cxx
new file mode 100644
index 000000000000..f84eba85b1b0
--- /dev/null
+++ b/binfilter/bf_sc/source/core/data/sc_column3.cxx
@@ -0,0 +1,1060 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+
+#include <bf_sfx2/objsh.hxx>
+#include <bf_svtools/zforlist.hxx>
+
+#include "scitems.hxx"
+#include "cell.hxx"
+#include "document.hxx"
+#include "attarray.hxx"
+#include "cellform.hxx"
+#include "detfunc.hxx" // fuer Notizen bei DeleteRange
+namespace binfilter {
+
+// Err527 Workaround
+extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx
+
+// STATIC DATA -----------------------------------------------------------
+
+/*N*/ BOOL ScColumn::bDoubleAlloc = FALSE; // fuer Import: Groesse beim Allozieren verdoppeln
+/*N*/
+/*N*/
+/*N*/ void ScColumn::Insert( USHORT nRow, ScBaseCell* pNewCell )
+/*N*/ {
+/*N*/ BOOL bIsAppended = FALSE;
+/*N*/ if (pItems && nCount)
+/*N*/ {
+/*N*/ if (pItems[nCount-1].nRow < nRow)
+/*N*/ {
+/*N*/ Append(nRow, pNewCell );
+/*N*/ bIsAppended = TRUE;
+/*N*/ }
+/*N*/ }
+/*N*/ if ( !bIsAppended )
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*N*/ ScBaseCell* pOldCell = pItems[nIndex].pCell;
+/*N*/ ScBroadcasterList* pBC = pOldCell->GetBroadcaster();
+/*N*/ if (pBC && !pNewCell->GetBroadcaster())
+/*N*/ {
+/*N*/ pNewCell->SetBroadcaster( pBC );
+/*N*/ pOldCell->ForgetBroadcaster();
+/*N*/ }
+/*N*/ if (pOldCell->GetNotePtr() && !pNewCell->GetNotePtr())
+/*?*/ pNewCell->SetNote( *pOldCell->GetNotePtr() );
+/*N*/ if ( pOldCell->GetCellType() == CELLTYPE_FORMULA && !pDocument->IsClipOrUndo() )
+/*N*/ {
+/*?*/ pOldCell->EndListeningTo( pDocument );
+/*?*/ // falls in EndListening NoteCell in gleicher Col zerstoert
+/*?*/ if ( nIndex >= nCount || pItems[nIndex].nRow != nRow )
+/*?*/ Search(nRow, nIndex);
+/*N*/ }
+/*N*/ pOldCell->Delete();
+/*N*/ pItems[nIndex].pCell = pNewCell;
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ if (nCount + 1 > nLimit)
+/*N*/ {
+/*N*/ if (bDoubleAlloc)
+/*N*/ {
+/*N*/ if (nLimit < COLUMN_DELTA)
+/*N*/ nLimit = COLUMN_DELTA;
+/*N*/ else
+/*N*/ {
+/*N*/ nLimit *= 2;
+/*N*/ if ( nLimit > MAXROW+1 )
+/*N*/ nLimit = MAXROW+1;
+/*N*/ }
+/*N*/ }
+/*N*/ else
+/*N*/ nLimit += COLUMN_DELTA;
+/*N*/
+/*N*/ ColEntry* pNewItems = new ColEntry[nLimit];
+/*N*/ if (pItems)
+/*N*/ {
+/*N*/ memmove( pNewItems, pItems, nCount * sizeof(ColEntry) );
+/*N*/ delete[] pItems;
+/*N*/ }
+/*N*/ pItems = pNewItems;
+/*N*/ }
+/*N*/ memmove( &pItems[nIndex + 1], &pItems[nIndex], (nCount - nIndex) * sizeof(ColEntry) );
+/*N*/ pItems[nIndex].pCell = pNewCell;
+/*N*/ pItems[nIndex].nRow = nRow;
+/*N*/ ++nCount;
+/*N*/ }
+/*N*/ }
+/*N*/ // Bei aus Clipboard sind hier noch falsche (alte) Referenzen!
+/*N*/ // Werden in CopyBlockFromClip per UpdateReference umgesetzt,
+/*N*/ // danach StartListeningFromClip und BroadcastFromClip gerufen.
+/*N*/ // Wird ins Clipboard/UndoDoc gestellt, wird kein Broadcast gebraucht.
+/*N*/ // Nach Import wird CalcAfterLoad gerufen, dort Listening.
+/*N*/ if ( !(pDocument->IsClipOrUndo() || pDocument->IsInsertingFromOtherDoc()) )
+/*N*/ {
+/*N*/ pNewCell->StartListeningTo( pDocument );
+/*N*/ CellType eCellType = pNewCell->GetCellType();
+/*N*/ // Notizzelle entsteht beim Laden nur durch StartListeningCell,
+/*N*/ // ausloesende Formelzelle muss sowieso dirty sein.
+/*N*/ if ( !(pDocument->IsCalcingAfterLoad() && eCellType == CELLTYPE_NOTE) )
+/*N*/ {
+/*N*/ if ( eCellType == CELLTYPE_FORMULA )
+/*N*/ ((ScFormulaCell*)pNewCell)->SetDirty();
+/*N*/ else
+/*N*/ pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
+/*N*/ ScAddress( nCol, nRow, nTab ), pNewCell ) );
+/*N*/ }
+/*N*/ }
+/*N*/ }
+
+
+/*N*/ void ScColumn::Insert( USHORT nRow, ULONG nNumberFormat, ScBaseCell* pCell )
+/*N*/ {
+/*N*/ Insert(nRow, pCell);
+/*N*/ short eOldType = pDocument->GetFormatTable()->
+/*N*/ GetType( (ULONG)
+/*N*/ ((SfxUInt32Item*)GetAttr( nRow, ATTR_VALUE_FORMAT ))->
+/*N*/ GetValue() );
+/*N*/ short eNewType = pDocument->GetFormatTable()->GetType(nNumberFormat);
+/*N*/ if (!pDocument->GetFormatTable()->IsCompatible(eOldType, eNewType))
+/*N*/ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, (UINT32) nNumberFormat) );
+/*N*/ }
+
+
+/*N*/ void ScColumn::Append( USHORT nRow, ScBaseCell* pCell )
+/*N*/ {
+/*N*/ if (nCount + 1 > nLimit)
+/*N*/ {
+/*N*/ if (bDoubleAlloc)
+/*N*/ {
+/*N*/ if (nLimit < COLUMN_DELTA)
+/*N*/ nLimit = COLUMN_DELTA;
+/*N*/ else
+/*N*/ {
+/*N*/ nLimit *= 2;
+/*N*/ if ( nLimit > MAXROW+1 )
+/*N*/ nLimit = MAXROW+1;
+/*N*/ }
+/*N*/ }
+/*N*/ else
+/*N*/ nLimit += COLUMN_DELTA;
+/*N*/
+/*N*/ ColEntry* pNewItems = new ColEntry[nLimit];
+/*N*/ if (pItems)
+/*N*/ {
+/*N*/ memmove( pNewItems, pItems, nCount * sizeof(ColEntry) );
+/*N*/ delete[] pItems;
+/*N*/ }
+/*N*/ pItems = pNewItems;
+/*N*/ }
+/*N*/ pItems[nCount].pCell = pCell;
+/*N*/ pItems[nCount].nRow = nRow;
+/*N*/ ++nCount;
+/*N*/ }
+
+
+/*N*/ void ScColumn::DeleteAtIndex( USHORT nIndex )
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*N*/ ScNoteCell* pNoteCell = new ScNoteCell;
+/*N*/ pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret
+/*N*/ pDocument->Broadcast( ScHint( SC_HINT_DYING,
+/*N*/ ScAddress( nCol, pItems[nIndex].nRow, nTab ), pCell ) );
+/*N*/ delete pNoteCell;
+/*N*/ --nCount;
+/*N*/ memmove( &pItems[nIndex], &pItems[nIndex + 1], (nCount - nIndex) * sizeof(ColEntry) );
+/*N*/ pItems[nCount].nRow = 0;
+/*N*/ pItems[nCount].pCell = NULL;
+/*N*/ pCell->EndListeningTo( pDocument );
+/*N*/ pCell->Delete();
+/*N*/ }
+
+
+/*N*/ void ScColumn::FreeAll()
+/*N*/ {
+/*N*/ if (pItems)
+/*N*/ {
+/*N*/ for (USHORT i = 0; i < nCount; i++)
+/*N*/ pItems[i].pCell->Delete();
+/*N*/ delete[] pItems;
+/*N*/ pItems = NULL;
+/*N*/ }
+/*N*/ nCount = 0;
+/*N*/ nLimit = 0;
+/*N*/ }
+
+
+/*N*/ void ScColumn::DeleteRow( USHORT nStartRow, USHORT nSize )
+/*N*/ {
+/*N*/ pAttrArray->DeleteRow( nStartRow, nSize );
+/*N*/
+/*N*/ if ( !pItems || !nCount )
+/*N*/ return ;
+/*N*/
+/*N*/ USHORT nFirstIndex;
+/*N*/ Search( nStartRow, nFirstIndex );
+/*N*/ if ( nFirstIndex >= nCount )
+/*N*/ return ;
+/*N*/
+/*N*/ BOOL bOldAutoCalc = pDocument->GetAutoCalc();
+/*N*/ pDocument->SetAutoCalc( FALSE ); // Mehrfachberechnungen vermeiden
+/*N*/
+/*N*/ BOOL bFound=FALSE;
+/*N*/ USHORT nEndRow = nStartRow + nSize - 1;
+/*N*/ USHORT nStartIndex;
+/*N*/ USHORT nEndIndex;
+/*N*/ USHORT i;
+/*N*/
+/*N*/ for ( i = nFirstIndex; i < nCount && pItems[i].nRow <= nEndRow; i++ )
+/*N*/ {
+/*N*/ if (!bFound)
+/*N*/ {
+/*N*/ nStartIndex = i;
+/*N*/ bFound = TRUE;
+/*N*/ }
+/*N*/ nEndIndex = i;
+/*N*/
+/*N*/ ScBaseCell* pCell = pItems[i].pCell;
+/*N*/ ScBroadcasterList* pBC = pCell->GetBroadcaster();
+/*N*/ if (pBC)
+/*N*/ {
+/*N*/ // gibt jetzt invalid reference, kein Aufruecken der direkten Referenzen
+/*N*/ // MoveListeners( *pBC, nRow+nSize );
+/*N*/ pCell->SetBroadcaster(NULL);
+/*N*/ // in DeleteRange werden leere Broadcaster geloescht
+/*N*/ }
+/*N*/ }
+/*N*/ if (bFound)
+/*N*/ {
+/*N*/ DeleteRange( nStartIndex, nEndIndex, IDF_CONTENTS );
+/*N*/ Search( nStartRow, i );
+/*N*/ if ( i >= nCount )
+/*N*/ {
+/*N*/ pDocument->SetAutoCalc( bOldAutoCalc );
+/*N*/ return ;
+/*N*/ }
+/*N*/ }
+/*N*/ else
+/*N*/ i = nFirstIndex;
+/*N*/
+/*N*/ ScAddress aAdr( nCol, 0, nTab );
+/*N*/ ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
+/*N*/ ScAddress& rAddress = aHint.GetAddress();
+/*N*/ // for sparse occupation use single broadcasts, not ranges
+/*N*/ BOOL bSingleBroadcasts = (((pItems[nCount-1].nRow - pItems[i].nRow) /
+/*N*/ (nCount - i)) > 1);
+/*N*/ if ( bSingleBroadcasts )
+/*N*/ {
+/*N*/ USHORT nLastBroadcast = MAXROW+1;
+/*N*/ for ( ; i < nCount; i++ )
+/*N*/ {
+/*N*/ USHORT nOldRow = pItems[i].nRow;
+/*N*/ // #43940# Aenderung Quelle broadcasten
+/*N*/ rAddress.SetRow( nOldRow );
+/*N*/ pDocument->AreaBroadcast( aHint );
+/*N*/ USHORT nNewRow = (pItems[i].nRow -= nSize);
+/*N*/ // #43940# Aenderung Ziel broadcasten
+/*N*/ if ( nLastBroadcast != nNewRow )
+/*N*/ { // direkt aufeinanderfolgende nicht doppelt broadcasten
+/*N*/ rAddress.SetRow( nNewRow );
+/*N*/ pDocument->AreaBroadcast( aHint );
+/*N*/ }
+/*N*/ nLastBroadcast = nOldRow;
+/*N*/ ScBaseCell* pCell = pItems[i].pCell;
+/*N*/ if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+/*N*/ ((ScFormulaCell*)pCell)->aPos.SetRow( nNewRow );
+/*N*/ }
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ rAddress.SetRow( pItems[i].nRow );
+/*N*/ ScRange aRange( rAddress );
+/*N*/ aRange.aEnd.SetRow( pItems[nCount-1].nRow );
+/*N*/ for ( ; i < nCount; i++ )
+/*N*/ {
+/*N*/ USHORT nNewRow = (pItems[i].nRow -= nSize);
+/*N*/ ScBaseCell* pCell = pItems[i].pCell;
+/*N*/ if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+/*N*/ ((ScFormulaCell*)pCell)->aPos.SetRow( nNewRow );
+/*N*/ }
+/*N*/ pDocument->AreaBroadcastInRange( aRange, aHint );
+/*N*/ }
+/*N*/
+/*N*/ pDocument->SetAutoCalc( bOldAutoCalc );
+/*N*/ }
+
+
+/*N*/ void ScColumn::DeleteRange( USHORT nStartIndex, USHORT nEndIndex, USHORT nDelFlag )
+/*N*/ {
+/*N*/ USHORT nDelCount = 0;
+/*N*/ ScBaseCell** ppDelCells = new ScBaseCell*[nEndIndex-nStartIndex+1];
+/*N*/
+/*N*/ BOOL bSimple = ((nDelFlag & IDF_CONTENTS) == IDF_CONTENTS);
+/*N*/ USHORT i;
+/*N*/
+/*N*/ // Notiz-Zeichenobjekte
+/*N*/ if (nDelFlag & IDF_NOTE)
+/*N*/ {
+/*N*/ for ( i = nStartIndex; i <= nEndIndex; i++ )
+/*N*/ {
+/*N*/ const ScPostIt* pNote = pItems[i].pCell->GetNotePtr();
+/*N*/ if ( pNote && pNote->IsShown() )
+/*N*/ {
+/*?*/ ScDetectiveFunc( pDocument, nTab ).HideComment( nCol, pItems[i].nRow );
+/*N*/ }
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ // Broadcaster stehenlassen
+/*N*/ if (bSimple)
+/*N*/ {
+/*N*/ for (i = nStartIndex; i <= nEndIndex && bSimple; i++)
+/*N*/ if (pItems[i].pCell->GetBroadcaster())
+/*N*/ bSimple = FALSE;
+/*N*/ }
+/*N*/
+/*N*/ ScHint aHint( SC_HINT_DYING, ScAddress( nCol, 0, nTab ), NULL );
+/*N*/
+/*N*/ if (bSimple) // Bereich komplett loeschen
+/*N*/ {
+/*N*/ ScBaseCell* pOldCell;
+/*N*/ ScNoteCell* pNoteCell = new ScNoteCell; // Dummy
+/*N*/ for (i = nStartIndex; i <= nEndIndex; i++)
+/*N*/ {
+/*N*/ pOldCell = pItems[i].pCell;
+/*N*/ if (pOldCell->GetCellType() == CELLTYPE_FORMULA) // Formeln spaeter loeschen
+/*N*/ ppDelCells[nDelCount++] = pOldCell;
+/*N*/ else
+/*N*/ {
+/*N*/ // Interpret in Broadcast darf kein Value finden
+/*N*/ pItems[i].pCell = pNoteCell;
+/*N*/ aHint.GetAddress().SetRow( pItems[i].nRow );
+/*N*/ aHint.SetCell( pOldCell );
+/*N*/ pDocument->Broadcast( aHint );
+/*N*/ pOldCell->Delete();
+/*N*/ }
+/*N*/ }
+/*N*/ delete pNoteCell;
+/*N*/ memmove( &pItems[nStartIndex], &pItems[nEndIndex + 1], (nCount - nEndIndex - 1) * sizeof(ColEntry) );
+/*N*/ nCount -= nEndIndex-nStartIndex+1;
+/*N*/ }
+/*N*/ else // Zellen einzeln durchgehen
+/*N*/ {
+/*N*/ USHORT j = nStartIndex;
+/*N*/ for (USHORT i = nStartIndex; i <= nEndIndex; i++)
+/*N*/ {
+/*N*/ BOOL bDelete = FALSE;
+/*N*/ ScBaseCell* pOldCell = pItems[j].pCell;
+/*N*/ CellType eCellType = pOldCell->GetCellType();
+/*N*/ switch ( eCellType )
+/*N*/ {
+/*N*/ case CELLTYPE_VALUE:
+/*N*/ if ( ( nDelFlag & (IDF_DATETIME|IDF_VALUE) ) == (IDF_DATETIME|IDF_VALUE) )
+/*N*/ bDelete = TRUE;
+/*N*/ else
+/*N*/ {
+/*?*/ ULONG nIndex = (ULONG)((SfxUInt32Item*)GetAttr( pItems[j].nRow, ATTR_VALUE_FORMAT ))->GetValue();
+/*?*/ short nTyp = pDocument->GetFormatTable()->GetType(nIndex);
+/*?*/ if ((nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) || (nTyp == NUMBERFORMAT_DATETIME))
+/*?*/ bDelete = ((nDelFlag & IDF_DATETIME) != 0);
+/*?*/ else
+/*?*/ bDelete = ((nDelFlag & IDF_VALUE) != 0);
+/*N*/ }
+/*N*/ break;
+/*?*/ case CELLTYPE_STRING:
+/*N*/ case CELLTYPE_EDIT: bDelete = ((nDelFlag & IDF_STRING) != 0); break;
+/*?*/ case CELLTYPE_FORMULA: bDelete = ((nDelFlag & IDF_FORMULA) != 0); break;
+/*?*/ case CELLTYPE_NOTE:
+/*?*/ bDelete = ((nDelFlag & IDF_NOTE) != 0) &&
+/*?*/ (pOldCell->GetBroadcaster() == NULL);
+/*?*/ break;
+/*N*/ }
+/*N*/
+/*N*/ if (bDelete)
+/*N*/ {
+/*N*/ ScNoteCell* pNoteCell = NULL;
+/*N*/ if (eCellType != CELLTYPE_NOTE)
+/*N*/ {
+/*N*/ if ((nDelFlag & IDF_NOTE) == 0)
+/*N*/ {
+/*?*/ const ScPostIt* pNote = pOldCell->GetNotePtr();
+/*?*/ if (pNote)
+/*?*/ pNoteCell = new ScNoteCell(*pNote);
+/*N*/ }
+/*N*/ ScBroadcasterList* pBC = pOldCell->GetBroadcaster();
+/*N*/ if (pBC)
+/*N*/ {
+/*N*/ if (!pNoteCell)
+/*N*/ pNoteCell = new ScNoteCell;
+/*N*/ pNoteCell->SetBroadcaster(pBC);
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ USHORT nOldRow = pItems[j].nRow;
+/*N*/ if (pNoteCell)
+/*N*/ {
+/*N*/ pItems[j].pCell = pNoteCell;
+/*N*/ ++j;
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ --nCount;
+/*N*/ memmove( &pItems[j], &pItems[j + 1], (nCount - j) * sizeof(ColEntry) );
+/*N*/ pItems[nCount].nRow = 0;
+/*N*/ pItems[nCount].pCell = NULL;
+/*N*/ }
+/*N*/ // ACHTUNG! pItems bereits verschoben!
+/*N*/ // Interpret in Broadcast muss neue/keine Zelle finden
+/*N*/ if (eCellType == CELLTYPE_FORMULA) // Formeln spaeter loeschen
+/*N*/ {
+/*N*/ ppDelCells[nDelCount++] = pOldCell;
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ aHint.GetAddress().SetRow( nOldRow );
+/*N*/ aHint.SetCell( pOldCell );
+/*N*/ pDocument->Broadcast( aHint );
+/*N*/ if (eCellType != CELLTYPE_NOTE)
+/*N*/ pOldCell->ForgetBroadcaster();
+/*N*/ pOldCell->Delete();
+/*N*/ }
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*?*/ if (nDelFlag & IDF_NOTE)
+/*?*/ if (pItems[j].pCell->GetNotePtr())
+/*?*/ pItems[j].pCell->DeleteNote();
+/*?*/ ++j;
+/*N*/ }
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ // erst Listener abhaengen kann Neuberechnungen sparen
+/*N*/ // eventuell werden dabei vorher entstandene NoteCell mitsamt
+/*N*/ // ihren Broadcaster deleted!
+/*N*/ for (i=0; i<nDelCount; i++)
+/*N*/ {
+/*?*/ ((ScFormulaCell*) ppDelCells[i])->EndListeningTo( pDocument );
+/*N*/ }
+/*N*/ // gibts die NoteCell und damit den Broadcaster noch?
+/*N*/ // If not, discard them all before broadcasting takes place!
+/*N*/ for (i=0; i<nDelCount; i++)
+/*N*/ {
+/*?*/ ScFormulaCell* pOldCell = (ScFormulaCell*) ppDelCells[i];
+/*?*/ USHORT nIndex;
+/*?*/ if ( !Search( pOldCell->aPos.Row(), nIndex ) )
+/*?*/ pOldCell->ForgetBroadcaster();
+/*N*/ }
+/*N*/ for (i=0; i<nDelCount; i++)
+/*N*/ {
+/*?*/ ScFormulaCell* pOldCell = (ScFormulaCell*) ppDelCells[i];
+/*?*/ aHint.SetAddress( pOldCell->aPos );
+/*?*/ aHint.SetCell( pOldCell );
+/*?*/ pDocument->Broadcast( aHint );
+/*?*/ pOldCell->ForgetBroadcaster();
+/*?*/ pOldCell->Delete();
+/*N*/ }
+/*N*/
+/*N*/ delete[] ppDelCells;
+/*N*/ }
+
+
+/*N*/ void ScColumn::DeleteArea(USHORT nStartRow, USHORT nEndRow, USHORT nDelFlag)
+/*N*/ {
+/*N*/ // FreeAll darf hier nicht gerufen werden wegen Broadcastern
+/*N*/
+/*N*/ // Attribute erst am Ende, damit vorher noch zwischen Zahlen und Datum
+/*N*/ // unterschieden werden kann (#47901#)
+/*N*/
+/*N*/ USHORT nContFlag = nDelFlag & IDF_CONTENTS;
+/*N*/ if (pItems && nCount && nContFlag)
+/*N*/ {
+/*N*/ if (nStartRow==0 && nEndRow==MAXROW)
+/*N*/ DeleteRange( 0, nCount-1, nContFlag );
+/*N*/ else
+/*N*/ {
+/*?*/ BOOL bFound=FALSE;
+/*?*/ USHORT nStartIndex;
+/*?*/ USHORT nEndIndex;
+/*?*/ for (USHORT i = 0; i < nCount; i++)
+/*?*/ if ((pItems[i].nRow >= nStartRow) && (pItems[i].nRow <= nEndRow))
+/*?*/ {
+/*?*/ if (!bFound)
+/*?*/ {
+/*?*/ nStartIndex = i;
+/*?*/ bFound = TRUE;
+/*?*/ }
+/*?*/ nEndIndex = i;
+/*?*/ }
+/*?*/ if (bFound)
+/*?*/ DeleteRange( nStartIndex, nEndIndex, nContFlag );
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ if ( nDelFlag & IDF_EDITATTR )
+/*N*/ {
+/*?*/ DBG_ASSERT( nContFlag == 0, "DeleteArea: falsche Flags" );
+DBG_BF_ASSERT(0, "STRIP"); //STRIP001 /*?*/ RemoveEditAttribs( nStartRow, nEndRow );
+/*N*/ }
+/*N*/
+/*N*/ // Attribute erst hier
+/*N*/ if ((nDelFlag & IDF_ATTRIB) == IDF_ATTRIB) pAttrArray->DeleteArea( nStartRow, nEndRow );
+/*N*/ else if ((nDelFlag & IDF_ATTRIB) != 0) pAttrArray->DeleteHardAttr( nStartRow, nEndRow );
+/*N*/ }
+
+
+
+
+// rColumn = Quelle
+// nRow1, nRow2 = Zielposition
+
+
+
+ // Formelzellen werden jetzt schon hier kopiert,
+ // Notizen muessen aber evtl. noch geloescht werden
+
+/*N*/ ScBaseCell* ScColumn::CloneCell(USHORT nIndex, USHORT nFlags,
+/*N*/ ScDocument* pDestDoc, const ScAddress& rDestPos)
+/*N*/ {
+/*N*/ ScBaseCell* pNew = 0;
+/*N*/ ScBaseCell* pSource = pItems[nIndex].pCell;
+/*N*/ switch (pSource->GetCellType())
+/*N*/ {
+/*?*/ case CELLTYPE_NOTE:
+/*?*/ if (nFlags & IDF_NOTE)
+/*?*/ pNew = new ScNoteCell(*(ScNoteCell*)pSource);
+/*?*/ break;
+/*?*/ case CELLTYPE_EDIT:
+/*?*/ if (nFlags & IDF_STRING)
+/*?*/ pNew = new ScEditCell( *(ScEditCell*)pSource, pDestDoc );
+/*?*/ break;
+/*N*/ case CELLTYPE_STRING:
+/*N*/ if (nFlags & IDF_STRING)
+/*N*/ pNew = new ScStringCell(*(ScStringCell*)pSource);
+/*N*/ break;
+/*N*/ case CELLTYPE_VALUE:
+/*N*/ {
+/*N*/ BOOL bDoIns = FALSE;
+/*N*/ USHORT nMask = nFlags & ( IDF_DATETIME | IDF_VALUE );
+/*N*/ if ( nMask == (IDF_DATETIME | IDF_VALUE) )
+/*N*/ bDoIns = TRUE;
+/*N*/ else if ( nMask )
+/*N*/ {
+/*?*/ ULONG nNumIndex = (ULONG)((SfxUInt32Item*) GetAttr(
+/*?*/ pItems[nIndex].nRow, ATTR_VALUE_FORMAT ))->GetValue();
+/*?*/ short nTyp = pDocument->GetFormatTable()->GetType(nNumIndex);
+/*?*/ if (nTyp == NUMBERFORMAT_DATE || nTyp == NUMBERFORMAT_TIME || nTyp == NUMBERFORMAT_DATETIME)
+/*?*/ bDoIns = (nFlags & IDF_DATETIME)!=0;
+/*?*/ else
+/*?*/ bDoIns = (nFlags & IDF_VALUE)!=0;
+/*N*/ }
+/*N*/ if (bDoIns)
+/*N*/ pNew = new ScValueCell(*(ScValueCell*)pSource);
+/*N*/ }
+/*N*/ break;
+/*?*/ case CELLTYPE_FORMULA:
+/*?*/ {
+/*?*/ ScFormulaCell* pForm = (ScFormulaCell*)pSource;
+/*?*/ if (nFlags & IDF_FORMULA)
+/*?*/ {
+DBG_BF_ASSERT(0, "STRIP"); //STRIP001 /*?*/ pNew = pForm->Clone( pDestDoc, rDestPos, TRUE );
+/*?*/ }
+/*?*/ else if ( (nFlags & (IDF_VALUE | IDF_DATETIME | IDF_STRING)) &&
+/*?*/ !pDestDoc->IsUndo() )
+/*?*/ {
+/*?*/ // #48491# ins Undo-Dokument immer nur die Original-Zelle kopieren,
+/*?*/ // aus Formeln keine Value/String-Zellen erzeugen
+/*?*/
+/*?*/ USHORT nErr = pForm->GetErrCode();
+/*?*/ if ( nErr )
+/*?*/ {
+/*?*/ // Fehler werden immer mit "Zahlen" kopiert
+/*?*/ // (Das ist hiermit willkuerlich so festgelegt)
+/*?*/
+/*?*/ if ( nFlags & IDF_VALUE )
+/*?*/ {
+DBG_BF_ASSERT(0, "STRIP"); //STRIP001 /*?*/ ScFormulaCell* pErrCell = new ScFormulaCell( pDestDoc, rDestPos );
+/*?*/ }
+/*?*/ }
+/*?*/ else if ( pForm->IsValue() )
+/*?*/ {
+/*?*/ BOOL bDoIns = FALSE;
+/*?*/ USHORT nMask = nFlags & ( IDF_DATETIME | IDF_VALUE );
+/*?*/ if ( nMask == (IDF_DATETIME | IDF_VALUE) )
+/*?*/ bDoIns = TRUE;
+/*?*/ else if ( nMask )
+/*?*/ {
+/*?*/ ULONG nNumIndex = (ULONG)((SfxUInt32Item*) GetAttr(
+/*?*/ pItems[nIndex].nRow, ATTR_VALUE_FORMAT ))->GetValue();
+/*?*/ short nTyp = pDocument->GetFormatTable()->GetType(nNumIndex);
+/*?*/ if (nTyp == NUMBERFORMAT_DATE || nTyp == NUMBERFORMAT_TIME || nTyp == NUMBERFORMAT_DATETIME)
+/*?*/ bDoIns = (nFlags & IDF_DATETIME)!=0;
+/*?*/ else
+/*?*/ bDoIns = (nFlags & IDF_VALUE)!=0;
+/*?*/ }
+/*?*/
+/*?*/ if (bDoIns)
+/*?*/ {
+/*?*/ double nVal = pForm->GetValue();
+/*?*/ pNew = new ScValueCell(nVal);
+/*?*/ }
+/*?*/ }
+/*?*/ else
+/*?*/ {
+/*?*/ if (nFlags & IDF_STRING)
+/*?*/ {
+/*?*/ String aString;
+/*?*/ pForm->GetString(aString);
+/*?*/ if ( aString.Len() )
+/*?*/ pNew = new ScStringCell(aString);
+/*?*/ // #33224# LeerStrings nicht kopieren
+/*?*/ }
+/*?*/ }
+/*?*/ if ( pNew && pSource->GetNotePtr() && ( nFlags & IDF_NOTE ) )
+/*?*/ pNew->SetNote(*pSource->GetNotePtr());
+/*?*/ }
+/*?*/ }
+/*?*/ break;
+/*N*/ }
+/*N*/
+/*N*/ if ( !pNew && pSource->GetNotePtr() && ( nFlags & IDF_NOTE ) )
+/*?*/ pNew = new ScNoteCell(*pSource->GetNotePtr());
+/*N*/
+/*N*/ return pNew;
+/*N*/ }
+
+
+
+
+// Ergebnis in rVal1
+
+
+
+
+
+
+
+/*N*/ ScAttrIterator* ScColumn::CreateAttrIterator( USHORT nStartRow, USHORT nEndRow ) const
+/*N*/ {
+/*N*/ return new ScAttrIterator( pAttrArray, nStartRow, nEndRow );
+/*N*/ }
+
+
+/*N*/ void ScColumn::StartAllListeners()
+/*N*/ {
+/*N*/ if (pItems)
+/*N*/ for (USHORT i = 0; i < nCount; i++)
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[i].pCell;
+/*N*/ if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+/*N*/ {
+/*N*/ USHORT nRow = pItems[i].nRow;
+/*N*/ ((ScFormulaCell*)pCell)->StartListeningTo( pDocument );
+/*N*/ if ( nRow != pItems[i].nRow )
+/*N*/ Search( nRow, i ); // Listener eingefuegt?
+/*N*/ }
+/*N*/ }
+/*N*/ }
+
+
+/*N*/ void ScColumn::StartNameListeners( BOOL bOnlyRelNames )
+/*N*/ {
+/*N*/ if (pItems)
+/*N*/ {
+/*N*/ USHORT nNameListening = (bOnlyRelNames ? SC_LISTENING_NAMES_REL :
+/*N*/ SC_LISTENING_NAMES_REL | SC_LISTENING_NAMES_ABS);
+/*N*/ for (USHORT i = 0; i < nCount; i++)
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[i].pCell;
+/*N*/ if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+/*N*/ {
+/*N*/ USHORT nRow = pItems[i].nRow;
+/*N*/ ((ScFormulaCell*)pCell)->StartListeningTo( pDocument, nNameListening );
+/*N*/ if ( nRow != pItems[i].nRow )
+/*N*/ Search( nRow, i ); // Listener eingefuegt?
+/*N*/ }
+/*N*/ }
+/*N*/ }
+/*N*/ }
+
+
+
+
+
+
+// TRUE = Zahlformat gesetzt
+/*N*/ BOOL ScColumn::SetString( USHORT nRow, USHORT nTab, const String& rString )
+/*N*/ {
+/*N*/ BOOL bNumFmtSet = FALSE;
+/*N*/ if (VALIDROW(nRow))
+/*N*/ {
+/*N*/ ScBaseCell* pNewCell = NULL;
+/*N*/ BOOL bIsLoading = FALSE;
+/*N*/ if (rString.Len() > 0)
+/*N*/ {
+/*N*/ double nVal;
+/*N*/ sal_uInt32 nIndex, nOldIndex;
+/*N*/ sal_Unicode cFirstChar;
+/*N*/ SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
+/*N*/ SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
+/*N*/ if ( pDocSh )
+/*N*/ bIsLoading = pDocSh->IsLoading();
+/*N*/ // IsLoading bei ConvertFrom Import
+/*N*/ if ( !bIsLoading )
+/*N*/ {
+/*N*/ nIndex = nOldIndex = GetNumberFormat( nRow );
+/*N*/ if ( rString.Len() > 1
+/*N*/ && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
+/*N*/ cFirstChar = rString.GetChar(0);
+/*N*/ else
+/*N*/ cFirstChar = 0; // Text
+/*N*/ }
+/*N*/ else
+/*N*/ { // waehrend ConvertFrom Import gibt es keine gesetzten Formate
+/*N*/ cFirstChar = rString.GetChar(0);
+/*N*/ }
+/*N*/
+/*N*/ if ( cFirstChar == '=' )
+/*N*/ {
+/*?*/ if ( rString.Len() == 1 ) // = Text
+/*?*/ pNewCell = new ScStringCell( rString );
+/*?*/ else // =Formel
+/*?*/ pNewCell = new ScFormulaCell( pDocument,
+/*?*/ ScAddress( nCol, nRow, nTab ), rString, 0 );
+/*N*/ }
+/*N*/ else if ( cFirstChar == '\'') // 'Text
+/*?*/ pNewCell = new ScStringCell( rString.Copy(1) );
+/*N*/ else
+/*N*/ {
+/*N*/ BOOL bIsText = FALSE;
+/*N*/ if ( bIsLoading )
+/*N*/ {
+/*N*/ if ( pItems && nCount )
+/*N*/ {
+/*?*/ String aStr;
+/*?*/ USHORT i = nCount;
+/*?*/ USHORT nStop = (i >= 3 ? i - 3 : 0);
+/*?*/ // die letzten Zellen vergleichen, ob gleicher String
+/*?*/ // und IsNumberFormat eingespart werden kann
+/*?*/ do
+/*?*/ {
+/*?*/ i--;
+/*?*/ ScBaseCell* pCell = pItems[i].pCell;
+/*?*/ switch ( pCell->GetCellType() )
+/*?*/ {
+/*?*/ case CELLTYPE_STRING :
+/*?*/ ((ScStringCell*)pCell)->GetString( aStr );
+/*?*/ if ( rString == aStr )
+/*?*/ bIsText = TRUE;
+/*?*/ break;
+/*?*/ case CELLTYPE_NOTE : // durch =Formel referenziert
+/*?*/ break;
+/*?*/ default:
+/*?*/ if ( i == nCount - 1 )
+/*?*/ i = 0;
+/*?*/ // wahrscheinlich ganze Spalte kein String
+/*?*/ }
+/*?*/ } while ( i && i > nStop && !bIsText );
+/*N*/ }
+/*N*/ // nIndex fuer IsNumberFormat vorbelegen
+/*N*/ if ( !bIsText )
+/*N*/ nIndex = nOldIndex = pFormatter->GetStandardIndex();
+/*N*/ }
+/*N*/ if ( !bIsText &&
+/*N*/ pFormatter->IsNumberFormat(rString, nIndex, nVal) )
+/*N*/ { // Zahl
+/*?*/ pNewCell = new ScValueCell( nVal );
+/*?*/ if ( nIndex != nOldIndex)
+/*?*/ {
+/*?*/ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
+/*?*/ (UINT32) nIndex) );
+/*?*/ bNumFmtSet = TRUE;
+/*?*/ }
+/*N*/ }
+/*N*/ else // Text
+/*N*/ pNewCell = new ScStringCell( rString );
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) )
+/*N*/ { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen
+/*N*/ // und Broadcast kommt eh erst nach dem Laden
+/*N*/ if ( pNewCell )
+/*N*/ Append( nRow, pNewCell );
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ USHORT i;
+/*N*/ if (Search(nRow, i))
+/*N*/ {
+/*?*/ ScBaseCell* pOldCell = pItems[i].pCell;
+/*?*/ const ScPostIt* pNote = pOldCell->GetNotePtr();
+/*?*/ ScBroadcasterList* pBC = pOldCell->GetBroadcaster();
+/*?*/ if (pNewCell || pNote || pBC)
+/*?*/ {
+/*?*/ if (!pNewCell)
+/*?*/ pNewCell = new ScNoteCell();
+/*?*/ if (pNote)
+/*?*/ pNewCell->SetNote(*pNote);
+/*?*/ if (pBC)
+/*?*/ {
+/*?*/ pNewCell->SetBroadcaster(pBC);
+/*?*/ pOldCell->ForgetBroadcaster();
+/*?*/ pLastFormulaTreeTop = 0; // Err527 Workaround
+/*?*/ }
+/*?*/
+/*?*/ if ( pOldCell->GetCellType() == CELLTYPE_FORMULA )
+/*?*/ {
+/*?*/ pOldCell->EndListeningTo( pDocument );
+/*?*/ // falls in EndListening NoteCell in gleicher Col zerstoert
+/*?*/ if ( i >= nCount || pItems[i].nRow != nRow )
+/*?*/ Search(nRow, i);
+/*?*/ }
+/*?*/ pOldCell->Delete();
+/*?*/ pItems[i].pCell = pNewCell; // ersetzen
+/*?*/ if ( pNewCell->GetCellType() == CELLTYPE_FORMULA )
+/*?*/ {
+/*?*/ pNewCell->StartListeningTo( pDocument );
+/*?*/ ((ScFormulaCell*)pNewCell)->SetDirty();
+/*?*/ }
+/*?*/ else
+/*?*/ pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
+/*?*/ ScAddress( nCol, nRow, nTab ), pNewCell ) );
+/*?*/ }
+/*?*/ else
+/*?*/ {
+/*?*/ DeleteAtIndex(i); // loeschen und Broadcast
+/*?*/ }
+/*N*/ }
+/*N*/ else if (pNewCell)
+/*N*/ {
+/*N*/ Insert(nRow, pNewCell); // neu eintragen und Broadcast
+/*N*/ }
+/*N*/ }
+/*N*/
+/*N*/ // hier keine Formate mehr fuer Formeln setzen!
+/*N*/ // (werden bei der Ausgabe abgefragt)
+/*N*/
+/*N*/ }
+/*N*/ return bNumFmtSet;
+/*N*/ }
+
+
+
+//
+// GetDataEntries - Strings aus zusammenhaengendem Bereich um nRow
+//
+
+// DATENT_MAX - max. Anzahl Eintrage in Liste fuer Auto-Eingabe
+// DATENT_SEARCH - max. Anzahl Zellen, die durchsucht werden - neu: nur Strings zaehlen
+#define DATENT_MAX 200
+#define DATENT_SEARCH 2000
+
+
+
+#undef DATENT_MAX
+#undef DATENT_SEARCH
+
+
+
+
+/*N*/ void ScColumn::SetError( USHORT nRow, const USHORT nError)
+/*N*/ {
+/*N*/ if (VALIDROW(nRow))
+/*N*/ {
+/*N*/ ScFormulaCell* pCell = new ScFormulaCell
+/*N*/ ( pDocument, ScAddress( nCol, nRow, nTab ) );
+/*N*/ pCell->SetErrCode( nError );
+/*N*/ Insert( nRow, pCell );
+/*N*/ }
+/*N*/ }
+
+
+/*N*/ void ScColumn::SetValue( USHORT nRow, const double& rVal)
+/*N*/ {
+/*N*/ if (VALIDROW(nRow))
+/*N*/ {
+/*N*/ ScBaseCell* pCell = new ScValueCell(rVal);
+/*N*/ Insert( nRow, pCell );
+/*N*/ }
+/*N*/ }
+
+
+/*N*/ void ScColumn::SetNote( USHORT nRow, const ScPostIt& rNote)
+/*N*/ {
+/*N*/ BOOL bEmpty = !rNote.GetText().Len();
+/*N*/
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*N*/ if (bEmpty && pCell->GetCellType() == CELLTYPE_NOTE && !pCell->GetBroadcaster())
+/*?*/ DeleteAtIndex(nIndex);
+/*N*/ else
+/*N*/ pCell->SetNote(rNote);
+/*N*/ }
+/*N*/ else
+/*N*/ {
+/*N*/ if (!bEmpty)
+/*N*/ Insert(nRow, new ScNoteCell(rNote));
+/*N*/ }
+/*N*/ }
+
+
+/*N*/ void ScColumn::GetString( USHORT nRow, String& rString ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ Color* pColor;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*N*/ if (pCell->GetCellType() != CELLTYPE_NOTE)
+/*N*/ {
+/*N*/ ULONG nFormat = GetNumberFormat( nRow );
+/*N*/ ScCellFormat::GetString( pCell, nFormat, rString, &pColor, *(pDocument->GetFormatTable()) );
+/*N*/ }
+/*N*/ else
+/*N*/ rString.Erase();
+/*N*/ }
+/*N*/ else
+/*N*/ rString.Erase();
+/*N*/ }
+
+
+/*N*/ void ScColumn::GetInputString( USHORT nRow, String& rString ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*?*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*?*/ if (pCell->GetCellType() != CELLTYPE_NOTE)
+/*?*/ {
+/*?*/ ULONG nFormat = GetNumberFormat( nRow );
+/*?*/ ScCellFormat::GetInputString( pCell, nFormat, rString, *(pDocument->GetFormatTable()) );
+/*?*/ }
+/*?*/ else
+/*?*/ rString.Erase();
+/*N*/ }
+/*N*/ else
+/*N*/ rString.Erase();
+/*N*/ }
+
+
+/*N*/ double ScColumn::GetValue( USHORT nRow ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*N*/ switch (pCell->GetCellType())
+/*N*/ {
+/*N*/ case CELLTYPE_VALUE:
+/*N*/ return ((ScValueCell*)pCell)->GetValue();
+/*N*/ break;
+/*N*/ case CELLTYPE_FORMULA:
+/*N*/ {
+/*N*/ if (((ScFormulaCell*)pCell)->IsValue())
+/*N*/ return ((ScFormulaCell*)pCell)->GetValue();
+/*N*/ else
+/*N*/ return 0.0;
+/*N*/ }
+/*N*/ break;
+/*N*/ default:
+/*N*/ return 0.0;
+/*N*/ break;
+/*N*/ }
+/*N*/ }
+/*N*/ return 0.0;
+/*N*/ }
+
+/*N*/ BOOL ScColumn::GetNote( USHORT nRow, ScPostIt& rNote) const
+/*N*/ {
+/*N*/ BOOL bHasNote = FALSE;
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ bHasNote = pItems[nIndex].pCell->GetNote(rNote);
+/*N*/ else
+/*?*/ rNote.Clear();
+/*N*/
+/*N*/ return bHasNote;
+/*N*/ }
+
+
+/*N*/ CellType ScColumn::GetCellType( USHORT nRow ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ return pItems[nIndex].pCell->GetCellType();
+/*N*/ return CELLTYPE_NONE;
+/*N*/ }
+
+
+/*N*/ USHORT ScColumn::GetErrCode( USHORT nRow ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ {
+/*N*/ ScBaseCell* pCell = pItems[nIndex].pCell;
+/*N*/ if (pCell->GetCellType() == CELLTYPE_FORMULA)
+/*N*/ return ((ScFormulaCell*)pCell)->GetErrCode();
+/*N*/ }
+/*N*/ return 0;
+/*N*/ }
+
+
+/*N*/ BOOL ScColumn::HasStringData( USHORT nRow ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ return (pItems[nIndex].pCell)->HasStringData();
+/*N*/ return FALSE;
+/*N*/ }
+
+
+/*N*/ BOOL ScColumn::HasValueData( USHORT nRow ) const
+/*N*/ {
+/*N*/ USHORT nIndex;
+/*N*/ if (Search(nRow, nIndex))
+/*N*/ return (pItems[nIndex].pCell)->HasValueData();
+/*N*/ return FALSE;
+/*N*/ }
+
+
+
+
+
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */