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