LCOV - code coverage report
Current view: top level - svx/source/form - tabwin.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 179 0.6 %
Date: 2012-08-25 Functions: 1 28 3.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 381 0.3 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include "tabwin.hxx"
      31                 :            : #include "svx/fmtools.hxx"
      32                 :            : #include "fmservs.hxx"
      33                 :            : #include "stringlistresource.hxx"
      34                 :            : 
      35                 :            : #include <svx/svxids.hrc>
      36                 :            : #include <svx/dbaexchange.hxx>
      37                 :            : #include <com/sun/star/sdb/CommandType.hpp>
      38                 :            : #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
      39                 :            : #include <com/sun/star/sdb/XQueriesSupplier.hpp>
      40                 :            : #include <com/sun/star/sdbc/XPreparedStatement.hpp>
      41                 :            : #include <com/sun/star/awt/XControlContainer.hpp>
      42                 :            : #include <com/sun/star/util/XLocalizedAliases.hpp>
      43                 :            : #include <comphelper/processfactory.hxx>
      44                 :            : #include <comphelper/stl_types.hxx>
      45                 :            : 
      46                 :            : #include "fmhelp.hrc"
      47                 :            : #include <svx/fmshell.hxx>
      48                 :            : #include "fmshimp.hxx"
      49                 :            : #include "svx/dbtoolsclient.hxx"
      50                 :            : #include <svx/fmpage.hxx>
      51                 :            : 
      52                 :            : #include "fmpgeimp.hxx"
      53                 :            : 
      54                 :            : #include "fmprop.hrc"
      55                 :            : 
      56                 :            : #include "svx/fmresids.hrc"
      57                 :            : #include <svx/dialmgr.hxx>
      58                 :            : #include <tools/shl.hxx>
      59                 :            : #include <svx/svdpagv.hxx>
      60                 :            : #include <sfx2/objitem.hxx>
      61                 :            : #include <sfx2/dispatch.hxx>
      62                 :            : #include <comphelper/property.hxx>
      63                 :            : #include <sfx2/frame.hxx>
      64                 :            : #include <svx/dataaccessdescriptor.hxx>
      65                 :            : 
      66                 :            : const long STD_WIN_SIZE_X = 120;
      67                 :            : const long STD_WIN_SIZE_Y = 150;
      68                 :            : 
      69                 :            : const long LISTBOX_BORDER = 2;
      70                 :            : 
      71                 :            : using namespace ::com::sun::star::sdbc;
      72                 :            : using namespace ::com::sun::star::sdb;
      73                 :            : using namespace ::com::sun::star::uno;
      74                 :            : using namespace ::com::sun::star::datatransfer;
      75                 :            : using namespace ::com::sun::star::beans;
      76                 :            : using namespace ::com::sun::star::lang;
      77                 :            : using namespace ::com::sun::star::form;
      78                 :            : using namespace ::com::sun::star::container;
      79                 :            : using namespace ::com::sun::star;
      80                 :            : using namespace ::svxform;
      81                 :            : using namespace ::svx;
      82                 :            : 
      83                 :            : 
      84                 :            : struct ColumnInfo
      85                 :            : {
      86                 :            :     ::rtl::OUString sColumnName;
      87                 :            :     ::rtl::OUString sLabel;
      88                 :            :     bool bColumn;
      89                 :          0 :     ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel)
      90                 :            :         : sColumnName(i_sColumnName)
      91                 :            :         , sLabel(i_sLabel)
      92                 :          0 :         , bColumn(true)
      93                 :            :     {
      94                 :          0 :     }
      95                 :            :     ColumnInfo(const ::rtl::OUString& i_sColumnName)
      96                 :            :         : sColumnName(i_sColumnName)
      97                 :            :         , bColumn(false)
      98                 :            :     {
      99                 :            :     }
     100                 :            : };
     101                 :            : 
     102                 :          0 : void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
     103                 :            : {
     104 [ #  # ][ #  # ]:          0 :     uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
     105                 :          0 :     const ::rtl::OUString* pEntries = aEntries.getConstArray();
     106                 :          0 :     sal_Int32 nEntries = aEntries.getLength();
     107         [ #  # ]:          0 :     for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
     108                 :            :     {
     109 [ #  # ][ #  # ]:          0 :         uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW);
                 [ #  # ]
     110                 :          0 :         ::rtl::OUString sLabel;
     111 [ #  # ][ #  # ]:          0 :         if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     112 [ #  # ][ #  # ]:          0 :             xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
                 [ #  # ]
     113         [ #  # ]:          0 :         if ( !sLabel.isEmpty() )
     114 [ #  # ][ #  # ]:          0 :             _rListBox.InsertEntry( sLabel,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
         [ #  # ][ #  # ]
     115                 :            :         else
     116 [ #  # ][ #  # ]:          0 :             _rListBox.InsertEntry( *pEntries,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
         [ #  # ][ #  # ]
     117         [ #  # ]:          0 :     }
     118                 :          0 : }
     119                 :            : //==================================================================
     120                 :            : // class FmFieldWinListBox
     121                 :            : //==================================================================
     122                 :            : DBG_NAME(FmFieldWinListBox)
     123                 :            : //------------------------------------------------------------------------------
     124                 :          0 : FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent )
     125                 :            :     :SvTreeListBox( pParent, WB_HASBUTTONS|WB_BORDER )
     126                 :          0 :     ,pTabWin( pParent )
     127                 :            : {
     128                 :            :     DBG_CTOR(FmFieldWinListBox,NULL);
     129         [ #  # ]:          0 :     SetHelpId( HID_FIELD_SEL );
     130                 :            : 
     131         [ #  # ]:          0 :     SetHighlightRange( );
     132                 :          0 : }
     133                 :            : 
     134                 :            : //------------------------------------------------------------------------------
     135                 :          0 : FmFieldWinListBox::~FmFieldWinListBox()
     136                 :            : {
     137                 :            :     DBG_DTOR(FmFieldWinListBox,NULL);
     138         [ #  # ]:          0 : }
     139                 :            : 
     140                 :            : //------------------------------------------------------------------------------
     141                 :          0 : sal_Int8 FmFieldWinListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
     142                 :            : {
     143                 :          0 :     return DND_ACTION_NONE;
     144                 :            : }
     145                 :            : 
     146                 :            : //------------------------------------------------------------------------------
     147                 :          0 : sal_Int8 FmFieldWinListBox::ExecuteDrop( const ExecuteDropEvent& /*rEvt*/ )
     148                 :            : {
     149                 :          0 :     return DND_ACTION_NONE;
     150                 :            : }
     151                 :            : 
     152                 :            : //------------------------------------------------------------------------------
     153                 :          0 : sal_Bool FmFieldWinListBox::DoubleClickHdl()
     154                 :            : {
     155         [ #  # ]:          0 :     if ( pTabWin->createSelectionControls() )
     156                 :          0 :         return sal_True;
     157                 :            : 
     158                 :          0 :     return SvTreeListBox::DoubleClickHdl();
     159                 :            : }
     160                 :            : 
     161                 :            : //------------------------------------------------------------------------------
     162                 :          0 : void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ )
     163                 :            : {
     164         [ #  # ]:          0 :     SvLBoxEntry* pSelected = FirstSelected();
     165         [ #  # ]:          0 :     if (!pSelected)
     166                 :            :         // no drag without a field
     167                 :          0 :         return;
     168                 :            : 
     169         [ #  # ]:          0 :     ::svx::ODataAccessDescriptor aDescriptor;
     170 [ #  # ][ #  # ]:          0 :     aDescriptor[ daDataSource ] <<= pTabWin->GetDatabaseName();
     171 [ #  # ][ #  # ]:          0 :     aDescriptor[ daConnection ] <<= pTabWin->GetConnection().getTyped();
         [ #  # ][ #  # ]
     172 [ #  # ][ #  # ]:          0 :     aDescriptor[ daCommand ]    <<= pTabWin->GetObjectName();
     173 [ #  # ][ #  # ]:          0 :     aDescriptor[ daCommandType ]<<= pTabWin->GetObjectType();
     174                 :          0 :     ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
     175 [ #  # ][ #  # ]:          0 :     aDescriptor[ daColumnName ] <<= pInfo->sColumnName;
     176                 :            : 
     177                 :            :     TransferableHelper* pTransferColumn = new OColumnTransferable(
     178                 :            :         aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR
     179         [ #  # ]:          0 :     );
     180 [ #  # ][ #  # ]:          0 :     Reference< XTransferable> xEnsureDelete = pTransferColumn;
     181         [ #  # ]:          0 :     if (pTransferColumn)
     182                 :            :     {
     183         [ #  # ]:          0 :         EndSelection();
     184         [ #  # ]:          0 :         pTransferColumn->StartDrag( this, DND_ACTION_COPY );
     185         [ #  # ]:          0 :     }
     186                 :            : }
     187                 :            : 
     188                 :            : //========================================================================
     189                 :            : // class FmFieldWinData
     190                 :            : //========================================================================
     191                 :            : DBG_NAME(FmFieldWinData);
     192                 :            : //-----------------------------------------------------------------------
     193                 :          0 : FmFieldWinData::FmFieldWinData()
     194                 :            : {
     195                 :            :     DBG_CTOR(FmFieldWinData,NULL);
     196                 :          0 : }
     197                 :            : 
     198                 :            : //-----------------------------------------------------------------------
     199                 :          0 : FmFieldWinData::~FmFieldWinData()
     200                 :            : {
     201                 :            :     DBG_DTOR(FmFieldWinData,NULL);
     202                 :          0 : }
     203                 :            : 
     204                 :            : //========================================================================
     205                 :            : // class FmFieldWin
     206                 :            : //========================================================================
     207                 :            : DBG_NAME(FmFieldWin);
     208                 :            : //-----------------------------------------------------------------------
     209                 :          0 : FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _pParent)
     210                 :            :             :SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE))
     211                 :            :             ,SfxControllerItem(SID_FM_FIELDS_CONTROL, *_pBindings)
     212                 :            :             ,::comphelper::OPropertyChangeListener(m_aMutex)
     213                 :          0 :             ,pData(new FmFieldWinData)
     214                 :            :             ,m_nObjectType(0)
     215 [ #  # ][ #  # ]:          0 :             ,m_pChangeListener(NULL)
                 [ #  # ]
           [ #  #  #  # ]
     216                 :            : {
     217                 :            :     DBG_CTOR(FmFieldWin,NULL);
     218         [ #  # ]:          0 :     SetHelpId( HID_FIELD_SEL_WIN );
     219                 :            : 
     220 [ #  # ][ #  # ]:          0 :     SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
         [ #  # ][ #  # ]
     221 [ #  # ][ #  # ]:          0 :     pListBox = new FmFieldWinListBox( this );
     222         [ #  # ]:          0 :     pListBox->Show();
     223         [ #  # ]:          0 :     UpdateContent(NULL);
     224         [ #  # ]:          0 :     SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
     225                 :          0 : }
     226                 :            : 
     227                 :            : //-----------------------------------------------------------------------
     228 [ #  # ][ #  # ]:          0 : FmFieldWin::~FmFieldWin()
         [ #  # ][ #  # ]
                 [ #  # ]
     229                 :            : {
     230         [ #  # ]:          0 :     if (m_pChangeListener)
     231                 :            :     {
     232         [ #  # ]:          0 :         m_pChangeListener->dispose();
     233                 :          0 :         m_pChangeListener->release();
     234                 :            :         //  delete m_pChangeListener;
     235                 :            :     }
     236 [ #  # ][ #  # ]:          0 :     delete pListBox;
     237         [ #  # ]:          0 :     delete pData;
     238                 :            :     DBG_DTOR(FmFieldWin,NULL);
     239         [ #  # ]:          0 : }
     240                 :            : 
     241                 :            : //-----------------------------------------------------------------------
     242                 :          0 : void FmFieldWin::GetFocus()
     243                 :            : {
     244         [ #  # ]:          0 :     if ( pListBox )
     245                 :          0 :         pListBox->GrabFocus();
     246                 :            :     else
     247                 :          0 :         SfxFloatingWindow::GetFocus();
     248                 :          0 : }
     249                 :            : 
     250                 :            : //-----------------------------------------------------------------------
     251                 :          0 : sal_Bool FmFieldWin::createSelectionControls( )
     252                 :            : {
     253                 :          0 :     SvLBoxEntry* pSelected = pListBox->FirstSelected();
     254         [ #  # ]:          0 :     if ( pSelected )
     255                 :            :     {
     256                 :            :         // build a descriptor for the currently selected field
     257         [ #  # ]:          0 :         ODataAccessDescriptor aDescr;
     258         [ #  # ]:          0 :         aDescr.setDataSource(GetDatabaseName());
     259                 :            : 
     260 [ #  # ][ #  # ]:          0 :         aDescr[ daConnection ]  <<= GetConnection().getTyped();
         [ #  # ][ #  # ]
     261                 :            : 
     262 [ #  # ][ #  # ]:          0 :         aDescr[ daCommand ]     <<= GetObjectName();
     263 [ #  # ][ #  # ]:          0 :         aDescr[ daCommandType ] <<= GetObjectType();
     264                 :          0 :         ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
     265 [ #  # ][ #  # ]:          0 :         aDescr[ daColumnName ]  <<= pInfo->sColumnName;//::rtl::OUString( pListBox->GetEntryText( pSelected) );
     266                 :            : 
     267                 :            :         // transfer this to the SFX world
     268 [ #  # ][ #  # ]:          0 :         SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) );
         [ #  # ][ #  # ]
     269                 :            :         const SfxPoolItem* pArgs[] =
     270                 :            :         {
     271                 :            :             &aDescriptorItem, NULL
     272                 :          0 :         };
     273                 :            : 
     274                 :            :         // execute the create slot
     275 [ #  # ][ #  # ]:          0 :         GetBindings().Execute( SID_FM_CREATE_FIELDCONTROL, pArgs );
                 [ #  # ]
     276                 :            :     }
     277                 :            : 
     278                 :          0 :     return NULL != pSelected;
     279                 :            : }
     280                 :            : 
     281                 :            : //-----------------------------------------------------------------------
     282                 :          0 : long FmFieldWin::PreNotify( NotifyEvent& _rNEvt )
     283                 :            : {
     284         [ #  # ]:          0 :     if ( EVENT_KEYINPUT == _rNEvt.GetType() )
     285                 :            :     {
     286                 :          0 :         const KeyCode& rKeyCode = _rNEvt.GetKeyEvent()->GetKeyCode();
     287 [ #  # ][ #  # ]:          0 :         if ( ( 0 == rKeyCode.GetModifier() ) && ( KEY_RETURN == rKeyCode.GetCode() ) )
                 [ #  # ]
     288                 :            :         {
     289         [ #  # ]:          0 :             if ( createSelectionControls() )
     290                 :          0 :                 return 1;
     291                 :            :         }
     292                 :            :     }
     293                 :            : 
     294                 :          0 :     return SfxFloatingWindow::PreNotify( _rNEvt );
     295                 :            : }
     296                 :            : 
     297                 :            : //-----------------------------------------------------------------------
     298                 :          0 : sal_Bool FmFieldWin::Close()
     299                 :            : {
     300                 :          0 :     return SfxFloatingWindow::Close();
     301                 :            : }
     302                 :            : 
     303                 :            : //-----------------------------------------------------------------------
     304                 :          0 : void FmFieldWin::_propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException )
     305                 :            : {
     306         [ #  # ]:          0 :     ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >  xForm(evt.Source, ::com::sun::star::uno::UNO_QUERY);
     307         [ #  # ]:          0 :     UpdateContent(xForm);
     308                 :          0 : }
     309                 :            : 
     310                 :            : //-----------------------------------------------------------------------
     311                 :          0 : void FmFieldWin::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
     312                 :            : {
     313 [ #  # ][ #  # ]:          0 :     if (!pState  || SID_FM_FIELDS_CONTROL != nSID)
     314                 :          0 :         return;
     315                 :            : 
     316         [ #  # ]:          0 :     if (eState >= SFX_ITEM_AVAILABLE)
     317                 :            :     {
     318 [ #  # ][ #  # ]:          0 :         FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell());
     319                 :          0 :         UpdateContent(pShell);
     320                 :            :     }
     321                 :            :     else
     322                 :          0 :         UpdateContent(NULL);
     323                 :            : }
     324                 :            : 
     325                 :            : //-----------------------------------------------------------------------
     326                 :          0 : void FmFieldWin::UpdateContent(FmFormShell* pShell)
     327                 :            : {
     328         [ #  # ]:          0 :     pListBox->Clear();
     329 [ #  # ][ #  # ]:          0 :     String aTitle( SVX_RES( RID_STR_FIELDSELECTION ) );
     330         [ #  # ]:          0 :     SetText( aTitle );
     331                 :            : 
     332 [ #  # ][ #  # ]:          0 :     if (!pShell || !pShell->GetImpl())
                 [ #  # ]
     333                 :          0 :         return;
     334                 :            : 
     335         [ #  # ]:          0 :     Reference< XForm >  xForm = pShell->GetImpl()->getCurrentForm();
     336         [ #  # ]:          0 :     if ( xForm.is() )
     337 [ #  # ][ #  # ]:          0 :         UpdateContent( xForm );
                 [ #  # ]
     338                 :            : }
     339                 :            : 
     340                 :            : //-----------------------------------------------------------------------
     341                 :          0 : void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > & xForm)
     342                 :            : {
     343                 :            :     try
     344                 :            :     {
     345                 :            :         // ListBox loeschen
     346         [ #  # ]:          0 :         pListBox->Clear();
     347 [ #  # ][ #  # ]:          0 :         UniString aTitle(SVX_RES(RID_STR_FIELDSELECTION));
     348         [ #  # ]:          0 :         SetText(aTitle);
     349                 :            : 
     350         [ #  # ]:          0 :         if (!xForm.is())
     351                 :          0 :             return;
     352                 :            : 
     353                 :          0 :         Reference< XPreparedStatement >  xStatement;
     354         [ #  # ]:          0 :         Reference< XPropertySet >  xSet(xForm, UNO_QUERY);
     355                 :            : 
     356 [ #  # ][ #  # ]:          0 :         m_aObjectName   = ::comphelper::getString(xSet->getPropertyValue(FM_PROP_COMMAND));
         [ #  # ][ #  # ]
     357 [ #  # ][ #  # ]:          0 :         m_aDatabaseName = ::comphelper::getString(xSet->getPropertyValue(FM_PROP_DATASOURCE));
         [ #  # ][ #  # ]
     358 [ #  # ][ #  # ]:          0 :         m_nObjectType   = ::comphelper::getINT32(xSet->getPropertyValue(FM_PROP_COMMANDTYPE));
         [ #  # ][ #  # ]
     359                 :            : 
     360                 :            :         // get the connection of the form
     361         [ #  # ]:          0 :         OStaticDataAccessTools aTools;
     362                 :            :         m_aConnection.reset(
     363                 :            :             aTools.connectRowset( Reference< XRowSet >( xForm, UNO_QUERY ), ::comphelper::getProcessServiceFactory(), sal_True ),
     364                 :            :             SharedConnection::NoTakeOwnership
     365 [ #  # ][ #  # ]:          0 :         );
         [ #  # ][ #  # ]
     366                 :            :         // TODO: When incompatible changes (such as extending the "virtualdbtools" interface by ensureRowSetConnection)
     367                 :            :         // are allowed, again, we should change this: dbtools should consistently use SharedConnection all over
     368                 :            :         // the place, and connectRowset should be replaced with ensureRowSetConnection
     369                 :            : 
     370                 :            :         // get the fields of the object
     371                 :            : 
     372 [ #  # ][ #  # ]:          0 :         if ( m_aConnection.is() && !m_aObjectName.isEmpty() )
                 [ #  # ]
     373                 :            :         {
     374                 :          0 :             Reference< XComponent > xKeepFieldsAlive;
     375         [ #  # ]:          0 :             Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive );
     376         [ #  # ]:          0 :             if ( xColumns.is() )
     377         [ #  # ]:          0 :                 lcl_addToList(*pListBox,xColumns);
     378                 :            :         }
     379                 :            : 
     380                 :            :         // Prefix setzen
     381         [ #  # ]:          0 :         UniString  aPrefix;
     382 [ #  # ][ #  # ]:          0 :         StringListResource aPrefixes( SVX_RES( RID_RSC_TABWIN_PREFIX ) );
     383                 :            : 
     384      [ #  #  # ]:          0 :         switch (m_nObjectType)
     385                 :            :         {
     386                 :            :             case CommandType::TABLE:
     387 [ #  # ][ #  # ]:          0 :                 aPrefix = aPrefixes[0];
     388                 :          0 :                 break;
     389                 :            :             case CommandType::QUERY:
     390 [ #  # ][ #  # ]:          0 :                 aPrefix = aPrefixes[1];
     391                 :          0 :                 break;
     392                 :            :             default:
     393 [ #  # ][ #  # ]:          0 :                 aPrefix = aPrefixes[2];
     394                 :          0 :                 break;
     395                 :            :         }
     396                 :            : 
     397                 :            :         // an dem PropertySet nach Aenderungen der ControlSource lauschen
     398         [ #  # ]:          0 :         if (m_pChangeListener)
     399                 :            :         {
     400         [ #  # ]:          0 :             m_pChangeListener->dispose();
     401                 :          0 :             m_pChangeListener->release();
     402                 :            :         }
     403         [ #  # ]:          0 :         m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer(this, xSet);
     404                 :          0 :         m_pChangeListener->acquire();
     405 [ #  # ][ #  # ]:          0 :         m_pChangeListener->addProperty(FM_PROP_DATASOURCE);
     406 [ #  # ][ #  # ]:          0 :         m_pChangeListener->addProperty(FM_PROP_COMMAND);
     407 [ #  # ][ #  # ]:          0 :         m_pChangeListener->addProperty(FM_PROP_COMMANDTYPE);
     408                 :            : 
     409                 :            :         // Titel setzen
     410         [ #  # ]:          0 :         aTitle.AppendAscii(" ");
     411         [ #  # ]:          0 :         aTitle += aPrefix;
     412         [ #  # ]:          0 :         aTitle.AppendAscii(" ");
     413         [ #  # ]:          0 :         aTitle += m_aObjectName.getStr();
     414 [ #  # ][ #  # ]:          0 :         SetText( aTitle );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     415                 :            :     }
     416                 :          0 :     catch( const Exception& )
     417                 :            :     {
     418                 :            :         OSL_FAIL( "FmTabWin::UpdateContent: caught an exception!" );
     419                 :            :     }
     420                 :            : }
     421                 :            : 
     422                 :            : //-----------------------------------------------------------------------
     423                 :          0 : void FmFieldWin::Resize()
     424                 :            : {
     425         [ #  # ]:          0 :     SfxFloatingWindow::Resize();
     426                 :            : 
     427                 :          0 :     Size aOutputSize( GetOutputSizePixel() );
     428                 :            : 
     429                 :            :     //////////////////////////////////////////////////////////////////////
     430                 :            : 
     431                 :            :     // Groesse der ::com::sun::star::form::ListBox anpassen
     432                 :          0 :     Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER );
     433                 :          0 :     Size aLBSize( aOutputSize );
     434                 :          0 :     aLBSize.Width() -= (2*LISTBOX_BORDER);
     435                 :          0 :     aLBSize.Height() -= (2*LISTBOX_BORDER);
     436                 :            : 
     437         [ #  # ]:          0 :     pListBox->SetPosSizePixel( aLBPos, aLBSize );
     438                 :          0 : }
     439                 :            : 
     440                 :            : //-----------------------------------------------------------------------
     441                 :          0 : void FmFieldWin::FillInfo( SfxChildWinInfo& rInfo ) const
     442                 :            : {
     443                 :          0 :     rInfo.bVisible = sal_False;
     444                 :          0 : }
     445                 :            : 
     446                 :            : //-----------------------------------------------------------------------
     447 [ #  # ][ +  - ]:        135 : SFX_IMPL_FLOATINGWINDOW(FmFieldWinMgr, SID_FM_ADD_FIELD)
                 [ #  # ]
     448                 :            : 
     449                 :            : //-----------------------------------------------------------------------
     450                 :          0 : FmFieldWinMgr::FmFieldWinMgr(Window* _pParent, sal_uInt16 _nId,
     451                 :            :                SfxBindings* _pBindings, SfxChildWinInfo* _pInfo)
     452                 :          0 :               :SfxChildWindow(_pParent, _nId)
     453                 :            : {
     454 [ #  # ][ #  # ]:          0 :     pWindow = new FmFieldWin(_pBindings, this, _pParent);
     455         [ #  # ]:          0 :     SetHideNotDelete(sal_True);
     456                 :          0 :     eChildAlignment = SFX_ALIGN_NOALIGNMENT;
     457         [ #  # ]:          0 :     ((SfxFloatingWindow*)pWindow)->Initialize( _pInfo );
     458                 :          0 : }
     459                 :            : 
     460                 :            : 
     461                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10