fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / viewdata.hxx
blob20854ee45a6919367e614015631d4c7d584d79c2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SC_SOURCE_UI_INC_VIEWDATA_HXX
20 #define INCLUDED_SC_SOURCE_UI_INC_VIEWDATA_HXX
22 #include <sfx2/zoomitem.hxx>
23 #include "rangelst.hxx"
24 #include "scdllapi.h"
25 #include "viewopti.hxx"
26 #include "docsh.hxx"
28 #include <boost/scoped_ptr.hpp>
30 #define SC_SIZE_NONE 65535
31 const SCCOL SC_TABSTART_NONE = SCCOL_MAX;
33 #define SC_FILL_NONE 0
34 #define SC_FILL_FILL 1
35 #define SC_FILL_EMBED_LT 2
36 #define SC_FILL_EMBED_RB 3
37 #define SC_FILL_MATRIX 4
39 enum ScSplitMode { SC_SPLIT_NONE = 0, SC_SPLIT_NORMAL, SC_SPLIT_FIX };
41 enum ScSplitPos { SC_SPLIT_TOPLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMLEFT, SC_SPLIT_BOTTOMRIGHT };
42 enum ScHSplitPos { SC_SPLIT_LEFT, SC_SPLIT_RIGHT };
43 enum ScVSplitPos { SC_SPLIT_TOP, SC_SPLIT_BOTTOM };
45 inline ScHSplitPos WhichH( ScSplitPos ePos );
46 inline ScVSplitPos WhichV( ScSplitPos ePos );
47 inline ScSplitPos Which( ScHSplitPos eHPos );
48 inline ScSplitPos Which( ScVSplitPos eVPos );
50 /** Screen behavior related to cursor movements */
51 enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, SC_FOLLOW_JUMP };
53 /** Mouse mode to select areas */
54 enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL,
55 SC_REFTYPE_EMBED_LT, SC_REFTYPE_EMBED_RB };
57 /** States GetSimpleArea() returns for the underlying selection marks, so the
58 caller can react if the result is not of type SC_MARK_SIMPLE. */
59 enum ScMarkType
61 SC_MARK_NONE = 0, // Not returned by GetSimpleArea(), used internally.
62 // Nothing marked always results in the
63 // current cursor position being selected and a simple mark.
64 SC_MARK_SIMPLE = 1, // Simple rectangular area marked, no filtered rows.
65 SC_MARK_FILTERED = 2, // At least one mark contains filtered rows.
66 SC_MARK_SIMPLE_FILTERED = // Simple rectangular area marked containing filtered rows.
67 SC_MARK_SIMPLE |
68 SC_MARK_FILTERED, // 3
69 SC_MARK_MULTI = 4 // Multiple selection marks.
70 /* TODO: if filtered multi-selection was implemented, this would be the value to use. */
71 #if 0
73 SC_MARK_MULTI_FILTERED = // Multiple selection marks containing filtered rows.
74 SC_MARK_MULTI |
75 SC_MARK_FILTERED // 6
76 #endif
79 enum ScPasteFlags
81 SC_PASTE_NONE = 0, // No flags specified
82 SC_PASTE_MODE = 1, // Enable paste-mode
83 SC_PASTE_BORDER = 2, // Show a border around the source cells
86 class ScDocFunc;
87 class ScDocShell;
88 class ScDocument;
89 class ScDBFunc;
90 class ScTabViewShell;
91 class ScDrawView;
92 class ScEditEngineDefaulter;
93 class EditView;
94 class EditStatus;
95 class Outliner;
96 namespace vcl { class Window; }
97 class SfxObjectShell;
98 class SfxBindings;
99 class SfxDispatcher;
100 class ScPatternAttr;
101 class ScExtDocOptions;
102 class ScViewData;
103 class ScMarkData;
104 class ScGridWindow;
106 class ScViewDataTable // per-sheet data
108 friend class ScViewData;
109 private:
110 SvxZoomType eZoomType; // selected zoom type (normal view)
111 Fraction aZoomX; // selected zoom X
112 Fraction aZoomY; // selected zoom Y (displayed)
113 Fraction aPageZoomX; // zoom in page break preview mode
114 Fraction aPageZoomY;
116 long nTPosX[2]; // MapMode - Offset (Twips)
117 long nTPosY[2];
118 long nMPosX[2]; // MapMode - Offset (1/100 mm)
119 long nMPosY[2];
120 long nPixPosX[2]; // Offset in Pixels
121 long nPixPosY[2];
122 long nHSplitPos;
123 long nVSplitPos;
125 ScSplitMode eHSplitMode;
126 ScSplitMode eVSplitMode;
127 ScSplitPos eWhichActive;
129 SCCOL nFixPosX; // Cell position of the splitter when freeze pane
130 SCROW nFixPosY;
132 SCCOL nCurX;
133 SCROW nCurY;
134 SCCOL nOldCurX;
135 SCROW nOldCurY;
136 SCCOL nPosX[2]; ///< X position of the top left cell of the visible area.
137 SCROW nPosY[2]; ///< Y position of the top left cell of the visible area.
139 bool bShowGrid; // per sheet show grid lines option.
140 bool mbOldCursorValid; // "virtual" Cursor position when combined
141 ScViewDataTable();
143 void WriteUserDataSequence(
144 com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings,
145 const ScViewData& rViewData, SCTAB nTab ) const;
147 void ReadUserDataSequence(
148 const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings,
149 ScViewData& rViewData, SCTAB nTab, bool& rHasZoom);
150 public:
151 ~ScViewDataTable();
154 class SC_DLLPUBLIC ScViewData
156 private:
157 double nPPTX, nPPTY; // Scaling factors
159 ::std::vector<ScViewDataTable*> maTabData;
160 boost::scoped_ptr<ScMarkData> mpMarkData;
161 ScViewDataTable* pThisTab; // Data of the displayed sheet
162 ScDocShell* pDocShell;
163 ScDocument* pDoc;
164 ScDBFunc* pView;
165 ScTabViewShell* pViewShell;
166 EditView* pEditView[4]; // Belongs to the window
167 ScViewOptions* pOptions;
168 EditView* pSpellingView;
170 Size aScenButSize;
172 Size aScrSize;
173 MapMode aLogicMode; // skalierter 1/100mm-MapMode
175 SvxZoomType eDefZoomType; // default zoom and type for missing TabData
176 Fraction aDefZoomX;
177 Fraction aDefZoomY;
178 Fraction aDefPageZoomX; // zoom in page break preview mode
179 Fraction aDefPageZoomY;
181 ScRefType eRefType;
183 SCTAB nTabNo; // displayed sheet
184 SCTAB nRefTabNo; // sheet which contains RefInput
185 SCCOL nRefStartX;
186 SCROW nRefStartY;
187 SCTAB nRefStartZ;
188 SCCOL nRefEndX;
189 SCROW nRefEndY;
190 SCTAB nRefEndZ;
191 SCCOL nFillStartX; // Fill Cursor
192 SCROW nFillStartY;
193 SCCOL nFillEndX;
194 SCROW nFillEndY;
195 SCCOL nEditCol; // Related position
196 SCROW nEditRow;
197 SCCOL nEditStartCol;
198 SCCOL nEditEndCol; // End of Edit View
199 SCROW nEditEndRow;
200 SCCOL nTabStartCol; // for Enter after Tab
201 ScRange aDelRange; // for delete AutoFill
203 ScPasteFlags nPasteFlags;
205 ScSplitPos eEditActivePart; // the part that was active when edit mode was started
206 sal_uInt8 nFillMode;
207 bool bEditActive[4]; // Active?
208 bool bActive:1; // Active Window ?
209 bool bIsRefMode:1; // Reference input
210 bool bDelMarkValid:1; // Only valid at SC_REFTYPE_FILL
211 bool bPagebreak:1; // Page break preview mode
212 bool bSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click
214 DECL_DLLPRIVATE_STATIC_LINK (ScViewData, EmptyEditHdl, void*);
215 DECL_DLLPRIVATE_LINK (EditEngineHdl, EditStatus*);
217 SAL_DLLPRIVATE void CalcPPT();
218 SAL_DLLPRIVATE void CreateTabData( SCTAB nNewTab );
219 SAL_DLLPRIVATE void CreateTabData( std::vector< SCTAB >& rvTabs );
220 SAL_DLLPRIVATE void CreateSelectedTabData();
221 SAL_DLLPRIVATE void EnsureTabDataSize(size_t nSize);
222 SAL_DLLPRIVATE void UpdateCurrentTab();
224 public:
225 ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh );
226 ScViewData( const ScViewData& rViewData );
227 ~ScViewData();
229 void InitData( ScDocument* pDocument );
231 ScDocShell* GetDocShell() const { return pDocShell; }
232 ScDocFunc& GetDocFunc() const;
233 ScDBFunc* GetView() const { return pView; }
234 ScTabViewShell* GetViewShell() const { return pViewShell; }
235 SfxObjectShell* GetSfxDocShell() const { return pDocShell; }
236 SfxBindings& GetBindings(); // from ViewShell's ViewFrame
237 SfxDispatcher& GetDispatcher(); // from ViewShell's ViewFrame
239 ScMarkData& GetMarkData();
240 const ScMarkData& GetMarkData() const;
242 vcl::Window* GetDialogParent(); // forwarded from tabvwsh
243 ScGridWindow* GetActiveWin(); // from View
244 const ScGridWindow* GetActiveWin() const;
245 ScDrawView* GetScDrawView(); // from View
246 bool IsMinimized(); // from View
248 void UpdateInputHandler( bool bForce = false, bool bStopEditing = true );
250 void WriteUserData(OUString& rData);
251 void ReadUserData(const OUString& rData);
252 void WriteExtOptions( ScExtDocOptions& rOpt ) const;
253 void ReadExtOptions( const ScExtDocOptions& rOpt );
254 void WriteUserDataSequence(com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings) const;
255 void ReadUserDataSequence(const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings);
257 ScDocument* GetDocument() const;
259 bool IsActive() const { return bActive; }
260 void Activate(bool bActivate) { bActive = bActivate; }
262 void InsertTab( SCTAB nTab );
263 void InsertTabs( SCTAB nTab, SCTAB nNewSheets );
264 void DeleteTab( SCTAB nTab );
265 void DeleteTabs( SCTAB nTab, SCTAB nSheets );
266 void CopyTab( SCTAB nSrcTab, SCTAB nDestTab );
267 void MoveTab( SCTAB nSrcTab, SCTAB nDestTab );
269 SCTAB GetRefTabNo() const { return nRefTabNo; }
270 void SetRefTabNo( SCTAB nNewTab ) { nRefTabNo = nNewTab; }
272 SCTAB GetTabNo() const { return nTabNo; }
273 ScSplitPos GetActivePart() const { return pThisTab->eWhichActive; }
274 SCCOL GetPosX( ScHSplitPos eWhich ) const { return pThisTab->nPosX[eWhich]; }
275 SCROW GetPosY( ScVSplitPos eWhich ) const { return pThisTab->nPosY[eWhich]; }
276 SCCOL GetCurX() const { return pThisTab->nCurX; }
277 SCROW GetCurY() const { return pThisTab->nCurY; }
278 bool HasOldCursor() const { return pThisTab->mbOldCursorValid; }
279 SCCOL GetOldCurX() const;
280 SCROW GetOldCurY() const;
281 ScSplitMode GetHSplitMode() const { return pThisTab->eHSplitMode; }
282 ScSplitMode GetVSplitMode() const { return pThisTab->eVSplitMode; }
283 long GetHSplitPos() const { return pThisTab->nHSplitPos; }
284 long GetVSplitPos() const { return pThisTab->nVSplitPos; }
285 SCCOL GetFixPosX() const { return pThisTab->nFixPosX; }
286 SCROW GetFixPosY() const { return pThisTab->nFixPosY; }
287 bool IsPagebreakMode() const { return bPagebreak; }
288 bool IsPasteMode() const { return (nPasteFlags & SC_PASTE_MODE) != 0; }
289 bool ShowPasteSource() const { return (nPasteFlags & SC_PASTE_BORDER) != 0; }
291 void SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
292 void SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
293 void SetCurX( SCCOL nNewCurX ) { pThisTab->nCurX = nNewCurX; }
294 void SetCurY( SCROW nNewCurY ) { pThisTab->nCurY = nNewCurY; }
295 void SetOldCursor( SCCOL nNewX, SCROW nNewY );
296 void ResetOldCursor();
297 void SetHSplitMode( ScSplitMode eMode ) { pThisTab->eHSplitMode = eMode; }
298 void SetVSplitMode( ScSplitMode eMode ) { pThisTab->eVSplitMode = eMode; }
299 void SetHSplitPos( long nPos ) { pThisTab->nHSplitPos = nPos; }
300 void SetVSplitPos( long nPos ) { pThisTab->nVSplitPos = nPos; }
301 void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; }
302 void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; }
303 void SetPagebreakMode( bool bSet );
304 void SetPasteMode ( ScPasteFlags nFlags ) { nPasteFlags = nFlags; }
306 void SetZoomType( SvxZoomType eNew, bool bAll );
307 void SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs );
308 void SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs );
309 void SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll );
310 void RefreshZoom();
312 void SetSelCtrlMouseClick( bool bTmp ) { bSelCtrlMouseClick = bTmp; }
314 SvxZoomType GetZoomType() const { return pThisTab->eZoomType; }
315 const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; }
316 const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; }
318 void SetShowGrid( bool bShow );
319 bool GetShowGrid() const { return pThisTab->bShowGrid; }
321 const MapMode& GetLogicMode( ScSplitPos eWhich );
322 const MapMode& GetLogicMode(); // Offset 0
324 long GetTPosX( ScHSplitPos eWhich ) const { return pThisTab->nTPosX[eWhich]; }
325 long GetTPosY( ScVSplitPos eWhich ) const { return pThisTab->nTPosY[eWhich]; }
327 double GetPPTX() const { return nPPTX; }
328 double GetPPTY() const { return nPPTY; }
330 ScMarkType GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab,
331 SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const;
332 ScMarkType GetSimpleArea( ScRange& rRange ) const;
333 /// May modify rNewMark using MarkToSimple().
334 ScMarkType GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const;
335 void GetMultiArea( ScRangeListRef& rRange ) const;
337 bool SimpleColMarked();
338 bool SimpleRowMarked();
340 bool IsMultiMarked();
342 void SetFillMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
343 void SetDragMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
344 sal_uInt8 nMode );
345 void GetFillData( SCCOL& rStartCol, SCROW& rStartRow,
346 SCCOL& rEndCol, SCROW& rEndRow );
347 void ResetFillMode();
348 bool IsAnyFillMode() { return nFillMode != SC_FILL_NONE; }
349 bool IsFillMode() { return nFillMode == SC_FILL_FILL; }
350 sal_uInt8 GetFillMode() { return nFillMode; }
352 // TRUE: Cell is merged
353 bool GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ) const;
354 bool GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
355 SCsCOL& rPosX, SCsROW& rPosY,
356 bool bTestMerge = true, bool bRepair = false,
357 bool bNextIfLarge = true );
358 void GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
359 SCsCOL nPosX, SCsROW nPosY, bool& rLeft, bool& rTop );
361 bool IsRefMode() const { return bIsRefMode; }
362 ScRefType GetRefType() const { return eRefType; }
363 SCCOL GetRefStartX() const { return nRefStartX; }
364 SCROW GetRefStartY() const { return nRefStartY; }
365 SCTAB GetRefStartZ() const { return nRefStartZ; }
366 SCCOL GetRefEndX() const { return nRefEndX; }
367 SCROW GetRefEndY() const { return nRefEndY; }
368 SCTAB GetRefEndZ() const { return nRefEndZ; }
370 void SetRefMode( bool bNewMode, ScRefType eNewType )
371 { bIsRefMode = bNewMode; eRefType = eNewType; }
373 void SetRefStart( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ );
374 void SetRefEnd( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ );
376 void ResetDelMark() { bDelMarkValid = false; }
377 void SetDelMark( const ScRange& rRange )
378 { aDelRange = rRange; bDelMarkValid = true; }
380 bool GetDelMark( ScRange& rRange ) const
381 { rRange = aDelRange; return bDelMarkValid; }
383 inline void GetMoveCursor( SCCOL& rCurX, SCROW& rCurY );
385 const ScViewOptions& GetOptions() const { return *pOptions; }
386 void SetOptions( const ScViewOptions& rOpt );
388 bool IsGridMode () const { return pOptions->GetOption( VOPT_GRID ); }
389 void SetGridMode ( bool bNewMode ) { pOptions->SetOption( VOPT_GRID, bNewMode ); }
390 bool IsSyntaxMode () const { return pOptions->GetOption( VOPT_SYNTAX ); }
391 void SetSyntaxMode ( bool bNewMode ) { pOptions->SetOption( VOPT_SYNTAX, bNewMode ); }
392 bool IsHeaderMode () const { return pOptions->GetOption( VOPT_HEADER ); }
393 void SetHeaderMode ( bool bNewMode ) { pOptions->SetOption( VOPT_HEADER, bNewMode ); }
394 bool IsTabMode () const { return pOptions->GetOption( VOPT_TABCONTROLS ); }
395 void SetTabMode ( bool bNewMode ) { pOptions->SetOption( VOPT_TABCONTROLS, bNewMode ); }
396 bool IsVScrollMode () const { return pOptions->GetOption( VOPT_VSCROLL ); }
397 void SetVScrollMode ( bool bNewMode ) { pOptions->SetOption( VOPT_VSCROLL, bNewMode ); }
398 bool IsHScrollMode () const { return pOptions->GetOption( VOPT_HSCROLL ); }
399 void SetHScrollMode ( bool bNewMode ) { pOptions->SetOption( VOPT_HSCROLL, bNewMode ); }
400 bool IsOutlineMode () const { return pOptions->GetOption( VOPT_OUTLINER ); }
401 void SetOutlineMode ( bool bNewMode ) { pOptions->SetOption( VOPT_OUTLINER, bNewMode ); }
403 void KillEditView();
404 void ResetEditView();
405 void SetEditEngine( ScSplitPos eWhich,
406 ScEditEngineDefaulter* pNewEngine,
407 vcl::Window* pWin, SCCOL nNewX, SCROW nNewY );
408 void GetEditView( ScSplitPos eWhich, EditView*& rViewPtr, SCCOL& rCol, SCROW& rRow );
409 bool HasEditView( ScSplitPos eWhich ) const
410 { return pEditView[eWhich] && bEditActive[eWhich]; }
411 EditView* GetEditView( ScSplitPos eWhich ) const
412 { return pEditView[eWhich]; }
414 void EditGrowX();
415 void EditGrowY( bool bInitial = false );
417 ScSplitPos GetEditActivePart() const { return eEditActivePart; }
418 SCCOL GetEditViewCol() const { return nEditCol; }
419 SCROW GetEditViewRow() const { return nEditRow; }
420 SCCOL GetEditStartCol() const { return nEditStartCol; }
421 SCROW GetEditStartRow() const { return nEditRow; } // never editing above the cell
422 SCCOL GetEditEndCol() const { return nEditEndCol; }
423 SCROW GetEditEndRow() const { return nEditEndRow; }
425 Rectangle GetEditArea( ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, vcl::Window* pWin,
426 const ScPatternAttr* pPattern, bool bForceToTop );
428 void SetTabNo( SCTAB nNewTab );
429 void SetActivePart( ScSplitPos eNewActive );
431 Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
432 bool bAllowNeg = false ) const;
433 Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScHSplitPos eWhich ) const;
434 Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScVSplitPos eWhich ) const;
436 SCCOL CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY = SC_SIZE_NONE ) const;
437 SCROW CellsAtY( SCsROW nPosY, SCsROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX = SC_SIZE_NONE ) const;
439 SCCOL VisibleCellsX( ScHSplitPos eWhichX ) const; // Completely visible cell
440 SCROW VisibleCellsY( ScVSplitPos eWhichY ) const;
441 SCCOL PrevCellsX( ScHSplitPos eWhichX ) const; // Cells on the preceding page
442 SCROW PrevCellsY( ScVSplitPos eWhichY ) const;
444 bool IsOle();
445 void SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
446 void SetScreen( const Rectangle& rVisArea );
447 void SetScreenPos( const Point& rVisAreaStart );
449 void UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY );
451 Size GetScrSize() const { return aScrSize; }
453 void RecalcPixPos();
454 Point GetPixPos( ScSplitPos eWhich ) const
455 { return Point( pThisTab->nPixPosX[WhichH(eWhich)],
456 pThisTab->nPixPosY[WhichV(eWhich)] ); }
457 void SetSpellingView( EditView* pSpView) { pSpellingView = pSpView; }
458 EditView* GetSpellingView() const { return pSpellingView; }
460 void UpdateOutlinerFlags( Outliner& rOutl ) const;
462 Point GetMousePosPixel();
464 bool UpdateFixX(SCTAB nTab = MAXTAB+1);
465 bool UpdateFixY(SCTAB nTab = MAXTAB+1);
467 SCCOL GetTabStartCol() const { return nTabStartCol; }
468 void SetTabStartCol(SCCOL nNew) { nTabStartCol = nNew; }
470 ScAddress GetCurPos() const;
472 const Size& GetScenButSize() const { return aScenButSize; }
473 void SetScenButSize(const Size& rNew) { aScenButSize = rNew; }
475 bool IsSelCtrlMouseClick() { return bSelCtrlMouseClick; }
477 static inline long ToPixel( sal_uInt16 nTwips, double nFactor );
479 /** while (rScrY <= nEndPixels && rPosY <= nEndRow) add pixels of row
480 heights converted with nPPTY to rScrY, optimized for row height
481 segments. Upon return rPosY is the last row evaluated <= nEndRow, rScrY
482 may be > nEndPixels!
484 static void AddPixelsWhile( long & rScrY, long nEndPixels,
485 SCROW & rPosY, SCROW nEndRow, double nPPTY,
486 const ScDocument * pDoc, SCTAB nTabNo );
488 /** while (rScrY <= nEndPixels && rPosY >= nStartRow) add pixels of row
489 heights converted with nPPTY to rScrY, optimized for row height
490 segments. Upon return rPosY is the last row evaluated >= nStartRow,
491 rScrY may be > nEndPixels!
493 static void AddPixelsWhileBackward( long & rScrY, long nEndPixels,
494 SCROW & rPosY, SCROW nStartRow, double nPPTY,
495 const ScDocument * pDoc, SCTAB nTabNo );
498 inline long ScViewData::ToPixel( sal_uInt16 nTwips, double nFactor )
500 long nRet = (long)( nTwips * nFactor );
501 if ( !nRet && nTwips )
502 nRet = 1;
503 return nRet;
506 inline void ScViewData::GetMoveCursor( SCCOL& rCurX, SCROW& rCurY )
508 if ( bIsRefMode )
510 rCurX = nRefEndX;
511 rCurY = nRefEndY;
513 else
515 rCurX = GetCurX();
516 rCurY = GetCurY();
520 inline ScHSplitPos WhichH( ScSplitPos ePos )
522 return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_BOTTOMLEFT) ?
523 SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
526 inline ScVSplitPos WhichV( ScSplitPos ePos )
528 return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_TOPRIGHT) ?
529 SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
532 inline ScSplitPos Which( ScHSplitPos eHPos )
534 return (eHPos==SC_SPLIT_LEFT) ?
535 SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
538 inline ScSplitPos Which( ScVSplitPos eVPos )
540 return (eVPos==SC_SPLIT_TOP) ?
541 SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
544 #endif
546 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */