Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include <sfx2/docfile.hxx>
21 : #ifdef REFERENCE
22 : #undef REFERENCE
23 : #endif
24 : #include <svtools/ehdl.hxx>
25 : #include <unotools/moduleoptions.hxx>
26 : #include <com/sun/star/sdb/SQLContext.hpp>
27 : #include <com/sun/star/uno/XNamingService.hpp>
28 : #include <com/sun/star/sdbc/XConnection.hpp>
29 : #include <com/sun/star/sdbc/DataType.hpp>
30 : #include <com/sun/star/form/XLoadable.hpp>
31 : #include <com/sun/star/form/XReset.hpp>
32 : #include "fmvwimp.hxx"
33 : #include <sfx2/objsh.hxx>
34 : #include <sfx2/viewsh.hxx>
35 : #include <sfx2/viewfrm.hxx>
36 : #include <sfx2/bindings.hxx>
37 : #include <sfx2/dispatch.hxx>
38 : #include <basic/sbuno.hxx>
39 : #include <basic/sbx.hxx>
40 : #include "fmitems.hxx"
41 : #include "fmobj.hxx"
42 : #include "svx/svditer.hxx"
43 : #include <svx/svdpagv.hxx>
44 : #include <svx/svdogrp.hxx>
45 : #include <svx/fmview.hxx>
46 : #include <svx/fmmodel.hxx>
47 : #include <svx/fmpage.hxx>
48 : #include <svx/fmshell.hxx>
49 : #include "fmpgeimp.hxx"
50 : #include "svx/fmtools.hxx"
51 : #include "fmshimp.hxx"
52 : #include "fmservs.hxx"
53 : #include "fmprop.hrc"
54 : #include "fmundo.hxx"
55 : #include <svx/dataaccessdescriptor.hxx>
56 : #include <comphelper/processfactory.hxx>
57 : #include <comphelper/namedvaluecollection.hxx>
58 : #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
59 : #include <com/sun/star/beans/PropertyValue.hpp>
60 : #include <com/sun/star/beans/PropertyState.hpp>
61 : #include <com/sun/star/form/FormComponentType.hpp>
62 : #include <vcl/svapp.hxx>
63 : #include <tools/diagnose_ex.h>
64 : #include <vcl/stdtext.hxx>
65 : #include <svx/fmglob.hxx>
66 : #include <svx/sdrpagewindow.hxx>
67 : #include "svx/sdrpaintwindow.hxx"
68 :
69 : using namespace ::com::sun::star;
70 : using namespace ::com::sun::star::uno;
71 : using namespace ::com::sun::star::lang;
72 : using namespace ::com::sun::star::sdbc;
73 : using namespace ::com::sun::star::sdb;
74 : using namespace ::com::sun::star::beans;
75 : using namespace ::com::sun::star::container;
76 : using namespace ::com::sun::star::form;
77 : using namespace ::com::sun::star::util;
78 : using namespace ::svxform;
79 : using namespace ::svx;
80 :
81 : //========================================================================
82 : //------------------------------------------------------------------------
83 7306 : TYPEINIT1(FmFormView, E3dView);
84 :
85 : //------------------------------------------------------------------------
86 1220 : FmFormView::FmFormView( FmFormModel* pModel, OutputDevice* pOut )
87 1220 : :E3dView(pModel,pOut)
88 : {
89 1220 : Init();
90 1220 : }
91 :
92 : //------------------------------------------------------------------------
93 1220 : void FmFormView::Init()
94 : {
95 1220 : pFormShell = NULL;
96 1220 : pImpl = new FmXFormView(this);
97 1220 : pImpl->acquire();
98 :
99 : //////////////////////////////////////////////////////////////////////
100 : // Model setzen
101 1220 : SdrModel* pModel = GetModel();
102 :
103 : DBG_ASSERT( pModel->ISA(FmFormModel), "Falsches Model" );
104 2440 : if( !pModel->ISA(FmFormModel) ) return;
105 1220 : FmFormModel* pFormModel = (FmFormModel*)pModel;
106 :
107 : //////////////////////////////////////////////////////////////////////
108 : // DesignMode vom Model holen
109 1220 : sal_Bool bInitDesignMode = pFormModel->GetOpenInDesignMode();
110 1220 : if ( pFormModel->OpenInDesignModeIsDefaulted( ) )
111 : { // this means that nobody ever explicitly set this on the model, and the model has never
112 : // been loaded from a stream.
113 : // This means this is a newly created document. This means, we want to have it in design
114 : // mode by default (though a newly created model returns true for GetOpenInDesignMode).
115 : // We _want_ to have this because it makes a lot of hacks following the original fix
116 : DBG_ASSERT( !bInitDesignMode, "FmFormView::Init: doesn't the model default to FALSE anymore?" );
117 : // if this asserts, either the on-contruction default in the model has changed (then this here
118 : // may not be necessary anymore), or we're not dealing with a new document ....
119 1155 : bInitDesignMode = sal_True;
120 : }
121 :
122 1220 : SfxObjectShell* pObjShell = pFormModel->GetObjectShell();
123 1220 : if ( pObjShell && pObjShell->GetMedium() )
124 : {
125 1220 : const SfxPoolItem *pItem=0;
126 1220 : if ( pObjShell->GetMedium()->GetItemSet()->GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
127 : {
128 1 : ::comphelper::NamedValueCollection aComponentData( ((SfxUnoAnyItem*)pItem)->GetValue() );
129 1 : bInitDesignMode = aComponentData.getOrDefault( "ApplyFormDesignMode", bInitDesignMode );
130 : }
131 : }
132 :
133 1220 : if( pObjShell && pObjShell->IsReadOnly() )
134 1 : bInitDesignMode = sal_False;
135 :
136 : // dieses wird in der Shell vorgenommen
137 : // bDesignMode = !bInitDesignMode; // erzwingt, dass SetDesignMode ausgefuehrt wird
138 1220 : SetDesignMode( bInitDesignMode );
139 : }
140 :
141 : //------------------------------------------------------------------------
142 2445 : FmFormView::~FmFormView()
143 : {
144 1217 : if( pFormShell )
145 0 : pFormShell->SetView( NULL );
146 :
147 1217 : pImpl->notifyViewDying();
148 1217 : pImpl->release();
149 1217 : pImpl = NULL;
150 1228 : }
151 :
152 : //------------------------------------------------------------------------
153 4346 : FmFormPage* FmFormView::GetCurPage()
154 : {
155 4346 : SdrPageView* pPageView = GetSdrPageView();
156 4346 : FmFormPage* pCurPage = pPageView ? PTR_CAST( FmFormPage, pPageView->GetPage() ) : NULL;
157 4346 : return pCurPage;
158 : }
159 :
160 : //------------------------------------------------------------------------
161 1085 : void FmFormView::MarkListHasChanged()
162 : {
163 1085 : E3dView::MarkListHasChanged();
164 :
165 1085 : if ( pFormShell && IsDesignMode() )
166 : {
167 2 : FmFormObj* pObj = getMarkedGrid();
168 2 : if ( pImpl->m_pMarkedGrid && pImpl->m_pMarkedGrid != pObj )
169 : {
170 0 : pImpl->m_pMarkedGrid = NULL;
171 0 : if ( pImpl->m_xWindow.is() )
172 : {
173 0 : pImpl->m_xWindow->removeFocusListener(pImpl);
174 0 : pImpl->m_xWindow = NULL;
175 : }
176 0 : SetMoveOutside(sal_False);
177 : //OLMRefreshAllIAOManagers();
178 : }
179 :
180 2 : pFormShell->GetImpl()->SetSelectionDelayed();
181 : }
182 1085 : }
183 :
184 : namespace
185 : {
186 405 : const SdrPageWindow* findPageWindow( const SdrPaintView* _pView, OutputDevice* _pWindow )
187 : {
188 405 : SdrPageView* pPageView = _pView->GetSdrPageView();
189 405 : if(pPageView)
190 : {
191 286 : for ( sal_uInt32 window = 0; window < pPageView->PageWindowCount(); ++window )
192 : {
193 286 : const SdrPageWindow* pPageWindow = pPageView->GetPageWindow( window );
194 286 : if ( !pPageWindow || &pPageWindow->GetPaintWindow().GetOutputDevice() != _pWindow )
195 10 : continue;
196 :
197 276 : return pPageWindow;
198 : }
199 : }
200 129 : return NULL;
201 : }
202 : }
203 :
204 : //------------------------------------------------------------------------
205 3 : void FmFormView::AddWindowToPaintView(OutputDevice* pNewWin)
206 : {
207 3 : E3dView::AddWindowToPaintView(pNewWin);
208 :
209 3 : if ( !pNewWin )
210 3 : return;
211 :
212 : // look up the PageViewWindow for the newly inserted window, and care for it
213 : // #i39269# / 2004-12-20 / frank.schoenheit@sun.com
214 3 : const SdrPageWindow* pPageWindow = findPageWindow( this, pNewWin );
215 3 : if ( pPageWindow )
216 3 : pImpl->addWindow( *pPageWindow );
217 : }
218 :
219 : //------------------------------------------------------------------------
220 402 : void FmFormView::DeleteWindowFromPaintView(OutputDevice* pNewWin)
221 : {
222 402 : const SdrPageWindow* pPageWindow = findPageWindow( this, pNewWin );
223 402 : if ( pPageWindow )
224 273 : pImpl->removeWindow( pPageWindow->GetControlContainer() );
225 :
226 402 : E3dView::DeleteWindowFromPaintView(pNewWin);
227 402 : }
228 :
229 : //------------------------------------------------------------------------
230 1061 : void FmFormView::ChangeDesignMode(sal_Bool bDesign)
231 : {
232 1061 : if (bDesign == IsDesignMode())
233 2116 : return;
234 :
235 6 : FmFormModel* pModel = PTR_CAST(FmFormModel, GetModel());
236 6 : if (pModel)
237 : { // fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
238 : // Properties mal eben aendern kann (sollte allerdings mit Vorsicht genossen und beim Rueckschalten des Modes
239 : // auch immer wieder rueckgaegig gemacht werden. Ein Beispiel ist das Setzen der maximalen Text-Laenge durch das
240 : // FmXEditModel an seinem Control.)
241 6 : pModel->GetUndoEnv().Lock();
242 : }
243 :
244 : // --- 1. deactivate all controls if we are switching to design mode
245 6 : if ( bDesign )
246 0 : DeactivateControls( GetSdrPageView() );
247 :
248 : // --- 2. simulate a deactivation (the shell will handle some things there ...?)
249 6 : if ( pFormShell && pFormShell->GetImpl() )
250 6 : pFormShell->GetImpl()->viewDeactivated( *this, sal_True );
251 : else
252 0 : pImpl->Deactivate( sal_True );
253 :
254 : // --- 3. activate all controls, if we're switching to alive mode
255 6 : if ( !bDesign )
256 6 : ActivateControls( GetSdrPageView() );
257 :
258 : // --- 4. load resp. unload the forms
259 6 : FmFormPage* pCurPage = GetCurPage();
260 6 : if ( pCurPage )
261 : {
262 6 : if ( pFormShell && pFormShell->GetImpl() )
263 6 : pFormShell->GetImpl()->loadForms( pCurPage, ( bDesign ? FORMS_UNLOAD : FORMS_LOAD ) );
264 : }
265 :
266 : // --- 5. base class functionality
267 6 : SetDesignMode( bDesign );
268 :
269 : // --- 6. simulate a activation (the shell will handle some things there ...?)
270 : OSL_PRECOND( pFormShell && pFormShell->GetImpl(), "FmFormView::ChangeDesignMode: is this really allowed? No shell?" );
271 6 : if ( pFormShell && pFormShell->GetImpl() )
272 6 : pFormShell->GetImpl()->viewActivated( *this );
273 : else
274 0 : pImpl->Activate();
275 :
276 6 : if ( pCurPage )
277 : {
278 6 : if ( bDesign )
279 : {
280 0 : if ( GetActualOutDev() && GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW )
281 : {
282 0 : const Window* pWindow = static_cast< const Window* >( GetActualOutDev() );
283 0 : const_cast< Window* >( pWindow )->GrabFocus();
284 : }
285 :
286 : // redraw UNO objects
287 0 : if ( GetSdrPageView() )
288 : {
289 0 : SdrObjListIter aIter(*pCurPage);
290 0 : while( aIter.IsMore() )
291 : {
292 0 : SdrObject* pObj = aIter.Next();
293 0 : if (pObj && pObj->IsUnoObj())
294 : {
295 : // For redraw just use ActionChanged()
296 : // pObj->BroadcastObjectChange();
297 0 : pObj->ActionChanged();
298 : }
299 0 : }
300 : }
301 : }
302 : else
303 : {
304 : // set the auto focus to the first control (if indicated by the model to do so)
305 6 : sal_Bool bForceControlFocus = pModel ? pModel->GetAutoControlFocus() : sal_False;
306 6 : if (bForceControlFocus)
307 0 : pImpl->AutoFocus();
308 : }
309 : }
310 :
311 : // und mein Undo-Environment wieder an
312 6 : if (pModel)
313 6 : pModel->GetUndoEnv().UnLock();
314 : }
315 :
316 : //------------------------------------------------------------------------
317 0 : void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync )
318 : {
319 0 : if ( !IsDesignMode() )
320 0 : pImpl->AutoFocus( _bForceSync );
321 0 : }
322 :
323 : //------------------------------------------------------------------------
324 1528 : SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
325 : {
326 1528 : SdrPageView* pPV = E3dView::ShowSdrPage(pPage);
327 :
328 1528 : if (pPage)
329 : {
330 1528 : if (!IsDesignMode())
331 : {
332 : // creating the controllers
333 129 : ActivateControls(pPV);
334 :
335 : // Alles deselektieren
336 129 : UnmarkAll();
337 : }
338 1399 : else if ( pFormShell && pFormShell->IsDesignMode() )
339 : {
340 237 : FmXFormShell* pFormShellImpl = pFormShell->GetImpl();
341 237 : pFormShellImpl->UpdateForms( sal_True );
342 :
343 : // damit der Formular-Navigator auf den Seitenwechsel reagieren kann
344 237 : pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_FMEXPLORER_CONTROL , sal_True, sal_False);
345 :
346 237 : pFormShellImpl->SetSelection(GetMarkedObjectList());
347 : }
348 : }
349 :
350 : // notify our shell that we have been activated
351 1528 : if ( pFormShell && pFormShell->GetImpl() )
352 300 : pFormShell->GetImpl()->viewActivated( *this );
353 : else
354 1228 : pImpl->Activate();
355 :
356 1528 : return pPV;
357 : }
358 :
359 : //------------------------------------------------------------------------
360 1592 : void FmFormView::HideSdrPage()
361 : {
362 : // --- 1. deactivate controls
363 1592 : if ( !IsDesignMode() )
364 135 : DeactivateControls(GetSdrPageView());
365 :
366 : // --- 2. tell the shell the view is (going to be) deactivated
367 1592 : if ( pFormShell && pFormShell->GetImpl() )
368 317 : pFormShell->GetImpl()->viewDeactivated( *this, sal_True );
369 : else
370 1275 : pImpl->Deactivate( sal_True );
371 :
372 : // --- 3. base class behavior
373 1592 : E3dView::HideSdrPage();
374 1592 : }
375 :
376 : //------------------------------------------------------------------------
377 0 : SdrModel* FmFormView::GetMarkedObjModel() const
378 : {
379 0 : return E3dView::GetMarkedObjModel();
380 : }
381 :
382 : //------------------------------------------------------------------------
383 0 : sal_Bool FmFormView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
384 : {
385 0 : return E3dView::Paste(rMod, rPos, pLst, nOptions);
386 : }
387 :
388 : //------------------------------------------------------------------------
389 135 : void FmFormView::ActivateControls(SdrPageView* pPageView)
390 : {
391 135 : if (!pPageView)
392 135 : return;
393 :
394 270 : for (sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); ++i)
395 : {
396 135 : const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
397 135 : pImpl->addWindow(rPageWindow);
398 : }
399 : }
400 :
401 : //------------------------------------------------------------------------
402 135 : void FmFormView::DeactivateControls(SdrPageView* pPageView)
403 : {
404 135 : if( !pPageView )
405 136 : return;
406 :
407 235 : for (sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); ++i)
408 : {
409 101 : const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
410 101 : pImpl->removeWindow(rPageWindow.GetControlContainer() );
411 : }
412 : }
413 :
414 : //------------------------------------------------------------------------
415 0 : SdrObject* FmFormView::CreateFieldControl( const ODataAccessDescriptor& _rColumnDescriptor )
416 : {
417 0 : return pImpl->implCreateFieldControl( _rColumnDescriptor );
418 : }
419 :
420 : //------------------------------------------------------------------------
421 0 : SdrObject* FmFormView::CreateXFormsControl( const OXFormsDescriptor &_rDesc )
422 : {
423 0 : return pImpl->implCreateXFormsControl(_rDesc);
424 : }
425 :
426 : //------------------------------------------------------------------------
427 0 : SdrObject* FmFormView::CreateFieldControl(const OUString& rFieldDesc) const
428 : {
429 0 : OUString sDataSource = rFieldDesc.getToken(0,sal_Unicode(11));
430 0 : OUString sObjectName = rFieldDesc.getToken(1,sal_Unicode(11));
431 0 : sal_uInt16 nObjectType = (sal_uInt16)rFieldDesc.getToken(2,sal_Unicode(11)).toInt32();
432 0 : OUString sFieldName = rFieldDesc.getToken(3,sal_Unicode(11));
433 :
434 0 : if (sFieldName.isEmpty() || sObjectName.isEmpty() || sDataSource.isEmpty())
435 0 : return NULL;
436 :
437 0 : ODataAccessDescriptor aColumnDescriptor;
438 0 : aColumnDescriptor.setDataSource(sDataSource);
439 0 : aColumnDescriptor[ daCommand ] <<= sObjectName;
440 0 : aColumnDescriptor[ daCommandType ] <<= nObjectType;
441 0 : aColumnDescriptor[ daColumnName ] <<= sFieldName;
442 :
443 0 : return pImpl->implCreateFieldControl( aColumnDescriptor );
444 : }
445 :
446 : //------------------------------------------------------------------------
447 480 : void FmFormView::InsertControlContainer(const Reference< ::com::sun::star::awt::XControlContainer > & xCC)
448 : {
449 480 : if( !IsDesignMode() )
450 : {
451 132 : SdrPageView* pPageView = GetSdrPageView();
452 132 : if( pPageView )
453 : {
454 138 : for( sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); i++ )
455 : {
456 138 : const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
457 :
458 138 : if( rPageWindow.GetControlContainer( false ) == xCC )
459 : {
460 132 : pImpl->addWindow(rPageWindow);
461 132 : break;
462 : }
463 : }
464 : }
465 : }
466 480 : }
467 :
468 : //------------------------------------------------------------------------
469 479 : void FmFormView::RemoveControlContainer(const Reference< ::com::sun::star::awt::XControlContainer > & xCC)
470 : {
471 479 : if( !IsDesignMode() )
472 : {
473 137 : pImpl->removeWindow( xCC );
474 : }
475 479 : }
476 :
477 : // -----------------------------------------------------------------------------
478 7673 : SdrPaintWindow* FmFormView::BeginCompleteRedraw(OutputDevice* pOut)
479 : {
480 7673 : SdrPaintWindow* pPaintWindow = E3dView::BeginCompleteRedraw( pOut );
481 7673 : pImpl->suspendTabOrderUpdate();
482 7673 : return pPaintWindow;
483 : }
484 :
485 : // -----------------------------------------------------------------------------
486 7673 : void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool bPaintFormLayer )
487 : {
488 7673 : E3dView::EndCompleteRedraw( rPaintWindow, bPaintFormLayer );
489 7673 : pImpl->resumeTabOrderUpdate();
490 7673 : }
491 :
492 : // -----------------------------------------------------------------------------
493 0 : sal_Bool FmFormView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
494 : {
495 0 : sal_Bool bDone = sal_False;
496 0 : const KeyCode& rKeyCode = rKEvt.GetKeyCode();
497 0 : if ( IsDesignMode()
498 0 : && rKeyCode.GetCode() == KEY_RETURN
499 : )
500 : {
501 : // RETURN alone enters grid controls, for keyboard accessibility
502 0 : if ( pWin
503 0 : && !rKeyCode.IsShift()
504 0 : && !rKeyCode.IsMod1()
505 0 : && !rKeyCode.IsMod2()
506 : )
507 : {
508 0 : FmFormObj* pObj = getMarkedGrid();
509 0 : if ( pObj )
510 : {
511 0 : Reference< awt::XWindow > xWindow( pObj->GetUnoControl( *this, *pWin ), UNO_QUERY );
512 0 : if ( xWindow.is() )
513 : {
514 0 : pImpl->m_pMarkedGrid = pObj;
515 0 : pImpl->m_xWindow = xWindow;
516 : // add as listener to get notified when ESC will be pressed inside the grid
517 0 : pImpl->m_xWindow->addFocusListener(pImpl);
518 0 : SetMoveOutside(sal_True);
519 : //OLMRefreshAllIAOManagers();
520 0 : xWindow->setFocus();
521 0 : bDone = sal_True;
522 0 : }
523 : }
524 : }
525 : // Alt-RETURN alone shows the properties of the selection
526 0 : if ( pFormShell
527 0 : && pFormShell->GetImpl()
528 0 : && !rKeyCode.IsShift()
529 0 : && !rKeyCode.IsMod1()
530 0 : && rKeyCode.IsMod2()
531 : )
532 : {
533 0 : pFormShell->GetImpl()->handleShowPropertiesRequest();
534 : }
535 :
536 : }
537 :
538 0 : if ( !bDone )
539 0 : bDone = E3dView::KeyInput(rKEvt,pWin);
540 0 : return bDone;
541 : }
542 : // -----------------------------------------------------------------------------
543 0 : sal_Bool FmFormView::checkUnMarkAll(const Reference< XInterface >& _xSource)
544 : {
545 0 : Reference< ::com::sun::star::awt::XControl> xControl(pImpl->m_xWindow,UNO_QUERY);
546 0 : sal_Bool bRet = !xControl.is() || !_xSource.is() || _xSource != xControl->getModel();
547 0 : if ( bRet )
548 0 : UnmarkAll();
549 :
550 0 : return bRet;
551 : }
552 :
553 : // -----------------------------------------------------------------------------
554 0 : sal_Bool FmFormView::MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin )
555 : {
556 0 : sal_Bool bReturn = E3dView::MouseButtonDown( _rMEvt, _pWin );
557 :
558 0 : if ( pFormShell && pFormShell->GetImpl() )
559 : {
560 0 : SdrViewEvent aViewEvent;
561 0 : PickAnything( _rMEvt, SDRMOUSEBUTTONDOWN, aViewEvent );
562 0 : pFormShell->GetImpl()->handleMouseButtonDown( aViewEvent );
563 : }
564 :
565 0 : return bReturn;
566 : }
567 :
568 : // -----------------------------------------------------------------------------
569 2 : FmFormObj* FmFormView::getMarkedGrid() const
570 : {
571 2 : FmFormObj* pFormObject = NULL;
572 2 : const SdrMarkList& rMarkList = GetMarkedObjectList();
573 2 : if ( 1 == rMarkList.GetMarkCount() )
574 : {
575 1 : SdrMark* pMark = rMarkList.GetMark(0);
576 1 : if ( pMark )
577 : {
578 1 : pFormObject = FmFormObj::GetFormObject( pMark->GetMarkedSdrObj() );
579 1 : if ( pFormObject )
580 : {
581 0 : Reference< XServiceInfo > xServInfo( pFormObject->GetUnoControlModel(), UNO_QUERY );
582 0 : if ( !xServInfo.is() || !xServInfo->supportsService( FM_SUN_COMPONENT_GRIDCONTROL ) )
583 0 : pFormObject = NULL;
584 : }
585 : }
586 : }
587 2 : return pFormObject;
588 : }
589 :
590 : // -----------------------------------------------------------------------------
591 0 : void FmFormView::createControlLabelPair( OutputDevice* _pOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM,
592 : const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats,
593 : sal_uInt16 _nControlObjectID, const OUString& _rFieldPostfix, sal_uInt32 _nInventor, sal_uInt16 _nLabelObjectID,
594 : SdrPage* _pLabelPage, SdrPage* _pControlPage, SdrModel* _pModel, SdrUnoObj*& _rpLabel, SdrUnoObj*& _rpControl )
595 : {
596 : FmXFormView::createControlLabelPair(
597 : *_pOutDev, _nXOffsetMM, _nYOffsetMM,
598 : _rxField, _rxNumberFormats,
599 : _nControlObjectID, _rFieldPostfix, _nInventor, _nLabelObjectID,
600 : _pLabelPage, _pControlPage, _pModel,
601 : _rpLabel, _rpControl
602 0 : );
603 0 : }
604 : // -----------------------------------------------------------------------------
605 0 : Reference< runtime::XFormController > FmFormView::GetFormController( const Reference< XForm >& _rxForm, const OutputDevice& _rDevice ) const
606 : {
607 0 : return pImpl->getFormController( _rxForm, _rDevice );
608 258 : }
609 :
610 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|