1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #include <sfx2/dispatch.hxx>
21 #include <sfx2/viewfrm.hxx>
22 #include <svx/ruler.hxx>
23 #include <editeng/lrspitem.hxx>
24 #include <o3tl/safeint.hxx>
25 #include <svl/srchitem.hxx>
26 #include <svl/stritem.hxx>
27 #include <sfx2/request.hxx>
28 #include <swmodule.hxx>
31 #include <viewopt.hxx>
34 #include <pagedesc.hxx>
37 #include <workctrl.hxx>
38 #include <usrpref.hxx>
44 #include <PostItMgr.hxx>
45 #include <AnnotationWin.hxx>
47 #include <svx/srchdlg.hxx>
48 #include <svx/svdview.hxx>
50 #include <vcl/uitest/logger.hxx>
51 #include <vcl/uitest/eventdescription.hxx>
53 sal_uInt16
SwView::s_nMoveType
= NID_PGE
;
54 sal_Int32
SwView::s_nActMark
= 0;
56 using namespace ::com::sun::star::uno
;
60 void collectUIInformation(const OUString
& aFactor
)
62 EventDescription aDescription
;
63 aDescription
.aID
= "writer_edit";
64 aDescription
.aParameters
= {{"ZOOM", aFactor
}};
65 aDescription
.aAction
= "SET";
66 aDescription
.aKeyWord
= "SwEditWinUIObject";
67 aDescription
.aParent
= "MainWindow";
68 UITestLogger::getInstance().logEvent(aDescription
);
73 void SwView::SetZoom( SvxZoomType eZoomType
, short nFactor
, bool bViewOnly
)
75 bool const bCursorIsVisible(m_pWrtShell
->IsCursorVisible());
76 SetZoom_( GetEditWin().GetOutputSizePixel(), eZoomType
, nFactor
, bViewOnly
);
77 // fdo#40465 force the cursor to stay in view whilst zooming
79 m_pWrtShell
->ShowCursor();
81 Invalidate(SID_ZOOM_IN
);
82 Invalidate(SID_ZOOM_OUT
);
84 collectUIInformation(OUString::number(nFactor
));
87 void SwView::SetZoom_( const Size
&rEditSize
, SvxZoomType eZoomType
,
88 short nFactor
, bool bViewOnly
)
90 bool bUnLockView
= !m_pWrtShell
->IsViewLocked();
91 m_pWrtShell
->LockView( true );
92 m_pWrtShell
->LockPaint(LockPaintReason::SetZoom
);
94 { // start of SwActContext scope
95 SwActContext
aActContext(m_pWrtShell
.get());
97 tools::Long nFac
= nFactor
;
99 const bool bWeb
= dynamic_cast< const SwWebView
*>( this ) != nullptr;
100 SwMasterUsrPref
*pUsrPref
= const_cast<SwMasterUsrPref
*>(SW_MOD()->GetUsrPref(bWeb
));
102 const SwPageDesc
&rDesc
= m_pWrtShell
->GetPageDesc( m_pWrtShell
->GetCurPageDesc() );
103 const SvxLRSpaceItem
&rLRSpace
= rDesc
.GetMaster().GetLRSpace();
104 const SwViewOption
*pOpt
= m_pWrtShell
->GetViewOptions();
105 tools::Long lLeftMargin
= 0;
107 if( eZoomType
!= SvxZoomType::PERCENT
)
109 const bool bAutomaticViewLayout
= 0 == pOpt
->GetViewLayoutColumns();
111 const SwRect
aPageRect( m_pWrtShell
->GetAnyCurRect( CurRectType::PageCalc
) );
112 const SwRect
aRootRect( m_pWrtShell
->GetAnyCurRect( CurRectType::PagesArea
) );
113 Size
aPageSize( aPageRect
.SSize() );
114 Size
aRootSize( aRootRect
.SSize() );
116 //mod #i6193# added sidebar width
117 SwPostItMgr
* pPostItMgr
= GetPostItMgr();
118 if (pPostItMgr
->HasNotes() && pPostItMgr
->ShowNotes())
119 aPageSize
.AdjustWidth(pPostItMgr
->GetSidebarWidth() + pPostItMgr
->GetSidebarBorderWidth() );
121 const MapMode
aTmpMap( MapUnit::MapTwip
);
122 const Size
aWindowSize( GetEditWin().PixelToLogic( rEditSize
, aTmpMap
) );
124 if( SvxZoomType::OPTIMAL
== eZoomType
)
126 // unclear if this is useful for OPTIMAL, or completely useless?
127 if( UseOnPage::Mirror
== rDesc
.GetUseOn() ) // mirrored pages
129 const SvxLRSpaceItem
&rLeftLRSpace
= rDesc
.GetLeft().GetLRSpace();
130 aPageSize
.AdjustWidth(std::abs( rLeftLRSpace
.GetLeft() - rLRSpace
.GetLeft() ) );
133 if (!pPostItMgr
->HasNotes() || !pPostItMgr
->ShowNotes())
134 aPageSize
.AdjustWidth( -( rLRSpace
.GetLeft() + rLRSpace
.GetRight() + nLeftOfst
* 2 ) );
135 lLeftMargin
= rLRSpace
.GetLeft() + DOCUMENTBORDER
+ nLeftOfst
;
136 nFac
= aWindowSize
.Width() * 100 / aPageSize
.Width();
138 else if(SvxZoomType::WHOLEPAGE
== eZoomType
|| SvxZoomType::PAGEWIDTH
== eZoomType
)
140 const tools::Long nOf
= DOCUMENTBORDER
* 2;
141 tools::Long nTmpWidth
= bAutomaticViewLayout
? aPageSize
.Width() : aRootSize
.Width();
143 aPageSize
.AdjustHeight(nOf
);
144 nFac
= aWindowSize
.Width() * 100 / nTmpWidth
;
146 if ( SvxZoomType::WHOLEPAGE
== eZoomType
)
148 tools::Long nVisPercent
= aWindowSize
.Height() * 100 / aPageSize
.Height();
149 nFac
= std::min( nFac
, nVisPercent
);
154 const tools::Long nTmpWidth
= bAutomaticViewLayout
? aPageSize
.Width() : aRootSize
.Width();
155 nFac
= aWindowSize
.Width() * 100 / nTmpWidth
;
159 nFac
= std::max( tools::Long( MINZOOM
), nFac
);
160 const sal_uInt16 nZoomFac
= o3tl::narrowing
<sal_uInt16
>(nFac
);
162 SwViewOption
aOpt( *pOpt
);
163 if ( !GetViewFrame().GetFrame().IsInPlace() )
165 //Update MasterUsrPrefs and after that update the ViewOptions of the current View.
167 (nZoomFac
!= pUsrPref
->GetZoom() ||
168 eZoomType
!= pUsrPref
->GetZoomType()) )
170 pUsrPref
->SetZoom(nZoomFac
);
171 pUsrPref
->SetZoomType(eZoomType
);
172 SW_MOD()->ApplyUsrPref(*pUsrPref
, nullptr);
173 pUsrPref
->SetModified();
175 if ( pOpt
->GetZoom() != nZoomFac
)
177 aOpt
.SetZoom(nZoomFac
);
178 aOpt
.SetReadonly(pOpt
->IsReadonly());
179 m_pWrtShell
->ApplyViewOptions( aOpt
);
181 if ( eZoomType
!= SvxZoomType::PERCENT
)
185 if ( eZoomType
== SvxZoomType::WHOLEPAGE
)
186 aPos
.setY( m_pWrtShell
->GetAnyCurRect(CurRectType::Page
).Top() - DOCUMENTBORDER
);
189 // Make sure that the cursor is in the visible range, so that
190 // the scrolling will be performed only once.
191 aPos
.setX( lLeftMargin
);
192 const SwRect
&rCharRect
= m_pWrtShell
->GetCharRect();
193 if ( rCharRect
.Top() > GetVisArea().Bottom() ||
194 rCharRect
.Bottom() < aPos
.Y() )
195 aPos
.setY( rCharRect
.Top() - rCharRect
.Height() );
197 aPos
.setY( GetVisArea().Top() );
201 // Compromise solution - Under certain circumstances SetZoom is called
202 // in CalcVisAreas again and thus be set wrong values.
203 const_cast<SwViewOption
*>(m_pWrtShell
->GetViewOptions())->SetZoomType( eZoomType
);
204 CalcVisArea( rEditSize
); // for the recalculation of the viewable area
206 else if ( nZoomFac
!= pOpt
->GetZoom() )
208 aOpt
.SetZoom( nZoomFac
);
209 m_pWrtShell
->ApplyViewOptions( aOpt
);
212 const Fraction
aFrac( nFac
, 100 );
213 m_pVRuler
->SetZoom( aFrac
);
214 m_pVRuler
->ForceUpdate();
215 m_pHRuler
->SetZoom( aFrac
);
216 m_pHRuler
->ForceUpdate();
217 const_cast<SwViewOption
*>(m_pWrtShell
->GetViewOptions())->SetZoomType( eZoomType
);
218 } // end of SwActContext scope
220 m_pWrtShell
->UnlockPaint();
222 m_pWrtShell
->LockView( false );
225 void SwView::SetViewLayout( sal_uInt16 nColumns
, bool bBookMode
, bool bViewOnly
)
227 const bool bUnLockView
= !m_pWrtShell
->IsViewLocked();
228 m_pWrtShell
->LockView( true );
229 m_pWrtShell
->LockPaint(LockPaintReason::ViewLayout
);
233 SwActContext
aActContext(m_pWrtShell
.get());
235 if ( !GetViewFrame().GetFrame().IsInPlace() && !bViewOnly
)
237 const bool bWeb
= dynamic_cast< const SwWebView
*>( this ) != nullptr;
238 SwMasterUsrPref
*pUsrPref
= const_cast<SwMasterUsrPref
*>(SW_MOD()->GetUsrPref(bWeb
));
240 // Update MasterUsrPrefs and after that update the ViewOptions of the current View.
241 if ( nColumns
!= pUsrPref
->GetViewLayoutColumns() ||
242 bBookMode
!= pUsrPref
->IsViewLayoutBookMode() )
244 pUsrPref
->SetViewLayoutColumns(nColumns
);
245 pUsrPref
->SetViewLayoutBookMode(bBookMode
);
246 SW_MOD()->ApplyUsrPref(*pUsrPref
, nullptr);
247 pUsrPref
->SetModified();
251 const SwViewOption
*pOpt
= m_pWrtShell
->GetViewOptions();
253 if ( nColumns
!= pOpt
->GetViewLayoutColumns() ||
254 bBookMode
!= pOpt
->IsViewLayoutBookMode() )
256 SwViewOption
aOpt( *pOpt
);
257 aOpt
.SetViewLayoutColumns( nColumns
);
258 aOpt
.SetViewLayoutBookMode( bBookMode
);
259 m_pWrtShell
->ApplyViewOptions( aOpt
);
262 m_pVRuler
->ForceUpdate();
263 m_pHRuler
->ForceUpdate();
267 m_pWrtShell
->UnlockPaint();
269 m_pWrtShell
->LockView( false );
271 SfxBindings
& rBnd
= GetViewFrame().GetBindings();
272 rBnd
.Invalidate( SID_ATTR_VIEWLAYOUT
);
273 rBnd
.Invalidate( SID_ATTR_ZOOMSLIDER
);
276 // Scrollbar - Handler
278 IMPL_LINK( SwView
, WindowChildEventListener
, VclWindowEvent
&, rEvent
, void )
280 OSL_ENSURE( rEvent
.GetWindow(), "Window???" );
281 vcl::Window
* pChildWin
= static_cast< vcl::Window
* >( rEvent
.GetData() );
283 switch ( rEvent
.GetId() )
285 case VclEventId::WindowHide
:
286 if( pChildWin
== m_pHScrollbar
)
287 ShowHScrollbar( false );
288 else if( pChildWin
== m_pVScrollbar
)
289 ShowVScrollbar( false );
291 case VclEventId::WindowShow
:
292 if( pChildWin
== m_pHScrollbar
)
293 ShowHScrollbar( true );
294 else if( pChildWin
== m_pVScrollbar
)
295 ShowVScrollbar( true );
301 void SwView::CreateScrollbar( bool bHori
)
303 vcl::Window
*pMDI
= &GetViewFrame().GetWindow();
304 VclPtr
<SwScrollbar
>& ppScrollbar
= bHori
? m_pHScrollbar
: m_pVScrollbar
;
306 assert(!ppScrollbar
); //check beforehand!
308 ppScrollbar
= VclPtr
<SwScrollbar
>::Create( pMDI
, bHori
);
311 ppScrollbar
->SetScrollHdl( LINK( this, SwView
, HoriScrollHdl
));
313 ppScrollbar
->SetScrollHdl( LINK( this, SwView
, VertScrollHdl
));
318 if (!m_bShowAtResize
)
319 ppScrollbar
->ExtendedShow();
322 IMPL_LINK( SwView
, MoveNavigationHdl
, void*, p
, void )
324 bool* pbNext
= static_cast<bool*>(p
);
327 const bool bNext
= *pbNext
;
328 SwWrtShell
& rSh
= GetWrtShell();
329 if ( NID_SRCH_REP
!= s_nMoveType
)
331 if ( rSh
.GetDrawView()->IsTextEdit() )
336 if ( NID_POSTIT
!= s_nMoveType
&& m_pPostItMgr
)
338 sw::annotation::SwAnnotationWin
* pActiveSidebarWin
= m_pPostItMgr
->GetActiveSidebarWin();
339 if (pActiveSidebarWin
)
340 pActiveSidebarWin
->SwitchToFieldPos();
342 if (NID_RECENCY
!= s_nMoveType
&& NID_PGE
!= s_nMoveType
&& NID_SRCH_REP
!= s_nMoveType
)
343 rSh
.addCurrentPosition();
344 switch( s_nMoveType
)
349 SwVisiblePageNumbers aVisiblePageNumbers
;
350 rSh
.GetFirstLastVisPageNumbers(aVisiblePageNumbers
);
351 if ((bNext
&& aVisiblePageNumbers
.nLastPhy
+ 1 > rSh
.GetPageCnt()) ||
352 (!bNext
&& aVisiblePageNumbers
.nFirstPhy
== 1))
354 nYPos
= rSh
.GetPagePos(bNext
? 1 : rSh
.GetPageCnt()).Y();
355 SvxSearchDialogWrapper::SetSearchLabel(bNext
? SearchLabel::EndWrapped
:
356 SearchLabel::StartWrapped
);
360 auto nPage
= bNext
? aVisiblePageNumbers
.nLastPhy
+ 1 :
361 aVisiblePageNumbers
.nFirstPhy
- 1;
362 nYPos
= rSh
.GetPagePos(nPage
).Y();
363 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::Empty
);
365 const Point
aPt(GetVisArea().Left(), nYPos
);
366 Point
aAlPt(AlignToPixel(aPt
));
367 // If there is a difference, has been truncated --> then add one pixel,
368 // so that no residue of the previous page is visible.
369 if(aPt
.Y() != aAlPt
.Y())
370 aAlPt
.AdjustY(3 * GetEditWin().PixelToLogic(Size(0, 1)).Height());
377 rSh
.MoveTable(GotoNextTable
, fnTableStart
);
379 rSh
.MoveTable(GotoPrevTable
, fnTableStart
);
385 GotoObjFlags eType
= GotoObjFlags::FlyFrame
;
386 if(s_nMoveType
== NID_GRF
)
387 eType
= GotoObjFlags::FlyGrf
;
388 else if(s_nMoveType
== NID_OLE
)
389 eType
= GotoObjFlags::FlyOLE
;
390 bool bSuccess
= bNext
?
391 rSh
.GotoNextFly(eType
) :
392 rSh
.GotoPrevFly(eType
);
396 rSh
.EnterSelFrameMode();
401 if (!rSh
.GetView().IsDesignMode())
402 rSh
.GetView().GetFormShell()->SetDesignMode(true);
406 bool bSuccess
= rSh
.GotoObj(bNext
,
407 s_nMoveType
== NID_DRW
?
408 GotoObjFlags::DrawSimple
:
409 GotoObjFlags::DrawControl
);
413 rSh
.EnterSelFrameMode();
420 rSh
.MoveRegion(GotoNextRegion
, fnRegionStart
);
422 rSh
.MoveRegion(GotoPrevRegion
, fnRegionStart
);
427 GetViewFrame().GetDispatcher()->Execute(bNext
?
435 SearchLabel eSearchLabel
= SearchLabel::Empty
;
436 if (!rSh
.MoveFieldType(nullptr, bNext
, SwFieldIds::Unknown
))
438 // no field found in the move direction
439 // wrap and try again
440 SwShellCursor
* pCursor
= rSh
.GetCursor_();
441 SwCursorSaveState
aSaveState(*pCursor
);
442 rSh
.SttEndDoc(bNext
);
443 // document might have a field at the start of the document
444 SwField
* pField
= rSh
.GetCurField();
445 if ((bNext
&& pField
&& pField
->GetTypeId() != SwFieldTypesEnum::Postit
) ||
446 rSh
.MoveFieldType(nullptr, bNext
, SwFieldIds::Unknown
))
448 eSearchLabel
= bNext
? SearchLabel::EndWrapped
: SearchLabel::StartWrapped
;
452 // no visible fields found
453 pCursor
->RestoreSavePos();
454 eSearchLabel
= SearchLabel::NavElementNotFound
;
457 SvxSearchDialogWrapper::SetSearchLabel(eSearchLabel
);
461 case NID_FIELD_BYTYPE
:
463 // see: SwFieldMgr::GoNextPrev
464 SwField
* pCurField
= rSh
.GetCurField(true);
468 SwFieldType
* pTyp
= nullptr;
469 const SwFieldTypesEnum nTypeId
= pCurField
->GetTypeId();
470 if (SwFieldTypesEnum::SetInput
== nTypeId
|| SwFieldTypesEnum::UserInput
== nTypeId
)
471 pTyp
= rSh
.GetFieldType(0, SwFieldIds::Input
);
473 pTyp
= pCurField
->GetTyp();
476 if (pTyp
->Which() == SwFieldIds::Database
)
477 rSh
.MoveFieldType(nullptr, bNext
, SwFieldIds::Database
);
479 rSh
.MoveFieldType(pTyp
, bNext
);
485 bNext
? rSh
.GotoNextOutline() : rSh
.GotoPrevOutline();
488 rSh
.GoNextPrevCursorSetSearchLabel(bNext
);
492 bool bFrameTypeFootnote(rSh
.GetFrameType(nullptr, false) & FrameTypeFlags::FOOTNOTE
);
494 if (bFrameTypeFootnote
)
497 rSh
.GotoFootnoteAnchor();
502 rSh
.GotoNextFootnoteAnchor() :
503 rSh
.GotoPrevFootnoteAnchor();
505 if (bFrameTypeFootnote
)
508 rSh
.GotoFootnoteText();
518 // collect and sort navigator reminder names
519 IDocumentMarkAccess
* const pMarkAccess
= rSh
.getIDocumentMarkAccess();
520 std::vector
< OUString
> vNavMarkNames
;
521 for(IDocumentMarkAccess::const_iterator_t ppMark
= pMarkAccess
->getAllMarksBegin();
522 ppMark
!= pMarkAccess
->getAllMarksEnd();
525 if( IDocumentMarkAccess::GetType(**ppMark
) == IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER
)
526 vNavMarkNames
.push_back((*ppMark
)->GetName());
528 std::sort(vNavMarkNames
.begin(), vNavMarkNames
.end());
531 if(!vNavMarkNames
.empty())
533 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty
);
538 if (s_nActMark
>= MAX_MARKS
|| s_nActMark
>= static_cast<sal_Int32
>(vNavMarkNames
.size()))
541 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderEndWrapped
);
547 if (s_nActMark
< 0 || o3tl::make_unsigned(s_nActMark
) >= vNavMarkNames
.size())
549 s_nActMark
= vNavMarkNames
.size()-1;
550 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderStartWrapped
);
553 rSh
.GotoMark(vNavMarkNames
[s_nActMark
]);
556 SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound
);
562 if (m_pPostItMgr
->HasNotes())
565 m_pPostItMgr
->AssureStdModeAtShell();
566 m_pPostItMgr
->SetActiveSidebarWin(nullptr);
567 GetEditWin().GrabFocus();
568 SwShellCursor
* pCursor
= rSh
.GetCursor_();
569 SwCursorSaveState
aSaveState(*pCursor
);
570 SwFieldType
* pFieldType
= rSh
.GetFieldType(0, SwFieldIds::Postit
);
571 bool bWrapped
= false;
576 if (!rSh
.MoveFieldType(pFieldType
, bNext
))
581 rSh
.SttEndDoc(bNext
);
586 auto pAnnotationWin
= m_pPostItMgr
->GetAnnotationWin(
587 rSh
.GetPostItFieldAtCursor());
588 if (pAnnotationWin
&& pAnnotationWin
->IsVisible())
590 } while (!bFound
&& rSh
.MoveFieldType(pFieldType
, bNext
));
594 pCursor
->RestoreSavePos();
595 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::NavElementNotFound
);
600 GetViewFrame().GetDispatcher()->Execute(FN_POSTIT
);
602 SvxSearchDialogWrapper::SetSearchLabel(bNext
? SearchLabel::EndWrapped
:
603 SearchLabel::StartWrapped
);
605 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::Empty
);
609 SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::NavElementNotFound
);
616 bool bBackward
= s_pSrchItem
->GetBackward();
617 if (rSh
.HasSelection() && bNext
!= rSh
.IsCursorPtAtEnd())
619 s_pSrchItem
->SetBackward(!bNext
);
620 SfxRequest
aReq(FN_REPEAT_SEARCH
, SfxCallMode::SLOT
, GetPool());
622 s_pSrchItem
->SetBackward(bBackward
);
625 case NID_INDEX_ENTRY
:
626 rSh
.GotoNxtPrvTOXMark(bNext
);
629 case NID_TABLE_FORMULA
:
630 rSh
.GotoNxtPrvTableFormula( bNext
);
633 case NID_TABLE_FORMULA_ERROR
:
634 rSh
.GotoNxtPrvTableFormula( bNext
, true );
639 bNext
? rSh
.GetNavigationMgr().goForward() : rSh
.GetNavigationMgr().goBack();
642 if (NID_POSTIT
!= s_nMoveType
)
643 m_pEditWin
->GrabFocus();
647 void SwView::CreateTab()
649 m_pHRuler
->SetActive(GetFrame() && IsActive());
655 void SwView::KillTab()
661 void SwView::ChangeTabMetric( FieldUnit eUnit
)
663 if(m_pHRuler
->GetUnit() != eUnit
)
665 m_pHRuler
->SetUnit( eUnit
);
666 m_pHRuler
->Invalidate();
670 void SwView::ChangeVRulerMetric( FieldUnit eUnit
)
672 if(m_pVRuler
->GetUnit() != eUnit
)
674 m_pVRuler
->SetUnit( eUnit
);
675 m_pVRuler
->Invalidate();
679 void SwView::GetVRulerMetric(FieldUnit
& eToFill
) const
681 eToFill
= m_pVRuler
->GetUnit();
684 void SwView::GetHRulerMetric(FieldUnit
& eToFill
) const
686 eToFill
= m_pHRuler
->GetUnit();
689 void SwView::CreateVRuler()
691 m_pHRuler
->SetBorderPos( m_pVRuler
->GetSizePixel().Width()-1 );
693 m_pVRuler
->SetActive(GetFrame() && IsActive());
698 void SwView::KillVRuler()
701 m_pHRuler
->SetBorderPos();
705 IMPL_LINK( SwView
, ExecRulerClick
, Ruler
*, pRuler
, void )
708 TypedWhichId
<SfxStringItem
> nDefDlg
= SID_PARA_DLG
;
709 switch( pRuler
->GetClickType() )
711 case RulerType::DontKnow
:
712 case RulerType::Outside
:
713 sDefPage
="labelTP_BORDER";
715 case RulerType::Indent
:
716 sDefPage
="labelTP_PARA_STD";
718 case RulerType::Margin1
:
719 case RulerType::Margin2
:
720 nDefDlg
= FN_FORMAT_PAGE_DLG
;
724 sDefPage
= "labelTP_TABULATOR";
728 SfxStringItem
aDefPage(nDefDlg
, sDefPage
);
729 GetViewFrame().GetDispatcher()->ExecuteList(nDefDlg
,
730 SfxCallMode::SYNCHRON
|SfxCallMode::RECORD
,
734 sal_uInt16
SwView::GetMoveType()
739 void SwView::SetMoveType(sal_uInt16 nSet
)
744 void SwView::SetActMark(sal_Int32 nSet
)
749 void SwView::ShowHScrollbar(bool bShow
)
751 assert(m_pHScrollbar
&& "Scrollbar invalid");
752 m_pHScrollbar
->ExtendedShow(bShow
);
755 bool SwView::IsHScrollbarVisible()const
757 assert(m_pHScrollbar
&& "Scrollbar invalid");
758 return m_pHScrollbar
->IsScrollbarVisible(false) || m_pHScrollbar
->IsAuto();
761 void SwView::ShowVScrollbar(bool bShow
)
763 assert(m_pVScrollbar
&& "Scrollbar invalid");
764 m_pVScrollbar
->ExtendedShow(bShow
);
767 bool SwView::IsVScrollbarVisible()const
769 assert(m_pVScrollbar
&& "Scrollbar invalid");
770 return m_pVScrollbar
->IsScrollbarVisible(false);
773 void SwView::EnableHScrollbar(bool bEnable
)
775 if (m_bHScrollbarEnabled
!= bEnable
)
777 m_bHScrollbarEnabled
= bEnable
;
782 void SwView::EnableVScrollbar(bool bEnable
)
784 if (m_bVScrollbarEnabled
!= bEnable
)
786 m_bVScrollbarEnabled
= bEnable
;
791 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */