LCOV - code coverage report
Current view: top level - libreoffice/extensions/source/propctrlr - propertyeditor.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 248 0.0 %
Date: 2012-12-17 Functions: 0 46 0.0 %
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 "propertyeditor.hxx"
      21             : #include "browserpage.hxx"
      22             : #include "linedescriptor.hxx"
      23             : 
      24             : #include <tools/debug.hxx>
      25             : 
      26             : //............................................................................
      27             : namespace pcr
      28             : {
      29             : //............................................................................
      30             : 
      31             :     #define LAYOUT_BORDER_LEFT      3
      32             :     #define LAYOUT_BORDER_TOP       3
      33             :     #define LAYOUT_BORDER_RIGHT     3
      34             :     #define LAYOUT_BORDER_BOTTOM    3
      35             : 
      36             :     /** === begin UNO using === **/
      37             :     using ::com::sun::star::uno::Any;
      38             :     using ::com::sun::star::inspection::XPropertyControl;
      39             :     using ::com::sun::star::uno::Reference;
      40             :     /** === end UNO using === **/
      41             : 
      42             :     //==================================================================
      43             :     // class OPropertyEditor
      44             :     //==================================================================
      45             :     DBG_NAME(OPropertyEditor)
      46             :     //------------------------------------------------------------------
      47           0 :     OPropertyEditor::OPropertyEditor( Window* pParent, WinBits nWinStyle)
      48             :             :Control(pParent, nWinStyle)
      49             :             ,m_aTabControl( this )
      50             :             ,m_nNextId(1)
      51             :             ,m_bHasHelpSection( false )
      52             :             ,m_nMinHelpLines( 0 )
      53           0 :             ,m_nMaxHelpLines( 0 )
      54             :     {
      55             :         DBG_CTOR(OPropertyEditor,NULL);
      56             : 
      57           0 :         m_aTabControl.Show();
      58           0 :         m_aTabControl.SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate));
      59           0 :         m_aTabControl.SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate));
      60           0 :         m_aTabControl.SetBackground(GetBackground());
      61           0 :         m_aTabControl.SetPaintTransparent(sal_True);
      62           0 :     }
      63             : 
      64             :     //------------------------------------------------------------------
      65           0 :     OPropertyEditor::~OPropertyEditor()
      66             :     {
      67           0 :         Hide();
      68           0 :         ClearAll();
      69             :         DBG_DTOR(OPropertyEditor,NULL);
      70           0 :     }
      71             : 
      72             :     //------------------------------------------------------------------
      73           0 :     void OPropertyEditor::ClearAll()
      74             :     {
      75           0 :         m_nNextId=1;
      76           0 :         sal_uInt16 nCount = m_aTabControl.GetPageCount();
      77           0 :         for(long i = nCount-1; i >= 0; --i)
      78             :         {
      79           0 :             sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
      80           0 :             OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
      81           0 :             if (pPage)
      82             :             {
      83           0 :                 pPage->EnableInput(sal_False);
      84           0 :                 m_aTabControl.RemovePage(nID);
      85           0 :                 delete pPage;
      86             :             }
      87             :         }
      88           0 :         m_aTabControl.Clear();
      89             : 
      90             :         {
      91           0 :             MapStringToPageId aEmpty;
      92           0 :             m_aPropertyPageIds.swap( aEmpty );
      93             :         }
      94             : 
      95           0 :         while ( !m_aHiddenPages.empty() )
      96             :         {
      97           0 :             delete m_aHiddenPages.begin()->second.pPage;
      98           0 :             m_aHiddenPages.erase( m_aHiddenPages.begin() );
      99             :         }
     100           0 :     }
     101             : 
     102             :     //------------------------------------------------------------------
     103           0 :     sal_Int32 OPropertyEditor::getMinimumHeight()
     104             :     {
     105           0 :         sal_Int32 nMinHeight( LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM );
     106             : 
     107           0 :         if ( m_aTabControl.GetPageCount() > 0 )
     108             :         {
     109           0 :             sal_uInt16 nFirstID = m_aTabControl.GetPageId( 0 );
     110             : 
     111             :             // reserve space for the tabs themself
     112           0 :             Rectangle aTabArea( m_aTabControl.GetTabBounds( nFirstID ) );
     113           0 :             nMinHeight += aTabArea.GetHeight();
     114             : 
     115             :             // ask the page how much it requires
     116           0 :             OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nFirstID ) );
     117           0 :             if ( pPage )
     118           0 :                 nMinHeight += pPage->getMinimumHeight();
     119             :         }
     120             :         else
     121           0 :             nMinHeight += 250;  // arbitrary ...
     122             : 
     123           0 :         return nMinHeight;
     124             :     }
     125             : 
     126             :     //------------------------------------------------------------------
     127           0 :     sal_Int32 OPropertyEditor::getMinimumWidth()
     128             :     {
     129           0 :         sal_uInt16 nCount = m_aTabControl.GetPageCount();
     130           0 :         sal_Int32 nPageMinWidth = 0;
     131           0 :         for(long i = nCount-1; i >= 0; --i)
     132             :         {
     133           0 :             sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
     134           0 :             OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
     135           0 :             if (pPage)
     136             :             {
     137           0 :                 sal_Int32 nCurPageMinWidth = pPage->getMinimumWidth();
     138           0 :                 if( nCurPageMinWidth > nPageMinWidth )
     139           0 :                     nPageMinWidth = nCurPageMinWidth;
     140             :             }
     141             :         }
     142           0 :         return nPageMinWidth+6;
     143             :     }
     144             : 
     145             :     //------------------------------------------------------------------
     146           0 :     void OPropertyEditor::CommitModified()
     147             :     {
     148             :         // commit all of my pages, if necessary
     149             : 
     150           0 :         sal_uInt16 nCount = m_aTabControl.GetPageCount();
     151           0 :         for ( sal_uInt16 i=0; i<nCount; ++i )
     152             :         {
     153           0 :             sal_uInt16 nID = m_aTabControl.GetPageId( i );
     154           0 :             OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
     155             : 
     156           0 :             if ( pPage && pPage->getListBox().IsModified() )
     157           0 :                 pPage->getListBox().CommitModified();
     158             :         }
     159           0 :     }
     160             : 
     161             :     //------------------------------------------------------------------
     162           0 :     void OPropertyEditor::GetFocus()
     163             :     {
     164           0 :         m_aTabControl.GrabFocus();
     165           0 :     }
     166             : 
     167             :     //------------------------------------------------------------------
     168           0 :     OBrowserPage* OPropertyEditor::getPage( const ::rtl::OUString& _rPropertyName )
     169             :     {
     170           0 :         OBrowserPage* pPage = NULL;
     171           0 :         MapStringToPageId::const_iterator aPropertyPageIdPos = m_aPropertyPageIds.find( _rPropertyName );
     172           0 :         if ( aPropertyPageIdPos != m_aPropertyPageIds.end() )
     173           0 :             pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( aPropertyPageIdPos->second ) );
     174           0 :         return pPage;
     175             :     }
     176             : 
     177             :     //------------------------------------------------------------------
     178           0 :     const OBrowserPage* OPropertyEditor::getPage( const ::rtl::OUString& _rPropertyName ) const
     179             :     {
     180           0 :         return const_cast< OPropertyEditor* >( this )->getPage( _rPropertyName );
     181             :     }
     182             : 
     183             :     //------------------------------------------------------------------
     184           0 :     OBrowserPage* OPropertyEditor::getPage( sal_uInt16& _rPageId )
     185             :     {
     186           0 :         return static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( _rPageId ) );
     187             :     }
     188             : 
     189             :     //------------------------------------------------------------------
     190           0 :     const OBrowserPage* OPropertyEditor::getPage( sal_uInt16& _rPageId ) const
     191             :     {
     192           0 :         return const_cast< OPropertyEditor* >( this )->getPage( _rPageId );
     193             :     }
     194             : 
     195             :     //------------------------------------------------------------------
     196           0 :     void OPropertyEditor::Resize()
     197             :     {
     198             :         Rectangle aPlayground(
     199             :             Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ),
     200             :             Size(
     201           0 :                 GetOutputSizePixel().Width() - LAYOUT_BORDER_LEFT - LAYOUT_BORDER_RIGHT,
     202           0 :                 GetOutputSizePixel().Height() - LAYOUT_BORDER_TOP - LAYOUT_BORDER_BOTTOM
     203             :             )
     204           0 :         );
     205             : 
     206           0 :         Rectangle aTabArea( aPlayground );
     207           0 :         m_aTabControl.SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() );
     208           0 :     }
     209             : 
     210             :     //------------------------------------------------------------------
     211           0 :     sal_uInt16 OPropertyEditor::AppendPage( const String & _rText, const rtl::OString& _rHelpId )
     212             :     {
     213             :         // obtain a new id
     214           0 :         sal_uInt16 nId = m_nNextId++;
     215             :         // insert the id
     216           0 :         m_aTabControl.InsertPage(nId, _rText);
     217             : 
     218             :         // create a new page
     219           0 :         OBrowserPage* pPage = new OBrowserPage(&m_aTabControl);
     220           0 :         pPage->SetText( _rText );
     221             :         // some knittings
     222           0 :         pPage->SetSizePixel(m_aTabControl.GetTabPageSizePixel());
     223           0 :         pPage->getListBox().SetListener(m_pListener);
     224           0 :         pPage->getListBox().SetObserver(m_pObserver);
     225           0 :         pPage->getListBox().EnableHelpSection( m_bHasHelpSection );
     226           0 :         pPage->getListBox().SetHelpLineLimites( m_nMinHelpLines, m_nMaxHelpLines );
     227           0 :         pPage->SetHelpId( _rHelpId );
     228             : 
     229             :         // immediately activate the page
     230           0 :         m_aTabControl.SetTabPage(nId, pPage);
     231           0 :         m_aTabControl.SetCurPageId(nId);
     232             : 
     233           0 :         return nId;
     234             :     }
     235             : 
     236             :     //------------------------------------------------------------------
     237           0 :     void OPropertyEditor::SetHelpId( const rtl::OString& rHelpId )
     238             :     {
     239           0 :         Control::SetHelpId("");
     240           0 :         m_aTabControl.SetHelpId(rHelpId);
     241           0 :     }
     242             : 
     243             :     //------------------------------------------------------------------
     244           0 :     void OPropertyEditor::RemovePage(sal_uInt16 nID)
     245             :     {
     246           0 :         OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
     247             : 
     248           0 :         if (pPage)
     249           0 :             pPage->EnableInput(sal_False);
     250           0 :         m_aTabControl.RemovePage(nID);
     251           0 :         if (pPage)
     252           0 :             delete pPage;
     253           0 :     }
     254             : 
     255             :     //------------------------------------------------------------------
     256           0 :     void OPropertyEditor::SetPage(sal_uInt16 nId)
     257             :     {
     258           0 :         m_aTabControl.SetCurPageId(nId);
     259           0 :     }
     260             : 
     261             :     //------------------------------------------------------------------
     262           0 :     sal_uInt16 OPropertyEditor::GetCurPage()
     263             :     {
     264           0 :         if(m_aTabControl.GetPageCount()>0)
     265           0 :             return m_aTabControl.GetCurPageId();
     266             :         else
     267           0 :             return 0;
     268             :     }
     269             : 
     270             :     //------------------------------------------------------------------
     271           0 :     void OPropertyEditor::Update(const ::std::mem_fun_t<void,OBrowserListBox>& _aUpdateFunction)
     272             :     {
     273             :         // forward this to all our pages
     274           0 :         sal_uInt16 nCount = m_aTabControl.GetPageCount();
     275           0 :         for (sal_uInt16 i=0;i<nCount;++i)
     276             :         {
     277           0 :             sal_uInt16 nID = m_aTabControl.GetPageId(i);
     278           0 :             OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
     279           0 :             if (pPage)
     280           0 :                 _aUpdateFunction(&pPage->getListBox());
     281             :         }
     282           0 :     }
     283             :     //------------------------------------------------------------------
     284           0 :     void OPropertyEditor::EnableUpdate()
     285             :     {
     286           0 :         Update(::std::mem_fun(&OBrowserListBox::EnableUpdate));
     287           0 :     }
     288             :     //------------------------------------------------------------------
     289           0 :     void OPropertyEditor::DisableUpdate()
     290             :     {
     291           0 :         Update(::std::mem_fun(&OBrowserListBox::DisableUpdate));
     292           0 :     }
     293             : 
     294             :     //------------------------------------------------------------------
     295           0 :     void OPropertyEditor::forEachPage( PageOperation _pOperation, const void* _pArgument )
     296             :     {
     297           0 :         sal_uInt16 nCount = m_aTabControl.GetPageCount();
     298           0 :         for ( sal_uInt16 i=0; i<nCount; ++i )
     299             :         {
     300           0 :             sal_uInt16 nID = m_aTabControl.GetPageId(i);
     301           0 :             OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
     302           0 :             if ( !pPage )
     303           0 :                 continue;
     304           0 :             (this->*_pOperation)( *pPage, _pArgument );
     305             :         }
     306           0 :     }
     307             : 
     308             :     //------------------------------------------------------------------
     309           0 :     void OPropertyEditor::setPageLineListener( OBrowserPage& _rPage, const void* )
     310             :     {
     311           0 :         _rPage.getListBox().SetListener( m_pListener );
     312           0 :     }
     313             : 
     314             :     //------------------------------------------------------------------
     315           0 :     void OPropertyEditor::SetLineListener(IPropertyLineListener* _pListener)
     316             :     {
     317           0 :         m_pListener = _pListener;
     318           0 :         forEachPage( &OPropertyEditor::setPageLineListener );
     319           0 :     }
     320             : 
     321             :     //------------------------------------------------------------------
     322           0 :     void OPropertyEditor::setPageControlObserver( OBrowserPage& _rPage, const void* )
     323             :     {
     324           0 :         _rPage.getListBox().SetObserver( m_pObserver );
     325           0 :     }
     326             : 
     327             :     //------------------------------------------------------------------
     328           0 :     void OPropertyEditor::SetControlObserver( IPropertyControlObserver* _pObserver )
     329             :     {
     330           0 :         m_pObserver = _pObserver;
     331           0 :         forEachPage( &OPropertyEditor::setPageControlObserver );
     332           0 :     }
     333             : 
     334             :     //------------------------------------------------------------------
     335           0 :     void OPropertyEditor::EnableHelpSection( bool _bEnable )
     336             :     {
     337           0 :         m_bHasHelpSection = _bEnable;
     338           0 :         forEachPage( &OPropertyEditor::enableHelpSection );
     339           0 :     }
     340             : 
     341             :     //------------------------------------------------------------------
     342           0 :     bool OPropertyEditor::HasHelpSection() const
     343             :     {
     344           0 :         return m_bHasHelpSection;
     345             :     }
     346             : 
     347             :     //------------------------------------------------------------------
     348           0 :     void OPropertyEditor::SetHelpText( const ::rtl::OUString& _rHelpText )
     349             :     {
     350           0 :         forEachPage( &OPropertyEditor::setHelpSectionText, &_rHelpText );
     351           0 :     }
     352             : 
     353             :     //------------------------------------------------------------------
     354           0 :     void OPropertyEditor::SetHelpLineLimites( sal_Int32 _nMinLines, sal_Int32 _nMaxLines )
     355             :     {
     356           0 :         m_nMinHelpLines = _nMinLines;
     357           0 :         m_nMaxHelpLines = _nMaxLines;
     358           0 :         forEachPage( &OPropertyEditor::setHelpLineLimits );
     359           0 :     }
     360             : 
     361             :     //------------------------------------------------------------------
     362           0 :     void OPropertyEditor::enableHelpSection( OBrowserPage& _rPage, const void* )
     363             :     {
     364           0 :         _rPage.getListBox().EnableHelpSection( m_bHasHelpSection );
     365           0 :     }
     366             : 
     367             :     //------------------------------------------------------------------
     368           0 :     void OPropertyEditor::setHelpSectionText( OBrowserPage& _rPage, const void* _pPointerToOUString )
     369             :     {
     370             :         OSL_ENSURE( _pPointerToOUString, "OPropertyEditor::setHelpSectionText: invalid argument!" );
     371           0 :         if ( !_pPointerToOUString )
     372           0 :             return;
     373             : 
     374           0 :         const ::rtl::OUString& rText( *(const ::rtl::OUString*)_pPointerToOUString );
     375           0 :         _rPage.getListBox().SetHelpText( rText );
     376             :     }
     377             : 
     378             :     //------------------------------------------------------------------
     379           0 :     void OPropertyEditor::setHelpLineLimits( OBrowserPage& _rPage, const void* )
     380             :     {
     381           0 :         _rPage.getListBox().SetHelpLineLimites( m_nMinHelpLines, m_nMaxHelpLines );
     382           0 :     }
     383             : 
     384             :     //------------------------------------------------------------------
     385           0 :     sal_uInt16 OPropertyEditor::InsertEntry( const OLineDescriptor& rData, sal_uInt16 _nPageId, sal_uInt16 nPos )
     386             :     {
     387             :         // let the current page handle this
     388           0 :         OBrowserPage* pPage = getPage( _nPageId );
     389             :         DBG_ASSERT( pPage, "OPropertyEditor::InsertEntry: don't have such a page!" );
     390           0 :         if ( !pPage )
     391           0 :             return LISTBOX_ENTRY_NOTFOUND;
     392             : 
     393           0 :         sal_uInt16 nEntry = pPage->getListBox().InsertEntry( rData, nPos );
     394             : 
     395             :         OSL_ENSURE( m_aPropertyPageIds.find( rData.sName ) == m_aPropertyPageIds.end(),
     396             :             "OPropertyEditor::InsertEntry: property already present in the map!" );
     397           0 :         m_aPropertyPageIds.insert( MapStringToPageId::value_type( rData.sName, _nPageId ) );
     398             : 
     399           0 :         return nEntry;
     400             :     }
     401             : 
     402             :     //------------------------------------------------------------------
     403           0 :     void OPropertyEditor::RemoveEntry( const ::rtl::OUString& _rName )
     404             :     {
     405           0 :         OBrowserPage* pPage = getPage( _rName );
     406           0 :         if ( pPage )
     407             :         {
     408           0 :             OSL_VERIFY( pPage->getListBox().RemoveEntry( _rName ) );
     409             : 
     410             :             OSL_ENSURE( m_aPropertyPageIds.find( _rName ) != m_aPropertyPageIds.end(),
     411             :                 "OPropertyEditor::RemoveEntry: property not present in the map!" );
     412           0 :             m_aPropertyPageIds.erase( _rName );
     413             :         }
     414           0 :     }
     415             : 
     416             :     //------------------------------------------------------------------
     417           0 :     void OPropertyEditor::ChangeEntry( const OLineDescriptor& rData )
     418             :     {
     419           0 :         OBrowserPage* pPage = getPage( rData.sName );
     420           0 :         if ( pPage )
     421           0 :             pPage->getListBox().ChangeEntry( rData, EDITOR_LIST_REPLACE_EXISTING );
     422           0 :     }
     423             : 
     424             :     //------------------------------------------------------------------
     425           0 :     void OPropertyEditor::SetPropertyValue( const ::rtl::OUString& rEntryName, const Any& _rValue, bool _bUnknownValue )
     426             :     {
     427           0 :         OBrowserPage* pPage = getPage( rEntryName );
     428           0 :         if ( pPage )
     429           0 :             pPage->getListBox().SetPropertyValue( rEntryName, _rValue, _bUnknownValue );
     430           0 :     }
     431             : 
     432             :     //------------------------------------------------------------------
     433           0 :     sal_uInt16 OPropertyEditor::GetPropertyPos( const ::rtl::OUString& rEntryName ) const
     434             :     {
     435           0 :         sal_uInt16 nVal=LISTBOX_ENTRY_NOTFOUND;
     436           0 :         const OBrowserPage* pPage = getPage( rEntryName );
     437           0 :         if ( pPage )
     438           0 :             nVal = pPage->getListBox().GetPropertyPos( rEntryName );
     439           0 :         return nVal;
     440             :     }
     441             : 
     442             :     //------------------------------------------------------------------
     443           0 :     void OPropertyEditor::ShowPropertyPage( sal_uInt16 _nPageId, bool _bShow )
     444             :     {
     445           0 :         if ( !_bShow )
     446             :         {
     447           0 :             sal_uInt16 nPagePos = m_aTabControl.GetPagePos( _nPageId );
     448           0 :             if ( TAB_PAGE_NOTFOUND == nPagePos )
     449           0 :                 return;
     450             :             DBG_ASSERT( m_aHiddenPages.find( _nPageId ) == m_aHiddenPages.end(), "OPropertyEditor::ShowPropertyPage: page already hidden!" );
     451             : 
     452           0 :             m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl.GetTabPage( _nPageId ) );
     453           0 :             m_aTabControl.RemovePage( _nPageId );
     454             :         }
     455             :         else
     456             :         {
     457           0 :             ::std::map< sal_uInt16, HiddenPage >::iterator aPagePos = m_aHiddenPages.find( _nPageId );
     458           0 :             if ( aPagePos == m_aHiddenPages.end() )
     459             :                 return;
     460             : 
     461           0 :             aPagePos->second.pPage->SetSizePixel( m_aTabControl.GetTabPageSizePixel() );
     462           0 :             m_aTabControl.InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos );
     463           0 :             m_aTabControl.SetTabPage( aPagePos->first, aPagePos->second.pPage );
     464             : 
     465           0 :             m_aHiddenPages.erase( aPagePos );
     466             :         }
     467             :     }
     468             : 
     469             :     //------------------------------------------------------------------
     470           0 :     void OPropertyEditor::EnablePropertyControls( const ::rtl::OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable )
     471             :     {
     472           0 :         for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
     473             :         {
     474           0 :             OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
     475           0 :             if ( pPage )
     476           0 :                 pPage->getListBox().EnablePropertyControls( _rEntryName, _nControls, _bEnable );
     477             :         }
     478           0 :     }
     479             : 
     480             :     //------------------------------------------------------------------
     481           0 :     void OPropertyEditor::EnablePropertyLine( const ::rtl::OUString& _rEntryName, bool _bEnable )
     482             :     {
     483           0 :         for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
     484             :         {
     485           0 :             OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
     486           0 :             if ( pPage )
     487           0 :                 pPage->getListBox().EnablePropertyLine( _rEntryName, _bEnable );
     488             :         }
     489           0 :     }
     490             : 
     491             :     //------------------------------------------------------------------
     492           0 :     Reference< XPropertyControl > OPropertyEditor::GetPropertyControl(const ::rtl::OUString& rEntryName)
     493             :     {
     494           0 :         Reference< XPropertyControl > xControl;
     495             :         // let the current page handle this
     496           0 :         OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(m_aTabControl.GetCurPageId()));
     497           0 :         if (pPage)
     498           0 :             xControl = pPage->getListBox().GetPropertyControl(rEntryName);
     499           0 :         return xControl;
     500             :     }
     501             : 
     502             :     //------------------------------------------------------------------
     503           0 :     IMPL_LINK_NOARG(OPropertyEditor, OnPageActivate)
     504             :     {
     505           0 :         if (m_aPageActivationHandler.IsSet())
     506           0 :             m_aPageActivationHandler.Call(NULL);
     507           0 :         return 0L;
     508             :     }
     509             : 
     510             :     //------------------------------------------------------------------
     511           0 :     IMPL_LINK_NOARG(OPropertyEditor, OnPageDeactivate)
     512             :     {
     513             :         // commit the data on the current (to-be-decativated) tab page
     514             :         // (79404)
     515           0 :         sal_Int32 nCurrentId = m_aTabControl.GetCurPageId();
     516           0 :         OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage((sal_uInt16)nCurrentId));
     517           0 :         if ( !pCurrentPage )
     518           0 :             return 1L;
     519             : 
     520           0 :         if ( pCurrentPage->getListBox().IsModified() )
     521           0 :             pCurrentPage->getListBox().CommitModified();
     522             : 
     523           0 :         return 1L;
     524             :     }
     525             : 
     526             : //............................................................................
     527             : } // namespace pcr
     528             : //............................................................................
     529             : 
     530             : 
     531             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10