bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / uiview / viewdlg.cxx
blob1c8fe6867c35a1ccb7b22f6670524dca8f141924
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 "hintids.hxx"
22 #include <sfx2/viewfrm.hxx>
23 #include <editeng/tstpitem.hxx>
24 #include <svl/stritem.hxx>
25 #include <sfx2/request.hxx>
27 #include "view.hxx"
28 #include "wrtsh.hxx"
29 #include "basesh.hxx"
30 #include "viewopt.hxx"
31 #include "uitool.hxx"
32 #include "cmdid.h"
33 #include <sfx2/tabdlg.hxx>
35 #include "pagedesc.hxx"
38 void SwView::ExecDlg(SfxRequest &rReq)
40 ModalDialog *pDialog = 0;
41 //Damit aus dem Basic keine Dialoge fuer Hintergrund-Views aufgerufen werden:
42 const SfxPoolItem* pItem = 0;
43 const SfxItemSet* pArgs = rReq.GetArgs();
45 sal_uInt16 nSlot = rReq.GetSlot();
46 if(pArgs)
47 pArgs->GetItemState( GetPool().GetWhich(nSlot), sal_False, &pItem );
49 switch ( nSlot )
51 case FN_CHANGE_PAGENUM:
53 if ( pItem )
55 sal_uInt16 nValue = ((SfxUInt16Item *)pItem)->GetValue();
56 sal_uInt16 nOldValue = m_pWrtShell->GetPageOffset();
57 sal_uInt16 nPage, nLogPage;
58 m_pWrtShell->GetPageNum( nPage, nLogPage,
59 m_pWrtShell->IsCrsrVisible(), sal_False);
61 if(nValue != nOldValue || nValue != nLogPage)
63 if(!nOldValue)
64 m_pWrtShell->SetNewPageOffset( nValue );
65 else
66 m_pWrtShell->SetPageOffset( nValue );
70 break;
72 default:
73 OSL_ENSURE(!this, "wrong dispatcher");
74 return;
77 if( pDialog )
79 pDialog->Execute();
80 delete pDialog;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */