LCOV - code coverage report
Current view: top level - sfx2/source/view - frame2.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 98 193 50.8 %
Date: 2012-08-25 Functions: 18 24 75.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 94 410 22.9 %

           Branch data     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                 :            : 
      21                 :            : #include "impframe.hxx"
      22                 :            : #include "objshimp.hxx"
      23                 :            : #include "sfx2/sfxhelp.hxx"
      24                 :            : #include "workwin.hxx"
      25                 :            : 
      26                 :            : #include "sfx2/app.hxx"
      27                 :            : #include "sfx2/bindings.hxx"
      28                 :            : #include "sfx2/dispatch.hxx"
      29                 :            : #include "sfx2/docfac.hxx"
      30                 :            : #include "sfx2/docfile.hxx"
      31                 :            : #include "sfx2/event.hxx"
      32                 :            : #include "sfx2/objface.hxx"
      33                 :            : #include "sfx2/request.hxx"
      34                 :            : 
      35                 :            : #include <com/sun/star/awt/XWindow2.hpp>
      36                 :            : #include <com/sun/star/beans/XPropertySet.hpp>
      37                 :            : #include <com/sun/star/frame/XComponentLoader.hpp>
      38                 :            : #include <com/sun/star/frame/XFrame.hpp>
      39                 :            : #include <com/sun/star/frame/XFramesSupplier.hpp>
      40                 :            : #include <com/sun/star/frame/XLayoutManager.hpp>
      41                 :            : 
      42                 :            : #include <comphelper/componentcontext.hxx>
      43                 :            : #include <comphelper/namedvaluecollection.hxx>
      44                 :            : #include <comphelper/processfactory.hxx>
      45                 :            : #include <svl/eitem.hxx>
      46                 :            : #include <svl/intitem.hxx>
      47                 :            : #include <svl/itemset.hxx>
      48                 :            : #include <svl/rectitem.hxx>
      49                 :            : #include <svl/stritem.hxx>
      50                 :            : #include <toolkit/helper/vclunohelper.hxx>
      51                 :            : #include <tools/diagnose_ex.h>
      52                 :            : 
      53                 :            : using namespace ::com::sun::star;
      54                 :            : using namespace ::com::sun::star::uno;
      55                 :            : using namespace ::com::sun::star::frame;
      56                 :            : using namespace ::com::sun::star::util;
      57                 :            : using namespace ::com::sun::star::container;
      58                 :            : using namespace ::com::sun::star::beans;
      59                 :            : using ::com::sun::star::lang::XMultiServiceFactory;
      60                 :            : using ::com::sun::star::lang::XComponent;
      61                 :            : using ::com::sun::star::frame::XComponentLoader;
      62                 :            : 
      63                 :            : //------------------------------------------------------------------------
      64                 :            : 
      65                 :            : class SfxFrameWindow_Impl : public Window
      66                 :            : {
      67                 :            : public:
      68                 :            :     SfxFrame*           pFrame;
      69                 :            : 
      70                 :            :     SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow );
      71                 :            :     ~SfxFrameWindow_Impl( );
      72                 :            : 
      73                 :            :     virtual void        DataChanged( const DataChangedEvent& rDCEvt );
      74                 :            :     virtual void        StateChanged( StateChangedType nStateChange );
      75                 :            :     virtual long        PreNotify( NotifyEvent& rNEvt );
      76                 :            :     virtual long        Notify( NotifyEvent& rEvt );
      77                 :            :     virtual void        Resize();
      78                 :            :     virtual void        GetFocus();
      79                 :            :     void                DoResize();
      80                 :            : };
      81                 :            : 
      82                 :       1711 : SfxFrameWindow_Impl::SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow )
      83                 :            :         : Window( &i_rContainerWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK )
      84                 :       1711 :         , pFrame( pF )
      85                 :            : {
      86                 :       1711 : }
      87                 :            : 
      88                 :       1620 : SfxFrameWindow_Impl::~SfxFrameWindow_Impl( )
      89                 :            : {
      90         [ -  + ]:       3240 : }
      91                 :            : 
      92                 :          6 : void SfxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
      93                 :            : {
      94                 :          6 :     Window::DataChanged( rDCEvt );
      95                 :          6 :     SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
      96         [ +  - ]:          6 :     if ( pWorkWin )
      97                 :          6 :         pWorkWin->DataChanged_Impl( rDCEvt );
      98                 :          6 : }
      99                 :            : 
     100                 :      49026 : long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt )
     101                 :            : {
     102 [ +  - ][ +  + ]:      49026 :     if ( pFrame->IsClosing_Impl() || !pFrame->GetFrameInterface().is() )
         [ +  - ][ -  + ]
                 [ +  + ]
           [ +  +  #  # ]
     103                 :      41493 :         return sal_False;
     104                 :            : 
     105                 :       7533 :     SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
     106 [ -  + ][ -  + ]:       7533 :     if ( !pView || !pView->GetObjectShell() )
                 [ +  - ]
     107                 :          0 :         return Window::Notify( rNEvt );
     108                 :            : 
     109         [ +  + ]:       7533 :     if ( rNEvt.GetType() == EVENT_GETFOCUS )
     110                 :            :     {
     111 [ +  - ][ +  - ]:       1569 :         if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() )
         [ +  - ][ +  - ]
         [ +  + ][ +  - ]
         [ +  - ][ +  + ]
     112                 :            :         {
     113                 :            :             OSL_TRACE("SfxFrame: GotFocus");
     114         [ +  - ]:       1567 :             pView->MakeActive_Impl( sal_False );
     115                 :            :         }
     116                 :            : 
     117                 :            :         // TODO/LATER: do we still need this code?
     118                 :       1569 :         Window* pWindow = rNEvt.GetWindow();
     119                 :       1569 :         rtl::OString sHelpId;
     120 [ +  + ][ +  + ]:       3569 :         while ( sHelpId.isEmpty() && pWindow )
                 [ +  + ]
     121                 :            :         {
     122         [ +  - ]:       2000 :             sHelpId = pWindow->GetHelpId();
     123         [ +  - ]:       2000 :             pWindow = pWindow->GetParent();
     124                 :            :         }
     125                 :            : 
     126         [ +  + ]:       1569 :         if ( !sHelpId.isEmpty() )
     127         [ +  - ]:       1469 :             SfxHelp::OpenHelpAgent( pFrame, sHelpId );
     128                 :            : 
     129                 :            :         // if focus was on an external window, the clipboard content might have been changed
     130         [ +  - ]:       1569 :         pView->GetBindings().Invalidate( SID_PASTE );
     131         [ +  - ]:       1569 :         pView->GetBindings().Invalidate( SID_PASTE_SPECIAL );
     132                 :       1569 :         return sal_True;
     133                 :            :     }
     134         [ -  + ]:       5964 :     else if( rNEvt.GetType() == EVENT_KEYINPUT )
     135                 :            :     {
     136         [ #  # ]:          0 :         if ( pView->GetViewShell()->KeyInput( *rNEvt.GetKeyEvent() ) )
     137                 :          0 :             return sal_True;
     138                 :            :     }
     139         [ -  + ]:       5964 :     else if ( rNEvt.GetType() == EVENT_EXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTDISABLE*/ )
     140                 :            :     {
     141                 :          0 :         pView->SetModalMode( sal_True );
     142                 :          0 :         return sal_True;
     143                 :            :     }
     144         [ -  + ]:       5964 :     else if ( rNEvt.GetType() == EVENT_ENDEXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTENABLE*/ )
     145                 :            :     {
     146                 :          0 :         pView->SetModalMode( sal_False );
     147                 :          0 :         return sal_True;
     148                 :            :     }
     149                 :            : 
     150                 :      49026 :     return Window::Notify( rNEvt );
     151                 :            : }
     152                 :            : 
     153                 :      10119 : long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt )
     154                 :            : {
     155                 :      10119 :     sal_uInt16 nType = rNEvt.GetType();
     156 [ -  + ][ +  - ]:      10119 :     if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP )
     157                 :            :     {
     158                 :          0 :         SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
     159         [ #  # ]:          0 :         SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
     160 [ #  # ][ #  # ]:          0 :         if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
         [ #  # ][ #  # ]
     161                 :          0 :             return sal_True;
     162                 :            :     }
     163 [ +  - ][ -  + ]:      10119 :     else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN )
     164                 :            :     {
     165                 :          0 :         Window* pWindow = rNEvt.GetWindow();
     166                 :          0 :         SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
     167         [ #  # ]:          0 :         SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
     168         [ #  # ]:          0 :         if ( pShell )
     169 [ #  # ][ #  # ]:          0 :             if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) )
                 [ #  # ]
     170 [ #  # ][ #  # ]:          0 :                 if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
                 [ #  # ]
     171                 :          0 :                     return sal_True;
     172                 :            :     }
     173                 :            : 
     174         [ -  + ]:      10119 :     if ( nType == EVENT_MOUSEBUTTONDOWN )
     175                 :            :     {
     176                 :          0 :         Window* pWindow = rNEvt.GetWindow();
     177         [ #  # ]:          0 :         const MouseEvent* pMEvent = rNEvt.GetMouseEvent();
     178         [ #  # ]:          0 :         Point aPos = pWindow->OutputToScreenPixel( pMEvent->GetPosPixel() );
     179         [ #  # ]:          0 :         SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
     180         [ #  # ]:          0 :         if ( pWorkWin )
     181         [ #  # ]:          0 :             pWorkWin->EndAutoShow_Impl( aPos );
     182                 :            :     }
     183                 :            : 
     184                 :      10119 :     return Window::PreNotify( rNEvt );
     185                 :            : }
     186                 :            : 
     187                 :       2811 : void SfxFrameWindow_Impl::GetFocus()
     188                 :            : {
     189 [ +  - ][ +  - ]:       2811 :     if ( pFrame && !pFrame->IsClosing_Impl() && pFrame->GetCurrentViewFrame() && pFrame->GetFrameInterface().is() )
         [ +  + ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  + ]
           [ +  +  #  # ]
     190                 :       1470 :         pFrame->GetCurrentViewFrame()->MakeActive_Impl( sal_True );
     191                 :       2811 : }
     192                 :            : 
     193                 :       4301 : void SfxFrameWindow_Impl::Resize()
     194                 :            : {
     195 [ +  - ][ +  + ]:       4301 :     if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() )
         [ +  - ][ +  + ]
         [ -  + ][ +  + ]
           [ +  +  #  # ]
     196                 :       2590 :         DoResize();
     197                 :       4301 : }
     198                 :            : 
     199                 :       3740 : void SfxFrameWindow_Impl::StateChanged( StateChangedType nStateChange )
     200                 :            : {
     201         [ +  + ]:       3740 :     if ( nStateChange == STATE_CHANGE_INITSHOW )
     202                 :            :     {
     203                 :       1691 :         pFrame->pImp->bHidden = sal_False;
     204         [ -  + ]:       1691 :         if ( pFrame->IsInPlace() )
     205                 :            :             // TODO/MBA: workaround for bug in LayoutManager: the final resize does not get through because the
     206                 :            :             // LayoutManager works asynchronously and between resize and time execution the DockingAcceptor was exchanged so that
     207                 :            :             // the resize event never is sent to the component
     208         [ #  # ]:          0 :             SetSizePixel( GetParent()->GetOutputSizePixel() );
     209                 :            : 
     210                 :       1691 :         DoResize();
     211                 :       1691 :         SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
     212         [ +  + ]:       1691 :         if ( pView )
     213                 :       1286 :             pView->GetBindings().GetWorkWindow_Impl()->ShowChildren_Impl();
     214                 :            :     }
     215                 :            : 
     216                 :       3740 :     Window::StateChanged( nStateChange );
     217                 :       3740 : }
     218                 :            : 
     219                 :       4281 : void SfxFrameWindow_Impl::DoResize()
     220                 :            : {
     221         [ +  - ]:       4281 :     if ( !pFrame->pImp->bLockResize )
     222                 :       4281 :         pFrame->Resize();
     223                 :       4281 : }
     224                 :            : 
     225                 :          0 : Reference < XFrame > SfxFrame::CreateBlankFrame()
     226                 :            : {
     227                 :          0 :     Reference < XFrame > xFrame;
     228                 :            :     try
     229                 :            :     {
     230 [ #  # ][ #  # ]:          0 :         ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
     231 [ #  # ][ #  # ]:          0 :         Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
     232 [ #  # ][ #  # ]:          0 :         xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     233                 :            :     }
     234         [ #  # ]:          0 :     catch( const Exception& )
     235                 :            :     {
     236                 :            :         DBG_UNHANDLED_EXCEPTION();
     237                 :            :     }
     238                 :          0 :     return xFrame;
     239                 :            : }
     240                 :            : 
     241                 :          0 : SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nViewId, bool bHidden )
     242                 :            : {
     243                 :          0 :     SfxFrame* pFrame = NULL;
     244                 :            :     try
     245                 :            :     {
     246                 :            :         // create and initialize new top level frame for this window
     247 [ #  # ][ #  # ]:          0 :         ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
     248 [ #  # ][ #  # ]:          0 :         Reference < XFramesSupplier > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
     249 [ #  # ][ #  # ]:          0 :         Reference < XFrame > xFrame( aContext.createComponent( "com.sun.star.frame.Frame"), UNO_QUERY_THROW );
     250                 :            : 
     251 [ #  # ][ #  # ]:          0 :         Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW );
     252 [ #  # ][ #  # ]:          0 :         xFrame->initialize( xWin.get() );
         [ #  # ][ #  # ]
     253 [ #  # ][ #  # ]:          0 :         xDesktop->getFrames()->append( xFrame );
         [ #  # ][ #  # ]
     254                 :            : 
     255 [ #  # ][ #  # ]:          0 :         if ( xWin->isActive() )
                 [ #  # ]
     256 [ #  # ][ #  # ]:          0 :             xFrame->activate();
     257                 :            : 
     258                 :            :         // create load arguments
     259         [ #  # ]:          0 :         Sequence< PropertyValue > aLoadArgs;
     260 [ #  # ][ #  # ]:          0 :         TransformItems( SID_OPENDOC, *rDoc.GetMedium()->GetItemSet(), aLoadArgs );
     261                 :            : 
     262         [ #  # ]:          0 :         ::comphelper::NamedValueCollection aArgs( aLoadArgs );
     263 [ #  # ][ #  # ]:          0 :         aArgs.put( "Model", rDoc.GetModel() );
     264         [ #  # ]:          0 :         aArgs.put( "Hidden", bHidden );
     265         [ #  # ]:          0 :         if ( nViewId )
     266         [ #  # ]:          0 :             aArgs.put( "ViewId", nViewId );
     267                 :            : 
     268 [ #  # ][ #  # ]:          0 :         aLoadArgs = aArgs.getPropertyValues();
                 [ #  # ]
     269                 :            : 
     270                 :            :         // load the doc into that frame
     271         [ #  # ]:          0 :         ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
     272         [ #  # ]:          0 :         Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW );
     273         [ #  # ]:          0 :         xLoader->loadComponentFromURL(
     274                 :            :             sLoaderURL,
     275                 :            :             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ),
     276                 :            :             0,
     277                 :            :             aLoadArgs
     278 [ #  # ][ #  # ]:          0 :         );
     279                 :            : 
     280 [ #  # ][ #  # ]:          0 :         for (   pFrame = SfxFrame::GetFirst();
                 [ #  # ]
     281                 :            :                 pFrame;
     282                 :            :                 pFrame = SfxFrame::GetNext( *pFrame )
     283                 :            :             )
     284                 :            :         {
     285 [ #  # ][ #  # ]:          0 :             if ( pFrame->GetFrameInterface() == xFrame )
                 [ #  # ]
     286                 :          0 :                 break;
     287                 :            :         }
     288                 :            : 
     289 [ #  # ][ #  # ]:          0 :         OSL_ENSURE( pFrame, "SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" );
         [ #  # ][ #  # ]
     290                 :            :     }
     291                 :          0 :     catch( const Exception& )
     292                 :            :     {
     293                 :            :         DBG_UNHANDLED_EXCEPTION();
     294                 :            :     }
     295                 :            : 
     296                 :          0 :     return pFrame;
     297                 :            : }
     298                 :            : 
     299                 :       1711 : SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame )
     300                 :            : {
     301                 :            :     // create a new TopFrame to an external XFrame object ( wrap controller )
     302 [ -  + ][ #  # ]:       1711 :     ENSURE_OR_THROW( i_rFrame.is(), "NULL frame not allowed" );
         [ #  # ][ #  # ]
     303         [ +  - ]:       1711 :     Window* pWindow = VCLUnoHelper::GetWindow( i_rFrame->getContainerWindow() );
     304 [ #  # ][ #  # ]:       1711 :     ENSURE_OR_THROW( pWindow, "frame without container window not allowed" );
         [ #  # ][ -  + ]
     305                 :            : 
     306         [ +  - ]:       1711 :     SfxFrame* pFrame = new SfxFrame( *pWindow, false );
     307                 :       1711 :     pFrame->SetFrameInterface_Impl( i_rFrame );
     308                 :       1711 :     return pFrame;
     309                 :            : }
     310                 :            : 
     311                 :       1711 : SfxFrame::SfxFrame( Window& i_rContainerWindow, bool i_bHidden )
     312                 :            :     :pParentFrame( NULL )
     313                 :            :     ,pChildArr( NULL )
     314                 :            :     ,pImp( NULL )
     315                 :       1711 :     ,pWindow( NULL )
     316                 :            : {
     317                 :       1711 :     Construct_Impl();
     318                 :            : 
     319                 :       1711 :     pImp->bHidden = i_bHidden;
     320                 :       1711 :     InsertTopFrame_Impl( this );
     321                 :       1711 :     pImp->pExternalContainerWindow = &i_rContainerWindow;
     322                 :            : 
     323         [ +  - ]:       1711 :     pWindow = new SfxFrameWindow_Impl( this, i_rContainerWindow );
     324                 :            : 
     325                 :            :     // always show pWindow, which is the ComponentWindow of the XFrame we live in
     326                 :            :     // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame
     327                 :            :     // is not done at level of the container window, not at SFX level. Thus, the component window can
     328                 :            :     // always be visible.
     329                 :       1711 :     pWindow->Show();
     330                 :       1711 : }
     331                 :            : 
     332                 :          0 : void SfxFrame::SetPresentationMode( sal_Bool bSet )
     333                 :            : {
     334 [ #  # ][ #  # ]:          0 :     if ( GetCurrentViewFrame() )
     335 [ #  # ][ #  # ]:          0 :         GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL );
         [ #  # ][ #  # ]
     336                 :            : 
     337 [ #  # ][ #  # ]:          0 :     Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
     338                 :          0 :     Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
     339                 :            : 
     340         [ #  # ]:          0 :     if ( xPropSet.is() )
     341                 :            :     {
     342 [ #  # ][ #  # ]:          0 :         Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
                 [ #  # ]
     343         [ #  # ]:          0 :         aValue >>= xLayoutManager;
     344                 :            :     }
     345                 :            : 
     346         [ #  # ]:          0 :     if ( xLayoutManager.is() )
     347 [ #  # ][ #  # ]:          0 :         xLayoutManager->setVisible( !bSet ); // we don't want to have ui in presentation mode
     348                 :            : 
     349         [ #  # ]:          0 :     SetMenuBarOn_Impl( !bSet );
     350 [ #  # ][ #  # ]:          0 :     if ( GetWorkWindow_Impl() )
     351         [ #  # ]:          0 :         GetWorkWindow_Impl()->SetDockingAllowed( !bSet );
     352 [ #  # ][ #  # ]:          0 :     if ( GetCurrentViewFrame() )
     353 [ #  # ][ #  # ]:          0 :         GetCurrentViewFrame()->GetDispatcher()->Update_Impl( sal_True );
     354                 :          0 : }
     355                 :            : 
     356                 :          0 : SystemWindow* SfxFrame::GetSystemWindow() const
     357                 :            : {
     358                 :          0 :     return GetTopWindow_Impl();
     359                 :            : }
     360                 :            : 
     361                 :         35 : SystemWindow* SfxFrame::GetTopWindow_Impl() const
     362                 :            : {
     363         [ +  - ]:         35 :     if ( pImp->pExternalContainerWindow->IsSystemWindow() )
     364                 :         35 :         return (SystemWindow*) pImp->pExternalContainerWindow;
     365                 :            :     else
     366                 :         35 :         return NULL;
     367                 :            : }
     368                 :            : 
     369                 :      41437 : Window& SfxFrame::GetWindow() const
     370                 :            : {
     371                 :      41437 :     return *pWindow;
     372                 :            : }
     373                 :            : 
     374                 :       1620 : sal_Bool SfxFrame::Close()
     375                 :            : {
     376         [ +  - ]:       1620 :     delete this;
     377                 :       1620 :     return sal_True;
     378                 :            : }
     379                 :            : 
     380                 :          0 : void SfxFrame::LockResize_Impl( sal_Bool bLock )
     381                 :            : {
     382                 :          0 :     pImp->bLockResize = bLock;
     383                 :          0 : }
     384                 :            : 
     385                 :          0 : void SfxFrame::SetMenuBarOn_Impl( sal_Bool bOn )
     386                 :            : {
     387                 :          0 :     pImp->bMenuBarOn = bOn;
     388                 :            : 
     389 [ #  # ][ #  # ]:          0 :     Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
     390                 :          0 :     Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
     391                 :            : 
     392         [ #  # ]:          0 :     if ( xPropSet.is() )
     393                 :            :     {
     394 [ #  # ][ #  # ]:          0 :         Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
                 [ #  # ]
     395         [ #  # ]:          0 :         aValue >>= xLayoutManager;
     396                 :            :     }
     397                 :            : 
     398         [ #  # ]:          0 :     if ( xLayoutManager.is() )
     399                 :            :     {
     400         [ #  # ]:          0 :         rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" ));
     401                 :            : 
     402         [ #  # ]:          0 :         if ( bOn )
     403 [ #  # ][ #  # ]:          0 :             xLayoutManager->showElement( aMenuBarURL );
     404                 :            :         else
     405 [ #  # ][ #  # ]:          0 :             xLayoutManager->hideElement( aMenuBarURL );
     406                 :          0 :     }
     407                 :          0 : }
     408                 :            : 
     409                 :       6340 : sal_Bool SfxFrame::IsMenuBarOn_Impl() const
     410                 :            : {
     411                 :       6340 :     return pImp->bMenuBarOn;
     412                 :            : }
     413                 :            : 
     414                 :       1711 : void SfxFrame::PrepareForDoc_Impl( SfxObjectShell& i_rDoc )
     415                 :            : {
     416 [ +  - ][ +  - ]:       1711 :     const ::comphelper::NamedValueCollection aDocumentArgs( i_rDoc.GetModel()->getArgs() );
         [ +  - ][ +  - ]
                 [ +  - ]
     417                 :            : 
     418                 :            :     // hidden?
     419                 :            :     OSL_ENSURE( !pImp->bHidden, "when does this happen?" );
     420         [ +  - ]:       1711 :     pImp->bHidden = aDocumentArgs.getOrDefault( "Hidden", pImp->bHidden );
     421                 :            : 
     422                 :            :     // update our descriptor
     423         [ +  - ]:       1711 :     UpdateDescriptor( &i_rDoc );
     424                 :            : 
     425                 :            :     // plugin mode
     426         [ +  - ]:       1711 :     sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
     427 [ -  + ][ #  # ]:       1711 :     if ( nPluginMode && ( nPluginMode != 2 ) )
     428 [ #  # ][ +  - ]:       1711 :         SetInPlace_Impl( sal_True );
     429                 :       1711 : }
     430                 :            : 
     431                 :       1727 : bool SfxFrame::IsMarkedHidden_Impl() const
     432                 :            : {
     433                 :       1727 :     return pImp->bHidden;
     434                 :            : }
     435                 :            : 
     436                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10