xref: /AOO41X/main/sw/source/ui/uiview/viewmdi.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sw.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <string> // HACK: prevent conflict between STLPORT and Workshop headers
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include "hintids.hxx"
36*cdf0e10cSrcweir #include <vcl/svapp.hxx>
37*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
38*cdf0e10cSrcweir #include <svx/ruler.hxx>
39*cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
40*cdf0e10cSrcweir #include <svl/srchitem.hxx>
41*cdf0e10cSrcweir #include <sfx2/request.hxx>
42*cdf0e10cSrcweir #include <swmodule.hxx>
43*cdf0e10cSrcweir #ifndef _VIEW_HXX
44*cdf0e10cSrcweir #include <view.hxx>
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #include <wrtsh.hxx>
47*cdf0e10cSrcweir #ifndef _DOCSH_HXX
48*cdf0e10cSrcweir #include <docsh.hxx>
49*cdf0e10cSrcweir #endif
50*cdf0e10cSrcweir #include <viewopt.hxx>
51*cdf0e10cSrcweir #include <frmatr.hxx>
52*cdf0e10cSrcweir #ifndef _WDOCSH_HXX
53*cdf0e10cSrcweir #include <wdocsh.hxx>
54*cdf0e10cSrcweir #endif
55*cdf0e10cSrcweir #include <uitool.hxx>
56*cdf0e10cSrcweir #include <edtwin.hxx>
57*cdf0e10cSrcweir #include <pagedesc.hxx>
58*cdf0e10cSrcweir #include <IMark.hxx>
59*cdf0e10cSrcweir #include <fldbas.hxx>
60*cdf0e10cSrcweir #include <workctrl.hxx>
61*cdf0e10cSrcweir #include <usrpref.hxx>
62*cdf0e10cSrcweir #include <scroll.hxx>
63*cdf0e10cSrcweir #ifndef _WVIEW_HXX
64*cdf0e10cSrcweir #include <wview.hxx>
65*cdf0e10cSrcweir #endif
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir #ifndef _CMDID_H
68*cdf0e10cSrcweir #include <cmdid.h>
69*cdf0e10cSrcweir #endif
70*cdf0e10cSrcweir #ifndef _VIEW_HRC
71*cdf0e10cSrcweir #include <view.hrc>
72*cdf0e10cSrcweir #endif
73*cdf0e10cSrcweir #ifndef _RIBBAR_HRC
74*cdf0e10cSrcweir #include <ribbar.hrc>
75*cdf0e10cSrcweir #endif
76*cdf0e10cSrcweir #ifndef _HELPID_H
77*cdf0e10cSrcweir #include <helpid.h>
78*cdf0e10cSrcweir #endif
79*cdf0e10cSrcweir #ifndef _GLOBALS_HRC
80*cdf0e10cSrcweir #include <globals.hrc>
81*cdf0e10cSrcweir #endif
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir #include <IDocumentSettingAccess.hxx>
84*cdf0e10cSrcweir #include <PostItMgr.hxx>
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir sal_uInt16	SwView::nMoveType = NID_PGE;
87*cdf0e10cSrcweir sal_Int32 SwView::nActMark = 0;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir #define VIEW_IMAGECOLOR COL_LIGHTBLUE
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
93*cdf0e10cSrcweir using namespace ::com::sun::star::frame;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, sal_Bool bViewOnly )
96*cdf0e10cSrcweir {
97*cdf0e10cSrcweir 	_SetZoom( GetEditWin().GetOutputSizePixel(), eZoomType, nFactor, bViewOnly );
98*cdf0e10cSrcweir }
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
101*cdf0e10cSrcweir 						short nFactor, sal_Bool bViewOnly )
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir 	sal_Bool bUnLockView = !pWrtShell->IsViewLocked();
104*cdf0e10cSrcweir 	pWrtShell->LockView( sal_True );
105*cdf0e10cSrcweir 	pWrtShell->LockPaint();
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     {
108*cdf0e10cSrcweir 	ACT_KONTEXT(pWrtShell);
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 	long nFac = nFactor;
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 	sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
113*cdf0e10cSrcweir 	SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	const SwPageDesc &rDesc = pWrtShell->GetPageDesc( pWrtShell->GetCurPageDesc() );
116*cdf0e10cSrcweir 	const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
117*cdf0e10cSrcweir 	const SwViewOption *pOpt = pWrtShell->GetViewOptions();
118*cdf0e10cSrcweir 	long lLeftMargin = 0;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	if( eZoomType != SVX_ZOOM_PERCENT )
121*cdf0e10cSrcweir 	{
122*cdf0e10cSrcweir         const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir         const SwRect aPageRect( pWrtShell->GetAnyCurRect( RECT_PAGE_CALC ) );
125*cdf0e10cSrcweir         const SwRect aRootRect( pWrtShell->GetAnyCurRect( RECT_PAGES_AREA ) );
126*cdf0e10cSrcweir         Size aPageSize( aPageRect.SSize() );
127*cdf0e10cSrcweir         Size aRootSize( aRootRect.SSize() );
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 		//mod #i6193# added sidebar width
130*cdf0e10cSrcweir 		SwPostItMgr* pPostItMgr = GetPostItMgr();
131*cdf0e10cSrcweir 		if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
132*cdf0e10cSrcweir 			aPageSize.Width() += pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth();
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 		const MapMode aTmpMap( MAP_TWIP );
135*cdf0e10cSrcweir 		const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir         if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() )	// gespiegelte Seiten
138*cdf0e10cSrcweir 		{
139*cdf0e10cSrcweir 			const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
140*cdf0e10cSrcweir 			aPageSize.Width() += Abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) );
141*cdf0e10cSrcweir 		}
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir         if( SVX_ZOOM_OPTIMAL == eZoomType )
144*cdf0e10cSrcweir 		{
145*cdf0e10cSrcweir 			if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
146*cdf0e10cSrcweir 			{
147*cdf0e10cSrcweir 				lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
148*cdf0e10cSrcweir 			}
149*cdf0e10cSrcweir 			else
150*cdf0e10cSrcweir 			{
151*cdf0e10cSrcweir 				aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 );
152*cdf0e10cSrcweir 				lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
153*cdf0e10cSrcweir 			}
154*cdf0e10cSrcweir 			nFac = aWindowSize.Width() * 100 / aPageSize.Width();
155*cdf0e10cSrcweir 		}
156*cdf0e10cSrcweir         else if(SVX_ZOOM_WHOLEPAGE == eZoomType || SVX_ZOOM_PAGEWIDTH == eZoomType )
157*cdf0e10cSrcweir 		{
158*cdf0e10cSrcweir             const long nOf = DOCUMENTBORDER * 2L;
159*cdf0e10cSrcweir             long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
160*cdf0e10cSrcweir             nTmpWidth += nOf;
161*cdf0e10cSrcweir             aPageSize.Height() += nOf;
162*cdf0e10cSrcweir             nFac = aWindowSize.Width() * 100 / nTmpWidth;
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir             if ( SVX_ZOOM_WHOLEPAGE == eZoomType )
165*cdf0e10cSrcweir             {
166*cdf0e10cSrcweir                 long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
167*cdf0e10cSrcweir 			    nFac = Min( nFac, nVisPercent );
168*cdf0e10cSrcweir             }
169*cdf0e10cSrcweir         }
170*cdf0e10cSrcweir         else /*if( SVX_ZOOM_PAGEWIDTH_NOBORDER == eZoomType )*/
171*cdf0e10cSrcweir         {
172*cdf0e10cSrcweir             const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
173*cdf0e10cSrcweir             nFac = aWindowSize.Width() * 100 / nTmpWidth;
174*cdf0e10cSrcweir         }
175*cdf0e10cSrcweir 	}
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 	nFac = Max( long( MINZOOM ), nFac );
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	SwViewOption aOpt( *pOpt );
180*cdf0e10cSrcweir     if ( !GetViewFrame()->GetFrame().IsInPlace() )
181*cdf0e10cSrcweir 	{
182*cdf0e10cSrcweir 		//MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
183*cdf0e10cSrcweir 		//View updaten.
184*cdf0e10cSrcweir 		if ( !bViewOnly &&
185*cdf0e10cSrcweir 				(sal_uInt16(nFac) 	   != pUsrPref->GetZoom() ||
186*cdf0e10cSrcweir 				sal_uInt8  (eZoomType) != pUsrPref->GetZoomType()) )
187*cdf0e10cSrcweir 		{
188*cdf0e10cSrcweir 			pUsrPref->SetZoom	 ( sal_uInt16(nFac) );
189*cdf0e10cSrcweir             pUsrPref->SetZoomType( eZoomType );
190*cdf0e10cSrcweir 			SW_MOD()->ApplyUsrPref( *pUsrPref,
191*cdf0e10cSrcweir 					bViewOnly ? this: 0,
192*cdf0e10cSrcweir 					bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
193*cdf0e10cSrcweir 			pUsrPref->SetModified();
194*cdf0e10cSrcweir 		}
195*cdf0e10cSrcweir 		if ( pOpt->GetZoom() != (sal_uInt16) nFac )
196*cdf0e10cSrcweir 		{
197*cdf0e10cSrcweir 			aOpt.SetZoom	( sal_uInt16(nFac) );
198*cdf0e10cSrcweir 			aOpt.SetReadonly(pOpt->IsReadonly());
199*cdf0e10cSrcweir 			pWrtShell->ApplyViewOptions( aOpt );
200*cdf0e10cSrcweir 		}
201*cdf0e10cSrcweir 		if ( eZoomType != SVX_ZOOM_PERCENT )
202*cdf0e10cSrcweir 		{
203*cdf0e10cSrcweir 			Point aPos;
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir             if ( eZoomType == SVX_ZOOM_WHOLEPAGE )
206*cdf0e10cSrcweir                 aPos.Y() = pWrtShell->GetAnyCurRect(RECT_PAGE).Top() - DOCUMENTBORDER;
207*cdf0e10cSrcweir             else
208*cdf0e10cSrcweir 			{
209*cdf0e10cSrcweir     			//sicherstellen, dass sich der Cursor im sichtbaren
210*cdf0e10cSrcweir 			    //Bereich befindet, damit nur 1x gescrollt wird
211*cdf0e10cSrcweir 			    aPos.X() = lLeftMargin;
212*cdf0e10cSrcweir 			    const SwRect &rCharRect = pWrtShell->GetCharRect();
213*cdf0e10cSrcweir 			    if ( rCharRect.Top() > GetVisArea().Bottom() ||
214*cdf0e10cSrcweir 				    rCharRect.Bottom() < aPos.Y() )
215*cdf0e10cSrcweir 				    aPos.Y() = rCharRect.Top() - rCharRect.Height();
216*cdf0e10cSrcweir 			    else
217*cdf0e10cSrcweir     				aPos.Y() = GetVisArea().Top();
218*cdf0e10cSrcweir             }
219*cdf0e10cSrcweir 			SetVisArea( aPos );
220*cdf0e10cSrcweir 		}
221*cdf0e10cSrcweir 		// OS: Notloesung - in CalcVisArea wird u.U. wieder SetZoom gerufen und
222*cdf0e10cSrcweir 		// dann werden falsche Werte eingestellt
223*cdf0e10cSrcweir         ((SwViewOption*)pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
224*cdf0e10cSrcweir 		CalcVisArea( rEditSize );	//fuer das Neuberechnen des sichtbaren Bereiches
225*cdf0e10cSrcweir 	}
226*cdf0e10cSrcweir 	else if ( sal_uInt16(nFac) != pOpt->GetZoom() )
227*cdf0e10cSrcweir 	{
228*cdf0e10cSrcweir 		aOpt.SetZoom	( sal_uInt16(nFac) );
229*cdf0e10cSrcweir 		pWrtShell->ApplyViewOptions( aOpt );
230*cdf0e10cSrcweir 	}
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 	const Fraction aFrac( nFac, 100 );
233*cdf0e10cSrcweir     pVRuler->SetZoom( aFrac );
234*cdf0e10cSrcweir     pVRuler->ForceUpdate();
235*cdf0e10cSrcweir     pHRuler->SetZoom( aFrac );
236*cdf0e10cSrcweir     pHRuler->ForceUpdate();
237*cdf0e10cSrcweir     ((SwViewOption*)pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
238*cdf0e10cSrcweir 	}
239*cdf0e10cSrcweir 	pWrtShell->UnlockPaint();
240*cdf0e10cSrcweir 	if( bUnLockView )
241*cdf0e10cSrcweir 		pWrtShell->LockView( sal_False );
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir //    if ( mpPostItMgr )
244*cdf0e10cSrcweir //    {
245*cdf0e10cSrcweir //        mpPostItMgr->Rescale();
246*cdf0e10cSrcweir //        mpPostItMgr->CalcRects();
247*cdf0e10cSrcweir //        mpPostItMgr->LayoutPostIts();
248*cdf0e10cSrcweir //    }
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir //	eZoom = eZoomType;
251*cdf0e10cSrcweir }
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly )
254*cdf0e10cSrcweir {
255*cdf0e10cSrcweir     const sal_Bool bUnLockView = !pWrtShell->IsViewLocked();
256*cdf0e10cSrcweir 	pWrtShell->LockView( sal_True );
257*cdf0e10cSrcweir 	pWrtShell->LockPaint();
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir     {
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir     ACT_KONTEXT(pWrtShell);
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir     if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly )
264*cdf0e10cSrcweir     {
265*cdf0e10cSrcweir         const sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
266*cdf0e10cSrcweir         SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir         //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
269*cdf0e10cSrcweir         //View updaten.
270*cdf0e10cSrcweir         if ( nColumns  != pUsrPref->GetViewLayoutColumns() ||
271*cdf0e10cSrcweir              bBookMode != pUsrPref->IsViewLayoutBookMode() )
272*cdf0e10cSrcweir         {
273*cdf0e10cSrcweir             pUsrPref->SetViewLayoutColumns( nColumns );
274*cdf0e10cSrcweir             pUsrPref->SetViewLayoutBookMode( bBookMode );
275*cdf0e10cSrcweir             SW_MOD()->ApplyUsrPref( *pUsrPref,
276*cdf0e10cSrcweir                     bViewOnly ? this: 0,
277*cdf0e10cSrcweir                     bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
278*cdf0e10cSrcweir             pUsrPref->SetModified();
279*cdf0e10cSrcweir         }
280*cdf0e10cSrcweir     }
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir     const SwViewOption *pOpt = pWrtShell->GetViewOptions();
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir     if ( nColumns  != pOpt->GetViewLayoutColumns() ||
285*cdf0e10cSrcweir          bBookMode != pOpt->IsViewLayoutBookMode() )
286*cdf0e10cSrcweir     {
287*cdf0e10cSrcweir         SwViewOption aOpt( *pOpt );
288*cdf0e10cSrcweir         aOpt.SetViewLayoutColumns( nColumns );
289*cdf0e10cSrcweir         aOpt.SetViewLayoutBookMode( bBookMode );
290*cdf0e10cSrcweir         pWrtShell->ApplyViewOptions( aOpt );
291*cdf0e10cSrcweir     }
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir     pVRuler->ForceUpdate();
294*cdf0e10cSrcweir     pHRuler->ForceUpdate();
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir     }
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir     pWrtShell->UnlockPaint();
299*cdf0e10cSrcweir 	if( bUnLockView )
300*cdf0e10cSrcweir 		pWrtShell->LockView( sal_False );
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir     SfxBindings& rBnd = GetViewFrame()->GetBindings();
303*cdf0e10cSrcweir     rBnd.Invalidate( SID_ATTR_VIEWLAYOUT );
304*cdf0e10cSrcweir     rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
305*cdf0e10cSrcweir }
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir /*
308*cdf0e10cSrcweir  * Scrollbar - Handler
309*cdf0e10cSrcweir  */
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir int SwView::_CreateScrollbar( sal_Bool bHori )
312*cdf0e10cSrcweir {
313*cdf0e10cSrcweir 	Window *pMDI = &GetViewFrame()->GetWindow();
314*cdf0e10cSrcweir 	SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 	ASSERT( !*ppScrollbar, "vorher abpruefen!" )
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir 	if( !bHori )
319*cdf0e10cSrcweir 		CreatePageButtons( !bShowAtResize );
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir 	*ppScrollbar = new SwScrollbar( pMDI, bHori );
322*cdf0e10cSrcweir 	UpdateScrollbars();
323*cdf0e10cSrcweir 	if(bHori)
324*cdf0e10cSrcweir 		(*ppScrollbar)->SetScrollHdl( LINK( this, SwView, EndScrollHdl ));
325*cdf0e10cSrcweir 	else
326*cdf0e10cSrcweir 		(*ppScrollbar)->SetScrollHdl( LINK( this, SwView, ScrollHdl ));
327*cdf0e10cSrcweir 	(*ppScrollbar)->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl ));
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir 	(*ppScrollbar)->EnableDrag( sal_True );
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir     if(GetWindow())
332*cdf0e10cSrcweir         InvalidateBorder();
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	// Scrollbar muss nochmals getestet werden, da im InvalidateBorder u.U. der
335*cdf0e10cSrcweir 	// Scrollbar wieder geloescht wurde
336*cdf0e10cSrcweir 	if ( !bShowAtResize && (*ppScrollbar))
337*cdf0e10cSrcweir         (*ppScrollbar)->ExtendedShow();
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir 	return 1;
340*cdf0e10cSrcweir }
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir void SwView::CreatePageButtons(sal_Bool bShow)
343*cdf0e10cSrcweir {
344*cdf0e10cSrcweir 	Window *pMDI = &GetViewFrame()->GetWindow();
345*cdf0e10cSrcweir 	pPageUpBtn		= new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEUP ), sal_True );
346*cdf0e10cSrcweir 	pPageUpBtn->SetHelpId(HID_SCRL_PAGEUP);
347*cdf0e10cSrcweir 	pPageDownBtn	= new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEDOWN ), sal_False );
348*cdf0e10cSrcweir 	pPageDownBtn->SetHelpId(HID_SCRL_PAGEDOWN);
349*cdf0e10cSrcweir     Reference< XFrame > xFrame = GetViewFrame()->GetFrame().GetFrameInterface();
350*cdf0e10cSrcweir     pNaviBtn = new SwNaviImageButton(pMDI, xFrame );
351*cdf0e10cSrcweir 	pNaviBtn->SetHelpId(HID_SCRL_NAVI);
352*cdf0e10cSrcweir 	Link aLk( LINK( this, SwView, BtnPage ) );
353*cdf0e10cSrcweir 	pPageUpBtn->SetClickHdl( aLk );
354*cdf0e10cSrcweir 	pPageDownBtn->SetClickHdl( aLk );
355*cdf0e10cSrcweir 	if(nMoveType != NID_PGE)
356*cdf0e10cSrcweir 	{
357*cdf0e10cSrcweir 		Color aColor(VIEW_IMAGECOLOR);
358*cdf0e10cSrcweir 		SetImageButtonColor(aColor);
359*cdf0e10cSrcweir 	}
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir 	if(bShow)
362*cdf0e10cSrcweir 	{
363*cdf0e10cSrcweir 		pPageUpBtn->Show();
364*cdf0e10cSrcweir 		pPageDownBtn->Show();
365*cdf0e10cSrcweir 		pNaviBtn->Show();
366*cdf0e10cSrcweir 	}
367*cdf0e10cSrcweir };
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir /*
370*cdf0e10cSrcweir  * Button-Handler
371*cdf0e10cSrcweir  */
372*cdf0e10cSrcweir IMPL_LINK( SwView, BtnPage, Button *, pButton )
373*cdf0e10cSrcweir {
374*cdf0e10cSrcweir     // #i75416# move the execution of the search to an asynchronously called static link
375*cdf0e10cSrcweir     bool* pbNext = new bool( (pButton == pPageDownBtn) );
376*cdf0e10cSrcweir     Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext );
377*cdf0e10cSrcweir 	return 0;
378*cdf0e10cSrcweir }
379*cdf0e10cSrcweir /*-----------------20.06.97 10:46-------------------
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir --------------------------------------------------*/
382*cdf0e10cSrcweir IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
383*cdf0e10cSrcweir {
384*cdf0e10cSrcweir     if ( !pbNext )
385*cdf0e10cSrcweir         return 0;
386*cdf0e10cSrcweir     bool bNext = *pbNext;
387*cdf0e10cSrcweir     SwWrtShell& rSh = pThis->GetWrtShell();
388*cdf0e10cSrcweir 	switch( nMoveType )
389*cdf0e10cSrcweir 	{
390*cdf0e10cSrcweir 		case NID_PGE:
391*cdf0e10cSrcweir             bNext ? pThis->PhyPageDown() : pThis->PhyPageUp();
392*cdf0e10cSrcweir 		break;
393*cdf0e10cSrcweir 		case NID_TBL :
394*cdf0e10cSrcweir 			rSh.EnterStdMode();
395*cdf0e10cSrcweir 			if(bNext)
396*cdf0e10cSrcweir 				rSh.MoveTable(fnTableNext, fnTableStart);
397*cdf0e10cSrcweir 			else
398*cdf0e10cSrcweir 				rSh.MoveTable(fnTablePrev, fnTableStart);
399*cdf0e10cSrcweir 		break;
400*cdf0e10cSrcweir 		case NID_FRM :
401*cdf0e10cSrcweir 		case NID_GRF:
402*cdf0e10cSrcweir 		case NID_OLE:
403*cdf0e10cSrcweir 		{
404*cdf0e10cSrcweir             sal_uInt16 eType = GOTOOBJ_FLY_FRM;
405*cdf0e10cSrcweir 			if(nMoveType == NID_GRF)
406*cdf0e10cSrcweir                 eType = GOTOOBJ_FLY_GRF;
407*cdf0e10cSrcweir 			else if(nMoveType == NID_OLE)
408*cdf0e10cSrcweir                 eType = GOTOOBJ_FLY_OLE;
409*cdf0e10cSrcweir 			sal_Bool bSuccess = bNext ?
410*cdf0e10cSrcweir 					rSh.GotoNextFly(eType) :
411*cdf0e10cSrcweir 						rSh.GotoPrevFly(eType);
412*cdf0e10cSrcweir 			if(bSuccess)
413*cdf0e10cSrcweir 			{
414*cdf0e10cSrcweir 				rSh.HideCrsr();
415*cdf0e10cSrcweir 				rSh.EnterSelFrmMode();
416*cdf0e10cSrcweir 			}
417*cdf0e10cSrcweir 		}
418*cdf0e10cSrcweir 		break;
419*cdf0e10cSrcweir 		case NID_DRW :
420*cdf0e10cSrcweir 		case NID_CTRL:
421*cdf0e10cSrcweir 			rSh.GotoObj(bNext,
422*cdf0e10cSrcweir 					nMoveType == NID_DRW ?
423*cdf0e10cSrcweir 						GOTOOBJ_DRAW_SIMPLE :
424*cdf0e10cSrcweir 						GOTOOBJ_DRAW_CONTROL);
425*cdf0e10cSrcweir 		break;
426*cdf0e10cSrcweir 		case NID_REG :
427*cdf0e10cSrcweir 			rSh.EnterStdMode();
428*cdf0e10cSrcweir 			if(bNext)
429*cdf0e10cSrcweir 				rSh.MoveRegion(fnRegionNext, fnRegionStart);
430*cdf0e10cSrcweir 			else
431*cdf0e10cSrcweir 				rSh.MoveRegion(fnRegionPrev, fnRegionStart);
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir 		break;
434*cdf0e10cSrcweir 		case NID_BKM :
435*cdf0e10cSrcweir 			rSh.EnterStdMode();
436*cdf0e10cSrcweir             pThis->GetViewFrame()->GetDispatcher()->Execute(bNext ?
437*cdf0e10cSrcweir 										FN_NEXT_BOOKMARK :
438*cdf0e10cSrcweir 											FN_PREV_BOOKMARK);
439*cdf0e10cSrcweir 		break;
440*cdf0e10cSrcweir 		case NID_OUTL:
441*cdf0e10cSrcweir 			rSh.EnterStdMode();
442*cdf0e10cSrcweir 			bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline();
443*cdf0e10cSrcweir 		break;
444*cdf0e10cSrcweir 		case NID_SEL :
445*cdf0e10cSrcweir 			bNext ? rSh.GoNextCrsr() : rSh.GoPrevCrsr();
446*cdf0e10cSrcweir 		break;
447*cdf0e10cSrcweir 		case NID_FTN:
448*cdf0e10cSrcweir 			rSh.EnterStdMode();
449*cdf0e10cSrcweir 			bNext ?
450*cdf0e10cSrcweir 				rSh.GotoNextFtnAnchor() :
451*cdf0e10cSrcweir 					rSh.GotoPrevFtnAnchor();
452*cdf0e10cSrcweir 		break;
453*cdf0e10cSrcweir         case NID_MARK:
454*cdf0e10cSrcweir         {
455*cdf0e10cSrcweir             // unselect
456*cdf0e10cSrcweir             rSh.MoveCrsr();
457*cdf0e10cSrcweir             rSh.EnterStdMode();
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir             // collect navigator reminders
460*cdf0e10cSrcweir             IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
461*cdf0e10cSrcweir             ::std::vector< const ::sw::mark::IMark* > vNavMarks;
462*cdf0e10cSrcweir             for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
463*cdf0e10cSrcweir                 ppMark != pMarkAccess->getMarksEnd();
464*cdf0e10cSrcweir                 ppMark++)
465*cdf0e10cSrcweir             {
466*cdf0e10cSrcweir                 if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER )
467*cdf0e10cSrcweir                     vNavMarks.push_back(ppMark->get());
468*cdf0e10cSrcweir             }
469*cdf0e10cSrcweir 
470*cdf0e10cSrcweir             // move
471*cdf0e10cSrcweir             if(vNavMarks.size())
472*cdf0e10cSrcweir             {
473*cdf0e10cSrcweir                 if(bNext)
474*cdf0e10cSrcweir                 {
475*cdf0e10cSrcweir                     nActMark++;
476*cdf0e10cSrcweir                     if (nActMark >= MAX_MARKS || nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
477*cdf0e10cSrcweir                         nActMark = 0;
478*cdf0e10cSrcweir                 }
479*cdf0e10cSrcweir                 else
480*cdf0e10cSrcweir                 {
481*cdf0e10cSrcweir                     nActMark--;
482*cdf0e10cSrcweir                     if (nActMark < 0 || nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
483*cdf0e10cSrcweir                         nActMark = vNavMarks.size()-1;
484*cdf0e10cSrcweir                 }
485*cdf0e10cSrcweir                 rSh.GotoMark(vNavMarks[nActMark]);
486*cdf0e10cSrcweir             }
487*cdf0e10cSrcweir         }
488*cdf0e10cSrcweir         break;
489*cdf0e10cSrcweir 		case NID_POSTIT:
490*cdf0e10cSrcweir 		{
491*cdf0e10cSrcweir             sw::sidebarwindows::SwSidebarWin* pPostIt = pThis->GetPostItMgr()->GetActiveSidebarWin();
492*cdf0e10cSrcweir 			if (pPostIt)
493*cdf0e10cSrcweir                 pThis->GetPostItMgr()->SetActiveSidebarWin(0);
494*cdf0e10cSrcweir 			SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
495*cdf0e10cSrcweir 			if (rSh.MoveFldType(pFldType, bNext))
496*cdf0e10cSrcweir 				pThis->GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
497*cdf0e10cSrcweir 			else
498*cdf0e10cSrcweir 				//first/last item
499*cdf0e10cSrcweir                 pThis->GetPostItMgr()->SetActiveSidebarWin(pPostIt);
500*cdf0e10cSrcweir 		}
501*cdf0e10cSrcweir 		break;
502*cdf0e10cSrcweir 		case NID_SRCH_REP:
503*cdf0e10cSrcweir 		if(pSrchItem)
504*cdf0e10cSrcweir 		{
505*cdf0e10cSrcweir 			sal_Bool bBackward = pSrchItem->GetBackward();
506*cdf0e10cSrcweir 			if(rSh.HasSelection() && !bNext == rSh.IsCrsrPtAtEnd())
507*cdf0e10cSrcweir 				rSh.SwapPam();
508*cdf0e10cSrcweir 			pSrchItem->SetBackward(!bNext);
509*cdf0e10cSrcweir             SfxRequest aReq(FN_REPEAT_SEARCH, SFX_CALLMODE_SLOT, pThis->GetPool());
510*cdf0e10cSrcweir             pThis->ExecSearch(aReq);
511*cdf0e10cSrcweir 			pSrchItem->SetBackward(bBackward);
512*cdf0e10cSrcweir 		}
513*cdf0e10cSrcweir 		break;
514*cdf0e10cSrcweir 		case NID_INDEX_ENTRY:
515*cdf0e10cSrcweir 			rSh.GotoNxtPrvTOXMark(bNext);
516*cdf0e10cSrcweir 		break;
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir 		case NID_TABLE_FORMULA:
519*cdf0e10cSrcweir 			rSh.GotoNxtPrvTblFormula( bNext );
520*cdf0e10cSrcweir 			break;
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir 		case NID_TABLE_FORMULA_ERROR:
523*cdf0e10cSrcweir 			rSh.GotoNxtPrvTblFormula( bNext, sal_True );
524*cdf0e10cSrcweir 			break;
525*cdf0e10cSrcweir 	}
526*cdf0e10cSrcweir     pThis->pEditWin->GrabFocus();
527*cdf0e10cSrcweir     delete pbNext;
528*cdf0e10cSrcweir     return 0;
529*cdf0e10cSrcweir }
530*cdf0e10cSrcweir 
531*cdf0e10cSrcweir /*************************************************************************
532*cdf0e10cSrcweir |*
533*cdf0e10cSrcweir |*	SwView::CreateTab()
534*cdf0e10cSrcweir |*
535*cdf0e10cSrcweir |*	Beschreibung
536*cdf0e10cSrcweir |*	Ersterstellung		VB 29.05.91
537*cdf0e10cSrcweir |*	Letzte Aenderung	OS 09.05.96
538*cdf0e10cSrcweir |*
539*cdf0e10cSrcweir *************************************************************************/
540*cdf0e10cSrcweir 
541*cdf0e10cSrcweir int SwView::CreateTab()
542*cdf0e10cSrcweir {
543*cdf0e10cSrcweir     pHRuler->SetActive(GetFrame() && IsActive());
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir     pHRuler->Show();
546*cdf0e10cSrcweir 	InvalidateBorder();
547*cdf0e10cSrcweir 	return 1;
548*cdf0e10cSrcweir }
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir /*************************************************************************
551*cdf0e10cSrcweir |*
552*cdf0e10cSrcweir |*	SwView::KillTab()
553*cdf0e10cSrcweir |*
554*cdf0e10cSrcweir |*	Beschreibung
555*cdf0e10cSrcweir |*	Ersterstellung		VB 29.05.91
556*cdf0e10cSrcweir |*	Letzte Aenderung	OS 09.05.96
557*cdf0e10cSrcweir |*
558*cdf0e10cSrcweir *************************************************************************/
559*cdf0e10cSrcweir 
560*cdf0e10cSrcweir int SwView::KillTab()
561*cdf0e10cSrcweir {
562*cdf0e10cSrcweir     pHRuler->Hide();
563*cdf0e10cSrcweir 	InvalidateBorder();
564*cdf0e10cSrcweir 	return 1;
565*cdf0e10cSrcweir }
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir void SwView::ChangeTabMetric( FieldUnit eUnit )
568*cdf0e10cSrcweir {
569*cdf0e10cSrcweir     if(pHRuler->GetUnit() != eUnit )
570*cdf0e10cSrcweir     {
571*cdf0e10cSrcweir         pHRuler->SetUnit( eUnit );
572*cdf0e10cSrcweir         pHRuler->Invalidate();
573*cdf0e10cSrcweir     }
574*cdf0e10cSrcweir }
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir void SwView::ChangeVLinealMetric( FieldUnit eUnit )
577*cdf0e10cSrcweir {
578*cdf0e10cSrcweir     if(pVRuler->GetUnit() != eUnit)
579*cdf0e10cSrcweir     {
580*cdf0e10cSrcweir         pVRuler->SetUnit( eUnit );
581*cdf0e10cSrcweir         pVRuler->Invalidate();
582*cdf0e10cSrcweir     }
583*cdf0e10cSrcweir }
584*cdf0e10cSrcweir /* -----------------------------07.04.01 17:09--------------------------------
585*cdf0e10cSrcweir 
586*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
587*cdf0e10cSrcweir void SwView::GetVLinealMetric(FieldUnit& eToFill) const
588*cdf0e10cSrcweir {
589*cdf0e10cSrcweir     eToFill = pVRuler->GetUnit();
590*cdf0e10cSrcweir }
591*cdf0e10cSrcweir /* -----------------------------07.04.01 17:09--------------------------------
592*cdf0e10cSrcweir 
593*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
594*cdf0e10cSrcweir void SwView::GetHLinealMetric(FieldUnit& eToFill) const
595*cdf0e10cSrcweir {
596*cdf0e10cSrcweir     eToFill = pHRuler->GetUnit();
597*cdf0e10cSrcweir }
598*cdf0e10cSrcweir /*************************************************************************
599*cdf0e10cSrcweir |*
600*cdf0e10cSrcweir |*	SwView::CreateVLineal()
601*cdf0e10cSrcweir |*
602*cdf0e10cSrcweir |*	Beschreibung
603*cdf0e10cSrcweir |*	Ersterstellung	VB 29.05.91
604*cdf0e10cSrcweir |*
605*cdf0e10cSrcweir *************************************************************************/
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir int SwView::CreateVLineal()
608*cdf0e10cSrcweir {
609*cdf0e10cSrcweir     pHRuler->SetBorderPos( pVRuler->GetSizePixel().Width()-1 );
610*cdf0e10cSrcweir 
611*cdf0e10cSrcweir     pVRuler->SetActive(GetFrame() && IsActive());
612*cdf0e10cSrcweir     pVRuler->Show();
613*cdf0e10cSrcweir     InvalidateBorder();
614*cdf0e10cSrcweir     return 1;
615*cdf0e10cSrcweir }
616*cdf0e10cSrcweir 
617*cdf0e10cSrcweir /*************************************************************************
618*cdf0e10cSrcweir |*
619*cdf0e10cSrcweir |*	SwView::KillVLineal()
620*cdf0e10cSrcweir |*
621*cdf0e10cSrcweir |*	Beschreibung
622*cdf0e10cSrcweir |*	Ersterstellung	VB 29.05.91
623*cdf0e10cSrcweir |*
624*cdf0e10cSrcweir *************************************************************************/
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir int SwView::KillVLineal()
627*cdf0e10cSrcweir {
628*cdf0e10cSrcweir     pVRuler->Hide();
629*cdf0e10cSrcweir     pHRuler->SetBorderPos( 0 );
630*cdf0e10cSrcweir 	InvalidateBorder();
631*cdf0e10cSrcweir 	return 1;
632*cdf0e10cSrcweir }
633*cdf0e10cSrcweir /*************************************************************************
634*cdf0e10cSrcweir |*
635*cdf0e10cSrcweir |*	SwView::ExecRulerClick()
636*cdf0e10cSrcweir |*
637*cdf0e10cSrcweir |*	Beschreibung
638*cdf0e10cSrcweir |*	Ersterstellung	OS 15.06.95
639*cdf0e10cSrcweir |*	Letzte Aenderung
640*cdf0e10cSrcweir |*
641*cdf0e10cSrcweir *************************************************************************/
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler )
644*cdf0e10cSrcweir {
645*cdf0e10cSrcweir 	sal_uInt16 nDefPage = 0;
646*cdf0e10cSrcweir 	switch( pRuler->GetClickType() )
647*cdf0e10cSrcweir 	{
648*cdf0e10cSrcweir 		case RULER_TYPE_DONTKNOW:
649*cdf0e10cSrcweir 		case RULER_TYPE_OUTSIDE:
650*cdf0e10cSrcweir 		case RULER_TYPE_INDENT:
651*cdf0e10cSrcweir 		case RULER_TYPE_MARGIN1:
652*cdf0e10cSrcweir 		case RULER_TYPE_MARGIN2:
653*cdf0e10cSrcweir 			nDefPage = TP_PARA_STD;
654*cdf0e10cSrcweir 		break;
655*cdf0e10cSrcweir 		default:
656*cdf0e10cSrcweir 			nDefPage = TP_TABULATOR;
657*cdf0e10cSrcweir 
658*cdf0e10cSrcweir 	}
659*cdf0e10cSrcweir 
660*cdf0e10cSrcweir 	SfxUInt16Item aDefPage(SID_PARA_DLG, nDefPage);
661*cdf0e10cSrcweir 	GetViewFrame()->GetDispatcher()->Execute( SID_PARA_DLG,
662*cdf0e10cSrcweir 								SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
663*cdf0e10cSrcweir 								&aDefPage, 0L );
664*cdf0e10cSrcweir 	return 0;
665*cdf0e10cSrcweir }
666*cdf0e10cSrcweir 
667*cdf0e10cSrcweir 
668*cdf0e10cSrcweir /*-----------------20.02.97 09:11-------------------
669*cdf0e10cSrcweir 
670*cdf0e10cSrcweir --------------------------------------------------*/
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir sal_uInt16 SwView::GetMoveType()
673*cdf0e10cSrcweir {
674*cdf0e10cSrcweir 	return nMoveType;
675*cdf0e10cSrcweir }
676*cdf0e10cSrcweir /*-----------------20.02.97 09:11-------------------
677*cdf0e10cSrcweir 
678*cdf0e10cSrcweir --------------------------------------------------*/
679*cdf0e10cSrcweir 
680*cdf0e10cSrcweir void SwView::SetMoveType(sal_uInt16 nSet)
681*cdf0e10cSrcweir {
682*cdf0e10cSrcweir 	sal_Bool bLastPage = nMoveType == NID_PGE;
683*cdf0e10cSrcweir 	nMoveType = nSet;
684*cdf0e10cSrcweir 	sal_Bool bNewPage = nMoveType == NID_PGE;
685*cdf0e10cSrcweir 	if(bNewPage != bLastPage)
686*cdf0e10cSrcweir 	{
687*cdf0e10cSrcweir 		Color aColor(bNewPage ? COL_BLACK : VIEW_IMAGECOLOR);
688*cdf0e10cSrcweir 		const TypeId aTypeId = TYPE(SwView);
689*cdf0e10cSrcweir 		SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
690*cdf0e10cSrcweir 		while( pView )
691*cdf0e10cSrcweir 		{
692*cdf0e10cSrcweir 			pView->SetImageButtonColor(aColor);
693*cdf0e10cSrcweir 			pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
694*cdf0e10cSrcweir 		}
695*cdf0e10cSrcweir 	}
696*cdf0e10cSrcweir }
697*cdf0e10cSrcweir 
698*cdf0e10cSrcweir /*-----------------20.06.97 11:18-------------------
699*cdf0e10cSrcweir 
700*cdf0e10cSrcweir --------------------------------------------------*/
701*cdf0e10cSrcweir void SwView::SetActMark(sal_Int32 nSet)
702*cdf0e10cSrcweir {
703*cdf0e10cSrcweir 	nActMark = nSet;
704*cdf0e10cSrcweir }
705*cdf0e10cSrcweir 
706*cdf0e10cSrcweir /*-----------------15.03.97 10:53-------------------
707*cdf0e10cSrcweir 
708*cdf0e10cSrcweir --------------------------------------------------*/
709*cdf0e10cSrcweir 
710*cdf0e10cSrcweir void SwView::SetImageButtonColor(Color& rColor)
711*cdf0e10cSrcweir {
712*cdf0e10cSrcweir 	if(pPageUpBtn)
713*cdf0e10cSrcweir 	{
714*cdf0e10cSrcweir 		pPageUpBtn->SetControlForeground(rColor);
715*cdf0e10cSrcweir 		pPageDownBtn->SetControlForeground(rColor);
716*cdf0e10cSrcweir 	}
717*cdf0e10cSrcweir }
718*cdf0e10cSrcweir /* -----------------------------2002/06/26 13:57------------------------------
719*cdf0e10cSrcweir 
720*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
721*cdf0e10cSrcweir void SwView::ShowHScrollbar(sal_Bool bShow)
722*cdf0e10cSrcweir {
723*cdf0e10cSrcweir     DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
724*cdf0e10cSrcweir     pHScrollbar->ExtendedShow(bShow);
725*cdf0e10cSrcweir }
726*cdf0e10cSrcweir /* -----------------------------2002/06/26 13:57------------------------------
727*cdf0e10cSrcweir 
728*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
729*cdf0e10cSrcweir sal_Bool SwView::IsHScrollbarVisible()const
730*cdf0e10cSrcweir {
731*cdf0e10cSrcweir     DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
732*cdf0e10cSrcweir     return pHScrollbar->IsVisible( sal_False ) || pHScrollbar->IsAuto();
733*cdf0e10cSrcweir }
734*cdf0e10cSrcweir /* -----------------------------2002/06/26 13:57------------------------------
735*cdf0e10cSrcweir 
736*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
737*cdf0e10cSrcweir void SwView::ShowVScrollbar(sal_Bool bShow)
738*cdf0e10cSrcweir {
739*cdf0e10cSrcweir     DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
740*cdf0e10cSrcweir     pVScrollbar->ExtendedShow(bShow);
741*cdf0e10cSrcweir     pPageUpBtn->Show(bShow);
742*cdf0e10cSrcweir     pPageDownBtn->Show(bShow);
743*cdf0e10cSrcweir     pNaviBtn->Show(bShow);
744*cdf0e10cSrcweir }
745*cdf0e10cSrcweir /* -----------------------------2002/06/26 13:57------------------------------
746*cdf0e10cSrcweir 
747*cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
748*cdf0e10cSrcweir sal_Bool SwView::IsVScrollbarVisible()const
749*cdf0e10cSrcweir {
750*cdf0e10cSrcweir     DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
751*cdf0e10cSrcweir     return pVScrollbar->IsVisible( sal_False );
752*cdf0e10cSrcweir }
753*cdf0e10cSrcweir 
754*cdf0e10cSrcweir 
755