update dev300-m58
[ooovba.git] / sc / source / ui / view / tabview5.cxx
blob9893ae8bf046e0966278c41ad66fa82a5a493817
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabview5.cxx,v $
10 * $Revision: 1.25.32.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 // INCLUDE ---------------------------------------------------------------
38 #include "scitems.hxx"
39 #include <svx/eeitem.hxx>
42 #include <svx/fmshell.hxx>
43 #include <svx/svdobj.hxx>
44 #include <svx/svdoutl.hxx>
45 #include <sfx2/bindings.hxx>
46 #include <sfx2/dispatch.hxx>
47 #include <sfx2/objsh.hxx>
48 #include <tools/ref.hxx>
50 #include "tabview.hxx"
51 #include "tabvwsh.hxx"
52 #include "document.hxx"
53 #include "gridwin.hxx"
54 #include "olinewin.hxx"
55 #include "tabsplit.hxx"
56 #include "colrowba.hxx"
57 #include "tabcont.hxx"
58 #include "hintwin.hxx"
59 #include "sc.hrc"
60 #include "pagedata.hxx"
61 #include "hiranges.hxx"
62 #include "drawview.hxx"
63 #include "drwlayer.hxx"
64 #include "fusel.hxx" // Start-Function
65 #include "seltrans.hxx"
66 #include "scmod.hxx"
67 #include "AccessibilityHints.hxx"
68 #include "docsh.hxx"
69 #include "viewuno.hxx"
71 #include <vcl/svapp.hxx>
73 using namespace com::sun::star;
75 // STATIC DATA -----------------------------------------------------------
78 void __EXPORT ScTabView::Init()
80 /* RTL layout of the view windows is done manually, because it depends on
81 the sheet orientation, not the UI setting. Note: controls that are
82 already constructed (e.g. scroll bars) have the RTL setting of the GUI.
83 Eventually this has to be disabled manually (see below). */
84 pFrameWin->EnableRTL( FALSE );
86 USHORT i;
88 aScrollTimer.SetTimeout(10);
89 aScrollTimer.SetTimeoutHdl( LINK( this, ScTabView, TimerHdl ) );
91 for (i=0; i<4; i++)
92 pGridWin[i] = NULL;
93 pGridWin[SC_SPLIT_BOTTOMLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT );
95 pSelEngine = new ScViewSelectionEngine( pGridWin[SC_SPLIT_BOTTOMLEFT], this,
96 SC_SPLIT_BOTTOMLEFT );
97 aFunctionSet.SetSelectionEngine( pSelEngine );
99 pHdrSelEng = new ScHeaderSelectionEngine( pFrameWin, &aHdrFunc );
101 pColBar[SC_SPLIT_LEFT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_LEFT,
102 &aHdrFunc, pHdrSelEng );
103 pColBar[SC_SPLIT_RIGHT] = NULL;
104 pRowBar[SC_SPLIT_BOTTOM] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_BOTTOM,
105 &aHdrFunc, pHdrSelEng );
106 pRowBar[SC_SPLIT_TOP] = NULL;
107 for (i=0; i<2; i++)
108 pColOutline[i] = pRowOutline[i] = NULL;
110 pHSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_HSCROLL ), &aViewData );
111 pVSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_VSCROLL ), &aViewData );
113 // SSA: override default keyboard step size to allow snap to row/column
114 pHSplitter->SetKeyboardStepSize( 1 );
115 pVSplitter->SetKeyboardStepSize( 1 );
117 pTabControl = new ScTabControl( pFrameWin, &aViewData );
118 /* #i97900# The tab control has to remain in RTL mode if GUI is RTL, this
119 is needed to draw the 3D effect correctly. The base TabBar implementes
120 mirroring independent from the GUI direction. Have to set RTL mode
121 explicitly because the parent frame window is already RTL disabled. */
122 pTabControl->EnableRTL( Application::GetSettings().GetLayoutRTL() );
124 InitScrollBar( aHScrollLeft, MAXCOL+1 );
125 InitScrollBar( aHScrollRight, MAXCOL+1 );
126 InitScrollBar( aVScrollTop, MAXROW+1 );
127 InitScrollBar( aVScrollBottom, MAXROW+1 );
128 /* #i97900# scrollbars remain in correct RTL mode, needed mirroring etc.
129 is now handled correctly at the respective places. */
131 // Hier noch nichts anzeigen (Show), weil noch falsch angeordnet ist
132 // Show kommt dann aus UpdateShow beim ersten Resize
133 // pTabControl, pGridWin, aHScrollLeft, aVScrollBottom,
134 // aCornerButton, aScrollBarBox, pHSplitter, pVSplitter
136 // Splitter
138 pHSplitter->SetSplitHdl( LINK( this, ScTabView, SplitHdl ) );
139 pVSplitter->SetSplitHdl( LINK( this, ScTabView, SplitHdl ) );
141 // UpdateShow kommt beim Resize, oder bei Kopie einer bestehenden View aus dem ctor
143 pDrawActual = NULL;
144 pDrawOld = NULL;
146 // DrawView darf nicht im TabView - ctor angelegt werden,
147 // wenn die ViewShell noch nicht konstruiert ist...
148 // Das gilt auch fuer ViewOptionsHasChanged()
150 TestHintWindow();
153 __EXPORT ScTabView::~ScTabView()
155 USHORT i;
157 // remove selection object
158 ScModule* pScMod = SC_MOD();
159 ScSelectionTransferObj* pOld = pScMod->GetSelectionTransfer();
160 if ( pOld && pOld->GetView() == this )
162 pOld->ForgetView();
163 pScMod->SetSelectionTransfer( NULL );
164 TransferableHelper::ClearSelection( GetActiveWin() ); // may delete pOld
167 DELETEZ(pBrushDocument);
168 DELETEZ(pDrawBrushSet);
170 DELETEZ(pPageBreakData);
171 DELETEZ(pHighlightRanges);
173 DELETEZ(pDrawOld);
174 DELETEZ(pDrawActual);
176 aViewData.KillEditView(); // solange GridWin's noch existieren
178 DELETEZ(pInputHintWindow);
180 if (pDrawView)
182 for (i=0; i<4; i++)
183 if (pGridWin[i])
185 pDrawView->VCRemoveWin(pGridWin[i]);
186 pDrawView->DeleteWindowFromPaintView(pGridWin[i]);
189 pDrawView->HideSdrPage();
190 delete pDrawView;
193 delete pSelEngine;
195 for (i=0; i<4; i++)
196 delete pGridWin[i];
198 delete pHdrSelEng;
200 for (i=0; i<2; i++)
202 delete pColBar[i];
203 delete pRowBar[i];
204 delete pColOutline[i];
205 delete pRowOutline[i];
208 delete pHSplitter;
209 delete pVSplitter;
211 delete pTabControl;
214 void ScTabView::MakeDrawView( BYTE nForceDesignMode )
216 if (!pDrawView)
218 ScDrawLayer* pLayer = aViewData.GetDocument()->GetDrawLayer();
219 DBG_ASSERT(pLayer, "wo ist der Draw Layer ??");
221 USHORT i;
222 pDrawView = new ScDrawView( pGridWin[SC_SPLIT_BOTTOMLEFT], &aViewData );
223 for (i=0; i<4; i++)
224 if (pGridWin[i])
226 if ( SC_SPLIT_BOTTOMLEFT != (ScSplitPos)i )
227 pDrawView->AddWindowToPaintView(pGridWin[i]);
228 pDrawView->VCAddWin(pGridWin[i]);
230 pDrawView->RecalcScale();
231 for (i=0; i<4; i++)
232 if (pGridWin[i])
234 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
236 pGridWin[i]->Update(); // wegen Invalidate im DrawView ctor (ShowPage),
237 // damit gleich gezeichnet werden kann
239 SfxRequest aSfxRequest(SID_OBJECT_SELECT, 0,aViewData.GetViewShell()->GetPool());
240 SetDrawFuncPtr(new FuSelection( aViewData.GetViewShell(), GetActiveWin(), pDrawView,
241 pLayer,aSfxRequest));
243 // #106334# used when switching back from page preview: restore saved design mode state
244 // (otherwise, keep the default from the draw view ctor)
245 if ( nForceDesignMode != SC_FORCEMODE_NONE )
246 pDrawView->SetDesignMode( (BOOL)nForceDesignMode );
248 // an der FormShell anmelden
249 FmFormShell* pFormSh = aViewData.GetViewShell()->GetFormShell();
250 if (pFormSh)
251 pFormSh->SetView(pDrawView);
253 if (aViewData.GetViewShell()->HasAccessibilityObjects())
254 aViewData.GetViewShell()->BroadcastAccessibility(SfxSimpleHint(SC_HINT_ACC_MAKEDRAWLAYER));
259 void ScTabView::DoAddWin( ScGridWindow* pWin )
261 if (pDrawView)
263 pDrawView->AddWindowToPaintView(pWin);
264 pDrawView->VCAddWin(pWin);
266 // #114409#
267 pWin->DrawLayerCreated();
271 //==================================================================
273 void ScTabView::TabChanged()
275 if (pDrawView)
277 DrawDeselectAll(); // beendet auch Text-Edit-Modus
279 USHORT i;
280 for (i=0; i<4; i++)
281 if (pGridWin[i])
282 pDrawView->VCRemoveWin(pGridWin[i]); // fuer alte Page
284 SCTAB nTab = aViewData.GetTabNo();
285 pDrawView->HideSdrPage();
286 pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
288 UpdateLayerLocks();
290 pDrawView->RecalcScale();
291 pDrawView->UpdateWorkArea(); // #54782# PageSize ist pro Page unterschiedlich
293 for (i=0; i<4; i++)
294 if (pGridWin[i])
295 pDrawView->VCAddWin(pGridWin[i]); // fuer neue Page
298 SfxBindings& rBindings = aViewData.GetBindings();
300 // Es gibt keine einfache Moeglichkeit, alle Slots der FormShell zu invalidieren
301 // (fuer disablete Slots auf geschuetzten Tabellen), darum hier einfach alles...
302 rBindings.InvalidateAll(FALSE);
304 #if 0
305 rBindings.Invalidate( SID_SELECT_SCENARIO );
306 rBindings.Invalidate( FID_PROTECT_TABLE );
307 rBindings.Invalidate( FID_DELETE_TABLE );
308 rBindings.Invalidate( FID_TABLE_SHOW );
309 rBindings.Invalidate( FID_TABLE_HIDE );
311 // Auswirkungen von geschuetzten Tabellen.
312 rBindings.Invalidate( FID_TAB_RENAME );
313 rBindings.Invalidate( FID_TAB_MOVE );
314 rBindings.Invalidate( SID_DEL_ROWS );
315 rBindings.Invalidate( SID_DEL_COLS );
316 rBindings.Invalidate( FID_INS_ROW );
317 rBindings.Invalidate( FID_INS_COLUMN );
318 rBindings.Invalidate( FID_INS_CELL );
319 rBindings.Invalidate( FID_INS_CELLSDOWN );
320 rBindings.Invalidate( FID_INS_CELLSRIGHT );
321 rBindings.Invalidate( FID_DELETE_CELL );
323 rBindings.Invalidate( SID_OPENDLG_CHART );
324 rBindings.Invalidate( SID_INSERT_OBJECT );
325 rBindings.Invalidate( SID_INSERT_DIAGRAM );
326 rBindings.Invalidate( SID_INSERT_SMATH );
327 rBindings.Invalidate( SID_INSERT_GRAPHIC );
328 #endif
330 if (aViewData.GetViewShell()->HasAccessibilityObjects())
332 SfxSimpleHint aAccHint(SC_HINT_ACC_TABLECHANGED);
333 aViewData.GetViewShell()->BroadcastAccessibility(aAccHint);
336 // notification for XActivationBroadcaster
337 SfxViewFrame* pViewFrame = aViewData.GetViewShell()->GetViewFrame();
338 if (pViewFrame)
340 SfxFrame* pFrame = pViewFrame->GetFrame();
341 if (pFrame)
343 uno::Reference<frame::XController> xController = pFrame->GetController();
344 if (xController.is())
346 ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController );
347 if (pImp)
348 pImp->SheetChanged();
354 void ScTabView::UpdateLayerLocks()
356 if (pDrawView)
358 SCTAB nTab = aViewData.GetTabNo();
359 BOOL bEx = aViewData.GetViewShell()->IsDrawSelMode();
360 BOOL bProt = aViewData.GetDocument()->IsTabProtected( nTab ) ||
361 aViewData.GetSfxDocShell()->IsReadOnly();
362 BOOL bShared = aViewData.GetDocShell()->IsDocShared();
364 SdrLayer* pLayer;
365 SdrLayerAdmin& rAdmin = pDrawView->GetModel()->GetLayerAdmin();
366 pLayer = rAdmin.GetLayerPerID(SC_LAYER_BACK);
367 if (pLayer)
368 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || !bEx || bShared );
369 pLayer = rAdmin.GetLayerPerID(SC_LAYER_INTERN);
370 if (pLayer)
371 pDrawView->SetLayerLocked( pLayer->GetName(), TRUE );
372 pLayer = rAdmin.GetLayerPerID(SC_LAYER_FRONT);
373 if (pLayer)
374 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
375 pLayer = rAdmin.GetLayerPerID(SC_LAYER_CONTROLS);
376 if (pLayer)
377 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
378 pLayer = rAdmin.GetLayerPerID(SC_LAYER_HIDDEN);
379 if (pLayer)
381 pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
382 pDrawView->SetLayerVisible( pLayer->GetName(), sal_False);
387 void ScTabView::DrawDeselectAll()
389 if (pDrawView)
391 ScTabViewShell* pViewSh = aViewData.GetViewShell();
392 if ( pDrawActual &&
393 ( pViewSh->IsDrawTextShell() || pDrawActual->GetSlotID() == SID_DRAW_NOTEEDIT ) )
395 // end text edit (as if escape pressed, in FuDraw)
396 aViewData.GetDispatcher().Execute( pDrawActual->GetSlotID(),
397 SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
400 pDrawView->ScEndTextEdit();
401 pDrawView->UnmarkAll();
403 if (!pViewSh->IsDrawSelMode())
404 pViewSh->SetDrawShell( FALSE );
408 BOOL ScTabView::IsDrawTextEdit() const
410 if (pDrawView)
411 return pDrawView->IsTextEdit();
412 else
413 return FALSE;
416 //UNUSED2008-05 String ScTabView::GetSelectedChartName() const
417 //UNUSED2008-05 {
418 //UNUSED2008-05 if (pDrawView)
419 //UNUSED2008-05 return pDrawView->GetSelectedChartName();
420 //UNUSED2008-05 else
421 //UNUSED2008-05 return EMPTY_STRING;
422 //UNUSED2008-05 }
424 SvxZoomType ScTabView::GetZoomType() const
426 return aViewData.GetZoomType();
429 void ScTabView::SetZoomType( SvxZoomType eNew, BOOL bAll )
431 aViewData.SetZoomType( eNew, bAll );
434 void ScTabView::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll )
436 aViewData.SetZoom( rNewX, rNewY, bAll );
437 if (pDrawView)
438 pDrawView->RecalcScale();
439 ZoomChanged(); // einzeln wegen CLOOKs
442 void ScTabView::RefreshZoom()
444 aViewData.RefreshZoom();
445 if (pDrawView)
446 pDrawView->RecalcScale();
447 ZoomChanged();
450 void ScTabView::SetPagebreakMode( BOOL bSet )
452 aViewData.SetPagebreakMode(bSet);
453 if (pDrawView)
454 pDrawView->RecalcScale();
455 ZoomChanged(); // einzeln wegen CLOOKs
458 void ScTabView::ResetDrawDragMode()
460 if (pDrawView)
461 pDrawView->SetDragMode( SDRDRAG_MOVE );
464 void ScTabView::ViewOptionsHasChanged( BOOL bHScrollChanged, BOOL bGraphicsChanged )
466 // DrawView erzeugen, wenn Gitter angezeigt werden soll
467 if ( !pDrawView && aViewData.GetOptions().GetGridOptions().GetGridVisible() )
468 MakeDrawLayer();
470 if (pDrawView)
471 pDrawView->UpdateUserViewOptions();
473 if (bGraphicsChanged)
474 DrawEnableAnim(TRUE); // DrawEnableAnim checks the options state
476 // if TabBar is set to visible, make sure its size is not 0
477 BOOL bGrow = ( aViewData.IsTabMode() && pTabControl->GetSizePixel().Width() <= 0 );
479 // if ScrollBar is set to visible, TabBar must make room
480 BOOL bShrink = ( bHScrollChanged && aViewData.IsTabMode() && aViewData.IsHScrollMode() &&
481 pTabControl->GetSizePixel().Width() > SC_TABBAR_DEFWIDTH );
483 if ( bGrow || bShrink )
485 Size aSize = pTabControl->GetSizePixel();
486 aSize.Width() = SC_TABBAR_DEFWIDTH; // initial size
487 pTabControl->SetSizePixel(aSize); // DoResize is called later...
491 // Helper-Funktion gegen das Include des Drawing Layers
493 SdrView* ScTabView::GetSdrView()
495 return pDrawView;
498 void ScTabView::DrawMarkListHasChanged()
500 if ( pDrawView )
501 pDrawView->MarkListHasChanged();
504 void ScTabView::UpdateAnchorHandles()
506 if ( pDrawView )
507 pDrawView->AdjustMarkHdl();
510 void ScTabView::UpdateIMap( SdrObject* pObj )
512 if ( pDrawView )
513 pDrawView->UpdateIMap( pObj );
516 void ScTabView::DrawMarkRect( const Rectangle& rRect )
518 //! store rectangle for repaint during drag
520 for (USHORT i=0; i<4; i++)
522 if ( pGridWin[i] && pGridWin[i]->IsVisible() )
524 RasterOp aROp = pGridWin[i]->GetRasterOp();
525 BOOL bHasLine = pGridWin[i]->IsLineColor();
526 Color aLine = pGridWin[i]->GetLineColor();
527 BOOL bHasFill = pGridWin[i]->IsFillColor();
528 Color aFill = pGridWin[i]->GetFillColor();
530 pGridWin[i]->SetRasterOp( ROP_INVERT );
531 pGridWin[i]->SetLineColor( COL_BLACK );
532 pGridWin[i]->SetFillColor();
534 pGridWin[i]->DrawRect(rRect);
536 pGridWin[i]->SetRasterOp(aROp);
537 if (bHasLine)
538 pGridWin[i]->SetLineColor(aLine);
539 else
540 pGridWin[i]->SetLineColor();
541 if (bHasFill)
542 pGridWin[i]->SetFillColor(aFill);
543 else
544 pGridWin[i]->SetFillColor();
549 void ScTabView::DrawEnableAnim(BOOL bSet)
551 USHORT i;
552 if ( pDrawView )
554 // #71040# dont start animations if display of graphics is disabled
555 // graphics are controlled by VOBJ_TYPE_OLE
556 if ( bSet && aViewData.GetOptions().GetObjMode(VOBJ_TYPE_OLE) == VOBJ_MODE_SHOW )
558 if ( !pDrawView->IsAnimationEnabled() )
560 pDrawView->SetAnimationEnabled(TRUE);
562 // Animierte GIFs muessen wieder gestartet werden:
563 ScDocument* pDoc = aViewData.GetDocument();
564 for (i=0; i<4; i++)
565 if ( pGridWin[i] && pGridWin[i]->IsVisible() )
566 pDoc->StartAnimations( aViewData.GetTabNo(), pGridWin[i] );
569 else
571 pDrawView->SetAnimationEnabled(FALSE);
576 //HMHvoid ScTabView::DrawShowMarkHdl(BOOL bShow)
577 //HMH{
578 //HMHif (!pDrawView)
579 //HMH return;
581 //HMHif (bShow)
582 //HMH{
583 //HMH if (!pDrawView->IsDisableHdl())
584 //HMH pDrawView->ShowMarkHdl();
585 //HMH}
586 //HMHelse
587 //HMH pDrawView->HideMarkHdl();
588 //HMH}
590 void ScTabView::UpdateDrawTextOutliner()
592 if ( pDrawView )
594 Outliner* pOL = pDrawView->GetTextEditOutliner();
595 if (pOL)
596 aViewData.UpdateOutlinerFlags( *pOL );
600 void ScTabView::DigitLanguageChanged()
602 LanguageType eNewLang = SC_MOD()->GetOptDigitLanguage();
603 for (USHORT i=0; i<4; i++)
604 if ( pGridWin[i] )
605 pGridWin[i]->SetDigitLanguage( eNewLang );
608 //---------------------------------------------------------------
610 void ScTabView::ScrollToObject( SdrObject* pDrawObj )
612 if ( pDrawObj )
613 MakeVisible( pDrawObj->GetLogicRect() );
616 void ScTabView::MakeVisible( const Rectangle& rHMMRect )
618 Window* pWin = GetActiveWin();
619 Size aWinSize = pWin->GetOutputSizePixel();
620 SCTAB nTab = aViewData.GetTabNo();
622 Rectangle aRect = pWin->LogicToPixel( rHMMRect );
624 long nScrollX=0, nScrollY=0; // Pixel
626 if ( aRect.Right() >= aWinSize.Width() ) // rechts raus
628 nScrollX = aRect.Right() - aWinSize.Width() + 1; // rechter Rand sichtbar
629 if ( aRect.Left() < nScrollX )
630 nScrollX = aRect.Left(); // links sichtbar (falls zu gross)
632 if ( aRect.Bottom() >= aWinSize.Height() ) // unten raus
634 nScrollY = aRect.Bottom() - aWinSize.Height() + 1; // unterer Rand sichtbar
635 if ( aRect.Top() < nScrollY )
636 nScrollY = aRect.Top(); // oben sichtbar (falls zu gross)
639 if ( aRect.Left() < 0 ) // links raus
640 nScrollX = aRect.Left(); // linker Rand sichtbar
641 if ( aRect.Top() < 0 ) // oben raus
642 nScrollY = aRect.Top(); // oberer Rand sichtbar
644 if (nScrollX || nScrollY)
646 ScDocument* pDoc = aViewData.GetDocument();
647 if ( pDoc->IsNegativePage( nTab ) )
648 nScrollX = -nScrollX;
650 double nPPTX = aViewData.GetPPTX();
651 double nPPTY = aViewData.GetPPTY();
652 ScSplitPos eWhich = aViewData.GetActivePart();
653 SCCOL nPosX = aViewData.GetPosX(WhichH(eWhich));
654 SCROW nPosY = aViewData.GetPosY(WhichV(eWhich));
656 long nLinesX=0, nLinesY=0; // Spalten/Zeilen - um mindestens nScrollX/Y scrollen
658 if (nScrollX > 0)
659 while (nScrollX > 0 && nPosX < MAXCOL)
661 nScrollX -= (long) ( pDoc->GetColWidth(nPosX, nTab) * nPPTX );
662 ++nPosX;
663 ++nLinesX;
665 else if (nScrollX < 0)
666 while (nScrollX < 0 && nPosX > 0)
668 --nPosX;
669 nScrollX += (long) ( pDoc->GetColWidth(nPosX, nTab) * nPPTX );
670 --nLinesX;
673 if (nScrollY > 0)
674 while (nScrollY > 0 && nPosY < MAXROW)
676 nScrollY -= (long) ( pDoc->FastGetRowHeight(nPosY, nTab) * nPPTY );
677 ++nPosY;
678 ++nLinesY;
680 else if (nScrollY < 0)
681 while (nScrollY < 0 && nPosY > 0)
683 --nPosY;
684 nScrollY += (long) ( pDoc->FastGetRowHeight(nPosY, nTab) * nPPTY );
685 --nLinesY;
688 ScrollLines( nLinesX, nLinesY ); // ausfuehren
692 //---------------------------------------------------------------
694 void ScTabView::SetBrushDocument( ScDocument* pNew, BOOL bLock )
696 delete pBrushDocument;
697 delete pDrawBrushSet;
699 pBrushDocument = pNew;
700 pDrawBrushSet = NULL;
702 bLockPaintBrush = bLock;
704 aViewData.GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
707 void ScTabView::SetDrawBrushSet( SfxItemSet* pNew, BOOL bLock )
709 delete pBrushDocument;
710 delete pDrawBrushSet;
712 pBrushDocument = NULL;
713 pDrawBrushSet = pNew;
715 bLockPaintBrush = bLock;
717 aViewData.GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
720 void ScTabView::ResetBrushDocument()
722 if ( HasPaintBrush() )
724 SetBrushDocument( NULL, FALSE );
725 SetActivePointer( Pointer( POINTER_ARROW ) ); // switch pointers also when ended with escape key