LCOV - code coverage report
Current view: top level - svx/source/form - fmview.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 167 245 68.2 %
Date: 2015-06-13 12:38:46 Functions: 26 36 72.2 %
Legend: Lines: hit not hit

          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       15089 : TYPEINIT1(FmFormView, E3dView);
      84             : 
      85             : 
      86        3793 : FmFormView::FmFormView( FmFormModel* pModel, OutputDevice* pOut )
      87        3793 :     :E3dView(pModel,pOut)
      88             : {
      89        3793 :     Init();
      90        3793 : }
      91             : 
      92             : 
      93        3793 : void FmFormView::Init()
      94             : {
      95        3793 :     pFormShell = NULL;
      96        3793 :     pImpl = new FmXFormView(this);
      97        3793 :     pImpl->acquire();
      98             : 
      99             : 
     100             :     // Model setzen
     101        3793 :     SdrModel* pModel = GetModel();
     102             : 
     103             :     DBG_ASSERT( pModel->ISA(FmFormModel), "Falsches Model" );
     104        7586 :     if( !pModel->ISA(FmFormModel) ) return;
     105        3793 :     FmFormModel* pFormModel = static_cast<FmFormModel*>(pModel);
     106             : 
     107             : 
     108             :     // DesignMode vom Model holen
     109        3793 :     bool bInitDesignMode = pFormModel->GetOpenInDesignMode();
     110        3793 :     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-construction 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        3554 :         bInitDesignMode = true;
     120             :     }
     121             : 
     122        3793 :     SfxObjectShell* pObjShell = pFormModel->GetObjectShell();
     123        3793 :     if ( pObjShell && pObjShell->GetMedium() )
     124             :     {
     125        3793 :         const SfxPoolItem *pItem=0;
     126        3793 :         if ( pObjShell->GetMedium()->GetItemSet()->GetItemState( SID_COMPONENTDATA, false, &pItem ) == SfxItemState::SET )
     127             :         {
     128           1 :             ::comphelper::NamedValueCollection aComponentData( static_cast<const SfxUnoAnyItem*>(pItem)->GetValue() );
     129           1 :             bInitDesignMode = aComponentData.getOrDefault( "ApplyFormDesignMode", bInitDesignMode );
     130             :         }
     131             :     }
     132             : 
     133             :     // dieses wird in der Shell vorgenommen
     134             :     // bDesignMode = !bInitDesignMode;  // erzwingt, dass SetDesignMode ausgefuehrt wird
     135        3793 :     SetDesignMode( bInitDesignMode );
     136             : }
     137             : 
     138             : 
     139        7585 : FmFormView::~FmFormView()
     140             : {
     141        3786 :     if( pFormShell )
     142           0 :         pFormShell->SetView( NULL );
     143             : 
     144        3786 :     pImpl->notifyViewDying();
     145        3786 :     pImpl->release();
     146        3786 :     pImpl = NULL;
     147        3799 : }
     148             : 
     149             : 
     150       11650 : FmFormPage* FmFormView::GetCurPage()
     151             : {
     152       11650 :     SdrPageView* pPageView = GetSdrPageView();
     153       11650 :     FmFormPage*  pCurPage = pPageView ? PTR_CAST( FmFormPage, pPageView->GetPage() ) : NULL;
     154       11650 :     return pCurPage;
     155             : }
     156             : 
     157             : 
     158        3636 : void FmFormView::MarkListHasChanged()
     159             : {
     160        3636 :     E3dView::MarkListHasChanged();
     161             : 
     162        3636 :     if ( pFormShell && IsDesignMode() )
     163             :     {
     164          36 :         FmFormObj* pObj = getMarkedGrid();
     165          36 :         if ( pImpl->m_pMarkedGrid && pImpl->m_pMarkedGrid != pObj )
     166             :         {
     167           0 :             pImpl->m_pMarkedGrid = NULL;
     168           0 :             if ( pImpl->m_xWindow.is() )
     169             :             {
     170           0 :                 pImpl->m_xWindow->removeFocusListener(pImpl);
     171           0 :                 pImpl->m_xWindow = NULL;
     172             :             }
     173           0 :             SetMoveOutside(false);
     174             :             //OLMRefreshAllIAOManagers();
     175             :         }
     176             : 
     177          36 :         pFormShell->GetImpl()->SetSelectionDelayed();
     178             :     }
     179        3636 : }
     180             : 
     181             : namespace
     182             : {
     183         674 :     const SdrPageWindow* findPageWindow( const SdrPaintView* _pView, OutputDevice* _pWindow )
     184             :     {
     185         674 :         SdrPageView* pPageView = _pView->GetSdrPageView();
     186         674 :         if(pPageView)
     187             :         {
     188         559 :             for ( sal_uInt32 window = 0; window < pPageView->PageWindowCount(); ++window )
     189             :             {
     190         559 :                 const SdrPageWindow* pPageWindow = pPageView->GetPageWindow( window );
     191         559 :                 if ( !pPageWindow || &pPageWindow->GetPaintWindow().GetOutputDevice() != _pWindow )
     192           9 :                     continue;
     193             : 
     194         550 :                 return pPageWindow;
     195             :             }
     196             :         }
     197         124 :         return NULL;
     198             :     }
     199             : }
     200             : 
     201             : 
     202           3 : void FmFormView::AddWindowToPaintView(OutputDevice* pNewWin)
     203             : {
     204           3 :     E3dView::AddWindowToPaintView(pNewWin);
     205             : 
     206           3 :     if ( !pNewWin )
     207           3 :         return;
     208             : 
     209             :     // look up the PageViewWindow for the newly inserted window, and care for it
     210             :     // #i39269# / 2004-12-20 / frank.schoenheit@sun.com
     211           3 :     const SdrPageWindow* pPageWindow = findPageWindow( this, pNewWin );
     212           3 :     if ( pPageWindow )
     213           3 :         pImpl->addWindow( *pPageWindow );
     214             : }
     215             : 
     216             : 
     217         671 : void FmFormView::DeleteWindowFromPaintView(OutputDevice* pNewWin)
     218             : {
     219         671 :     const SdrPageWindow* pPageWindow = findPageWindow( this, pNewWin );
     220         671 :     if ( pPageWindow )
     221         547 :         pImpl->removeWindow( pPageWindow->GetControlContainer() );
     222             : 
     223         671 :     E3dView::DeleteWindowFromPaintView(pNewWin);
     224         671 : }
     225             : 
     226             : 
     227        3258 : void FmFormView::ChangeDesignMode(bool bDesign)
     228             : {
     229        3258 :     if (bDesign == IsDesignMode())
     230        6493 :         return;
     231             : 
     232          23 :     FmFormModel* pModel = PTR_CAST(FmFormModel, GetModel());
     233          23 :     if (pModel)
     234             :     {   // fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
     235             :         // Properties mal eben aendern kann (sollte allerdings mit Vorsicht genossen und beim Rueckschalten des Modes
     236             :         // auch immer wieder rueckgaegig gemacht werden. Ein Beispiel ist das Setzen der maximalen Text-Laenge durch das
     237             :         // FmXEditModel an seinem Control.)
     238          23 :         pModel->GetUndoEnv().Lock();
     239             :     }
     240             : 
     241             :     // --- 1. deactivate all controls if we are switching to design mode
     242          23 :     if ( bDesign )
     243           0 :         DeactivateControls( GetSdrPageView() );
     244             : 
     245             :     // --- 2. simulate a deactivation (the shell will handle some things there ...?)
     246          23 :     if ( pFormShell && pFormShell->GetImpl() )
     247          23 :         pFormShell->GetImpl()->viewDeactivated( *this, true );
     248             :     else
     249           0 :         pImpl->Deactivate( true );
     250             : 
     251             :     // --- 3. activate all controls, if we're switching to alive mode
     252          23 :     if ( !bDesign )
     253          23 :         ActivateControls( GetSdrPageView() );
     254             : 
     255             :     // --- 4. load resp. unload the forms
     256          23 :     FmFormPage*  pCurPage = GetCurPage();
     257          23 :     if ( pCurPage )
     258             :     {
     259          23 :         if ( pFormShell && pFormShell->GetImpl() )
     260          23 :             pFormShell->GetImpl()->loadForms( pCurPage, ( bDesign ? FORMS_UNLOAD : FORMS_LOAD ) );
     261             :     }
     262             : 
     263             :     // --- 5. base class functionality
     264          23 :     SetDesignMode( bDesign );
     265             : 
     266             :     // --- 6. simulate a activation (the shell will handle some things there ...?)
     267             :     OSL_PRECOND( pFormShell && pFormShell->GetImpl(), "FmFormView::ChangeDesignMode: is this really allowed? No shell?" );
     268          23 :     if ( pFormShell && pFormShell->GetImpl() )
     269          23 :         pFormShell->GetImpl()->viewActivated( *this );
     270             :     else
     271           0 :         pImpl->Activate();
     272             : 
     273          23 :     if ( pCurPage )
     274             :     {
     275          23 :         if ( bDesign )
     276             :         {
     277           0 :             if ( GetActualOutDev() && GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW )
     278             :             {
     279           0 :                 const vcl::Window* pWindow = static_cast< const vcl::Window* >( GetActualOutDev() );
     280           0 :                 const_cast< vcl::Window* >( pWindow )->GrabFocus();
     281             :             }
     282             : 
     283             :             // redraw UNO objects
     284           0 :             if ( GetSdrPageView() )
     285             :             {
     286           0 :                 SdrObjListIter aIter(*pCurPage);
     287           0 :                 while( aIter.IsMore() )
     288             :                 {
     289           0 :                     SdrObject* pObj = aIter.Next();
     290           0 :                     if (pObj && pObj->IsUnoObj())
     291             :                     {
     292             :                         // For redraw just use ActionChanged()
     293             :                         // pObj->BroadcastObjectChange();
     294           0 :                         pObj->ActionChanged();
     295             :                     }
     296           0 :                 }
     297             :             }
     298             :         }
     299             :         else
     300             :         {
     301             :             // set the auto focus to the first control (if indicated by the model to do so)
     302          23 :             bool bForceControlFocus = pModel && pModel->GetAutoControlFocus();
     303          23 :             if (bForceControlFocus)
     304           0 :                 pImpl->AutoFocus();
     305             :         }
     306             :     }
     307             : 
     308             :     // und mein Undo-Environment wieder an
     309          23 :     if (pModel)
     310          23 :         pModel->GetUndoEnv().UnLock();
     311             : }
     312             : 
     313             : 
     314           0 : void FmFormView::GrabFirstControlFocus( bool _bForceSync )
     315             : {
     316           0 :     if ( !IsDesignMode() )
     317           0 :         pImpl->AutoFocus( _bForceSync );
     318           0 : }
     319             : 
     320             : 
     321        4428 : SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
     322             : {
     323        4428 :     SdrPageView* pPV = E3dView::ShowSdrPage(pPage);
     324             : 
     325        4428 :     if (pPage)
     326             :     {
     327        4428 :         if (!IsDesignMode())
     328             :         {
     329             :             // creating the controllers
     330         536 :             ActivateControls(pPV);
     331             : 
     332             :             // Alles deselektieren
     333         536 :             UnmarkAll();
     334             :         }
     335        3892 :         else if ( pFormShell && pFormShell->IsDesignMode() )
     336             :         {
     337         316 :             FmXFormShell* pFormShellImpl = pFormShell->GetImpl();
     338         316 :             pFormShellImpl->UpdateForms( true );
     339             : 
     340             :             // damit der Formular-Navigator auf den Seitenwechsel reagieren kann
     341         316 :             pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_FMEXPLORER_CONTROL, true, false);
     342             : 
     343         316 :             pFormShellImpl->SetSelection(GetMarkedObjectList());
     344             :         }
     345             :     }
     346             : 
     347             :     // notify our shell that we have been activated
     348        4428 :     if ( pFormShell && pFormShell->GetImpl() )
     349         612 :         pFormShell->GetImpl()->viewActivated( *this );
     350             :     else
     351        3816 :         pImpl->Activate();
     352             : 
     353        4428 :     return pPV;
     354             : }
     355             : 
     356             : 
     357        4423 : void FmFormView::HideSdrPage()
     358             : {
     359             :     // --- 1. deactivate controls
     360        4423 :     if ( !IsDesignMode() )
     361         559 :         DeactivateControls(GetSdrPageView());
     362             : 
     363             :     // --- 2. tell the shell the view is (going to be) deactivated
     364        4423 :     if ( pFormShell && pFormShell->GetImpl() )
     365         629 :         pFormShell->GetImpl()->viewDeactivated( *this, true );
     366             :     else
     367        3794 :         pImpl->Deactivate( true );
     368             : 
     369             :     // --- 3. base class behavior
     370        4423 :     E3dView::HideSdrPage();
     371        4423 : }
     372             : 
     373             : 
     374           0 : SdrModel* FmFormView::GetMarkedObjModel() const
     375             : {
     376           0 :     return E3dView::GetMarkedObjModel();
     377             : }
     378             : 
     379         559 : void FmFormView::ActivateControls(SdrPageView* pPageView)
     380             : {
     381         559 :     if (!pPageView)
     382         559 :         return;
     383             : 
     384        1118 :     for (sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); ++i)
     385             :     {
     386         559 :         const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
     387         559 :         pImpl->addWindow(rPageWindow);
     388             :     }
     389             : }
     390             : 
     391             : 
     392         559 : void FmFormView::DeactivateControls(SdrPageView* pPageView)
     393             : {
     394         559 :     if( !pPageView )
     395         560 :         return;
     396             : 
     397        1008 :     for (sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); ++i)
     398             :     {
     399         450 :         const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
     400         450 :         pImpl->removeWindow(rPageWindow.GetControlContainer() );
     401             :     }
     402             : }
     403             : 
     404             : 
     405           0 : SdrObject* FmFormView::CreateFieldControl( const ODataAccessDescriptor& _rColumnDescriptor )
     406             : {
     407           0 :     return pImpl->implCreateFieldControl( _rColumnDescriptor );
     408             : }
     409             : 
     410             : 
     411           0 : SdrObject* FmFormView::CreateXFormsControl( const OXFormsDescriptor &_rDesc )
     412             : {
     413           0 :     return pImpl->implCreateXFormsControl(_rDesc);
     414             : }
     415             : 
     416             : 
     417           0 : SdrObject* FmFormView::CreateFieldControl(const OUString& rFieldDesc) const
     418             : {
     419           0 :     OUString sDataSource     = rFieldDesc.getToken(0,sal_Unicode(11));
     420           0 :     OUString sObjectName     = rFieldDesc.getToken(1,sal_Unicode(11));
     421           0 :     sal_uInt16 nObjectType   = (sal_uInt16)rFieldDesc.getToken(2,sal_Unicode(11)).toInt32();
     422           0 :     OUString sFieldName      = rFieldDesc.getToken(3,sal_Unicode(11));
     423             : 
     424           0 :     if (sFieldName.isEmpty() || sObjectName.isEmpty() || sDataSource.isEmpty())
     425           0 :         return NULL;
     426             : 
     427           0 :     ODataAccessDescriptor aColumnDescriptor;
     428           0 :     aColumnDescriptor.setDataSource(sDataSource);
     429           0 :     aColumnDescriptor[ daCommand ]          <<= sObjectName;
     430           0 :     aColumnDescriptor[ daCommandType ]      <<= nObjectType;
     431           0 :     aColumnDescriptor[ daColumnName ]       <<= sFieldName;
     432             : 
     433           0 :     return pImpl->implCreateFieldControl( aColumnDescriptor );
     434             : }
     435             : 
     436             : 
     437        1100 : void FmFormView::InsertControlContainer(const Reference< ::com::sun::star::awt::XControlContainer > & xCC)
     438             : {
     439        1100 :     if( !IsDesignMode() )
     440             :     {
     441         539 :         SdrPageView* pPageView = GetSdrPageView();
     442         539 :         if( pPageView )
     443             :         {
     444         545 :             for( sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); i++ )
     445             :             {
     446         545 :                 const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
     447             : 
     448         545 :                 if( rPageWindow.GetControlContainer( false ) == xCC )
     449             :                 {
     450         539 :                     pImpl->addWindow(rPageWindow);
     451         539 :                     break;
     452             :                 }
     453             :             }
     454             :         }
     455             :     }
     456        1100 : }
     457             : 
     458             : 
     459        1099 : void FmFormView::RemoveControlContainer(const Reference< ::com::sun::star::awt::XControlContainer > & xCC)
     460             : {
     461        1099 :     if( !IsDesignMode() )
     462             :     {
     463         561 :         pImpl->removeWindow( xCC );
     464             :     }
     465        1099 : }
     466             : 
     467             : 
     468       13488 : SdrPaintWindow* FmFormView::BeginCompleteRedraw(OutputDevice* pOut)
     469             : {
     470       13488 :     SdrPaintWindow* pPaintWindow = E3dView::BeginCompleteRedraw( pOut );
     471       13488 :     pImpl->suspendTabOrderUpdate();
     472       13488 :     return pPaintWindow;
     473             : }
     474             : 
     475             : 
     476       13488 : void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool bPaintFormLayer )
     477             : {
     478       13488 :     E3dView::EndCompleteRedraw( rPaintWindow, bPaintFormLayer );
     479       13488 :     pImpl->resumeTabOrderUpdate();
     480       13488 : }
     481             : 
     482             : 
     483           2 : bool FmFormView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
     484             : {
     485           2 :     bool bDone = false;
     486           2 :     const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
     487           4 :     if  (   IsDesignMode()
     488           2 :         &&  rKeyCode.GetCode() == KEY_RETURN
     489             :         )
     490             :     {
     491             :         // RETURN alone enters grid controls, for keyboard accessibility
     492           0 :         if  (   pWin
     493           0 :             &&  !rKeyCode.IsShift()
     494           0 :             &&  !rKeyCode.IsMod1()
     495           0 :             &&  !rKeyCode.IsMod2()
     496             :             )
     497             :         {
     498           0 :             FmFormObj* pObj = getMarkedGrid();
     499           0 :             if ( pObj )
     500             :             {
     501           0 :                 Reference< awt::XWindow > xWindow( pObj->GetUnoControl( *this, *pWin ), UNO_QUERY );
     502           0 :                 if ( xWindow.is() )
     503             :                 {
     504           0 :                     pImpl->m_pMarkedGrid = pObj;
     505           0 :                     pImpl->m_xWindow = xWindow;
     506             :                     // add as listener to get notified when ESC will be pressed inside the grid
     507           0 :                     pImpl->m_xWindow->addFocusListener(pImpl);
     508           0 :                     SetMoveOutside(true);
     509             :                     //OLMRefreshAllIAOManagers();
     510           0 :                     xWindow->setFocus();
     511           0 :                     bDone = true;
     512           0 :                 }
     513             :             }
     514             :         }
     515             :         // Alt-RETURN alone shows the properties of the selection
     516           0 :         if  (   pFormShell
     517           0 :             &&  pFormShell->GetImpl()
     518           0 :             &&  !rKeyCode.IsShift()
     519           0 :             &&  !rKeyCode.IsMod1()
     520           0 :             &&   rKeyCode.IsMod2()
     521             :             )
     522             :         {
     523           0 :             pFormShell->GetImpl()->handleShowPropertiesRequest();
     524             :         }
     525             : 
     526             :     }
     527             : 
     528           2 :     if ( !bDone )
     529           2 :         bDone = E3dView::KeyInput(rKEvt,pWin);
     530           2 :     return bDone;
     531             : }
     532             : 
     533           0 : bool FmFormView::checkUnMarkAll(const Reference< XInterface >& _xSource)
     534             : {
     535           0 :     Reference< ::com::sun::star::awt::XControl> xControl(pImpl->m_xWindow,UNO_QUERY);
     536           0 :     bool bRet = !xControl.is() || !_xSource.is() || _xSource != xControl->getModel();
     537           0 :     if ( bRet )
     538           0 :         UnmarkAll();
     539             : 
     540           0 :     return bRet;
     541             : }
     542             : 
     543             : 
     544           3 : bool FmFormView::MouseButtonDown( const MouseEvent& _rMEvt, vcl::Window* _pWin )
     545             : {
     546           3 :     bool bReturn = E3dView::MouseButtonDown( _rMEvt, _pWin );
     547             : 
     548           3 :     if ( pFormShell && pFormShell->GetImpl() )
     549             :     {
     550           3 :         SdrViewEvent aViewEvent;
     551           3 :         PickAnything( _rMEvt, SdrMouseEventKind::BUTTONDOWN, aViewEvent );
     552           3 :         pFormShell->GetImpl()->handleMouseButtonDown( aViewEvent );
     553             :     }
     554             : 
     555           3 :     return bReturn;
     556             : }
     557             : 
     558             : 
     559          36 : FmFormObj* FmFormView::getMarkedGrid() const
     560             : {
     561          36 :     FmFormObj* pFormObject = NULL;
     562          36 :     const SdrMarkList& rMarkList = GetMarkedObjectList();
     563          36 :     if ( 1 == rMarkList.GetMarkCount() )
     564             :     {
     565          16 :         SdrMark* pMark = rMarkList.GetMark(0);
     566          16 :         if ( pMark )
     567             :         {
     568          16 :             pFormObject = FmFormObj::GetFormObject( pMark->GetMarkedSdrObj() );
     569          16 :             if ( pFormObject )
     570             :             {
     571           0 :                 Reference< XServiceInfo > xServInfo( pFormObject->GetUnoControlModel(), UNO_QUERY );
     572           0 :                 if ( !xServInfo.is() || !xServInfo->supportsService( FM_SUN_COMPONENT_GRIDCONTROL ) )
     573           0 :                     pFormObject = NULL;
     574             :             }
     575             :         }
     576             :     }
     577          36 :     return pFormObject;
     578             : }
     579             : 
     580             : 
     581           0 : void FmFormView::createControlLabelPair( OutputDevice* _pOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM,
     582             :     const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats,
     583             :     sal_uInt16 _nControlObjectID, const OUString& _rFieldPostfix, sal_uInt32 _nInventor, sal_uInt16 _nLabelObjectID,
     584             :     SdrPage* _pLabelPage, SdrPage* _pControlPage, SdrModel* _pModel, SdrUnoObj*& _rpLabel, SdrUnoObj*& _rpControl )
     585             : {
     586             :     FmXFormView::createControlLabelPair(
     587             :         *_pOutDev, _nXOffsetMM, _nYOffsetMM,
     588             :         _rxField, _rxNumberFormats,
     589             :         _nControlObjectID, _rFieldPostfix, _nInventor, _nLabelObjectID,
     590             :         _pLabelPage, _pControlPage, _pModel,
     591             :         _rpLabel, _rpControl
     592           0 :     );
     593           0 : }
     594             : 
     595           0 : Reference< runtime::XFormController > FmFormView::GetFormController( const Reference< XForm >& _rxForm, const OutputDevice& _rDevice ) const
     596             : {
     597           0 :     return pImpl->getFormController( _rxForm, _rDevice );
     598         435 : }
     599             : 
     600             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11