1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_COLUMN_HXX 25cdf0e10cSrcweir #define SC_COLUMN_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "markarr.hxx" 28cdf0e10cSrcweir #include "global.hxx" 29cdf0e10cSrcweir #include "address.hxx" 30cdf0e10cSrcweir #include "rangenam.hxx" 31cdf0e10cSrcweir #include <tools/solar.h> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <set> 34cdf0e10cSrcweir 35cdf0e10cSrcweir class Fraction; 36cdf0e10cSrcweir class OutputDevice; 37cdf0e10cSrcweir class Rectangle; 38cdf0e10cSrcweir class SfxBroadcaster; 39cdf0e10cSrcweir class SfxItemPoolCache; 40cdf0e10cSrcweir class SfxItemSet; 41cdf0e10cSrcweir class SvtListener; 42cdf0e10cSrcweir class SfxPoolItem; 43cdf0e10cSrcweir class SfxStyleSheetBase; 44cdf0e10cSrcweir class SvxBorderLine; 45cdf0e10cSrcweir class SvxBoxInfoItem; 46cdf0e10cSrcweir class SvxBoxItem; 47cdf0e10cSrcweir 48cdf0e10cSrcweir class ScAttrIterator; 49cdf0e10cSrcweir class ScAttrArray; 50cdf0e10cSrcweir class ScBaseCell; 51cdf0e10cSrcweir class ScDocument; 52cdf0e10cSrcweir class ScFormulaCell; 53cdf0e10cSrcweir class ScMarkData; 54cdf0e10cSrcweir class ScPatternAttr; 55cdf0e10cSrcweir class ScStyleSheet; 56cdf0e10cSrcweir class SvtBroadcaster; 57cdf0e10cSrcweir class TypedScStrCollection; 58cdf0e10cSrcweir class ScProgress; 59cdf0e10cSrcweir class ScPostIt; 60cdf0e10cSrcweir struct ScFunctionData; 61cdf0e10cSrcweir struct ScLineFlags; 62cdf0e10cSrcweir struct ScMergePatternState; 63cdf0e10cSrcweir class ScFlatBoolRowSegments; 64cdf0e10cSrcweir 65cdf0e10cSrcweir #define COLUMN_DELTA 4 66cdf0e10cSrcweir 67cdf0e10cSrcweir 68cdf0e10cSrcweir struct ScNeededSizeOptions 69cdf0e10cSrcweir { 70cdf0e10cSrcweir const ScPatternAttr* pPattern; 71cdf0e10cSrcweir sal_Bool bFormula; 72cdf0e10cSrcweir sal_Bool bSkipMerged; 73cdf0e10cSrcweir sal_Bool bGetFont; 74cdf0e10cSrcweir sal_Bool bTotalSize; 75cdf0e10cSrcweir 76cdf0e10cSrcweir ScNeededSizeOptions() 77cdf0e10cSrcweir { 78cdf0e10cSrcweir pPattern = NULL; 79cdf0e10cSrcweir bFormula = sal_False; 80cdf0e10cSrcweir bSkipMerged = sal_True; 81cdf0e10cSrcweir bGetFont = sal_True; 82cdf0e10cSrcweir bTotalSize = sal_False; 83cdf0e10cSrcweir } 84cdf0e10cSrcweir }; 85cdf0e10cSrcweir 86cdf0e10cSrcweir struct ColEntry 87cdf0e10cSrcweir { 88cdf0e10cSrcweir SCROW nRow; 89cdf0e10cSrcweir ScBaseCell* pCell; 90cdf0e10cSrcweir }; 91cdf0e10cSrcweir 92cdf0e10cSrcweir 93cdf0e10cSrcweir class ScColumn 94cdf0e10cSrcweir { 95cdf0e10cSrcweir private: 96cdf0e10cSrcweir SCCOL nCol; 97cdf0e10cSrcweir SCTAB nTab; 98cdf0e10cSrcweir 99cdf0e10cSrcweir SCSIZE nCount; 100cdf0e10cSrcweir SCSIZE nLimit; 101cdf0e10cSrcweir ColEntry* pItems; 102cdf0e10cSrcweir 103cdf0e10cSrcweir ScAttrArray* pAttrArray; 104cdf0e10cSrcweir ScDocument* pDocument; 105cdf0e10cSrcweir 106cdf0e10cSrcweir friend class ScDocument; // fuer FillInfo 107cdf0e10cSrcweir friend class ScDocumentIterator; 108cdf0e10cSrcweir friend class ScValueIterator; 109cdf0e10cSrcweir friend class ScHorizontalValueIterator; 110cdf0e10cSrcweir friend class ScDBQueryDataIterator; 111cdf0e10cSrcweir friend class ScColumnIterator; 112cdf0e10cSrcweir friend class ScQueryCellIterator; 113cdf0e10cSrcweir friend class ScMarkedDataIter; 114cdf0e10cSrcweir friend class ScCellIterator; 115cdf0e10cSrcweir friend class ScHorizontalCellIterator; 116cdf0e10cSrcweir friend class ScHorizontalAttrIterator; 117cdf0e10cSrcweir 118cdf0e10cSrcweir public: 119cdf0e10cSrcweir static sal_Bool bDoubleAlloc; // fuer Import: Groesse beim Allozieren verdoppeln 120cdf0e10cSrcweir 121cdf0e10cSrcweir public: 122cdf0e10cSrcweir ScColumn(); 123cdf0e10cSrcweir ~ScColumn(); 124cdf0e10cSrcweir 125cdf0e10cSrcweir void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc); 126cdf0e10cSrcweir 127cdf0e10cSrcweir sal_Bool Search( SCROW nRow, SCSIZE& nIndex ) const; 128cdf0e10cSrcweir ScBaseCell* GetCell( SCROW nRow ) const; 129cdf0e10cSrcweir void Insert( SCROW nRow, ScBaseCell* pCell ); 130cdf0e10cSrcweir void Insert( SCROW nRow, sal_uLong nFormatIndex, ScBaseCell* pCell ); 131cdf0e10cSrcweir void Append( SCROW nRow, ScBaseCell* pCell ); 132cdf0e10cSrcweir void Delete( SCROW nRow ); 133cdf0e10cSrcweir void DeleteAtIndex( SCSIZE nIndex ); 134cdf0e10cSrcweir void FreeAll(); 135cdf0e10cSrcweir void Resize( SCSIZE nSize ); 136cdf0e10cSrcweir void SwapRow( SCROW nRow1, SCROW nRow2 ); 137cdf0e10cSrcweir void SwapCell( SCROW nRow, ScColumn& rCol); 138cdf0e10cSrcweir 139cdf0e10cSrcweir //UNUSED2009-05 sal_Bool HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes, 140cdf0e10cSrcweir //UNUSED2009-05 sal_Bool bLeft, sal_Bool bRight ) const; 141cdf0e10cSrcweir bool HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; 142cdf0e10cSrcweir sal_Bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const; 143cdf0e10cSrcweir sal_Bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, 144cdf0e10cSrcweir SCCOL& rPaintCol, SCROW& rPaintRow, 145cdf0e10cSrcweir sal_Bool bRefresh, sal_Bool bAttrs ); 146cdf0e10cSrcweir 147cdf0e10cSrcweir sal_Bool IsEmptyVisData(sal_Bool bNotes) const; // ohne Broadcaster 148cdf0e10cSrcweir sal_Bool IsEmptyData() const; 149cdf0e10cSrcweir sal_Bool IsEmptyAttr() const; 150cdf0e10cSrcweir sal_Bool IsEmpty() const; 151cdf0e10cSrcweir 152cdf0e10cSrcweir // nur Daten: 153cdf0e10cSrcweir sal_Bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes = false) const; 154cdf0e10cSrcweir SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; 155cdf0e10cSrcweir sal_Bool HasDataAt(SCROW nRow) const; 156cdf0e10cSrcweir sal_Bool HasVisibleDataAt(SCROW nRow) const; 157cdf0e10cSrcweir SCROW GetFirstDataPos() const; 158cdf0e10cSrcweir SCROW GetLastDataPos() const; 159cdf0e10cSrcweir SCROW GetLastVisDataPos(sal_Bool bNotes) const; // ohne Broadcaster 160cdf0e10cSrcweir SCROW GetFirstVisDataPos(sal_Bool bNotes) const; 161cdf0e10cSrcweir sal_Bool GetPrevDataPos(SCROW& rRow) const; 162cdf0e10cSrcweir sal_Bool GetNextDataPos(SCROW& rRow) const; 163cdf0e10cSrcweir void FindDataAreaPos(SCROW& rRow, long nMovY) const; // (ohne Broadcaster) 164cdf0e10cSrcweir void FindUsed( SCROW nStartRow, SCROW nEndRow, sal_Bool* pUsed ) const; 165cdf0e10cSrcweir 166cdf0e10cSrcweir SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const; 167cdf0e10cSrcweir 168cdf0e10cSrcweir sal_uInt16 GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; 169cdf0e10cSrcweir sal_Bool HasSelectionMatrixFragment(const ScMarkData& rMark) const; 170cdf0e10cSrcweir 171cdf0e10cSrcweir sal_Bool GetFirstVisibleAttr( SCROW& rFirstRow ) const; 172cdf0e10cSrcweir sal_Bool GetLastVisibleAttr( SCROW& rLastRow ) const; 173cdf0e10cSrcweir sal_Bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; 174cdf0e10cSrcweir sal_Bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow = 0, 175cdf0e10cSrcweir SCROW nEndRow = MAXROW ) const; 176cdf0e10cSrcweir sal_Bool IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const; 177cdf0e10cSrcweir 178cdf0e10cSrcweir sal_Bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const; 179cdf0e10cSrcweir sal_Bool TestInsertRow( SCSIZE nSize ) const; 180cdf0e10cSrcweir void InsertRow( SCROW nStartRow, SCSIZE nSize ); 181cdf0e10cSrcweir void DeleteRow( SCROW nStartRow, SCSIZE nSize ); 182cdf0e10cSrcweir void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag ); 183cdf0e10cSrcweir void DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag ); 184cdf0e10cSrcweir void CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, sal_Bool bKeepScenarioFlags, sal_Bool bCloneNoteCaptions); 185cdf0e10cSrcweir void CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, 186cdf0e10cSrcweir sal_uInt16 nInsFlag, sal_Bool bAsLink, sal_Bool bSkipAttrForEmpty, ScColumn& rColumn); 187cdf0e10cSrcweir void StartListeningInArea( SCROW nRow1, SCROW nRow2 ); 188cdf0e10cSrcweir void BroadcastInArea( SCROW nRow1, SCROW nRow2 ); 189cdf0e10cSrcweir 190cdf0e10cSrcweir void RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ); 191cdf0e10cSrcweir 192cdf0e10cSrcweir // Markierung von diesem Dokument 193cdf0e10cSrcweir void MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction, 194cdf0e10cSrcweir sal_Bool bSkipEmpty, ScColumn& rSrcCol ); 195cdf0e10cSrcweir void MixData( SCROW nRow1, SCROW nRow2, sal_uInt16 nFunction, sal_Bool bSkipEmpty, 196cdf0e10cSrcweir ScColumn& rSrcCol ); 197cdf0e10cSrcweir 198cdf0e10cSrcweir ScFormulaCell* CreateRefCell( ScDocument* pDestDoc, const ScAddress& rDestPos, 199cdf0e10cSrcweir SCSIZE nIndex, sal_uInt16 nFlags ) const; 200cdf0e10cSrcweir 201cdf0e10cSrcweir ScAttrIterator* CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const; 202cdf0e10cSrcweir 203cdf0e10cSrcweir SCCOL GetCol() const { return nCol; } 204cdf0e10cSrcweir 205cdf0e10cSrcweir // UpdateSelectionFunction: Mehrfachselektion 206cdf0e10cSrcweir void UpdateSelectionFunction( const ScMarkData& rMark, 207cdf0e10cSrcweir ScFunctionData& rData, 208cdf0e10cSrcweir ScFlatBoolRowSegments& rHiddenRows, 209cdf0e10cSrcweir sal_Bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow ); 210cdf0e10cSrcweir void UpdateAreaFunction( ScFunctionData& rData, 211cdf0e10cSrcweir ScFlatBoolRowSegments& rHiddenRows, 212cdf0e10cSrcweir SCROW nStartRow, SCROW nEndRow ); 213cdf0e10cSrcweir 214cdf0e10cSrcweir void CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked, 215cdf0e10cSrcweir ScColumn& rColumn, const ScMarkData* pMarkData = NULL, 216cdf0e10cSrcweir sal_Bool bAsLink = sal_False ); 217cdf0e10cSrcweir void UndoToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked, 218cdf0e10cSrcweir ScColumn& rColumn, const ScMarkData* pMarkData = NULL ); 219cdf0e10cSrcweir 220cdf0e10cSrcweir void CopyScenarioFrom( const ScColumn& rSrcCol ); 221cdf0e10cSrcweir void CopyScenarioTo( ScColumn& rDestCol ) const; 222cdf0e10cSrcweir sal_Bool TestCopyScenarioTo( const ScColumn& rDestCol ) const; 223cdf0e10cSrcweir void MarkScenarioIn( ScMarkData& rDestMark ) const; 224cdf0e10cSrcweir 225cdf0e10cSrcweir void CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const; 226cdf0e10cSrcweir 227cdf0e10cSrcweir void SwapCol(ScColumn& rCol); 228cdf0e10cSrcweir void MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol); 229cdf0e10cSrcweir 230cdf0e10cSrcweir sal_Bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const; 231cdf0e10cSrcweir 232cdf0e10cSrcweir // sal_True = Zahlformat gesetzt 233cdf0e10cSrcweir sal_Bool SetString( SCROW nRow, SCTAB nTab, const String& rString, 234cdf0e10cSrcweir formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO, 235cdf0e10cSrcweir SvNumberFormatter* pFormatter = NULL, 236cdf0e10cSrcweir bool bDetectNumberFormat = true ); 237cdf0e10cSrcweir void SetValue( SCROW nRow, const double& rVal); 238cdf0e10cSrcweir void SetError( SCROW nRow, const sal_uInt16 nError); 239cdf0e10cSrcweir 240cdf0e10cSrcweir void GetString( SCROW nRow, String& rString ) const; 241cdf0e10cSrcweir void GetInputString( SCROW nRow, String& rString ) const; 242cdf0e10cSrcweir double GetValue( SCROW nRow ) const; 243cdf0e10cSrcweir void GetFormula( SCROW nRow, String& rFormula, 244cdf0e10cSrcweir sal_Bool bAsciiExport = sal_False ) const; 245cdf0e10cSrcweir CellType GetCellType( SCROW nRow ) const; 246cdf0e10cSrcweir SCSIZE GetCellCount() const { return nCount; } 247cdf0e10cSrcweir sal_uLong GetWeightedCount() const; 248cdf0e10cSrcweir sal_uLong GetCodeCount() const; // RPN-Code in Formeln 249cdf0e10cSrcweir sal_uInt16 GetErrCode( SCROW nRow ) const; 250cdf0e10cSrcweir 251cdf0e10cSrcweir sal_Bool HasStringData( SCROW nRow ) const; 252cdf0e10cSrcweir sal_Bool HasValueData( SCROW nRow ) const; 253cdf0e10cSrcweir //UNUSED2009-05 sal_uInt16 GetErrorData( SCROW nRow) const; 254cdf0e10cSrcweir sal_Bool HasStringCells( SCROW nStartRow, SCROW nEndRow ) const; 255cdf0e10cSrcweir 256cdf0e10cSrcweir /** Returns the pointer to a cell note object at the passed row. */ 257cdf0e10cSrcweir ScPostIt* GetNote( SCROW nRow ); 258cdf0e10cSrcweir /** Sets the passed cell note object at the passed row. Takes ownership! */ 259cdf0e10cSrcweir void TakeNote( SCROW nRow, ScPostIt* pNote ); 260cdf0e10cSrcweir /** Returns and forgets a cell note object at the passed row. */ 261cdf0e10cSrcweir ScPostIt* ReleaseNote( SCROW nRow ); 262cdf0e10cSrcweir /** Deletes the note at the passed row. */ 263cdf0e10cSrcweir void DeleteNote( SCROW nRow ); 264cdf0e10cSrcweir 265cdf0e10cSrcweir void SetDirty(); 266cdf0e10cSrcweir void SetDirty( const ScRange& ); 267cdf0e10cSrcweir void SetDirtyVar(); 268cdf0e10cSrcweir void SetDirtyAfterLoad(); 269cdf0e10cSrcweir void SetTableOpDirty( const ScRange& ); 270cdf0e10cSrcweir void CalcAll(); 271cdf0e10cSrcweir void CalcAfterLoad(); 272cdf0e10cSrcweir void CompileAll(); 273cdf0e10cSrcweir void CompileXML( ScProgress& rProgress ); 274cdf0e10cSrcweir 275cdf0e10cSrcweir void ResetChanged( SCROW nStartRow, SCROW nEndRow ); 276cdf0e10cSrcweir 277cdf0e10cSrcweir void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, 278cdf0e10cSrcweir SCCOL nCol2, SCROW nRow2, SCTAB nTab2, 279cdf0e10cSrcweir SCsCOL nDx, SCsROW nDy, SCsTAB nDz, 280cdf0e10cSrcweir ScDocument* pUndoDoc = NULL ); 281cdf0e10cSrcweir void UpdateInsertTab( SCTAB nTable); 282cdf0e10cSrcweir void UpdateInsertTabOnlyCells( SCTAB nTable); 283cdf0e10cSrcweir void UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScColumn* pRefUndo = NULL ); 284cdf0e10cSrcweir void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo); 285cdf0e10cSrcweir void UpdateCompile( sal_Bool bForceIfNameInUse = sal_False ); 286cdf0e10cSrcweir void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest, 287cdf0e10cSrcweir ScDocument* pUndoDoc ); 288cdf0e10cSrcweir void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY ); 289cdf0e10cSrcweir 290cdf0e10cSrcweir void SetTabNo(SCTAB nNewTab); 291cdf0e10cSrcweir sal_Bool IsRangeNameInUse(SCROW nRow1, SCROW nRow2, sal_uInt16 nIndex) const; 292cdf0e10cSrcweir void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, std::set<sal_uInt16>& rIndexes) const; 293cdf0e10cSrcweir void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScRangeData::IndexMap& rMap ); 294cdf0e10cSrcweir 295cdf0e10cSrcweir const SfxPoolItem* GetAttr( SCROW nRow, sal_uInt16 nWhich ) const; 296cdf0e10cSrcweir const ScPatternAttr* GetPattern( SCROW nRow ) const; 297cdf0e10cSrcweir const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const; 298cdf0e10cSrcweir 299cdf0e10cSrcweir sal_uLong GetNumberFormat( SCROW nRow ) const; 300cdf0e10cSrcweir 301cdf0e10cSrcweir void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, sal_Bool bDeep ) const; 302cdf0e10cSrcweir void MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, sal_Bool bDeep ) const; 303cdf0e10cSrcweir void MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, 304cdf0e10cSrcweir ScLineFlags& rFlags, 305cdf0e10cSrcweir SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) const; 306cdf0e10cSrcweir void ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner, 307cdf0e10cSrcweir SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ); 308cdf0e10cSrcweir 309cdf0e10cSrcweir void ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr ); 310cdf0e10cSrcweir void ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr ); 311cdf0e10cSrcweir void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr ); 312cdf0e10cSrcweir void SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, sal_Bool bPutToPool = sal_False ); 313cdf0e10cSrcweir void SetPatternArea( SCROW nStartRow, SCROW nEndRow, 314cdf0e10cSrcweir const ScPatternAttr& rPatAttr, sal_Bool bPutToPool = sal_False ); 315cdf0e10cSrcweir void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, 316cdf0e10cSrcweir const ScPatternAttr& rPattern, short nNewType ); 317cdf0e10cSrcweir 318cdf0e10cSrcweir void ApplyStyle( SCROW nRow, const ScStyleSheet& rStyle ); 319cdf0e10cSrcweir void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle ); 320cdf0e10cSrcweir void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark); 321cdf0e10cSrcweir void ApplySelectionLineStyle( const ScMarkData& rMark, 322cdf0e10cSrcweir const SvxBorderLine* pLine, sal_Bool bColorOnly ); 323cdf0e10cSrcweir 324cdf0e10cSrcweir const ScStyleSheet* GetStyle( SCROW nRow ) const; 325cdf0e10cSrcweir const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, sal_Bool& rFound ) const; 326cdf0e10cSrcweir const ScStyleSheet* GetAreaStyle( sal_Bool& rFound, SCROW nRow1, SCROW nRow2 ) const; 327cdf0e10cSrcweir 328cdf0e10cSrcweir void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); 329cdf0e10cSrcweir sal_Bool IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const; 330cdf0e10cSrcweir 331cdf0e10cSrcweir /// May return -1 if not found 332cdf0e10cSrcweir SCsROW SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, 333cdf0e10cSrcweir sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark ); 334cdf0e10cSrcweir sal_Bool SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle, 335cdf0e10cSrcweir sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark ); 336cdf0e10cSrcweir 337cdf0e10cSrcweir sal_Bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); 338cdf0e10cSrcweir sal_Bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ); 339cdf0e10cSrcweir void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich ); 340cdf0e10cSrcweir 341cdf0e10cSrcweir void RemoveProtected( SCROW nStartRow, SCROW nEndRow ); 342cdf0e10cSrcweir 343cdf0e10cSrcweir SCsROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark ); 344cdf0e10cSrcweir void DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark ); 345cdf0e10cSrcweir 346cdf0e10cSrcweir void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark ); 347cdf0e10cSrcweir void ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark ); 348cdf0e10cSrcweir 349cdf0e10cSrcweir long GetNeededSize( SCROW nRow, OutputDevice* pDev, 350cdf0e10cSrcweir double nPPTX, double nPPTY, 351cdf0e10cSrcweir const Fraction& rZoomX, const Fraction& rZoomY, 352cdf0e10cSrcweir sal_Bool bWidth, const ScNeededSizeOptions& rOptions ); 353cdf0e10cSrcweir sal_uInt16 GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nPPTY, 354cdf0e10cSrcweir const Fraction& rZoomX, const Fraction& rZoomY, 355cdf0e10cSrcweir sal_Bool bFormula, sal_uInt16 nOldWidth, 356cdf0e10cSrcweir const ScMarkData* pMarkData, 357cdf0e10cSrcweir sal_Bool bSimpleTextImport ); 358cdf0e10cSrcweir void GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHeight, 359cdf0e10cSrcweir OutputDevice* pDev, 360cdf0e10cSrcweir double nPPTX, double nPPTY, 361cdf0e10cSrcweir const Fraction& rZoomX, const Fraction& rZoomY, 362cdf0e10cSrcweir sal_Bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart ); 363cdf0e10cSrcweir private: 364cdf0e10cSrcweir long GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev, 365cdf0e10cSrcweir sal_Bool bWidth ); 366cdf0e10cSrcweir public: 367cdf0e10cSrcweir 368cdf0e10cSrcweir /// Including current, may return -1 369cdf0e10cSrcweir SCsROW GetNextUnprotected( SCROW nRow, sal_Bool bUp ) const; 370cdf0e10cSrcweir 371cdf0e10cSrcweir void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates); 372cdf0e10cSrcweir sal_Bool GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, sal_Bool bLimit); 373cdf0e10cSrcweir 374cdf0e10cSrcweir //UNUSED2008-05 SCROW NoteCount( SCROW nMaxRow = MAXROW ) const; 375cdf0e10cSrcweir 376cdf0e10cSrcweir void UpdateInsertTabAbs(SCTAB nNewPos); 377cdf0e10cSrcweir sal_Bool TestTabRefAbs(SCTAB nTable); 378cdf0e10cSrcweir sal_Bool GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMarkData& rData) const; 379cdf0e10cSrcweir 380cdf0e10cSrcweir void RemoveAutoSpellObj(); 381cdf0e10cSrcweir 382cdf0e10cSrcweir void StartListening( SvtListener& rLst, SCROW nRow ); 383cdf0e10cSrcweir void EndListening( SvtListener& rLst, SCROW nRow ); 384cdf0e10cSrcweir void MoveListeners( SvtBroadcaster& rSource, SCROW nDestRow ); 385cdf0e10cSrcweir void StartAllListeners(); 386cdf0e10cSrcweir void StartNeededListeners(); // only for cells where NeedsListening()==TRUE 387cdf0e10cSrcweir void SetRelNameDirty(); 388cdf0e10cSrcweir 389cdf0e10cSrcweir void CompileDBFormula(); 390cdf0e10cSrcweir void CompileDBFormula( sal_Bool bCreateFormulaString ); 391cdf0e10cSrcweir void CompileNameFormula( sal_Bool bCreateFormulaString ); 392cdf0e10cSrcweir void CompileColRowNameFormula(); 393cdf0e10cSrcweir 394cdf0e10cSrcweir sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const; 395cdf0e10cSrcweir xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision, 396cdf0e10cSrcweir SCROW nRowStart, SCROW nRowEnd ) const; 397cdf0e10cSrcweir 398cdf0e10cSrcweir private: 399cdf0e10cSrcweir ScBaseCell* CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos); 400cdf0e10cSrcweir //UNUSED2008-05 void CorrectSymbolCells( CharSet eStreamCharSet ); 401cdf0e10cSrcweir }; 402cdf0e10cSrcweir 403cdf0e10cSrcweir 404cdf0e10cSrcweir class ScColumnIterator // alle Daten eines Bereichs durchgehen 405cdf0e10cSrcweir { 406cdf0e10cSrcweir const ScColumn* pColumn; 407cdf0e10cSrcweir SCSIZE nPos; 408cdf0e10cSrcweir SCROW nTop; 409cdf0e10cSrcweir SCROW nBottom; 410cdf0e10cSrcweir public: 411cdf0e10cSrcweir ScColumnIterator( const ScColumn* pCol, SCROW nStart=0, SCROW nEnd=MAXROW ); 412cdf0e10cSrcweir ~ScColumnIterator(); 413cdf0e10cSrcweir 414cdf0e10cSrcweir sal_Bool Next( SCROW& rRow, ScBaseCell*& rpCell ); 415cdf0e10cSrcweir SCSIZE GetIndex() const; 416cdf0e10cSrcweir }; 417cdf0e10cSrcweir 418cdf0e10cSrcweir 419cdf0e10cSrcweir class ScMarkedDataIter // Daten in selektierten Bereichen durchgehen 420cdf0e10cSrcweir { 421cdf0e10cSrcweir const ScColumn* pColumn; 422cdf0e10cSrcweir SCSIZE nPos; 423cdf0e10cSrcweir ScMarkArrayIter* pMarkIter; 424cdf0e10cSrcweir SCROW nTop; 425cdf0e10cSrcweir SCROW nBottom; 426cdf0e10cSrcweir sal_Bool bNext; 427cdf0e10cSrcweir sal_Bool bAll; 428cdf0e10cSrcweir 429cdf0e10cSrcweir public: 430cdf0e10cSrcweir ScMarkedDataIter( const ScColumn* pCol, const ScMarkData* pMarkData, 431cdf0e10cSrcweir sal_Bool bAllIfNone = sal_False ); 432cdf0e10cSrcweir ~ScMarkedDataIter(); 433cdf0e10cSrcweir 434cdf0e10cSrcweir sal_Bool Next( SCSIZE& rIndex ); 435cdf0e10cSrcweir }; 436cdf0e10cSrcweir 437cdf0e10cSrcweir 438cdf0e10cSrcweir #endif 439cdf0e10cSrcweir 440cdf0e10cSrcweir 441