Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <sfx2/viewfrm.hxx>
30 : : #include <sfx2/dispatch.hxx>
31 : :
32 : : #include "cmdid.h"
33 : : #include "swmodule.hxx"
34 : : #include "view.hxx"
35 : : #include "edtwin.hxx"
36 : : #include "label.hrc"
37 : :
38 : : #define _SYNCDLG
39 : : #include "syncbtn.hxx"
40 : : #include "swtypes.hxx"
41 : :
42 [ # # ][ + - ]: 73 : SFX_IMPL_FLOATINGWINDOW( SwSyncChildWin, FN_SYNC_LABELS )
[ # # ]
43 : :
44 : 0 : SwSyncChildWin::SwSyncChildWin( Window* _pParent,
45 : : sal_uInt16 nId,
46 : : SfxBindings* pBindings,
47 : : SfxChildWinInfo* pInfo ) :
48 : 0 : SfxChildWindow( _pParent, nId )
49 : : {
50 [ # # ][ # # ]: 0 : pWindow = new SwSyncBtnDlg( pBindings, this, _pParent);
51 : :
52 [ # # ][ # # ]: 0 : if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
[ # # ]
53 : : {
54 [ # # ]: 0 : SwView* pActiveView = ::GetActiveView();
55 [ # # ]: 0 : if(pActiveView)
56 : : {
57 : 0 : const SwEditWin &rEditWin = pActiveView->GetEditWin();
58 [ # # ][ # # ]: 0 : pWindow->SetPosPixel(rEditWin.OutputToScreenPixel(Point(0, 0)));
59 : : }
60 : : else
61 [ # # ][ # # ]: 0 : pWindow->SetPosPixel(_pParent->OutputToScreenPixel(Point(0, 0)));
62 [ # # ]: 0 : pInfo->aPos = pWindow->GetPosPixel();
63 [ # # ]: 0 : pInfo->aSize = pWindow->GetSizePixel();
64 : : }
65 : :
66 [ # # ]: 0 : ((SwSyncBtnDlg *)pWindow)->Initialize(pInfo);
67 : :
68 [ # # ]: 0 : pWindow->Show();
69 : 0 : }
70 : :
71 : 0 : SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings,
72 : : SfxChildWindow* pChild,
73 : : Window *pParent) :
74 : : SfxFloatingWindow(_pBindings, pChild, pParent, SW_RES(DLG_SYNC_BTN)),
75 [ # # ][ # # ]: 0 : aSyncBtn (this, SW_RES(BTN_SYNC ))
76 : : {
77 [ # # ]: 0 : FreeResource();
78 [ # # ]: 0 : aSyncBtn.SetClickHdl(LINK(this, SwSyncBtnDlg, BtnHdl));
79 : 0 : }
80 : :
81 [ # # ]: 0 : SwSyncBtnDlg::~SwSyncBtnDlg()
82 : : {
83 [ # # ]: 0 : }
84 : :
85 : 0 : IMPL_LINK_NOARG(SwSyncBtnDlg, BtnHdl)
86 : : {
87 : 0 : SfxViewFrame::Current()->GetDispatcher()->Execute(FN_UPDATE_ALL_LINKS, SFX_CALLMODE_ASYNCHRON);
88 : 0 : return 0;
89 : : }
90 : :
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|