update credits
[LibreOffice.git] / sw / source / ui / uiview / viewmdi.cxx
blobb942edb0c37be60f10785fd40a1a4252b121554c
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 .
21 #include <string>
23 #include "hintids.hxx"
24 #include <vcl/svapp.hxx>
25 #include <sfx2/dispatch.hxx>
26 #include <svx/ruler.hxx>
27 #include <editeng/lrspitem.hxx>
28 #include <svl/srchitem.hxx>
29 #include <sfx2/request.hxx>
30 #include <swmodule.hxx>
31 #include <view.hxx>
32 #include <wrtsh.hxx>
33 #include <docsh.hxx>
34 #include <viewopt.hxx>
35 #include <frmatr.hxx>
36 #include <wdocsh.hxx>
37 #include <uitool.hxx>
38 #include <edtwin.hxx>
39 #include <pagedesc.hxx>
40 #include <IMark.hxx>
41 #include <fldbas.hxx>
42 #include <workctrl.hxx>
43 #include <usrpref.hxx>
44 #include <scroll.hxx>
45 #include <wview.hxx>
47 #include <cmdid.h>
48 #include <view.hrc>
49 #include <ribbar.hrc>
50 #include <helpid.h>
51 #include <globals.hrc>
53 #include <IDocumentSettingAccess.hxx>
54 #include <PostItMgr.hxx>
56 sal_uInt16 SwView::m_nMoveType = NID_PGE;
57 sal_Int32 SwView::m_nActMark = 0;
60 #define VIEW_IMAGECOLOR COL_LIGHTBLUE
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::frame;
65 void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, sal_Bool bViewOnly )
67 bool const bCrsrIsVisible(m_pWrtShell->IsCrsrVisible());
68 _SetZoom( GetEditWin().GetOutputSizePixel(), eZoomType, nFactor, bViewOnly );
69 // fdo#40465 force the cursor to stay in view whilst zooming
70 if (bCrsrIsVisible)
71 m_pWrtShell->ShowCrsr();
74 void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
75 short nFactor, sal_Bool bViewOnly )
77 sal_Bool bUnLockView = !m_pWrtShell->IsViewLocked();
78 m_pWrtShell->LockView( sal_True );
79 m_pWrtShell->LockPaint();
82 SwActContext aActContext(m_pWrtShell);
84 long nFac = nFactor;
86 sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
87 SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
89 const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() );
90 const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
91 const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
92 long lLeftMargin = 0;
94 if( eZoomType != SVX_ZOOM_PERCENT )
96 const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
98 const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( RECT_PAGE_CALC ) );
99 const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( RECT_PAGES_AREA ) );
100 Size aPageSize( aPageRect.SSize() );
101 Size aRootSize( aRootRect.SSize() );
103 //mod #i6193# added sidebar width
104 SwPostItMgr* pPostItMgr = GetPostItMgr();
105 if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
106 aPageSize.Width() += pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth();
108 const MapMode aTmpMap( MAP_TWIP );
109 const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
111 if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() ) // gespiegelte Seiten
113 const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
114 aPageSize.Width() += std::abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) );
117 if( SVX_ZOOM_OPTIMAL == eZoomType )
119 if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes())
120 aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 );
121 lLeftMargin = long(rLRSpace.GetLeft()) + DOCUMENTBORDER + nLeftOfst;
122 nFac = aWindowSize.Width() * 100 / aPageSize.Width();
124 else if(SVX_ZOOM_WHOLEPAGE == eZoomType || SVX_ZOOM_PAGEWIDTH == eZoomType )
126 const long nOf = DOCUMENTBORDER * 2L;
127 long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
128 nTmpWidth += nOf;
129 aPageSize.Height() += nOf;
130 nFac = aWindowSize.Width() * 100 / nTmpWidth;
132 if ( SVX_ZOOM_WHOLEPAGE == eZoomType )
134 long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
135 nFac = std::min( nFac, nVisPercent );
138 else
140 const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
141 nFac = aWindowSize.Width() * 100 / nTmpWidth;
145 nFac = std::max( long( MINZOOM ), nFac );
147 SwViewOption aOpt( *pOpt );
148 if ( !GetViewFrame()->GetFrame().IsInPlace() )
150 //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
151 //View updaten.
152 if ( !bViewOnly &&
153 (sal_uInt16(nFac) != pUsrPref->GetZoom() ||
154 sal_uInt8 (eZoomType) != pUsrPref->GetZoomType()) )
156 pUsrPref->SetZoom ( sal_uInt16(nFac) );
157 pUsrPref->SetZoomType( eZoomType );
158 SW_MOD()->ApplyUsrPref( *pUsrPref,
159 bViewOnly ? this: 0,
160 bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
161 pUsrPref->SetModified();
163 if ( pOpt->GetZoom() != (sal_uInt16) nFac )
165 aOpt.SetZoom ( sal_uInt16(nFac) );
166 aOpt.SetReadonly(pOpt->IsReadonly());
167 m_pWrtShell->ApplyViewOptions( aOpt );
169 if ( eZoomType != SVX_ZOOM_PERCENT )
171 Point aPos;
173 if ( eZoomType == SVX_ZOOM_WHOLEPAGE )
174 aPos.Y() = m_pWrtShell->GetAnyCurRect(RECT_PAGE).Top() - DOCUMENTBORDER;
175 else
177 //sicherstellen, dass sich der Cursor im sichtbaren
178 //Bereich befindet, damit nur 1x gescrollt wird
179 aPos.X() = lLeftMargin;
180 const SwRect &rCharRect = m_pWrtShell->GetCharRect();
181 if ( rCharRect.Top() > GetVisArea().Bottom() ||
182 rCharRect.Bottom() < aPos.Y() )
183 aPos.Y() = rCharRect.Top() - rCharRect.Height();
184 else
185 aPos.Y() = GetVisArea().Top();
187 SetVisArea( aPos );
189 // OS: Notloesung - in CalcVisArea wird u.U. wieder SetZoom gerufen und
190 // dann werden falsche Werte eingestellt
191 ((SwViewOption*)m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
192 CalcVisArea( rEditSize ); //fuer das Neuberechnen des sichtbaren Bereiches
194 else if ( sal_uInt16(nFac) != pOpt->GetZoom() )
196 aOpt.SetZoom ( sal_uInt16(nFac) );
197 m_pWrtShell->ApplyViewOptions( aOpt );
200 const Fraction aFrac( nFac, 100 );
201 m_pVRuler->SetZoom( aFrac );
202 m_pVRuler->ForceUpdate();
203 m_pHRuler->SetZoom( aFrac );
204 m_pHRuler->ForceUpdate();
205 ((SwViewOption*)m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
207 m_pWrtShell->UnlockPaint();
208 if( bUnLockView )
209 m_pWrtShell->LockView( sal_False );
212 void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly )
214 const sal_Bool bUnLockView = !m_pWrtShell->IsViewLocked();
215 m_pWrtShell->LockView( sal_True );
216 m_pWrtShell->LockPaint();
220 SwActContext aActContext(m_pWrtShell);
222 if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly )
224 const sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
225 SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
227 //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
228 //View updaten.
229 if ( nColumns != pUsrPref->GetViewLayoutColumns() ||
230 bBookMode != pUsrPref->IsViewLayoutBookMode() )
232 pUsrPref->SetViewLayoutColumns( nColumns );
233 pUsrPref->SetViewLayoutBookMode( bBookMode );
234 SW_MOD()->ApplyUsrPref( *pUsrPref,
235 bViewOnly ? this: 0,
236 bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
237 pUsrPref->SetModified();
241 const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
243 if ( nColumns != pOpt->GetViewLayoutColumns() ||
244 bBookMode != pOpt->IsViewLayoutBookMode() )
246 SwViewOption aOpt( *pOpt );
247 aOpt.SetViewLayoutColumns( nColumns );
248 aOpt.SetViewLayoutBookMode( bBookMode );
249 m_pWrtShell->ApplyViewOptions( aOpt );
252 m_pVRuler->ForceUpdate();
253 m_pHRuler->ForceUpdate();
257 m_pWrtShell->UnlockPaint();
258 if( bUnLockView )
259 m_pWrtShell->LockView( sal_False );
261 SfxBindings& rBnd = GetViewFrame()->GetBindings();
262 rBnd.Invalidate( SID_ATTR_VIEWLAYOUT );
263 rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
267 * Scrollbar - Handler
269 IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent )
271 OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
272 if ( pEvent && pEvent->ISA( VclWindowEvent ) )
274 VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
275 OSL_ENSURE( pVclEvent->GetWindow(), "Window???" );
276 Window* pChildWin = static_cast< Window* >( pVclEvent->GetData() );
278 switch ( pVclEvent->GetId() )
280 case VCLEVENT_WINDOW_HIDE:
281 if( pChildWin == m_pHScrollbar )
282 ShowHScrollbar( sal_False );
283 else if( pChildWin == m_pVScrollbar )
284 ShowVScrollbar( sal_False );
285 break;
286 case VCLEVENT_WINDOW_SHOW:
287 if( pChildWin == m_pHScrollbar )
288 ShowHScrollbar( sal_True );
289 else if( pChildWin == m_pVScrollbar )
290 ShowVScrollbar( sal_True );
291 break;
295 return 0;
298 int SwView::_CreateScrollbar( sal_Bool bHori )
300 Window *pMDI = &GetViewFrame()->GetWindow();
301 SwScrollbar** ppScrollbar = bHori ? &m_pHScrollbar : &m_pVScrollbar;
303 OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" );
305 if( !bHori )
306 CreatePageButtons( !m_bShowAtResize );
308 *ppScrollbar = new SwScrollbar( pMDI, bHori );
309 UpdateScrollbars();
310 if(bHori)
311 (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, EndScrollHdl ));
312 else
313 (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, ScrollHdl ));
314 (*ppScrollbar)->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl ));
316 (*ppScrollbar)->EnableDrag( sal_True );
318 if(GetWindow())
319 InvalidateBorder();
321 // Scrollbar muss nochmals getestet werden, da im InvalidateBorder u.U. der
322 // Scrollbar wieder geloescht wurde
323 if ( !m_bShowAtResize && (*ppScrollbar))
324 (*ppScrollbar)->ExtendedShow();
326 return 1;
329 void SwView::CreatePageButtons(sal_Bool bShow)
331 Window *pMDI = &GetViewFrame()->GetWindow();
332 m_pPageUpBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEUP ), sal_True );
333 m_pPageUpBtn->SetHelpId(HID_SCRL_PAGEUP);
334 m_pPageDownBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEDOWN ), sal_False );
335 m_pPageDownBtn->SetHelpId(HID_SCRL_PAGEDOWN);
336 Reference< XFrame > xFrame = GetViewFrame()->GetFrame().GetFrameInterface();
337 m_pNaviBtn = new SwNaviImageButton(pMDI, xFrame );
338 m_pNaviBtn->SetHelpId(HID_SCRL_NAVI);
339 Link aLk( LINK( this, SwView, BtnPage ) );
340 m_pPageUpBtn->SetClickHdl( aLk );
341 m_pPageDownBtn->SetClickHdl( aLk );
342 if(m_nMoveType != NID_PGE)
344 Color aColor(VIEW_IMAGECOLOR);
345 SetImageButtonColor(aColor);
348 if(bShow)
350 m_pPageUpBtn->Show();
351 m_pPageDownBtn->Show();
352 m_pNaviBtn->Show();
357 * Button-Handler
359 IMPL_LINK( SwView, BtnPage, Button *, pButton )
361 // #i75416# move the execution of the search to an asynchronously called static link
362 bool* pbNext = new bool( (pButton == m_pPageDownBtn) );
363 Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext );
364 return 0;
367 IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
369 if ( !pbNext )
370 return 0;
371 bool bNext = *pbNext;
372 SwWrtShell& rSh = pThis->GetWrtShell();
373 switch( m_nMoveType )
375 case NID_PGE:
376 bNext ? pThis->PhyPageDown() : pThis->PhyPageUp();
377 break;
378 case NID_TBL :
379 rSh.EnterStdMode();
380 if(bNext)
381 rSh.MoveTable(fnTableNext, fnTableStart);
382 else
383 rSh.MoveTable(fnTablePrev, fnTableStart);
384 break;
385 case NID_FRM :
386 case NID_GRF:
387 case NID_OLE:
389 sal_uInt16 eType = GOTOOBJ_FLY_FRM;
390 if(m_nMoveType == NID_GRF)
391 eType = GOTOOBJ_FLY_GRF;
392 else if(m_nMoveType == NID_OLE)
393 eType = GOTOOBJ_FLY_OLE;
394 sal_Bool bSuccess = bNext ?
395 rSh.GotoNextFly(eType) :
396 rSh.GotoPrevFly(eType);
397 if(bSuccess)
399 rSh.HideCrsr();
400 rSh.EnterSelFrmMode();
403 break;
404 case NID_DRW :
405 case NID_CTRL:
406 rSh.GotoObj(bNext,
407 m_nMoveType == NID_DRW ?
408 GOTOOBJ_DRAW_SIMPLE :
409 GOTOOBJ_DRAW_CONTROL);
410 break;
411 case NID_REG :
412 rSh.EnterStdMode();
413 if(bNext)
414 rSh.MoveRegion(fnRegionNext, fnRegionStart);
415 else
416 rSh.MoveRegion(fnRegionPrev, fnRegionStart);
418 break;
419 case NID_BKM :
420 rSh.EnterStdMode();
421 pThis->GetViewFrame()->GetDispatcher()->Execute(bNext ?
422 FN_NEXT_BOOKMARK :
423 FN_PREV_BOOKMARK);
424 break;
425 case NID_OUTL:
426 rSh.EnterStdMode();
427 bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline();
428 break;
429 case NID_SEL :
430 bNext ? rSh.GoNextCrsr() : rSh.GoPrevCrsr();
431 break;
432 case NID_FTN:
433 rSh.EnterStdMode();
434 bNext ?
435 rSh.GotoNextFtnAnchor() :
436 rSh.GotoPrevFtnAnchor();
437 break;
438 case NID_MARK:
440 // unselect
441 rSh.MoveCrsr();
442 rSh.EnterStdMode();
444 // collect navigator reminders
445 IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
446 ::std::vector< const ::sw::mark::IMark* > vNavMarks;
447 for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
448 ppMark != pMarkAccess->getMarksEnd();
449 ppMark++)
451 if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER )
452 vNavMarks.push_back(ppMark->get());
455 // move
456 if(!vNavMarks.empty())
458 if(bNext)
460 m_nActMark++;
461 if (m_nActMark >= MAX_MARKS || m_nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
462 m_nActMark = 0;
464 else
466 m_nActMark--;
467 if (m_nActMark < 0 || m_nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
468 m_nActMark = vNavMarks.size()-1;
470 rSh.GotoMark(vNavMarks[m_nActMark]);
473 break;
474 case NID_POSTIT:
476 sw::sidebarwindows::SwSidebarWin* pPostIt = pThis->GetPostItMgr()->GetActiveSidebarWin();
477 if (pPostIt)
478 pThis->GetPostItMgr()->SetActiveSidebarWin(0);
479 SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
480 if (rSh.MoveFldType(pFldType, bNext))
481 pThis->GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
482 else
483 //first/last item
484 pThis->GetPostItMgr()->SetActiveSidebarWin(pPostIt);
486 break;
487 case NID_SRCH_REP:
488 if(m_pSrchItem)
490 sal_Bool bBackward = m_pSrchItem->GetBackward();
491 if(rSh.HasSelection() && !bNext == rSh.IsCrsrPtAtEnd())
492 rSh.SwapPam();
493 m_pSrchItem->SetBackward(!bNext);
494 SfxRequest aReq(FN_REPEAT_SEARCH, SFX_CALLMODE_SLOT, pThis->GetPool());
495 pThis->ExecSearch(aReq);
496 m_pSrchItem->SetBackward(bBackward);
498 break;
499 case NID_INDEX_ENTRY:
500 rSh.GotoNxtPrvTOXMark(bNext);
501 break;
503 case NID_TABLE_FORMULA:
504 rSh.GotoNxtPrvTblFormula( bNext );
505 break;
507 case NID_TABLE_FORMULA_ERROR:
508 rSh.GotoNxtPrvTblFormula( bNext, sal_True );
509 break;
511 pThis->m_pEditWin->GrabFocus();
512 delete pbNext;
513 return 0;
516 int SwView::CreateTab()
518 m_pHRuler->SetActive(GetFrame() && IsActive());
520 m_pHRuler->Show();
521 InvalidateBorder();
522 return 1;
525 int SwView::KillTab()
527 m_pHRuler->Hide();
528 InvalidateBorder();
529 return 1;
532 void SwView::ChangeTabMetric( FieldUnit eUnit )
534 if(m_pHRuler->GetUnit() != eUnit )
536 m_pHRuler->SetUnit( eUnit );
537 m_pHRuler->Invalidate();
541 void SwView::ChangeVRulerMetric( FieldUnit eUnit )
543 if(m_pVRuler->GetUnit() != eUnit)
545 m_pVRuler->SetUnit( eUnit );
546 m_pVRuler->Invalidate();
550 void SwView::GetVRulerMetric(FieldUnit& eToFill) const
552 eToFill = m_pVRuler->GetUnit();
555 void SwView::GetHRulerMetric(FieldUnit& eToFill) const
557 eToFill = m_pHRuler->GetUnit();
560 int SwView::CreateVRuler()
562 m_pHRuler->SetBorderPos( m_pVRuler->GetSizePixel().Width()-1 );
564 m_pVRuler->SetActive(GetFrame() && IsActive());
565 m_pVRuler->Show();
566 InvalidateBorder();
567 return 1;
570 int SwView::KillVRuler()
572 m_pVRuler->Hide();
573 m_pHRuler->SetBorderPos( 0 );
574 InvalidateBorder();
575 return 1;
578 IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler )
580 sal_uInt16 nDefPage = 0;
581 switch( pRuler->GetClickType() )
583 case RULER_TYPE_DONTKNOW:
584 case RULER_TYPE_OUTSIDE:
585 case RULER_TYPE_INDENT:
586 case RULER_TYPE_MARGIN1:
587 case RULER_TYPE_MARGIN2:
588 nDefPage = TP_PARA_STD;
589 break;
590 default:
591 nDefPage = TP_TABULATOR;
595 SfxUInt16Item aDefPage(SID_PARA_DLG, nDefPage);
596 GetViewFrame()->GetDispatcher()->Execute( SID_PARA_DLG,
597 SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
598 &aDefPage, 0L );
599 return 0;
602 sal_uInt16 SwView::GetMoveType()
604 return m_nMoveType;
607 void SwView::SetMoveType(sal_uInt16 nSet)
609 sal_Bool bLastPage = m_nMoveType == NID_PGE;
610 m_nMoveType = nSet;
611 sal_Bool bNewPage = m_nMoveType == NID_PGE;
612 if(bNewPage != bLastPage)
614 Color aColor(bNewPage ? COL_BLACK : VIEW_IMAGECOLOR);
615 const TypeId aTypeId = TYPE(SwView);
616 SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
617 while( pView )
619 pView->SetImageButtonColor(aColor);
620 pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
625 void SwView::SetActMark(sal_Int32 nSet)
627 m_nActMark = nSet;
630 void SwView::SetImageButtonColor(Color& rColor)
632 if(m_pPageUpBtn)
634 m_pPageUpBtn->SetControlForeground(rColor);
635 m_pPageDownBtn->SetControlForeground(rColor);
639 void SwView::ShowHScrollbar(sal_Bool bShow)
641 OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid");
642 m_pHScrollbar->ExtendedShow(bShow);
645 sal_Bool SwView::IsHScrollbarVisible()const
647 OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid");
648 return m_pHScrollbar->IsVisible( sal_False ) || m_pHScrollbar->IsAuto();
651 void SwView::ShowVScrollbar(sal_Bool bShow)
653 OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid");
654 m_pVScrollbar->ExtendedShow(bShow);
655 m_pPageUpBtn->Show(bShow);
656 m_pPageDownBtn->Show(bShow);
657 m_pNaviBtn->Show(bShow);
660 sal_Bool SwView::IsVScrollbarVisible()const
662 OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid");
663 return m_pVScrollbar->IsVisible( sal_False );
666 void SwView::EnableHScrollbar(bool bEnable)
668 if (m_bHScrollbarEnabled != bEnable)
670 m_bHScrollbarEnabled = bEnable;
671 InvalidateBorder();
675 void SwView::EnableVScrollbar(bool bEnable)
677 if (m_bVScrollbarEnabled != bEnable)
679 m_bVScrollbarEnabled = bEnable;
680 InvalidateBorder();
684 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */