LCOV - code coverage report
Current view: top level - cui/source/tabpages - connect.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 259 0.0 %
Date: 2012-08-25 Functions: 0 15 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 328 0.0 %

           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                 :            : #include <sfx2/app.hxx>
      30                 :            : #include <sfx2/module.hxx>
      31                 :            : #include <tools/shl.hxx>
      32                 :            : #include "svx/ofaitem.hxx"
      33                 :            : #include <sfx2/request.hxx>
      34                 :            : #include <svx/dialogs.hrc>
      35                 :            : 
      36                 :            : #define _SVX_CONNECT_CXX
      37                 :            : 
      38                 :            : #include <svx/svdoedge.hxx>
      39                 :            : #include <svx/svdattr.hxx>
      40                 :            : #include <svx/svdattrx.hxx>
      41                 :            : #include <svx/svdview.hxx>
      42                 :            : 
      43                 :            : #include "svx/connctrl.hxx"
      44                 :            : #include "connect.hxx"
      45                 :            : #include "connect.hrc"
      46                 :            : #include <dialmgr.hxx>
      47                 :            : #include "svx/dlgutil.hxx"
      48                 :            : 
      49                 :            : #include "paragrph.hrc"
      50                 :            : #include <cuires.hrc>
      51                 :            : 
      52                 :            : static sal_uInt16 pRanges[] =
      53                 :            : {
      54                 :            :     SDRATTR_EDGE_FIRST,
      55                 :            :     SDRATTR_EDGE_LAST,
      56                 :            :     0
      57                 :            : };
      58                 :            : 
      59                 :            : /*************************************************************************
      60                 :            : |*
      61                 :            : |* dialog for changing connectors
      62                 :            : |*
      63                 :            : \************************************************************************/
      64                 :            : 
      65                 :          0 : SvxConnectionDialog::SvxConnectionDialog( Window* pParent, const SfxItemSet& rInAttrs,
      66                 :            :                                 const SdrView* pSdrView ) :
      67                 :          0 :         SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_CONNECTION )
      68                 :            : {
      69 [ #  # ][ #  # ]:          0 :     SvxConnectionPage* _pPage = new SvxConnectionPage( this, rInAttrs );
      70                 :            : 
      71                 :          0 :     _pPage->SetView( pSdrView );
      72         [ #  # ]:          0 :     _pPage->Construct();
      73                 :            : 
      74         [ #  # ]:          0 :     SetTabPage( _pPage );
      75 [ #  # ][ #  # ]:          0 :     SetText( _pPage->GetText() );
                 [ #  # ]
      76                 :          0 : }
      77                 :            : 
      78                 :            : /*************************************************************************
      79                 :            : |*
      80                 :            : |* Dtor
      81                 :            : |*
      82                 :            : \************************************************************************/
      83                 :            : 
      84                 :          0 : SvxConnectionDialog::~SvxConnectionDialog()
      85                 :            : {
      86         [ #  # ]:          0 : }
      87                 :            : 
      88                 :            : /*************************************************************************
      89                 :            : |*
      90                 :            : |* page for changing connectors
      91                 :            : |*
      92                 :            : \************************************************************************/
      93                 :            : 
      94                 :          0 : SvxConnectionPage::SvxConnectionPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
      95                 :          0 :                 SfxTabPage      ( pWindow, CUI_RES( RID_SVXPAGE_CONNECTION ),
      96                 :            :                                   rInAttrs ),
      97                 :            : 
      98         [ #  # ]:          0 :         aFtType                 ( this, CUI_RES( FT_TYPE ) ),
      99         [ #  # ]:          0 :         aLbType                 ( this, CUI_RES( LB_TYPE ) ),
     100                 :            : 
     101         [ #  # ]:          0 :         aFlDelta                ( this, CUI_RES( FL_DELTA ) ),
     102         [ #  # ]:          0 :         aFtLine1                ( this, CUI_RES( FT_LINE_1 ) ),
     103         [ #  # ]:          0 :         aMtrFldLine1            ( this, CUI_RES( MTR_FLD_LINE_1 ) ),
     104         [ #  # ]:          0 :         aFtLine2                ( this, CUI_RES( FT_LINE_2 ) ),
     105         [ #  # ]:          0 :         aMtrFldLine2            ( this, CUI_RES( MTR_FLD_LINE_2 ) ),
     106         [ #  # ]:          0 :         aFtLine3                ( this, CUI_RES( FT_LINE_3 ) ),
     107         [ #  # ]:          0 :         aMtrFldLine3            ( this, CUI_RES( MTR_FLD_LINE_3 ) ),
     108                 :            : 
     109         [ #  # ]:          0 :         aFlDistance             ( this, CUI_RES( FL_DISTANCE ) ),
     110         [ #  # ]:          0 :         aFtHorz1                ( this, CUI_RES( FT_HORZ_1 ) ),
     111         [ #  # ]:          0 :         aMtrFldHorz1            ( this, CUI_RES( MTR_FLD_HORZ_1 ) ),
     112         [ #  # ]:          0 :         aFtVert1                ( this, CUI_RES( FT_VERT_1 ) ),
     113         [ #  # ]:          0 :         aMtrFldVert1            ( this, CUI_RES( MTR_FLD_VERT_1 ) ),
     114         [ #  # ]:          0 :         aFtHorz2                ( this, CUI_RES( FT_HORZ_2 ) ),
     115         [ #  # ]:          0 :         aMtrFldHorz2            ( this, CUI_RES( MTR_FLD_HORZ_2 ) ),
     116         [ #  # ]:          0 :         aFtVert2                ( this, CUI_RES( FT_VERT_2 ) ),
     117         [ #  # ]:          0 :         aMtrFldVert2            ( this, CUI_RES( MTR_FLD_VERT_2 ) ),
     118                 :            : 
     119         [ #  # ]:          0 :         aCtlPreview             ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ),
     120                 :            :         rOutAttrs               ( rInAttrs ),
     121 [ #  # ][ #  # ]:          0 :         aAttrSet                ( *rInAttrs.GetPool() )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     122                 :            : {
     123         [ #  # ]:          0 :     FreeResource();
     124                 :            : 
     125 [ #  # ][ #  # ]:          0 :     aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
         [ #  # ][ #  # ]
     126                 :            : 
     127                 :          0 :     SfxItemPool* pPool = rOutAttrs.GetPool();
     128                 :            :     DBG_ASSERT( pPool, "Wo ist der Pool" );
     129         [ #  # ]:          0 :     eUnit = pPool->GetMetric( SDRATTR_EDGENODE1HORZDIST );
     130                 :            : 
     131         [ #  # ]:          0 :     FillTypeLB();
     132                 :            : 
     133         [ #  # ]:          0 :     const FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs );
     134         [ #  # ]:          0 :     SetFieldUnit( aMtrFldHorz1, eFUnit );
     135         [ #  # ]:          0 :     SetFieldUnit( aMtrFldHorz2, eFUnit );
     136         [ #  # ]:          0 :     SetFieldUnit( aMtrFldVert1, eFUnit );
     137         [ #  # ]:          0 :     SetFieldUnit( aMtrFldVert2, eFUnit );
     138         [ #  # ]:          0 :     SetFieldUnit( aMtrFldLine1, eFUnit );
     139         [ #  # ]:          0 :     SetFieldUnit( aMtrFldLine2, eFUnit );
     140         [ #  # ]:          0 :     SetFieldUnit( aMtrFldLine3, eFUnit );
     141         [ #  # ]:          0 :     if( eFUnit == FUNIT_MM )
     142                 :            :     {
     143                 :          0 :         aMtrFldHorz1.SetSpinSize( 50 );
     144                 :          0 :         aMtrFldHorz2.SetSpinSize( 50 );
     145                 :          0 :         aMtrFldVert1.SetSpinSize( 50 );
     146                 :          0 :         aMtrFldVert2.SetSpinSize( 50 );
     147                 :          0 :         aMtrFldLine1.SetSpinSize( 50 );
     148                 :          0 :         aMtrFldLine2.SetSpinSize( 50 );
     149                 :          0 :         aMtrFldLine3.SetSpinSize( 50 );
     150                 :            :     }
     151                 :            : 
     152                 :            :     // disable 3D border
     153         [ #  # ]:          0 :     aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO);
     154                 :            : 
     155         [ #  # ]:          0 :     Link aLink( LINK( this, SvxConnectionPage, ChangeAttrHdl_Impl ) );
     156                 :          0 :     aMtrFldHorz1.SetModifyHdl( aLink );
     157                 :          0 :     aMtrFldVert1.SetModifyHdl( aLink );
     158                 :          0 :     aMtrFldHorz2.SetModifyHdl( aLink );
     159                 :          0 :     aMtrFldVert2.SetModifyHdl( aLink );
     160                 :          0 :     aMtrFldLine1.SetModifyHdl( aLink );
     161                 :          0 :     aMtrFldLine2.SetModifyHdl( aLink );
     162                 :          0 :     aMtrFldLine3.SetModifyHdl( aLink );
     163                 :          0 :     aLbType.SetSelectHdl( aLink );
     164                 :          0 : }
     165                 :            : 
     166                 :            : /*************************************************************************
     167                 :            : |*
     168                 :            : |* Dtor
     169                 :            : |*
     170                 :            : \************************************************************************/
     171                 :            : 
     172 [ #  # ][ #  # ]:          0 : SvxConnectionPage::~SvxConnectionPage()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     173                 :            : {
     174         [ #  # ]:          0 : }
     175                 :            : 
     176                 :            : /*************************************************************************
     177                 :            : |*
     178                 :            : |* reads passed Item-Set
     179                 :            : |*
     180                 :            : \************************************************************************/
     181                 :            : 
     182                 :          0 : void SvxConnectionPage::Reset( const SfxItemSet& rAttrs )
     183                 :            : {
     184                 :          0 :     const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_EDGENODE1HORZDIST );
     185                 :          0 :     const SfxItemPool* pPool = rAttrs.GetPool();
     186                 :            : 
     187                 :            :     // SdrEdgeNode1HorzDistItem
     188         [ #  # ]:          0 :     if( !pItem )
     189                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1HORZDIST );
     190         [ #  # ]:          0 :     if( pItem )
     191                 :            :     {
     192                 :          0 :         long nValue = ( ( const SdrEdgeNode1HorzDistItem* )pItem )->GetValue();
     193                 :          0 :         SetMetricValue( aMtrFldHorz1, nValue, eUnit );
     194                 :            :     }
     195                 :            :     else
     196                 :          0 :         aMtrFldHorz1.SetEmptyFieldValue();
     197                 :            : 
     198                 :          0 :     aMtrFldHorz1.SaveValue();
     199                 :            : 
     200                 :            :     // SdrEdgeNode2HorzDistItem
     201                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGENODE2HORZDIST );
     202         [ #  # ]:          0 :     if( !pItem )
     203                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2HORZDIST );
     204         [ #  # ]:          0 :     if( pItem )
     205                 :            :     {
     206                 :          0 :         long nValue = ( ( const SdrEdgeNode2HorzDistItem* )pItem )->GetValue();
     207                 :          0 :         SetMetricValue( aMtrFldHorz2, nValue, eUnit );
     208                 :            :     }
     209                 :            :     else
     210                 :          0 :         aMtrFldHorz2.SetEmptyFieldValue();
     211                 :            : 
     212                 :          0 :     aMtrFldHorz2.SaveValue();
     213                 :            : 
     214                 :            :     // SdrEdgeNode1VertDistItem
     215                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGENODE1VERTDIST );
     216         [ #  # ]:          0 :     if( !pItem )
     217                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1VERTDIST );
     218         [ #  # ]:          0 :     if( pItem )
     219                 :            :     {
     220                 :          0 :         long nValue = ( ( const SdrEdgeNode1VertDistItem* )pItem )->GetValue();
     221                 :          0 :         SetMetricValue( aMtrFldVert1, nValue, eUnit );
     222                 :            :     }
     223                 :            :     else
     224                 :          0 :         aMtrFldVert1.SetEmptyFieldValue();
     225                 :            : 
     226                 :          0 :     aMtrFldVert1.SaveValue();
     227                 :            : 
     228                 :            :     // SdrEdgeNode2VertDistItem
     229                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGENODE2VERTDIST );
     230         [ #  # ]:          0 :     if( !pItem )
     231                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2VERTDIST );
     232         [ #  # ]:          0 :     if( pItem )
     233                 :            :     {
     234                 :          0 :         long nValue = ( ( const SdrEdgeNode2VertDistItem* )pItem )->GetValue();
     235                 :          0 :         SetMetricValue( aMtrFldVert2, nValue, eUnit );
     236                 :            :     }
     237                 :            :     else
     238                 :          0 :         aMtrFldVert2.SetEmptyFieldValue();
     239                 :            : 
     240                 :          0 :     aMtrFldVert2.SaveValue();
     241                 :            : 
     242                 :            :     // SdrEdgeLine1DeltaItem
     243                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGELINE1DELTA );
     244         [ #  # ]:          0 :     if( !pItem )
     245                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE1DELTA );
     246         [ #  # ]:          0 :     if( pItem )
     247                 :            :     {
     248                 :          0 :         long nValue = ( ( const SdrEdgeLine1DeltaItem* )pItem )->GetValue();
     249                 :          0 :         SetMetricValue( aMtrFldLine1, nValue, eUnit );
     250                 :            :     }
     251                 :            :     else
     252                 :          0 :         aMtrFldLine1.SetEmptyFieldValue();
     253                 :            : 
     254                 :          0 :     aMtrFldLine1.SaveValue();
     255                 :            : 
     256                 :            :     // SdrEdgeLine2DeltaItem
     257                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGELINE2DELTA );
     258         [ #  # ]:          0 :     if( !pItem )
     259                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE2DELTA );
     260         [ #  # ]:          0 :     if( pItem )
     261                 :            :     {
     262                 :          0 :         long nValue = ( ( const SdrEdgeLine2DeltaItem* )pItem )->GetValue();
     263                 :          0 :         SetMetricValue( aMtrFldLine2, nValue, eUnit );
     264                 :            :     }
     265                 :            :     else
     266                 :          0 :         aMtrFldLine2.SetEmptyFieldValue();
     267                 :            : 
     268                 :          0 :     aMtrFldLine2.SaveValue();
     269                 :            : 
     270                 :            :     // SdrEdgeLine3DeltaItem
     271                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGELINE3DELTA );
     272         [ #  # ]:          0 :     if( !pItem )
     273                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE3DELTA );
     274         [ #  # ]:          0 :     if( pItem )
     275                 :            :     {
     276                 :          0 :         long nValue = ( ( const SdrEdgeLine3DeltaItem* )pItem )->GetValue();
     277                 :          0 :         SetMetricValue( aMtrFldLine3, nValue, eUnit );
     278                 :            :     }
     279                 :            :     else
     280                 :          0 :         aMtrFldLine3.SetEmptyFieldValue();
     281                 :            : 
     282                 :          0 :     aMtrFldLine3.SaveValue();
     283                 :            : 
     284                 :            :     // SdrEdgeLineDeltaAnzItem
     285                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGELINEDELTAANZ );
     286         [ #  # ]:          0 :     if( !pItem )
     287                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTAANZ );
     288         [ #  # ]:          0 :     if( pItem )
     289                 :            :     {
     290                 :          0 :         sal_uInt16 nValue = ( ( const SdrEdgeLineDeltaAnzItem* )pItem )->GetValue();
     291         [ #  # ]:          0 :         if( nValue <= 2 )
     292                 :            :         {
     293                 :          0 :             aFtLine3.Enable( sal_False );
     294                 :          0 :             aMtrFldLine3.Enable( sal_False );
     295                 :          0 :             aMtrFldLine3.SetEmptyFieldValue();
     296                 :            :         }
     297         [ #  # ]:          0 :         if( nValue <= 1 )
     298                 :            :         {
     299                 :          0 :             aFtLine2.Enable( sal_False );
     300                 :          0 :             aMtrFldLine2.Enable( sal_False );
     301                 :          0 :             aMtrFldLine2.SetEmptyFieldValue();
     302                 :            :         }
     303         [ #  # ]:          0 :         if( nValue == 0 )
     304                 :            :         {
     305                 :          0 :             aFtLine1.Enable( sal_False );
     306                 :          0 :             aMtrFldLine1.Enable( sal_False );
     307                 :          0 :             aMtrFldLine1.SetEmptyFieldValue();
     308                 :            :         }
     309                 :            :     }
     310                 :            : 
     311                 :            :     // SdrEdgeKindItem
     312                 :          0 :     pItem = GetItem( rAttrs, SDRATTR_EDGEKIND );
     313         [ #  # ]:          0 :     if( !pItem )
     314                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
     315         [ #  # ]:          0 :     if( pItem )
     316                 :            :     {
     317                 :          0 :         SdrEdgeKind nValue = ( ( const SdrEdgeKindItem* )pItem )->GetValue();
     318                 :          0 :         aLbType.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(nValue) );
     319                 :            :     }
     320                 :            :     else
     321                 :          0 :         aLbType.SetNoSelection();
     322                 :          0 :     aLbType.SaveValue();
     323                 :          0 : }
     324                 :            : 
     325                 :            : /*************************************************************************
     326                 :            : |*
     327                 :            : |* fills the passed Item-Set width Dialogbox attributes
     328                 :            : |*
     329                 :            : \************************************************************************/
     330                 :            : 
     331                 :          0 : sal_Bool SvxConnectionPage::FillItemSet( SfxItemSet& rAttrs)
     332                 :            : {
     333                 :          0 :     sal_Bool     bModified = sal_False;
     334                 :            :     sal_Int32    nValue;
     335                 :            : 
     336 [ #  # ][ #  # ]:          0 :     if( aMtrFldHorz1.GetText() != aMtrFldHorz1.GetSavedValue() )
     337                 :            :     {
     338                 :          0 :         nValue = GetCoreValue( aMtrFldHorz1, eUnit );
     339         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeNode1HorzDistItem( nValue ) );
     340                 :          0 :         bModified = sal_True;
     341                 :            :     }
     342                 :            : 
     343 [ #  # ][ #  # ]:          0 :     if( aMtrFldHorz2.GetText() != aMtrFldHorz2.GetSavedValue() )
     344                 :            :     {
     345                 :          0 :         nValue = GetCoreValue( aMtrFldHorz2, eUnit );
     346         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeNode2HorzDistItem( nValue ) );
     347                 :          0 :         bModified = sal_True;
     348                 :            :     }
     349                 :            : 
     350 [ #  # ][ #  # ]:          0 :     if( aMtrFldVert1.GetText() != aMtrFldVert1.GetSavedValue() )
     351                 :            :     {
     352                 :          0 :         nValue = GetCoreValue( aMtrFldVert1, eUnit );
     353         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeNode1VertDistItem( nValue ) );
     354                 :          0 :         bModified = sal_True;
     355                 :            :     }
     356                 :            : 
     357 [ #  # ][ #  # ]:          0 :     if( aMtrFldVert2.GetText() != aMtrFldVert2.GetSavedValue() )
     358                 :            :     {
     359                 :          0 :         nValue = GetCoreValue( aMtrFldVert2, eUnit );
     360         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeNode2VertDistItem( nValue ) );
     361                 :          0 :         bModified = sal_True;
     362                 :            :     }
     363                 :            : 
     364 [ #  # ][ #  # ]:          0 :     if( aMtrFldLine1.GetText() != aMtrFldLine1.GetSavedValue() )
     365                 :            :     {
     366                 :          0 :         nValue = GetCoreValue( aMtrFldLine1, eUnit );
     367         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeLine1DeltaItem( nValue ) );
     368                 :          0 :         bModified = sal_True;
     369                 :            :     }
     370                 :            : 
     371 [ #  # ][ #  # ]:          0 :     if( aMtrFldLine2.GetText() != aMtrFldLine2.GetSavedValue() )
     372                 :            :     {
     373                 :          0 :         nValue = GetCoreValue( aMtrFldLine2, eUnit );
     374         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeLine2DeltaItem( nValue ) );
     375                 :          0 :         bModified = sal_True;
     376                 :            :     }
     377                 :            : 
     378 [ #  # ][ #  # ]:          0 :     if( aMtrFldLine3.GetText() != aMtrFldLine3.GetSavedValue() )
     379                 :            :     {
     380                 :          0 :         nValue = GetCoreValue( aMtrFldLine3, eUnit );
     381         [ #  # ]:          0 :         rAttrs.Put( SdrEdgeLine3DeltaItem( nValue ) );
     382                 :          0 :         bModified = sal_True;
     383                 :            :     }
     384                 :            : 
     385                 :            : 
     386                 :          0 :     sal_uInt16 nPos = aLbType.GetSelectEntryPos();
     387         [ #  # ]:          0 :     if( nPos != aLbType.GetSavedValue() )
     388                 :            :     {
     389         [ #  # ]:          0 :         if( nPos != LISTBOX_ENTRY_NOTFOUND )
     390                 :            :         {
     391         [ #  # ]:          0 :             rAttrs.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) );
     392                 :          0 :             bModified = sal_True;
     393                 :            :         }
     394                 :            :     }
     395                 :            : 
     396                 :          0 :     return( bModified );
     397                 :            : }
     398                 :            : 
     399                 :          0 : void SvxConnectionPage::Construct()
     400                 :            : {
     401                 :            :     DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
     402                 :            : 
     403                 :          0 :     aCtlPreview.SetView( pView );
     404                 :          0 :     aCtlPreview.Construct();
     405                 :          0 : }
     406                 :            : 
     407                 :            : /*************************************************************************
     408                 :            : |*
     409                 :            : |* creates the page
     410                 :            : |*
     411                 :            : \************************************************************************/
     412                 :            : 
     413                 :          0 : SfxTabPage* SvxConnectionPage::Create( Window* pWindow,
     414                 :            :                 const SfxItemSet& rAttrs )
     415                 :            : {
     416         [ #  # ]:          0 :     return( new SvxConnectionPage( pWindow, rAttrs ) );
     417                 :            : }
     418                 :            : 
     419                 :          0 : sal_uInt16* SvxConnectionPage::GetRanges()
     420                 :            : {
     421                 :          0 :     return( pRanges );
     422                 :            : }
     423                 :            : 
     424                 :          0 : IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p )
     425                 :            : {
     426         [ #  # ]:          0 :     if( p == &aMtrFldHorz1 )
     427                 :            :     {
     428                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldHorz1, eUnit );
     429         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeNode1HorzDistItem( nValue ) );
     430                 :            :     }
     431                 :            : 
     432         [ #  # ]:          0 :     if( p == &aMtrFldHorz2 )
     433                 :            :     {
     434                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldHorz2, eUnit );
     435         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeNode2HorzDistItem( nValue ) );
     436                 :            :     }
     437                 :            : 
     438         [ #  # ]:          0 :     if( p == &aMtrFldVert1 )
     439                 :            :     {
     440                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldVert1, eUnit );
     441         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeNode1VertDistItem( nValue ) );
     442                 :            :     }
     443                 :            : 
     444         [ #  # ]:          0 :     if( p == &aMtrFldVert2 )
     445                 :            :     {
     446                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldVert2, eUnit );
     447         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeNode2VertDistItem( nValue ) );
     448                 :            :     }
     449                 :            : 
     450         [ #  # ]:          0 :     if( p == &aMtrFldLine1 )
     451                 :            :     {
     452                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldLine1, eUnit );
     453         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeLine1DeltaItem( nValue ) );
     454                 :            :     }
     455                 :            : 
     456         [ #  # ]:          0 :     if( p == &aMtrFldLine2 )
     457                 :            :     {
     458                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldLine2, eUnit );
     459         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeLine2DeltaItem( nValue ) );
     460                 :            :     }
     461                 :            : 
     462         [ #  # ]:          0 :     if( p == &aMtrFldLine3 )
     463                 :            :     {
     464                 :          0 :         sal_Int32 nValue = GetCoreValue( aMtrFldLine3, eUnit );
     465         [ #  # ]:          0 :         aAttrSet.Put( SdrEdgeLine3DeltaItem( nValue ) );
     466                 :            :     }
     467                 :            : 
     468                 :            : 
     469         [ #  # ]:          0 :     if( p == &aLbType )
     470                 :            :     {
     471                 :          0 :         sal_uInt16 nPos = aLbType.GetSelectEntryPos();
     472         [ #  # ]:          0 :         if( nPos != LISTBOX_ENTRY_NOTFOUND )
     473                 :            :         {
     474         [ #  # ]:          0 :             aAttrSet.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) );
     475                 :            :         }
     476                 :            :     }
     477                 :            : 
     478                 :          0 :     aCtlPreview.SetAttributes( aAttrSet );
     479                 :            : 
     480         [ #  # ]:          0 :     if( p == &aLbType )
     481                 :            :     {
     482                 :            :         // get the number of line displacements
     483                 :          0 :         sal_uInt16 nCount = aCtlPreview.GetLineDeltaAnz();
     484                 :            : 
     485                 :          0 :         aFtLine3.Enable( nCount > 2 );
     486                 :          0 :         aMtrFldLine3.Enable( nCount > 2 );
     487         [ #  # ]:          0 :         if( nCount > 2 )
     488                 :          0 :             aMtrFldLine3.SetValue( aMtrFldLine3.GetValue() );
     489                 :            :         else
     490                 :          0 :             aMtrFldLine3.SetEmptyFieldValue();
     491                 :            : 
     492                 :          0 :         aFtLine2.Enable( nCount > 1 );
     493                 :          0 :         aMtrFldLine2.Enable( nCount > 1 );
     494         [ #  # ]:          0 :         if( nCount > 1 )
     495                 :          0 :             aMtrFldLine2.SetValue( aMtrFldLine2.GetValue() );
     496                 :            :         else
     497                 :          0 :             aMtrFldLine2.SetEmptyFieldValue();
     498                 :            : 
     499                 :          0 :         aFtLine1.Enable( nCount > 0 );
     500                 :          0 :         aMtrFldLine1.Enable( nCount > 0 );
     501         [ #  # ]:          0 :         if( nCount > 0 )
     502                 :          0 :             aMtrFldLine1.SetValue( aMtrFldLine1.GetValue() );
     503                 :            :         else
     504                 :          0 :             aMtrFldLine1.SetEmptyFieldValue();
     505                 :            : 
     506                 :            :     }
     507                 :            : 
     508                 :          0 :     return( 0L );
     509                 :            : }
     510                 :            : 
     511                 :          0 : void SvxConnectionPage::FillTypeLB()
     512                 :            : {
     513                 :            :     // fill ListBox with connector names
     514                 :          0 :     const SfxPoolItem* pItem = GetItem( rOutAttrs, SDRATTR_EDGEKIND );
     515                 :          0 :     const SfxItemPool* pPool = rOutAttrs.GetPool();
     516                 :            : 
     517         [ #  # ]:          0 :     if( !pItem )
     518                 :          0 :         pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
     519         [ #  # ]:          0 :     if( pItem )
     520                 :            :     {
     521                 :          0 :         const SdrEdgeKindItem* pEdgeKindItem = (const SdrEdgeKindItem*) pItem;
     522         [ #  # ]:          0 :         sal_uInt16 nCount = pEdgeKindItem->GetValueCount();
     523         [ #  # ]:          0 :         String aStr;
     524                 :            : 
     525         [ #  # ]:          0 :         for( sal_uInt16 i = 0; i < nCount; i++ )
     526                 :            :         {
     527 [ #  # ][ #  # ]:          0 :             aStr = pEdgeKindItem->GetValueTextByPos( i );
     528         [ #  # ]:          0 :             aLbType.InsertEntry( aStr );
     529         [ #  # ]:          0 :         }
     530                 :            :     }
     531                 :          0 : }
     532                 :          0 : void SvxConnectionPage::PageCreated (SfxAllItemSet aSet)
     533                 :            : {
     534                 :          0 :     SFX_ITEMSET_ARG(&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
     535         [ #  # ]:          0 :     if (pOfaPtrItem)
     536                 :          0 :         SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()) );
     537                 :            : 
     538                 :          0 :     Construct();
     539                 :          0 : }
     540                 :            : 
     541                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10