1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_cui.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir // include --------------------------------------------------------------- 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #ifndef _SVX_SIZEITEM_HXX //autogen 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include <editeng/sizeitem.hxx> 36*cdf0e10cSrcweir #endif 37*cdf0e10cSrcweir #include <tools/shl.hxx> 38*cdf0e10cSrcweir #include <tools/urlobj.hxx> 39*cdf0e10cSrcweir #include <sfx2/app.hxx> 40*cdf0e10cSrcweir #include <sfx2/module.hxx> 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir #define _SVX_TPLINE_CXX 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #include <cuires.hrc> 45*cdf0e10cSrcweir #include "tabline.hrc" 46*cdf0e10cSrcweir #include "svx/xattr.hxx" 47*cdf0e10cSrcweir #include <svx/xpool.hxx> 48*cdf0e10cSrcweir #include <svx/xtable.hxx> 49*cdf0e10cSrcweir #include "svx/drawitem.hxx" 50*cdf0e10cSrcweir #include "cuitabline.hxx" 51*cdf0e10cSrcweir #include "dlgname.hxx" 52*cdf0e10cSrcweir #include <dialmgr.hxx> 53*cdf0e10cSrcweir #include "svx/dlgutil.hxx" 54*cdf0e10cSrcweir #include <svx/svdmodel.hxx> 55*cdf0e10cSrcweir #include "svx/svxgrahicitem.hxx" 56*cdf0e10cSrcweir //#include "linectrl.hrc" 57*cdf0e10cSrcweir #include <sfx2/request.hxx> 58*cdf0e10cSrcweir #include "svx/ofaitem.hxx" 59*cdf0e10cSrcweir #include <svx/svdobj.hxx> 60*cdf0e10cSrcweir #include <svx/svdview.hxx> 61*cdf0e10cSrcweir #include <svx/svdmodel.hxx> 62*cdf0e10cSrcweir #include <svx/numvset.hxx> 63*cdf0e10cSrcweir #include <vcl/msgbox.hxx> 64*cdf0e10cSrcweir #include <editeng/numitem.hxx> 65*cdf0e10cSrcweir #include <editeng/svxenum.hxx> 66*cdf0e10cSrcweir #include <sfx2/objsh.hxx> 67*cdf0e10cSrcweir #include <editeng/brshitem.hxx> 68*cdf0e10cSrcweir #include <svx/gallery.hxx> 69*cdf0e10cSrcweir #include <svx/xbitmap.hxx> 70*cdf0e10cSrcweir #include <unotools/localfilehelper.hxx> 71*cdf0e10cSrcweir #include "paragrph.hrc" 72*cdf0e10cSrcweir #include "sfx2/opengrf.hxx" 73*cdf0e10cSrcweir #include <svx/dialmgr.hxx> 74*cdf0e10cSrcweir #include <svx/dialogs.hrc> 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir #define MAX_BMP_WIDTH 16 77*cdf0e10cSrcweir #define MAX_BMP_HEIGHT 16 78*cdf0e10cSrcweir // define ---------------------------------------------------------------- 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir #define DLGWIN this->GetParent()->GetParent() 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir #define BITMAP_WIDTH 32 83*cdf0e10cSrcweir #define BITMAP_HEIGHT 12 84*cdf0e10cSrcweir #define XOUT_WIDTH 150 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir // static ---------------------------------------------------------------- 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir static sal_uInt16 pLineRanges[] = 89*cdf0e10cSrcweir { 90*cdf0e10cSrcweir XATTR_LINETRANSPARENCE, 91*cdf0e10cSrcweir XATTR_LINETRANSPARENCE, 92*cdf0e10cSrcweir SID_ATTR_LINE_STYLE, 93*cdf0e10cSrcweir SID_ATTR_LINE_ENDCENTER, 94*cdf0e10cSrcweir 0 95*cdf0e10cSrcweir }; 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir /************************************************************************* 98*cdf0e10cSrcweir |* 99*cdf0e10cSrcweir |* Dialog zum Aendern der Linien 100*cdf0e10cSrcweir |* 101*cdf0e10cSrcweir \************************************************************************/ 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir SvxLineTabPage::SvxLineTabPage 104*cdf0e10cSrcweir ( 105*cdf0e10cSrcweir Window* pParent, 106*cdf0e10cSrcweir const SfxItemSet& rInAttrs 107*cdf0e10cSrcweir ) : 108*cdf0e10cSrcweir SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_LINE ), rInAttrs ), 109*cdf0e10cSrcweir aFlLine ( this, CUI_RES( FL_LINE ) ), 110*cdf0e10cSrcweir aFtLineStyle ( this, CUI_RES( FT_LINE_STYLE ) ), 111*cdf0e10cSrcweir aLbLineStyle ( this, CUI_RES( LB_LINE_STYLE ) ), 112*cdf0e10cSrcweir aFtColor ( this, CUI_RES( FT_COLOR ) ), 113*cdf0e10cSrcweir aLbColor ( this, CUI_RES( LB_COLOR ) ), 114*cdf0e10cSrcweir aFtLineWidth ( this, CUI_RES( FT_LINE_WIDTH ) ), 115*cdf0e10cSrcweir aMtrLineWidth ( this, CUI_RES( MTR_FLD_LINE_WIDTH ) ), 116*cdf0e10cSrcweir aFtTransparent ( this, CUI_RES( FT_TRANSPARENT ) ), 117*cdf0e10cSrcweir aMtrTransparent ( this, CUI_RES( MTR_LINE_TRANSPARENT ) ), 118*cdf0e10cSrcweir aFlLineEnds ( this, CUI_RES( FL_LINE_ENDS ) ), 119*cdf0e10cSrcweir aLbStartStyle ( this, CUI_RES( LB_START_STYLE ) ), 120*cdf0e10cSrcweir aMtrStartWidth ( this, CUI_RES( MTR_FLD_START_WIDTH ) ), 121*cdf0e10cSrcweir aTsbCenterStart ( this, CUI_RES( TSB_CENTER_START ) ), 122*cdf0e10cSrcweir aFtLineEndsStyle ( this, CUI_RES( FT_LINE_ENDS_STYLE ) ), 123*cdf0e10cSrcweir aLbEndStyle ( this, CUI_RES( LB_END_STYLE ) ), 124*cdf0e10cSrcweir aFtLineEndsWidth ( this, CUI_RES( FT_LINE_ENDS_WIDTH ) ), 125*cdf0e10cSrcweir aMtrEndWidth ( this, CUI_RES( MTR_FLD_END_WIDTH ) ), 126*cdf0e10cSrcweir aTsbCenterEnd ( this, CUI_RES( TSB_CENTER_END ) ), 127*cdf0e10cSrcweir aCbxSynchronize ( this, CUI_RES( CBX_SYNCHRONIZE ) ), 128*cdf0e10cSrcweir aFLSeparator ( this, CUI_RES( FL_SEPARATOR ) ), 129*cdf0e10cSrcweir aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir // #116827# 132*cdf0e10cSrcweir maFLEdgeStyle ( this, CUI_RES( FL_EDGE_STYLE ) ), 133*cdf0e10cSrcweir maFTEdgeStyle ( this, CUI_RES( FT_EDGE_STYLE ) ), 134*cdf0e10cSrcweir maLBEdgeStyle ( this, CUI_RES( LB_EDGE_STYLE ) ), 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir pSymbolList(NULL), 137*cdf0e10cSrcweir bNewSize(false), 138*cdf0e10cSrcweir nNumMenuGalleryItems(0), 139*cdf0e10cSrcweir nSymbolType(SVX_SYMBOLTYPE_UNKNOWN), //unbekannt bzw. unchanged 140*cdf0e10cSrcweir pSymbolAttr(NULL), 141*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) 142*cdf0e10cSrcweir aFlSymbol ( this, CUI_RES(FL_SYMBOL_FORMAT)), 143*cdf0e10cSrcweir aSymbolMB ( this, CUI_RES(MB_SYMBOL_BITMAP)), 144*cdf0e10cSrcweir aSymbolWidthFT ( this, CUI_RES(FT_SYMBOL_WIDTH)), 145*cdf0e10cSrcweir aSymbolWidthMF ( this, CUI_RES(MF_SYMBOL_WIDTH)), 146*cdf0e10cSrcweir aSymbolHeightFT ( this, CUI_RES(FT_SYMBOL_HEIGHT)), 147*cdf0e10cSrcweir aSymbolHeightMF ( this, CUI_RES(MF_SYMBOL_HEIGHT)), 148*cdf0e10cSrcweir aSymbolRatioCB ( this, CUI_RES(CB_SYMBOL_RATIO)), 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir bLastWidthModified(sal_False), 151*cdf0e10cSrcweir aSymbolLastSize(Size(0,0)), 152*cdf0e10cSrcweir bSymbols(sal_False), 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir rOutAttrs ( rInAttrs ), 155*cdf0e10cSrcweir bObjSelected( sal_False ), 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), 158*cdf0e10cSrcweir aXLStyle ( XLINE_DASH ), 159*cdf0e10cSrcweir aXWidth ( 1 ), 160*cdf0e10cSrcweir aXDash ( String(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ), 161*cdf0e10cSrcweir aXColor ( String(), COL_LIGHTRED ), 162*cdf0e10cSrcweir aXLineAttr ( pXPool ), 163*cdf0e10cSrcweir rXLSet ( aXLineAttr.GetItemSet() ), 164*cdf0e10cSrcweir pnLineEndListState( 0 ), 165*cdf0e10cSrcweir pnDashListState( 0 ), 166*cdf0e10cSrcweir pnColorTableState( 0 ), 167*cdf0e10cSrcweir nPageType ( 0 )//CHINA001 pPageType ( NULL ), 168*cdf0e10cSrcweir { 169*cdf0e10cSrcweir aLbEndStyle.SetAccessibleName(String(CUI_RES(STR_STYLE))); 170*cdf0e10cSrcweir aLbStartStyle.SetAccessibleName(String(CUI_RES( STR_LB_START_STYLE ) ) ); 171*cdf0e10cSrcweir aMtrStartWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_START_WIDTH ) ) ); 172*cdf0e10cSrcweir aLbEndStyle.SetAccessibleName(String(CUI_RES( STR_LB_END_STYLE ) ) ); 173*cdf0e10cSrcweir aMtrEndWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_END_WIDTH ) ) ); 174*cdf0e10cSrcweir aTsbCenterStart.SetAccessibleName(String(CUI_RES( STR_CENTER_START ) ) ); 175*cdf0e10cSrcweir aTsbCenterEnd.SetAccessibleName(String(CUI_RES( STR_CENTER_END ) ) ); 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir FreeResource(); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir // diese Page braucht ExchangeSupport 182*cdf0e10cSrcweir SetExchangeSupport(); 183*cdf0e10cSrcweir 184*cdf0e10cSrcweir // Metrik einstellen 185*cdf0e10cSrcweir FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir switch ( eFUnit ) 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir case FUNIT_M: 190*cdf0e10cSrcweir case FUNIT_KM: 191*cdf0e10cSrcweir eFUnit = FUNIT_MM; 192*cdf0e10cSrcweir // no break -> we now have mm 193*cdf0e10cSrcweir case FUNIT_MM: 194*cdf0e10cSrcweir aMtrLineWidth.SetSpinSize( 50 ); 195*cdf0e10cSrcweir aMtrStartWidth.SetSpinSize( 50 ); 196*cdf0e10cSrcweir aMtrEndWidth.SetSpinSize( 50 ); 197*cdf0e10cSrcweir break; 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir case FUNIT_INCH: 200*cdf0e10cSrcweir aMtrLineWidth.SetSpinSize( 2 ); 201*cdf0e10cSrcweir aMtrStartWidth.SetSpinSize( 2 ); 202*cdf0e10cSrcweir aMtrEndWidth.SetSpinSize( 2 ); 203*cdf0e10cSrcweir break; 204*cdf0e10cSrcweir default: ;//prevent warning 205*cdf0e10cSrcweir } 206*cdf0e10cSrcweir SetFieldUnit( aMtrLineWidth, eFUnit ); 207*cdf0e10cSrcweir SetFieldUnit( aMtrStartWidth, eFUnit ); 208*cdf0e10cSrcweir SetFieldUnit( aMtrEndWidth, eFUnit ); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir // PoolUnit ermitteln 211*cdf0e10cSrcweir SfxItemPool* pPool = rOutAttrs.GetPool(); 212*cdf0e10cSrcweir DBG_ASSERT( pPool, "Wo ist der Pool?" ); 213*cdf0e10cSrcweir ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH ); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir aLbLineStyle.SetSelectHdl( 216*cdf0e10cSrcweir LINK( this, SvxLineTabPage, ClickInvisibleHdl_Impl ) ); 217*cdf0e10cSrcweir aLbColor.SetSelectHdl( 218*cdf0e10cSrcweir LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); 219*cdf0e10cSrcweir aMtrLineWidth.SetModifyHdl( 220*cdf0e10cSrcweir LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); 221*cdf0e10cSrcweir aMtrTransparent.SetModifyHdl( 222*cdf0e10cSrcweir LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl ) ); 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir Link aStart = LINK( this, SvxLineTabPage, ChangeStartHdl_Impl ); 225*cdf0e10cSrcweir Link aEnd = LINK( this, SvxLineTabPage, ChangeEndHdl_Impl ); 226*cdf0e10cSrcweir aLbStartStyle.SetSelectHdl( aStart ); 227*cdf0e10cSrcweir aLbEndStyle.SetSelectHdl( aEnd ); 228*cdf0e10cSrcweir aMtrStartWidth.SetModifyHdl( aStart ); 229*cdf0e10cSrcweir aMtrEndWidth.SetModifyHdl( aEnd ); 230*cdf0e10cSrcweir aTsbCenterStart.SetClickHdl( aStart ); 231*cdf0e10cSrcweir aTsbCenterEnd.SetClickHdl( aEnd ); 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir pColorTab = NULL; 234*cdf0e10cSrcweir pDashList = NULL; 235*cdf0e10cSrcweir pLineEndList = NULL; 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir // #116827# 238*cdf0e10cSrcweir Link aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); 239*cdf0e10cSrcweir maLBEdgeStyle.SetSelectHdl( aEdgeStyle ); 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) , MB-Handler setzen 242*cdf0e10cSrcweir aSymbolMB.SetSelectHdl(LINK(this, SvxLineTabPage, GraphicHdl_Impl)); 243*cdf0e10cSrcweir aSymbolMB.SetActivateHdl(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl)); 244*cdf0e10cSrcweir aSymbolWidthMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl)); 245*cdf0e10cSrcweir aSymbolHeightMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl)); 246*cdf0e10cSrcweir aSymbolRatioCB.SetClickHdl(LINK(this, SvxLineTabPage, RatioHdl_Impl)); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir aSymbolRatioCB.Check(sal_True); 249*cdf0e10cSrcweir ShowSymbolControls(sal_False); 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir // #63083# 252*cdf0e10cSrcweir nActLineWidth = -1; 253*cdf0e10cSrcweir } 254*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) , Symbol-Controls aktivieren 255*cdf0e10cSrcweir void SvxLineTabPage::ShowSymbolControls(sal_Bool bOn) 256*cdf0e10cSrcweir { 257*cdf0e10cSrcweir bSymbols=bOn; 258*cdf0e10cSrcweir aSymbolWidthFT.Show(bOn); 259*cdf0e10cSrcweir aSymbolWidthMF.Show(bOn); 260*cdf0e10cSrcweir aSymbolHeightFT.Show(bOn); 261*cdf0e10cSrcweir aSymbolHeightMF.Show(bOn); 262*cdf0e10cSrcweir aFlSymbol.Show(bOn); 263*cdf0e10cSrcweir aSymbolRatioCB.Show(bOn); 264*cdf0e10cSrcweir aSymbolMB.Show(bOn); 265*cdf0e10cSrcweir aCtlPreview.ShowSymbol(bOn); 266*cdf0e10cSrcweir } 267*cdf0e10cSrcweir // ----------------------------------------------------------------------- 268*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) , dtor neu! 269*cdf0e10cSrcweir SvxLineTabPage::~SvxLineTabPage() 270*cdf0e10cSrcweir { 271*cdf0e10cSrcweir delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir if(pSymbolList) 274*cdf0e10cSrcweir delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ); 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir String* pStr = (String*)aGrfNames.First(); 277*cdf0e10cSrcweir while( pStr ) 278*cdf0e10cSrcweir { 279*cdf0e10cSrcweir delete pStr; 280*cdf0e10cSrcweir pStr = (String*)aGrfNames.Next(); 281*cdf0e10cSrcweir } 282*cdf0e10cSrcweir SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)aGrfBrushItems.First(); 283*cdf0e10cSrcweir while( pInfo ) 284*cdf0e10cSrcweir { 285*cdf0e10cSrcweir delete pInfo->pBrushItem; 286*cdf0e10cSrcweir delete pInfo; 287*cdf0e10cSrcweir pInfo = (SvxBmpItemInfo*)aGrfBrushItems.Next(); 288*cdf0e10cSrcweir } 289*cdf0e10cSrcweir } 290*cdf0e10cSrcweir void SvxLineTabPage::Construct() 291*cdf0e10cSrcweir { 292*cdf0e10cSrcweir // Farbtabelle 293*cdf0e10cSrcweir aLbColor.Fill( pColorTab ); 294*cdf0e10cSrcweir FillListboxes(); 295*cdf0e10cSrcweir } 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir void SvxLineTabPage::FillListboxes() 298*cdf0e10cSrcweir { 299*cdf0e10cSrcweir // Linienstile 300*cdf0e10cSrcweir sal_uInt16 nOldSelect = aLbLineStyle.GetSelectEntryPos(); 301*cdf0e10cSrcweir aLbLineStyle.FillStyles(); 302*cdf0e10cSrcweir aLbLineStyle.Fill( pDashList ); 303*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( nOldSelect ); 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir // LinienEndenStile 306*cdf0e10cSrcweir String sNone( SVX_RES( RID_SVXSTR_NONE ) ); 307*cdf0e10cSrcweir nOldSelect = aLbStartStyle.GetSelectEntryPos(); 308*cdf0e10cSrcweir aLbStartStyle.Clear(); 309*cdf0e10cSrcweir aLbStartStyle.InsertEntry( sNone ); 310*cdf0e10cSrcweir aLbStartStyle.Fill( pLineEndList ); 311*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( nOldSelect ); 312*cdf0e10cSrcweir nOldSelect = aLbEndStyle.GetSelectEntryPos(); 313*cdf0e10cSrcweir aLbEndStyle.Clear(); 314*cdf0e10cSrcweir aLbEndStyle.InsertEntry( sNone ); 315*cdf0e10cSrcweir aLbEndStyle.Fill( pLineEndList, sal_False ); 316*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( nOldSelect ); 317*cdf0e10cSrcweir } 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir // ----------------------------------------------------------------------- 320*cdf0e10cSrcweir 321*cdf0e10cSrcweir void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) 322*cdf0e10cSrcweir { 323*cdf0e10cSrcweir SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False); //add CHINA001 begin 324*cdf0e10cSrcweir if (pPageTypeItem) 325*cdf0e10cSrcweir SetPageType(pPageTypeItem->GetValue()); //add CHINA001 end 326*cdf0e10cSrcweir if( nDlgType == 0 && pDashList ) //CHINA001 if( *pDlgType == 0 && pDashList ) // Linien-Dialog 327*cdf0e10cSrcweir { 328*cdf0e10cSrcweir sal_uInt16 nPos; 329*cdf0e10cSrcweir sal_uInt16 nCount; 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir // Dashliste 332*cdf0e10cSrcweir if( ( *pnDashListState & CT_MODIFIED ) || 333*cdf0e10cSrcweir ( *pnDashListState & CT_CHANGED ) ) 334*cdf0e10cSrcweir { 335*cdf0e10cSrcweir if( *pnDashListState & CT_CHANGED ) 336*cdf0e10cSrcweir pDashList = ( (SvxLineTabDialog*) DLGWIN )-> 337*cdf0e10cSrcweir GetNewDashList(); 338*cdf0e10cSrcweir *pnDashListState = CT_NONE; 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir // Styleliste 341*cdf0e10cSrcweir nPos = aLbLineStyle.GetSelectEntryPos(); 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir aLbLineStyle.Clear(); 344*cdf0e10cSrcweir aLbLineStyle.InsertEntry( 345*cdf0e10cSrcweir SVX_RESSTR( RID_SVXSTR_INVISIBLE ) ); 346*cdf0e10cSrcweir aLbLineStyle.InsertEntry( 347*cdf0e10cSrcweir SVX_RESSTR( RID_SVXSTR_SOLID ) ); 348*cdf0e10cSrcweir aLbLineStyle.Fill( pDashList ); 349*cdf0e10cSrcweir nCount = aLbLineStyle.GetEntryCount(); 350*cdf0e10cSrcweir 351*cdf0e10cSrcweir if ( nCount == 0 ) 352*cdf0e10cSrcweir ; // Dieser Fall sollte nicht auftreten 353*cdf0e10cSrcweir else if( nCount <= nPos ) 354*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( 0 ); 355*cdf0e10cSrcweir else 356*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( nPos ); 357*cdf0e10cSrcweir // SelectStyleHdl_Impl( this ); 358*cdf0e10cSrcweir } 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir INetURLObject aDashURL( pDashList->GetPath() ); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir aDashURL.Append( pDashList->GetName() ); 363*cdf0e10cSrcweir DBG_ASSERT( aDashURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); 364*cdf0e10cSrcweir /* // Ermitteln (evtl. abschneiden) des Namens und in 365*cdf0e10cSrcweir // der GroupBox darstellen 366*cdf0e10cSrcweir String aString( ResId( RID_SVXSTR_TABLE, pMgr ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir if ( aDashURL.getBase().Len() > 18 ) 369*cdf0e10cSrcweir { 370*cdf0e10cSrcweir aString += aDashURL.getBase().Copy( 0, 15 ); 371*cdf0e10cSrcweir aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); 372*cdf0e10cSrcweir } 373*cdf0e10cSrcweir else 374*cdf0e10cSrcweir aString += aDashURL.getBase(); 375*cdf0e10cSrcweir 376*cdf0e10cSrcweir aGrpLine.SetText( aString ); 377*cdf0e10cSrcweir */ 378*cdf0e10cSrcweir // LineEndliste 379*cdf0e10cSrcweir if( ( *pnLineEndListState & CT_MODIFIED ) || 380*cdf0e10cSrcweir ( *pnLineEndListState & CT_CHANGED ) ) 381*cdf0e10cSrcweir { 382*cdf0e10cSrcweir if( *pnLineEndListState & CT_CHANGED ) 383*cdf0e10cSrcweir pLineEndList = ( (SvxLineTabDialog*) DLGWIN )-> 384*cdf0e10cSrcweir GetNewLineEndList(); 385*cdf0e10cSrcweir *pnLineEndListState = CT_NONE; 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir nPos = aLbLineStyle.GetSelectEntryPos(); 388*cdf0e10cSrcweir String sNone( SVX_RES( RID_SVXSTR_NONE ) ); 389*cdf0e10cSrcweir aLbStartStyle.Clear(); 390*cdf0e10cSrcweir aLbStartStyle.InsertEntry( sNone ); 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir aLbStartStyle.Fill( pLineEndList ); 393*cdf0e10cSrcweir nCount = aLbStartStyle.GetEntryCount(); 394*cdf0e10cSrcweir if( nCount == 0 ) 395*cdf0e10cSrcweir ; // Dieser Fall sollte nicht auftreten 396*cdf0e10cSrcweir else if( nCount <= nPos ) 397*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( 0 ); 398*cdf0e10cSrcweir else 399*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( nPos ); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir aLbEndStyle.Clear(); 402*cdf0e10cSrcweir aLbEndStyle.InsertEntry( sNone ); 403*cdf0e10cSrcweir 404*cdf0e10cSrcweir aLbEndStyle.Fill( pLineEndList, sal_False ); 405*cdf0e10cSrcweir nCount = aLbEndStyle.GetEntryCount(); 406*cdf0e10cSrcweir 407*cdf0e10cSrcweir if( nCount == 0 ) 408*cdf0e10cSrcweir ; // Dieser Fall sollte nicht auftreten 409*cdf0e10cSrcweir else if( nCount <= nPos ) 410*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( 0 ); 411*cdf0e10cSrcweir else 412*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( nPos ); 413*cdf0e10cSrcweir } 414*cdf0e10cSrcweir INetURLObject aLineURL( pLineEndList->GetPath() ); 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir aLineURL.Append( pLineEndList->GetName() ); 417*cdf0e10cSrcweir DBG_ASSERT( aLineURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); 418*cdf0e10cSrcweir /* // Ermitteln (evtl. abschneiden) des Namens und in 419*cdf0e10cSrcweir // der GroupBox darstellen 420*cdf0e10cSrcweir aString = String( ResId( RID_SVXSTR_TABLE, pMgr ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir if ( aLineURL.getBase().Len() > 18 ) 423*cdf0e10cSrcweir { 424*cdf0e10cSrcweir aString += aLineURL.getBase().Copy( 0, 15 ); 425*cdf0e10cSrcweir aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); 426*cdf0e10cSrcweir } 427*cdf0e10cSrcweir else 428*cdf0e10cSrcweir aString += aLineURL.getBase(); 429*cdf0e10cSrcweir 430*cdf0e10cSrcweir aGrpLineEnds.SetText( aString ); 431*cdf0e10cSrcweir */ 432*cdf0e10cSrcweir // Auswertung, ob von einer anderen TabPage ein anderer Fuelltyp gesetzt wurde 433*cdf0e10cSrcweir if( aLbLineStyle.GetSelectEntryPos() != 0 ) 434*cdf0e10cSrcweir { 435*cdf0e10cSrcweir if( nPageType == 2 ) // 1//CHINA001 if( *pPageType == 2 ) // 1 436*cdf0e10cSrcweir { 437*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( *pPosDashLb + 2 ); // +2 wegen SOLID und INVLISIBLE 438*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 439*cdf0e10cSrcweir } 440*cdf0e10cSrcweir if( nPageType == 3 )//CHINA001 if( *pPageType == 3 ) 441*cdf0e10cSrcweir { 442*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID 443*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID 444*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 445*cdf0e10cSrcweir } 446*cdf0e10cSrcweir } 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir // ColorTable 449*cdf0e10cSrcweir if( *pnColorTableState ) 450*cdf0e10cSrcweir { 451*cdf0e10cSrcweir if( *pnColorTableState & CT_CHANGED ) 452*cdf0e10cSrcweir pColorTab = ( (SvxLineTabDialog*) DLGWIN )-> 453*cdf0e10cSrcweir GetNewColorTable(); 454*cdf0e10cSrcweir // aLbColor 455*cdf0e10cSrcweir sal_uInt16 nColorPos = aLbColor.GetSelectEntryPos(); 456*cdf0e10cSrcweir aLbColor.Clear(); 457*cdf0e10cSrcweir aLbColor.Fill( pColorTab ); 458*cdf0e10cSrcweir nCount = aLbColor.GetEntryCount(); 459*cdf0e10cSrcweir if( nCount == 0 ) 460*cdf0e10cSrcweir ; // This case should never occur 461*cdf0e10cSrcweir else if( nCount <= nColorPos ) 462*cdf0e10cSrcweir aLbColor.SelectEntryPos( 0 ); 463*cdf0e10cSrcweir else 464*cdf0e10cSrcweir aLbColor.SelectEntryPos( nColorPos ); 465*cdf0e10cSrcweir 466*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 467*cdf0e10cSrcweir } 468*cdf0e10cSrcweir 469*cdf0e10cSrcweir nPageType = 0;//CHINA001 *pPageType = 0; 470*cdf0e10cSrcweir } 471*cdf0e10cSrcweir // Seite existiert im Ctor noch nicht, deswegen hier! 472*cdf0e10cSrcweir 473*cdf0e10cSrcweir else if ( nDlgType == 1100 || // Chart-Dialog//CHINA001 else if ( *pDlgType == 1100 || // Chart-Dialog 474*cdf0e10cSrcweir nDlgType == 1101 )//CHINA001 *pDlgType == 1101 ) 475*cdf0e10cSrcweir { 476*cdf0e10cSrcweir aFtLineEndsStyle.Hide(); 477*cdf0e10cSrcweir aFtLineEndsWidth.Hide(); 478*cdf0e10cSrcweir aLbStartStyle.Hide(); 479*cdf0e10cSrcweir aMtrStartWidth.Hide(); 480*cdf0e10cSrcweir aTsbCenterStart.Hide(); 481*cdf0e10cSrcweir aLbEndStyle.Hide(); 482*cdf0e10cSrcweir aMtrEndWidth.Hide(); 483*cdf0e10cSrcweir aTsbCenterEnd.Hide(); 484*cdf0e10cSrcweir aCbxSynchronize.Hide(); 485*cdf0e10cSrcweir aFlLineEnds.Hide(); 486*cdf0e10cSrcweir 487*cdf0e10cSrcweir // #116827# 488*cdf0e10cSrcweir maFLEdgeStyle.Hide(); 489*cdf0e10cSrcweir maFTEdgeStyle.Hide(); 490*cdf0e10cSrcweir maLBEdgeStyle.Hide(); 491*cdf0e10cSrcweir } 492*cdf0e10cSrcweir } 493*cdf0e10cSrcweir 494*cdf0e10cSrcweir // ----------------------------------------------------------------------- 495*cdf0e10cSrcweir 496*cdf0e10cSrcweir int SvxLineTabPage::DeactivatePage( SfxItemSet* _pSet ) 497*cdf0e10cSrcweir { 498*cdf0e10cSrcweir if( nDlgType == 0 ) // Linien-Dialog//CHINA001 if( *pDlgType == 0 ) // Linien-Dialog 499*cdf0e10cSrcweir { 500*cdf0e10cSrcweir nPageType = 1; // evtl. fuer Erweiterungen//CHINA001 *pPageType = 1; // evtl. fuer Erweiterungen 501*cdf0e10cSrcweir *pPosDashLb = aLbLineStyle.GetSelectEntryPos() - 2;// erster Eintrag SOLID !!! 502*cdf0e10cSrcweir sal_uInt16 nPos = aLbStartStyle.GetSelectEntryPos(); 503*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND ) 504*cdf0e10cSrcweir nPos--; 505*cdf0e10cSrcweir *pPosLineEndLb = nPos; 506*cdf0e10cSrcweir } 507*cdf0e10cSrcweir 508*cdf0e10cSrcweir if( _pSet ) 509*cdf0e10cSrcweir FillItemSet( *_pSet ); 510*cdf0e10cSrcweir 511*cdf0e10cSrcweir return( LEAVE_PAGE ); 512*cdf0e10cSrcweir } 513*cdf0e10cSrcweir 514*cdf0e10cSrcweir // ----------------------------------------------------------------------- 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir sal_Bool SvxLineTabPage::FillItemSet( SfxItemSet& rAttrs ) 517*cdf0e10cSrcweir { 518*cdf0e10cSrcweir const SfxPoolItem* pOld = NULL; 519*cdf0e10cSrcweir sal_uInt16 nPos; 520*cdf0e10cSrcweir sal_Bool bModified = sal_False; 521*cdf0e10cSrcweir 522*cdf0e10cSrcweir // Um evtl. Modifikationen der Liste vorzubeugen 523*cdf0e10cSrcweir // werden Items anderer Seiten nicht gesetzt 524*cdf0e10cSrcweir if( nDlgType != 0 || nPageType != 2 )//CHINA001 if( *pDlgType != 0 || *pPageType != 2 ) 525*cdf0e10cSrcweir { 526*cdf0e10cSrcweir nPos = aLbLineStyle.GetSelectEntryPos(); 527*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND && 528*cdf0e10cSrcweir nPos != aLbLineStyle.GetSavedValue() ) 529*cdf0e10cSrcweir { 530*cdf0e10cSrcweir XLineStyleItem* pStyleItem = NULL; 531*cdf0e10cSrcweir 532*cdf0e10cSrcweir if( nPos == 0 ) 533*cdf0e10cSrcweir pStyleItem = new XLineStyleItem( XLINE_NONE ); 534*cdf0e10cSrcweir else if( nPos == 1 ) 535*cdf0e10cSrcweir pStyleItem = new XLineStyleItem( XLINE_SOLID ); 536*cdf0e10cSrcweir else 537*cdf0e10cSrcweir { 538*cdf0e10cSrcweir pStyleItem = new XLineStyleItem( XLINE_DASH ); 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir // Zusaetzliche Sicherheit 541*cdf0e10cSrcweir if( pDashList->Count() > (long) ( nPos - 2 ) ) 542*cdf0e10cSrcweir { 543*cdf0e10cSrcweir XLineDashItem aDashItem( aLbLineStyle.GetSelectEntry(), 544*cdf0e10cSrcweir pDashList->GetDash( nPos - 2 )->GetDash() ); 545*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEDASH ); 546*cdf0e10cSrcweir if ( !pOld || !( *(const XLineDashItem*)pOld == aDashItem ) ) 547*cdf0e10cSrcweir { 548*cdf0e10cSrcweir rAttrs.Put( aDashItem ); 549*cdf0e10cSrcweir bModified = sal_True; 550*cdf0e10cSrcweir } 551*cdf0e10cSrcweir } 552*cdf0e10cSrcweir } 553*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINESTYLE ); 554*cdf0e10cSrcweir if ( !pOld || !( *(const XLineStyleItem*)pOld == *pStyleItem ) ) 555*cdf0e10cSrcweir { 556*cdf0e10cSrcweir rAttrs.Put( *pStyleItem ); 557*cdf0e10cSrcweir bModified = sal_True; 558*cdf0e10cSrcweir } 559*cdf0e10cSrcweir delete pStyleItem; 560*cdf0e10cSrcweir } 561*cdf0e10cSrcweir } 562*cdf0e10cSrcweir // Linienbreite 563*cdf0e10cSrcweir // GetSavedValue() liefert String! 564*cdf0e10cSrcweir if( aMtrLineWidth.GetText() != aMtrLineWidth.GetSavedValue() ) 565*cdf0e10cSrcweir { 566*cdf0e10cSrcweir XLineWidthItem aItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) ); 567*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEWIDTH ); 568*cdf0e10cSrcweir if ( !pOld || !( *(const XLineWidthItem*)pOld == aItem ) ) 569*cdf0e10cSrcweir { 570*cdf0e10cSrcweir rAttrs.Put( aItem ); 571*cdf0e10cSrcweir bModified = sal_True; 572*cdf0e10cSrcweir } 573*cdf0e10cSrcweir } 574*cdf0e10cSrcweir //Breite Linienanfang 575*cdf0e10cSrcweir if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() ) 576*cdf0e10cSrcweir { 577*cdf0e10cSrcweir XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ); 578*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH ); 579*cdf0e10cSrcweir if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) ) 580*cdf0e10cSrcweir { 581*cdf0e10cSrcweir rAttrs.Put( aItem ); 582*cdf0e10cSrcweir bModified = sal_True; 583*cdf0e10cSrcweir } 584*cdf0e10cSrcweir } 585*cdf0e10cSrcweir //Breite Linienende 586*cdf0e10cSrcweir if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() ) 587*cdf0e10cSrcweir { 588*cdf0e10cSrcweir XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ); 589*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH ); 590*cdf0e10cSrcweir if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) ) 591*cdf0e10cSrcweir { 592*cdf0e10cSrcweir rAttrs.Put( aItem ); 593*cdf0e10cSrcweir bModified = sal_True; 594*cdf0e10cSrcweir } 595*cdf0e10cSrcweir } 596*cdf0e10cSrcweir 597*cdf0e10cSrcweir // Linienfarbe 598*cdf0e10cSrcweir if( aLbColor.GetSelectEntryPos() != aLbColor.GetSavedValue() ) 599*cdf0e10cSrcweir { 600*cdf0e10cSrcweir XLineColorItem aItem( aLbColor.GetSelectEntry(), 601*cdf0e10cSrcweir aLbColor.GetSelectEntryColor() ); 602*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINECOLOR ); 603*cdf0e10cSrcweir if ( !pOld || !( *(const XLineColorItem*)pOld == aItem ) ) 604*cdf0e10cSrcweir { 605*cdf0e10cSrcweir rAttrs.Put( aItem ); 606*cdf0e10cSrcweir bModified = sal_True; 607*cdf0e10cSrcweir } 608*cdf0e10cSrcweir } 609*cdf0e10cSrcweir 610*cdf0e10cSrcweir if( nDlgType != 0 || nPageType != 3 )//CHINA001 if( *pDlgType != 0 || *pPageType != 3 ) 611*cdf0e10cSrcweir { 612*cdf0e10cSrcweir // Linienanfang 613*cdf0e10cSrcweir nPos = aLbStartStyle.GetSelectEntryPos(); 614*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND && 615*cdf0e10cSrcweir nPos != aLbStartStyle.GetSavedValue() ) 616*cdf0e10cSrcweir { 617*cdf0e10cSrcweir XLineStartItem* pItem = NULL; 618*cdf0e10cSrcweir if( nPos == 0 ) 619*cdf0e10cSrcweir pItem = new XLineStartItem(); 620*cdf0e10cSrcweir else if( pLineEndList->Count() > (long) ( nPos - 1 ) ) 621*cdf0e10cSrcweir pItem = new XLineStartItem( aLbStartStyle.GetSelectEntry(), 622*cdf0e10cSrcweir pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ); 623*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINESTART ); 624*cdf0e10cSrcweir if( pItem && 625*cdf0e10cSrcweir ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) ) 626*cdf0e10cSrcweir { 627*cdf0e10cSrcweir rAttrs.Put( *pItem ); 628*cdf0e10cSrcweir bModified = sal_True; 629*cdf0e10cSrcweir } 630*cdf0e10cSrcweir delete pItem; 631*cdf0e10cSrcweir } 632*cdf0e10cSrcweir // Linienende 633*cdf0e10cSrcweir nPos = aLbEndStyle.GetSelectEntryPos(); 634*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND && 635*cdf0e10cSrcweir nPos != aLbEndStyle.GetSavedValue() ) 636*cdf0e10cSrcweir { 637*cdf0e10cSrcweir XLineEndItem* pItem = NULL; 638*cdf0e10cSrcweir if( nPos == 0 ) 639*cdf0e10cSrcweir pItem = new XLineEndItem(); 640*cdf0e10cSrcweir else if( pLineEndList->Count() > (long) ( nPos - 1 ) ) 641*cdf0e10cSrcweir pItem = new XLineEndItem( aLbEndStyle.GetSelectEntry(), 642*cdf0e10cSrcweir pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ); 643*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEEND ); 644*cdf0e10cSrcweir if( pItem && 645*cdf0e10cSrcweir ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) ) 646*cdf0e10cSrcweir { 647*cdf0e10cSrcweir rAttrs.Put( *pItem ); 648*cdf0e10cSrcweir bModified = sal_True; 649*cdf0e10cSrcweir } 650*cdf0e10cSrcweir delete pItem; 651*cdf0e10cSrcweir } 652*cdf0e10cSrcweir } 653*cdf0e10cSrcweir 654*cdf0e10cSrcweir // Linienenden zentriert 655*cdf0e10cSrcweir TriState eState = aTsbCenterStart.GetState(); 656*cdf0e10cSrcweir if( eState != aTsbCenterStart.GetSavedValue() ) 657*cdf0e10cSrcweir { 658*cdf0e10cSrcweir XLineStartCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); 659*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINESTARTCENTER ); 660*cdf0e10cSrcweir if ( !pOld || !( *(const XLineStartCenterItem*)pOld == aItem ) ) 661*cdf0e10cSrcweir { 662*cdf0e10cSrcweir rAttrs.Put( aItem ); 663*cdf0e10cSrcweir bModified = sal_True; 664*cdf0e10cSrcweir } 665*cdf0e10cSrcweir } 666*cdf0e10cSrcweir eState = aTsbCenterEnd.GetState(); 667*cdf0e10cSrcweir if( eState != aTsbCenterEnd.GetSavedValue() ) 668*cdf0e10cSrcweir { 669*cdf0e10cSrcweir XLineEndCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); 670*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEENDCENTER ); 671*cdf0e10cSrcweir if ( !pOld || !( *(const XLineEndCenterItem*)pOld == aItem ) ) 672*cdf0e10cSrcweir { 673*cdf0e10cSrcweir rAttrs.Put( aItem ); 674*cdf0e10cSrcweir bModified = sal_True; 675*cdf0e10cSrcweir } 676*cdf0e10cSrcweir } 677*cdf0e10cSrcweir 678*cdf0e10cSrcweir //Breite Linienanfang 679*cdf0e10cSrcweir if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() ) 680*cdf0e10cSrcweir { 681*cdf0e10cSrcweir XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ); 682*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH ); 683*cdf0e10cSrcweir if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) ) 684*cdf0e10cSrcweir { 685*cdf0e10cSrcweir rAttrs.Put( aItem ); 686*cdf0e10cSrcweir bModified = sal_True; 687*cdf0e10cSrcweir } 688*cdf0e10cSrcweir } 689*cdf0e10cSrcweir //Breite Linienende 690*cdf0e10cSrcweir if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() ) 691*cdf0e10cSrcweir { 692*cdf0e10cSrcweir XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ); 693*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH ); 694*cdf0e10cSrcweir if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) ) 695*cdf0e10cSrcweir { 696*cdf0e10cSrcweir rAttrs.Put( aItem ); 697*cdf0e10cSrcweir bModified = sal_True; 698*cdf0e10cSrcweir } 699*cdf0e10cSrcweir } 700*cdf0e10cSrcweir 701*cdf0e10cSrcweir // Transparenz 702*cdf0e10cSrcweir sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); 703*cdf0e10cSrcweir if( nVal != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() ) 704*cdf0e10cSrcweir { 705*cdf0e10cSrcweir XLineTransparenceItem aItem( nVal ); 706*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINETRANSPARENCE ); 707*cdf0e10cSrcweir if ( !pOld || !( *(const XLineTransparenceItem*)pOld == aItem ) ) 708*cdf0e10cSrcweir { 709*cdf0e10cSrcweir rAttrs.Put( aItem ); 710*cdf0e10cSrcweir bModified = sal_True; 711*cdf0e10cSrcweir } 712*cdf0e10cSrcweir } 713*cdf0e10cSrcweir 714*cdf0e10cSrcweir // #116827# 715*cdf0e10cSrcweir nPos = maLBEdgeStyle.GetSelectEntryPos(); 716*cdf0e10cSrcweir if( LISTBOX_ENTRY_NOTFOUND != nPos && nPos != maLBEdgeStyle.GetSavedValue() ) 717*cdf0e10cSrcweir { 718*cdf0e10cSrcweir XLineJointItem* pNew = 0L; 719*cdf0e10cSrcweir 720*cdf0e10cSrcweir switch(nPos) 721*cdf0e10cSrcweir { 722*cdf0e10cSrcweir case 0: // Rounded, default 723*cdf0e10cSrcweir { 724*cdf0e10cSrcweir pNew = new XLineJointItem(XLINEJOINT_ROUND); 725*cdf0e10cSrcweir break; 726*cdf0e10cSrcweir } 727*cdf0e10cSrcweir case 1: // - none - 728*cdf0e10cSrcweir { 729*cdf0e10cSrcweir pNew = new XLineJointItem(XLINEJOINT_NONE); 730*cdf0e10cSrcweir break; 731*cdf0e10cSrcweir } 732*cdf0e10cSrcweir case 2: // Miter 733*cdf0e10cSrcweir { 734*cdf0e10cSrcweir pNew = new XLineJointItem(XLINEJOINT_MITER); 735*cdf0e10cSrcweir break; 736*cdf0e10cSrcweir } 737*cdf0e10cSrcweir case 3: // Bevel 738*cdf0e10cSrcweir { 739*cdf0e10cSrcweir pNew = new XLineJointItem(XLINEJOINT_BEVEL); 740*cdf0e10cSrcweir break; 741*cdf0e10cSrcweir } 742*cdf0e10cSrcweir } 743*cdf0e10cSrcweir 744*cdf0e10cSrcweir if(pNew) 745*cdf0e10cSrcweir { 746*cdf0e10cSrcweir pOld = GetOldItem( rAttrs, XATTR_LINEJOINT ); 747*cdf0e10cSrcweir 748*cdf0e10cSrcweir if(!pOld || !(*(const XLineJointItem*)pOld == *pNew)) 749*cdf0e10cSrcweir { 750*cdf0e10cSrcweir rAttrs.Put( *pNew ); 751*cdf0e10cSrcweir bModified = sal_True; 752*cdf0e10cSrcweir } 753*cdf0e10cSrcweir 754*cdf0e10cSrcweir delete pNew; 755*cdf0e10cSrcweir } 756*cdf0e10cSrcweir } 757*cdf0e10cSrcweir 758*cdf0e10cSrcweir if(nSymbolType!=SVX_SYMBOLTYPE_UNKNOWN || bNewSize) 759*cdf0e10cSrcweir { 760*cdf0e10cSrcweir //wurde also per Auswahl gesetzt oder Gr��e ist anders 761*cdf0e10cSrcweir SvxSizeItem aSItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),aSymbolSize); 762*cdf0e10cSrcweir const SfxPoolItem* pSOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) ); 763*cdf0e10cSrcweir bNewSize = pSOld ? *(const SvxSizeItem *)pSOld != aSItem : bNewSize ; 764*cdf0e10cSrcweir if(bNewSize) 765*cdf0e10cSrcweir { 766*cdf0e10cSrcweir rAttrs.Put(aSItem); 767*cdf0e10cSrcweir bModified=sal_True; 768*cdf0e10cSrcweir } 769*cdf0e10cSrcweir 770*cdf0e10cSrcweir SfxInt32Item aTItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),nSymbolType); 771*cdf0e10cSrcweir const SfxPoolItem* pTOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) ); 772*cdf0e10cSrcweir bool bNewType = pTOld == NULL || *(const SfxInt32Item*)pTOld != aTItem; 773*cdf0e10cSrcweir if(bNewType && nSymbolType==SVX_SYMBOLTYPE_UNKNOWN) 774*cdf0e10cSrcweir bNewType=false;//kleine Korrektur, Typ wurde garnicht gesetzt -> kein Type-Item erzeugen! 775*cdf0e10cSrcweir if(bNewType) 776*cdf0e10cSrcweir { 777*cdf0e10cSrcweir rAttrs.Put(aTItem); 778*cdf0e10cSrcweir bModified=sal_True; 779*cdf0e10cSrcweir } 780*cdf0e10cSrcweir 781*cdf0e10cSrcweir if(nSymbolType!=SVX_SYMBOLTYPE_NONE) 782*cdf0e10cSrcweir { 783*cdf0e10cSrcweir SvxBrushItem aBItem(aSymbolGraphic,GPOS_MM,rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH)); 784*cdf0e10cSrcweir const SfxPoolItem* pBOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH) ); 785*cdf0e10cSrcweir bool bNewBrush = 786*cdf0e10cSrcweir pBOld == NULL || *(const SvxBrushItem*)pBOld != aBItem; 787*cdf0e10cSrcweir if(bNewBrush) 788*cdf0e10cSrcweir { 789*cdf0e10cSrcweir rAttrs.Put(aBItem); 790*cdf0e10cSrcweir bModified=sal_True; 791*cdf0e10cSrcweir } 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir } 794*cdf0e10cSrcweir rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType));//add CHINA001 795*cdf0e10cSrcweir return( bModified ); 796*cdf0e10cSrcweir } 797*cdf0e10cSrcweir 798*cdf0e10cSrcweir // ----------------------------------------------------------------------- 799*cdf0e10cSrcweir 800*cdf0e10cSrcweir sal_Bool SvxLineTabPage::FillXLSet_Impl() 801*cdf0e10cSrcweir { 802*cdf0e10cSrcweir sal_uInt16 nPos; 803*cdf0e10cSrcweir 804*cdf0e10cSrcweir if( aLbLineStyle.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND ) 805*cdf0e10cSrcweir { 806*cdf0e10cSrcweir //rXLSet.Put( XLineDashItem ( rOutAttrs.Get( GetWhich( XATTR_LINEDASH ) ) ) ); 807*cdf0e10cSrcweir rXLSet.Put( XLineStyleItem( XLINE_NONE ) ); 808*cdf0e10cSrcweir } 809*cdf0e10cSrcweir else if( aLbLineStyle.IsEntryPosSelected( 0 ) ) 810*cdf0e10cSrcweir rXLSet.Put( XLineStyleItem( XLINE_NONE ) ); 811*cdf0e10cSrcweir else if( aLbLineStyle.IsEntryPosSelected( 1 ) ) 812*cdf0e10cSrcweir rXLSet.Put( XLineStyleItem( XLINE_SOLID ) ); 813*cdf0e10cSrcweir else 814*cdf0e10cSrcweir { 815*cdf0e10cSrcweir rXLSet.Put( XLineStyleItem( XLINE_DASH ) ); 816*cdf0e10cSrcweir 817*cdf0e10cSrcweir nPos = aLbLineStyle.GetSelectEntryPos(); 818*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND ) 819*cdf0e10cSrcweir { 820*cdf0e10cSrcweir rXLSet.Put( XLineDashItem( aLbLineStyle.GetSelectEntry(), 821*cdf0e10cSrcweir pDashList->GetDash( nPos - 2 )->GetDash() ) ); 822*cdf0e10cSrcweir } 823*cdf0e10cSrcweir } 824*cdf0e10cSrcweir 825*cdf0e10cSrcweir nPos = aLbStartStyle.GetSelectEntryPos(); 826*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND ) 827*cdf0e10cSrcweir { 828*cdf0e10cSrcweir if( nPos == 0 ) 829*cdf0e10cSrcweir rXLSet.Put( XLineStartItem() ); 830*cdf0e10cSrcweir else 831*cdf0e10cSrcweir rXLSet.Put( XLineStartItem( aLbStartStyle.GetSelectEntry(), 832*cdf0e10cSrcweir pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) ); 833*cdf0e10cSrcweir } 834*cdf0e10cSrcweir nPos = aLbEndStyle.GetSelectEntryPos(); 835*cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND ) 836*cdf0e10cSrcweir { 837*cdf0e10cSrcweir if( nPos == 0 ) 838*cdf0e10cSrcweir rXLSet.Put( XLineEndItem() ); 839*cdf0e10cSrcweir else 840*cdf0e10cSrcweir rXLSet.Put( XLineEndItem( aLbEndStyle.GetSelectEntry(), 841*cdf0e10cSrcweir pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) ); 842*cdf0e10cSrcweir } 843*cdf0e10cSrcweir 844*cdf0e10cSrcweir // #116827# 845*cdf0e10cSrcweir nPos = maLBEdgeStyle.GetSelectEntryPos(); 846*cdf0e10cSrcweir if(LISTBOX_ENTRY_NOTFOUND != nPos) 847*cdf0e10cSrcweir { 848*cdf0e10cSrcweir switch(nPos) 849*cdf0e10cSrcweir { 850*cdf0e10cSrcweir case 0: // Rounded, default 851*cdf0e10cSrcweir { 852*cdf0e10cSrcweir rXLSet.Put(XLineJointItem(XLINEJOINT_ROUND)); 853*cdf0e10cSrcweir break; 854*cdf0e10cSrcweir } 855*cdf0e10cSrcweir case 1: // - none - 856*cdf0e10cSrcweir { 857*cdf0e10cSrcweir rXLSet.Put(XLineJointItem(XLINEJOINT_NONE)); 858*cdf0e10cSrcweir break; 859*cdf0e10cSrcweir } 860*cdf0e10cSrcweir case 2: // Miter 861*cdf0e10cSrcweir { 862*cdf0e10cSrcweir rXLSet.Put(XLineJointItem(XLINEJOINT_MITER)); 863*cdf0e10cSrcweir break; 864*cdf0e10cSrcweir } 865*cdf0e10cSrcweir case 3: // Bevel 866*cdf0e10cSrcweir { 867*cdf0e10cSrcweir rXLSet.Put(XLineJointItem(XLINEJOINT_BEVEL)); 868*cdf0e10cSrcweir break; 869*cdf0e10cSrcweir } 870*cdf0e10cSrcweir } 871*cdf0e10cSrcweir } 872*cdf0e10cSrcweir 873*cdf0e10cSrcweir rXLSet.Put( XLineStartWidthItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ) ); 874*cdf0e10cSrcweir rXLSet.Put( XLineEndWidthItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ) ); 875*cdf0e10cSrcweir 876*cdf0e10cSrcweir rXLSet.Put( XLineWidthItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) ) ); 877*cdf0e10cSrcweir rXLSet.Put( XLineColorItem( aLbColor.GetSelectEntry(), 878*cdf0e10cSrcweir aLbColor.GetSelectEntryColor() ) ); 879*cdf0e10cSrcweir 880*cdf0e10cSrcweir // Linienenden zentriert 881*cdf0e10cSrcweir if( aTsbCenterStart.GetState() == STATE_CHECK ) 882*cdf0e10cSrcweir rXLSet.Put( XLineStartCenterItem( sal_True ) ); 883*cdf0e10cSrcweir else if( aTsbCenterStart.GetState() == STATE_NOCHECK ) 884*cdf0e10cSrcweir rXLSet.Put( XLineStartCenterItem( sal_False ) ); 885*cdf0e10cSrcweir 886*cdf0e10cSrcweir if( aTsbCenterEnd.GetState() == STATE_CHECK ) 887*cdf0e10cSrcweir rXLSet.Put( XLineEndCenterItem( sal_True ) ); 888*cdf0e10cSrcweir else if( aTsbCenterEnd.GetState() == STATE_NOCHECK ) 889*cdf0e10cSrcweir rXLSet.Put( XLineEndCenterItem( sal_False ) ); 890*cdf0e10cSrcweir 891*cdf0e10cSrcweir // Transparenz 892*cdf0e10cSrcweir sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); 893*cdf0e10cSrcweir rXLSet.Put( XLineTransparenceItem( nVal ) ); 894*cdf0e10cSrcweir 895*cdf0e10cSrcweir // #116827# 896*cdf0e10cSrcweir aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); 897*cdf0e10cSrcweir 898*cdf0e10cSrcweir return( sal_True ); 899*cdf0e10cSrcweir } 900*cdf0e10cSrcweir 901*cdf0e10cSrcweir // ----------------------------------------------------------------------- 902*cdf0e10cSrcweir 903*cdf0e10cSrcweir void SvxLineTabPage::Reset( const SfxItemSet& rAttrs ) 904*cdf0e10cSrcweir { 905*cdf0e10cSrcweir String aString; 906*cdf0e10cSrcweir XLineStyle eXLS; // XLINE_NONE, XLINE_SOLID, XLINE_DASH 907*cdf0e10cSrcweir 908*cdf0e10cSrcweir // Linienstil 909*cdf0e10cSrcweir /* 910*cdf0e10cSrcweir if( bObjSelected && 911*cdf0e10cSrcweir rAttrs.GetItemState( GetWhich( XATTR_LINESTYLE ) ) == SFX_ITEM_DEFAULT ) 912*cdf0e10cSrcweir { 913*cdf0e10cSrcweir aLbLineStyle.Disable(); 914*cdf0e10cSrcweir } 915*cdf0e10cSrcweir */ 916*cdf0e10cSrcweir const SfxPoolItem *pPoolItem; 917*cdf0e10cSrcweir long nSymType=SVX_SYMBOLTYPE_UNKNOWN; 918*cdf0e10cSrcweir sal_Bool bPrevSym=sal_False; 919*cdf0e10cSrcweir sal_Bool bEnable=sal_True; 920*cdf0e10cSrcweir sal_Bool bIgnoreGraphic=sal_False; 921*cdf0e10cSrcweir sal_Bool bIgnoreSize=sal_False; 922*cdf0e10cSrcweir if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),sal_True,&pPoolItem) == SFX_ITEM_SET) 923*cdf0e10cSrcweir { 924*cdf0e10cSrcweir nSymType=((const SfxInt32Item *)pPoolItem)->GetValue(); 925*cdf0e10cSrcweir } 926*cdf0e10cSrcweir 927*cdf0e10cSrcweir if(nSymType == SVX_SYMBOLTYPE_AUTO) 928*cdf0e10cSrcweir { 929*cdf0e10cSrcweir aSymbolGraphic=aAutoSymbolGraphic; 930*cdf0e10cSrcweir aSymbolSize=aSymbolLastSize=aAutoSymbolGraphic.GetPrefSize(); 931*cdf0e10cSrcweir bPrevSym=sal_True; 932*cdf0e10cSrcweir } 933*cdf0e10cSrcweir else if(nSymType == SVX_SYMBOLTYPE_NONE) 934*cdf0e10cSrcweir { 935*cdf0e10cSrcweir bEnable=sal_False; 936*cdf0e10cSrcweir bIgnoreGraphic=sal_True; 937*cdf0e10cSrcweir bIgnoreSize=sal_True; 938*cdf0e10cSrcweir } 939*cdf0e10cSrcweir else if(nSymType >= 0) 940*cdf0e10cSrcweir { 941*cdf0e10cSrcweir VirtualDevice aVDev; 942*cdf0e10cSrcweir aVDev.SetMapMode(MapMode(MAP_100TH_MM)); 943*cdf0e10cSrcweir 944*cdf0e10cSrcweir SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS); 945*cdf0e10cSrcweir pModel->GetItemPool().FreezeIdRanges(); 946*cdf0e10cSrcweir SdrPage* pPage = new SdrPage( *pModel, sal_False ); 947*cdf0e10cSrcweir pPage->SetSize(Size(1000,1000)); 948*cdf0e10cSrcweir pModel->InsertPage( pPage, 0 ); 949*cdf0e10cSrcweir SdrView* pView = new SdrView( pModel, &aVDev ); 950*cdf0e10cSrcweir pView->hideMarkHandles(); 951*cdf0e10cSrcweir SdrPageView* pPageView = pView->ShowSdrPage(pPage); 952*cdf0e10cSrcweir // SdrPageView* pPageView = pView->ShowSdrPage(pPage, Point()); 953*cdf0e10cSrcweir SdrObject *pObj=NULL; 954*cdf0e10cSrcweir long nSymTmp=nSymType; 955*cdf0e10cSrcweir if(pSymbolList) 956*cdf0e10cSrcweir { 957*cdf0e10cSrcweir if(pSymbolList->GetObjCount()) 958*cdf0e10cSrcweir { 959*cdf0e10cSrcweir nSymTmp=nSymTmp%pSymbolList->GetObjCount(); //Liste wird als cyclisch betrachtet!!! 960*cdf0e10cSrcweir pObj=pSymbolList->GetObj(nSymTmp); 961*cdf0e10cSrcweir if(pObj) 962*cdf0e10cSrcweir { 963*cdf0e10cSrcweir pObj=pObj->Clone(); 964*cdf0e10cSrcweir pPage->NbcInsertObject(pObj); 965*cdf0e10cSrcweir pView->MarkObj(pObj,pPageView); 966*cdf0e10cSrcweir if(pSymbolAttr) 967*cdf0e10cSrcweir { 968*cdf0e10cSrcweir pObj->SetMergedItemSet(*pSymbolAttr); 969*cdf0e10cSrcweir } 970*cdf0e10cSrcweir else 971*cdf0e10cSrcweir { 972*cdf0e10cSrcweir pObj->SetMergedItemSet(rOutAttrs); 973*cdf0e10cSrcweir } 974*cdf0e10cSrcweir GDIMetaFile aMeta(pView->GetAllMarkedMetaFile()); 975*cdf0e10cSrcweir 976*cdf0e10cSrcweir aSymbolGraphic=Graphic(aMeta); 977*cdf0e10cSrcweir aSymbolSize=pObj->GetSnapRect().GetSize(); 978*cdf0e10cSrcweir aSymbolGraphic.SetPrefSize(aSymbolSize); 979*cdf0e10cSrcweir aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM); 980*cdf0e10cSrcweir bPrevSym=sal_True; 981*cdf0e10cSrcweir bEnable=sal_True; 982*cdf0e10cSrcweir bIgnoreGraphic=sal_True; 983*cdf0e10cSrcweir 984*cdf0e10cSrcweir pView->UnmarkAll(); 985*cdf0e10cSrcweir pObj=pPage->RemoveObject(0); 986*cdf0e10cSrcweir SdrObject::Free( pObj ); 987*cdf0e10cSrcweir } 988*cdf0e10cSrcweir } 989*cdf0e10cSrcweir } 990*cdf0e10cSrcweir delete pView; 991*cdf0e10cSrcweir delete pModel; 992*cdf0e10cSrcweir } 993*cdf0e10cSrcweir if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH),sal_True,&pPoolItem) == SFX_ITEM_SET) 994*cdf0e10cSrcweir { 995*cdf0e10cSrcweir const Graphic* pGraphic = ((const SvxBrushItem *)pPoolItem)->GetGraphic(); 996*cdf0e10cSrcweir if( pGraphic ) 997*cdf0e10cSrcweir { 998*cdf0e10cSrcweir if(!bIgnoreGraphic) 999*cdf0e10cSrcweir { 1000*cdf0e10cSrcweir aSymbolGraphic=*pGraphic; 1001*cdf0e10cSrcweir } 1002*cdf0e10cSrcweir if(!bIgnoreSize) 1003*cdf0e10cSrcweir { 1004*cdf0e10cSrcweir aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), 1005*cdf0e10cSrcweir pGraphic->GetPrefMapMode(), 1006*cdf0e10cSrcweir MAP_100TH_MM ); 1007*cdf0e10cSrcweir } 1008*cdf0e10cSrcweir bPrevSym=sal_True; 1009*cdf0e10cSrcweir } 1010*cdf0e10cSrcweir } 1011*cdf0e10cSrcweir if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),sal_True,&pPoolItem) == SFX_ITEM_SET) 1012*cdf0e10cSrcweir { 1013*cdf0e10cSrcweir aSymbolSize = ((const SvxSizeItem *)pPoolItem)->GetSize(); 1014*cdf0e10cSrcweir } 1015*cdf0e10cSrcweir 1016*cdf0e10cSrcweir 1017*cdf0e10cSrcweir aSymbolRatioCB.Enable(bEnable); 1018*cdf0e10cSrcweir aSymbolHeightFT.Enable(bEnable); 1019*cdf0e10cSrcweir aSymbolWidthFT.Enable(bEnable); 1020*cdf0e10cSrcweir aSymbolWidthMF.Enable(bEnable); 1021*cdf0e10cSrcweir aSymbolHeightMF.Enable(bEnable); 1022*cdf0e10cSrcweir if(bPrevSym) 1023*cdf0e10cSrcweir { 1024*cdf0e10cSrcweir SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit); 1025*cdf0e10cSrcweir SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(),ePoolUnit); 1026*cdf0e10cSrcweir aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize); 1027*cdf0e10cSrcweir aSymbolLastSize=aSymbolSize; 1028*cdf0e10cSrcweir } 1029*cdf0e10cSrcweir 1030*cdf0e10cSrcweir if( rAttrs.GetItemState( XATTR_LINESTYLE ) != SFX_ITEM_DONTCARE ) 1031*cdf0e10cSrcweir { 1032*cdf0e10cSrcweir eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs.Get( XATTR_LINESTYLE ) ).GetValue(); 1033*cdf0e10cSrcweir 1034*cdf0e10cSrcweir switch( eXLS ) 1035*cdf0e10cSrcweir { 1036*cdf0e10cSrcweir case XLINE_NONE: 1037*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( 0 ); 1038*cdf0e10cSrcweir break; 1039*cdf0e10cSrcweir case XLINE_SOLID: 1040*cdf0e10cSrcweir aLbLineStyle.SelectEntryPos( 1 ); 1041*cdf0e10cSrcweir break; 1042*cdf0e10cSrcweir 1043*cdf0e10cSrcweir case XLINE_DASH: 1044*cdf0e10cSrcweir aLbLineStyle.SetNoSelection(); 1045*cdf0e10cSrcweir aLbLineStyle.SelectEntry( ( ( const XLineDashItem& ) rAttrs. 1046*cdf0e10cSrcweir Get( XATTR_LINEDASH ) ).GetName() ); 1047*cdf0e10cSrcweir break; 1048*cdf0e10cSrcweir 1049*cdf0e10cSrcweir default: 1050*cdf0e10cSrcweir break; 1051*cdf0e10cSrcweir } 1052*cdf0e10cSrcweir } 1053*cdf0e10cSrcweir else 1054*cdf0e10cSrcweir { 1055*cdf0e10cSrcweir aLbLineStyle.SetNoSelection(); 1056*cdf0e10cSrcweir } 1057*cdf0e10cSrcweir 1058*cdf0e10cSrcweir // Linienstaerke 1059*cdf0e10cSrcweir /* 1060*cdf0e10cSrcweir if( bObjSelected && 1061*cdf0e10cSrcweir rAttrs.GetItemState( GetWhich( XATTR_LINEWIDTH ) ) == SFX_ITEM_DEFAULT ) 1062*cdf0e10cSrcweir { 1063*cdf0e10cSrcweir aMtrLineWidth.Disable(); 1064*cdf0e10cSrcweir } 1065*cdf0e10cSrcweir */ 1066*cdf0e10cSrcweir if( rAttrs.GetItemState( XATTR_LINEWIDTH ) != SFX_ITEM_DONTCARE ) 1067*cdf0e10cSrcweir { 1068*cdf0e10cSrcweir SetMetricValue( aMtrLineWidth, ( ( const XLineWidthItem& ) rAttrs. 1069*cdf0e10cSrcweir Get( XATTR_LINEWIDTH ) ).GetValue(), ePoolUnit ); 1070*cdf0e10cSrcweir } 1071*cdf0e10cSrcweir else 1072*cdf0e10cSrcweir aMtrLineWidth.SetText( String() ); 1073*cdf0e10cSrcweir 1074*cdf0e10cSrcweir // Linienfarbe 1075*cdf0e10cSrcweir /* 1076*cdf0e10cSrcweir if( bObjSelected && 1077*cdf0e10cSrcweir rAttrs.GetItemState( GetWhich( XATTR_LINECOLOR ) ) == SFX_ITEM_DEFAULT ) 1078*cdf0e10cSrcweir { 1079*cdf0e10cSrcweir aLbColor.Disable(); 1080*cdf0e10cSrcweir } 1081*cdf0e10cSrcweir */ 1082*cdf0e10cSrcweir aLbColor.SetNoSelection(); 1083*cdf0e10cSrcweir 1084*cdf0e10cSrcweir if ( rAttrs.GetItemState( XATTR_LINECOLOR ) != SFX_ITEM_DONTCARE ) 1085*cdf0e10cSrcweir { 1086*cdf0e10cSrcweir Color aCol = ( ( const XLineColorItem& ) rAttrs.Get( XATTR_LINECOLOR ) ).GetColorValue(); 1087*cdf0e10cSrcweir aLbColor.SelectEntry( aCol ); 1088*cdf0e10cSrcweir if( aLbColor.GetSelectEntryCount() == 0 ) 1089*cdf0e10cSrcweir { 1090*cdf0e10cSrcweir aLbColor.InsertEntry( aCol, String() ); 1091*cdf0e10cSrcweir aLbColor.SelectEntry( aCol ); 1092*cdf0e10cSrcweir } 1093*cdf0e10cSrcweir } 1094*cdf0e10cSrcweir 1095*cdf0e10cSrcweir // LinienAnfang 1096*cdf0e10cSrcweir if( bObjSelected && 1097*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINESTART ) == SFX_ITEM_DEFAULT ) 1098*cdf0e10cSrcweir { 1099*cdf0e10cSrcweir aLbStartStyle.Disable(); 1100*cdf0e10cSrcweir } 1101*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINESTART ) != SFX_ITEM_DONTCARE ) 1102*cdf0e10cSrcweir { 1103*cdf0e10cSrcweir // #86265# select entry using list and polygon, not string 1104*cdf0e10cSrcweir sal_Bool bSelected(sal_False); 1105*cdf0e10cSrcweir const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineStartItem&)rAttrs.Get(XATTR_LINESTART)).GetLineStartValue(); 1106*cdf0e10cSrcweir 1107*cdf0e10cSrcweir for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++) 1108*cdf0e10cSrcweir { 1109*cdf0e10cSrcweir XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a); 1110*cdf0e10cSrcweir const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); 1111*cdf0e10cSrcweir 1112*cdf0e10cSrcweir if(rItemPolygon == rEntryPolygon) 1113*cdf0e10cSrcweir { 1114*cdf0e10cSrcweir // select this entry 1115*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos((sal_uInt16)a + 1); 1116*cdf0e10cSrcweir bSelected = sal_True; 1117*cdf0e10cSrcweir } 1118*cdf0e10cSrcweir } 1119*cdf0e10cSrcweir 1120*cdf0e10cSrcweir if(!bSelected) 1121*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( 0 ); 1122*cdf0e10cSrcweir } 1123*cdf0e10cSrcweir else 1124*cdf0e10cSrcweir { 1125*cdf0e10cSrcweir aLbStartStyle.SetNoSelection(); 1126*cdf0e10cSrcweir } 1127*cdf0e10cSrcweir 1128*cdf0e10cSrcweir // LinienEnde 1129*cdf0e10cSrcweir if( bObjSelected && 1130*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINEEND ) == SFX_ITEM_DEFAULT ) 1131*cdf0e10cSrcweir { 1132*cdf0e10cSrcweir aLbEndStyle.Disable(); 1133*cdf0e10cSrcweir } 1134*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINEEND ) != SFX_ITEM_DONTCARE ) 1135*cdf0e10cSrcweir { 1136*cdf0e10cSrcweir // #86265# select entry using list and polygon, not string 1137*cdf0e10cSrcweir sal_Bool bSelected(sal_False); 1138*cdf0e10cSrcweir const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineEndItem&)rAttrs.Get(XATTR_LINEEND)).GetLineEndValue(); 1139*cdf0e10cSrcweir 1140*cdf0e10cSrcweir for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++) 1141*cdf0e10cSrcweir { 1142*cdf0e10cSrcweir XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a); 1143*cdf0e10cSrcweir const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); 1144*cdf0e10cSrcweir 1145*cdf0e10cSrcweir if(rItemPolygon == rEntryPolygon) 1146*cdf0e10cSrcweir { 1147*cdf0e10cSrcweir // select this entry 1148*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos((sal_uInt16)a + 1); 1149*cdf0e10cSrcweir bSelected = sal_True; 1150*cdf0e10cSrcweir } 1151*cdf0e10cSrcweir } 1152*cdf0e10cSrcweir 1153*cdf0e10cSrcweir if(!bSelected) 1154*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( 0 ); 1155*cdf0e10cSrcweir } 1156*cdf0e10cSrcweir else 1157*cdf0e10cSrcweir { 1158*cdf0e10cSrcweir aLbEndStyle.SetNoSelection(); 1159*cdf0e10cSrcweir } 1160*cdf0e10cSrcweir 1161*cdf0e10cSrcweir // LinienAnfang St"arke 1162*cdf0e10cSrcweir if( bObjSelected && 1163*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) == SFX_ITEM_DEFAULT ) 1164*cdf0e10cSrcweir { 1165*cdf0e10cSrcweir aMtrStartWidth.Disable(); 1166*cdf0e10cSrcweir } 1167*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) != SFX_ITEM_DONTCARE ) 1168*cdf0e10cSrcweir { 1169*cdf0e10cSrcweir SetMetricValue( aMtrStartWidth, ( ( const XLineStartWidthItem& ) rAttrs. 1170*cdf0e10cSrcweir Get( XATTR_LINESTARTWIDTH ) ).GetValue(), ePoolUnit ); 1171*cdf0e10cSrcweir } 1172*cdf0e10cSrcweir else 1173*cdf0e10cSrcweir aMtrStartWidth.SetText( String() ); 1174*cdf0e10cSrcweir 1175*cdf0e10cSrcweir // LinienEnde St"arke 1176*cdf0e10cSrcweir if( bObjSelected && 1177*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINEENDWIDTH ) == SFX_ITEM_DEFAULT ) 1178*cdf0e10cSrcweir { 1179*cdf0e10cSrcweir aMtrEndWidth.Disable(); 1180*cdf0e10cSrcweir } 1181*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINEENDWIDTH ) != SFX_ITEM_DONTCARE ) 1182*cdf0e10cSrcweir { 1183*cdf0e10cSrcweir SetMetricValue( aMtrEndWidth, ( ( const XLineEndWidthItem& ) rAttrs. 1184*cdf0e10cSrcweir Get( XATTR_LINEENDWIDTH ) ).GetValue(), ePoolUnit ); 1185*cdf0e10cSrcweir } 1186*cdf0e10cSrcweir else 1187*cdf0e10cSrcweir aMtrEndWidth.SetText( String() ); 1188*cdf0e10cSrcweir 1189*cdf0e10cSrcweir // Linienenden zentriert (Start) 1190*cdf0e10cSrcweir if( bObjSelected && 1191*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINESTARTCENTER ) == SFX_ITEM_DEFAULT ) 1192*cdf0e10cSrcweir { 1193*cdf0e10cSrcweir aTsbCenterStart.Disable(); 1194*cdf0e10cSrcweir } 1195*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINESTARTCENTER ) != SFX_ITEM_DONTCARE ) 1196*cdf0e10cSrcweir { 1197*cdf0e10cSrcweir aTsbCenterStart.EnableTriState( sal_False ); 1198*cdf0e10cSrcweir 1199*cdf0e10cSrcweir if( ( ( const XLineStartCenterItem& ) rAttrs.Get( XATTR_LINESTARTCENTER ) ).GetValue() ) 1200*cdf0e10cSrcweir aTsbCenterStart.SetState( STATE_CHECK ); 1201*cdf0e10cSrcweir else 1202*cdf0e10cSrcweir aTsbCenterStart.SetState( STATE_NOCHECK ); 1203*cdf0e10cSrcweir } 1204*cdf0e10cSrcweir else 1205*cdf0e10cSrcweir { 1206*cdf0e10cSrcweir aTsbCenterStart.SetState( STATE_DONTKNOW ); 1207*cdf0e10cSrcweir } 1208*cdf0e10cSrcweir 1209*cdf0e10cSrcweir // Linienenden zentriert (Ende) 1210*cdf0e10cSrcweir if( bObjSelected && 1211*cdf0e10cSrcweir rAttrs.GetItemState( XATTR_LINEENDCENTER ) == SFX_ITEM_DEFAULT ) 1212*cdf0e10cSrcweir { 1213*cdf0e10cSrcweir aTsbCenterEnd.Disable(); 1214*cdf0e10cSrcweir } 1215*cdf0e10cSrcweir else if( rAttrs.GetItemState( XATTR_LINEENDCENTER ) != SFX_ITEM_DONTCARE ) 1216*cdf0e10cSrcweir { 1217*cdf0e10cSrcweir aTsbCenterEnd.EnableTriState( sal_False ); 1218*cdf0e10cSrcweir 1219*cdf0e10cSrcweir if( ( ( const XLineEndCenterItem& ) rAttrs.Get( XATTR_LINEENDCENTER ) ).GetValue() ) 1220*cdf0e10cSrcweir aTsbCenterEnd.SetState( STATE_CHECK ); 1221*cdf0e10cSrcweir else 1222*cdf0e10cSrcweir aTsbCenterEnd.SetState( STATE_NOCHECK ); 1223*cdf0e10cSrcweir } 1224*cdf0e10cSrcweir else 1225*cdf0e10cSrcweir { 1226*cdf0e10cSrcweir aTsbCenterEnd.SetState( STATE_DONTKNOW ); 1227*cdf0e10cSrcweir } 1228*cdf0e10cSrcweir 1229*cdf0e10cSrcweir // Transparenz 1230*cdf0e10cSrcweir if( rAttrs.GetItemState( XATTR_LINETRANSPARENCE ) != SFX_ITEM_DONTCARE ) 1231*cdf0e10cSrcweir { 1232*cdf0e10cSrcweir sal_uInt16 nTransp = ( ( const XLineTransparenceItem& ) rAttrs. 1233*cdf0e10cSrcweir Get( XATTR_LINETRANSPARENCE ) ).GetValue(); 1234*cdf0e10cSrcweir aMtrTransparent.SetValue( nTransp ); 1235*cdf0e10cSrcweir ChangeTransparentHdl_Impl( NULL ); 1236*cdf0e10cSrcweir } 1237*cdf0e10cSrcweir else 1238*cdf0e10cSrcweir aMtrTransparent.SetText( String() ); 1239*cdf0e10cSrcweir 1240*cdf0e10cSrcweir if( !aLbStartStyle.IsEnabled() && 1241*cdf0e10cSrcweir !aLbEndStyle.IsEnabled() && 1242*cdf0e10cSrcweir !aMtrStartWidth.IsEnabled() && 1243*cdf0e10cSrcweir !aMtrEndWidth.IsEnabled() && 1244*cdf0e10cSrcweir !aTsbCenterStart.IsEnabled()&& 1245*cdf0e10cSrcweir !aTsbCenterEnd.IsEnabled() ) 1246*cdf0e10cSrcweir { 1247*cdf0e10cSrcweir aCbxSynchronize.Disable(); 1248*cdf0e10cSrcweir aFtLineEndsStyle.Disable(); 1249*cdf0e10cSrcweir aFtLineEndsWidth.Disable(); 1250*cdf0e10cSrcweir aFlLineEnds.Disable(); 1251*cdf0e10cSrcweir } 1252*cdf0e10cSrcweir 1253*cdf0e10cSrcweir // Synchronisieren 1254*cdf0e10cSrcweir // Jetzt wird der Wert aus der INI-Datei geholt (#42258#) 1255*cdf0e10cSrcweir String aStr = GetUserData(); 1256*cdf0e10cSrcweir aCbxSynchronize.Check( (sal_Bool)aStr.ToInt32() ); 1257*cdf0e10cSrcweir 1258*cdf0e10cSrcweir // #116827# 1259*cdf0e10cSrcweir if(bObjSelected && SFX_ITEM_DEFAULT == rAttrs.GetItemState(XATTR_LINEJOINT)) 1260*cdf0e10cSrcweir { 1261*cdf0e10cSrcweir maFTEdgeStyle.Disable(); 1262*cdf0e10cSrcweir maLBEdgeStyle.Disable(); 1263*cdf0e10cSrcweir } 1264*cdf0e10cSrcweir else if(SFX_ITEM_DONTCARE != rAttrs.GetItemState(XATTR_LINEJOINT)) 1265*cdf0e10cSrcweir { 1266*cdf0e10cSrcweir XLineJoint eLineJoint = ((const XLineJointItem&)(rAttrs.Get(XATTR_LINEJOINT))).GetValue(); 1267*cdf0e10cSrcweir 1268*cdf0e10cSrcweir switch(eLineJoint) 1269*cdf0e10cSrcweir { 1270*cdf0e10cSrcweir case XLINEJOINT_ROUND : maLBEdgeStyle.SelectEntryPos(0); break; 1271*cdf0e10cSrcweir case XLINEJOINT_NONE : maLBEdgeStyle.SelectEntryPos(1); break; 1272*cdf0e10cSrcweir case XLINEJOINT_MITER : maLBEdgeStyle.SelectEntryPos(2); break; 1273*cdf0e10cSrcweir case XLINEJOINT_BEVEL : maLBEdgeStyle.SelectEntryPos(3); break; 1274*cdf0e10cSrcweir case XLINEJOINT_MIDDLE : break; 1275*cdf0e10cSrcweir } 1276*cdf0e10cSrcweir } 1277*cdf0e10cSrcweir else 1278*cdf0e10cSrcweir { 1279*cdf0e10cSrcweir maLBEdgeStyle.SetNoSelection(); 1280*cdf0e10cSrcweir } 1281*cdf0e10cSrcweir 1282*cdf0e10cSrcweir /* 1283*cdf0e10cSrcweir if( aLbStartStyle.GetSelectEntryPos() == aLbEndStyle.GetSelectEntryPos() && 1284*cdf0e10cSrcweir aMtrStartWidth.GetValue() == aMtrEndWidth.GetValue() && 1285*cdf0e10cSrcweir aTsbCenterStart.GetState() == aTsbCenterEnd.GetState() ) 1286*cdf0e10cSrcweir { 1287*cdf0e10cSrcweir aCbxSynchronize.Check(); 1288*cdf0e10cSrcweir } 1289*cdf0e10cSrcweir */ 1290*cdf0e10cSrcweir 1291*cdf0e10cSrcweir // Werte sichern 1292*cdf0e10cSrcweir aLbLineStyle.SaveValue(); 1293*cdf0e10cSrcweir aMtrLineWidth.SaveValue(); 1294*cdf0e10cSrcweir aLbColor.SaveValue(); 1295*cdf0e10cSrcweir aLbStartStyle.SaveValue(); 1296*cdf0e10cSrcweir aLbEndStyle.SaveValue(); 1297*cdf0e10cSrcweir aMtrStartWidth.SaveValue(); 1298*cdf0e10cSrcweir aMtrEndWidth.SaveValue(); 1299*cdf0e10cSrcweir aTsbCenterStart.SaveValue(); 1300*cdf0e10cSrcweir aTsbCenterEnd.SaveValue(); 1301*cdf0e10cSrcweir aMtrTransparent.SaveValue(); 1302*cdf0e10cSrcweir 1303*cdf0e10cSrcweir // #116827# 1304*cdf0e10cSrcweir maLBEdgeStyle.SaveValue(); 1305*cdf0e10cSrcweir 1306*cdf0e10cSrcweir ClickInvisibleHdl_Impl( this ); 1307*cdf0e10cSrcweir //ClickMeasuringHdl_Impl( this ); 1308*cdf0e10cSrcweir //aCtlPosition.Reset(); 1309*cdf0e10cSrcweir 1310*cdf0e10cSrcweir ChangePreviewHdl_Impl( NULL ); 1311*cdf0e10cSrcweir } 1312*cdf0e10cSrcweir 1313*cdf0e10cSrcweir // ----------------------------------------------------------------------- 1314*cdf0e10cSrcweir 1315*cdf0e10cSrcweir SfxTabPage* SvxLineTabPage::Create( Window* pWindow, 1316*cdf0e10cSrcweir const SfxItemSet& rAttrs ) 1317*cdf0e10cSrcweir { 1318*cdf0e10cSrcweir return( new SvxLineTabPage( pWindow, rAttrs ) ); 1319*cdf0e10cSrcweir } 1320*cdf0e10cSrcweir 1321*cdf0e10cSrcweir //------------------------------------------------------------------------ 1322*cdf0e10cSrcweir 1323*cdf0e10cSrcweir sal_uInt16* SvxLineTabPage::GetRanges() 1324*cdf0e10cSrcweir { 1325*cdf0e10cSrcweir return( pLineRanges ); 1326*cdf0e10cSrcweir } 1327*cdf0e10cSrcweir 1328*cdf0e10cSrcweir //------------------------------------------------------------------------ 1329*cdf0e10cSrcweir 1330*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) 1331*cdf0e10cSrcweir { 1332*cdf0e10cSrcweir if(pCntrl == &aMtrLineWidth) 1333*cdf0e10cSrcweir { 1334*cdf0e10cSrcweir // Linienbreite und Start/EndBreite 1335*cdf0e10cSrcweir sal_Int32 nNewLineWidth = GetCoreValue( aMtrLineWidth, ePoolUnit ); 1336*cdf0e10cSrcweir if(nActLineWidth == -1) 1337*cdf0e10cSrcweir { 1338*cdf0e10cSrcweir // Noch nicht initialisiert, hole den Startwert 1339*cdf0e10cSrcweir const SfxPoolItem* pOld = GetOldItem( rXLSet, XATTR_LINEWIDTH ); 1340*cdf0e10cSrcweir sal_Int32 nStartLineWidth = 0; 1341*cdf0e10cSrcweir if(pOld) 1342*cdf0e10cSrcweir nStartLineWidth = (( const XLineWidthItem *)pOld)->GetValue(); 1343*cdf0e10cSrcweir nActLineWidth = nStartLineWidth; 1344*cdf0e10cSrcweir } 1345*cdf0e10cSrcweir 1346*cdf0e10cSrcweir if(nActLineWidth != nNewLineWidth) 1347*cdf0e10cSrcweir { 1348*cdf0e10cSrcweir // Anpassungen Start/EndWidth #63083# 1349*cdf0e10cSrcweir sal_Int32 nValAct = GetCoreValue( aMtrStartWidth, ePoolUnit ); 1350*cdf0e10cSrcweir sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); 1351*cdf0e10cSrcweir if(nValNew < 0) 1352*cdf0e10cSrcweir nValNew = 0; 1353*cdf0e10cSrcweir SetMetricValue( aMtrStartWidth, nValNew, ePoolUnit ); 1354*cdf0e10cSrcweir 1355*cdf0e10cSrcweir nValAct = GetCoreValue( aMtrEndWidth, ePoolUnit ); 1356*cdf0e10cSrcweir nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); 1357*cdf0e10cSrcweir if(nValNew < 0) 1358*cdf0e10cSrcweir nValNew = 0; 1359*cdf0e10cSrcweir SetMetricValue( aMtrEndWidth, nValNew, ePoolUnit ); 1360*cdf0e10cSrcweir } 1361*cdf0e10cSrcweir 1362*cdf0e10cSrcweir // Aktuellen Wert merken 1363*cdf0e10cSrcweir nActLineWidth = nNewLineWidth; 1364*cdf0e10cSrcweir } 1365*cdf0e10cSrcweir 1366*cdf0e10cSrcweir FillXLSet_Impl(); 1367*cdf0e10cSrcweir aCtlPreview.Invalidate(); 1368*cdf0e10cSrcweir 1369*cdf0e10cSrcweir // Transparenz entspr. zugaenglich machen 1370*cdf0e10cSrcweir if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar 1371*cdf0e10cSrcweir { 1372*cdf0e10cSrcweir aFtTransparent.Disable(); 1373*cdf0e10cSrcweir aMtrTransparent.Disable(); 1374*cdf0e10cSrcweir } 1375*cdf0e10cSrcweir else 1376*cdf0e10cSrcweir { 1377*cdf0e10cSrcweir aFtTransparent.Enable(); 1378*cdf0e10cSrcweir aMtrTransparent.Enable(); 1379*cdf0e10cSrcweir } 1380*cdf0e10cSrcweir 1381*cdf0e10cSrcweir const bool bHasLineStart = aLbStartStyle.GetSelectEntryPos() != 0; 1382*cdf0e10cSrcweir const bool bHasLineEnd = aLbEndStyle.GetSelectEntryPos() != 0; 1383*cdf0e10cSrcweir 1384*cdf0e10cSrcweir aFtLineEndsWidth.Enable( bHasLineStart || bHasLineEnd ); 1385*cdf0e10cSrcweir aMtrStartWidth.Enable( bHasLineStart ); 1386*cdf0e10cSrcweir aTsbCenterStart.Enable( bHasLineStart ); 1387*cdf0e10cSrcweir aMtrEndWidth.Enable( bHasLineEnd ); 1388*cdf0e10cSrcweir aTsbCenterEnd.Enable( bHasLineEnd ); 1389*cdf0e10cSrcweir 1390*cdf0e10cSrcweir return( 0L ); 1391*cdf0e10cSrcweir } 1392*cdf0e10cSrcweir 1393*cdf0e10cSrcweir //------------------------------------------------------------------------ 1394*cdf0e10cSrcweir 1395*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) 1396*cdf0e10cSrcweir { 1397*cdf0e10cSrcweir if( aCbxSynchronize.IsChecked() ) 1398*cdf0e10cSrcweir { 1399*cdf0e10cSrcweir if( p == &aMtrStartWidth ) 1400*cdf0e10cSrcweir aMtrEndWidth.SetValue( aMtrStartWidth.GetValue() ); 1401*cdf0e10cSrcweir if( p == &aLbStartStyle ) 1402*cdf0e10cSrcweir aLbEndStyle.SelectEntryPos( aLbStartStyle.GetSelectEntryPos() ); 1403*cdf0e10cSrcweir if( p == &aTsbCenterStart ) 1404*cdf0e10cSrcweir aTsbCenterEnd.SetState( aTsbCenterStart.GetState() ); 1405*cdf0e10cSrcweir } 1406*cdf0e10cSrcweir 1407*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 1408*cdf0e10cSrcweir 1409*cdf0e10cSrcweir return( 0L ); 1410*cdf0e10cSrcweir } 1411*cdf0e10cSrcweir 1412*cdf0e10cSrcweir //------------------------------------------------------------------------ 1413*cdf0e10cSrcweir // #116827# 1414*cdf0e10cSrcweir 1415*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ChangeEdgeStyleHdl_Impl, void *, EMPTYARG ) 1416*cdf0e10cSrcweir { 1417*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 1418*cdf0e10cSrcweir 1419*cdf0e10cSrcweir return( 0L ); 1420*cdf0e10cSrcweir } 1421*cdf0e10cSrcweir 1422*cdf0e10cSrcweir //------------------------------------------------------------------------ 1423*cdf0e10cSrcweir 1424*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG ) 1425*cdf0e10cSrcweir { 1426*cdf0e10cSrcweir if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar 1427*cdf0e10cSrcweir { 1428*cdf0e10cSrcweir aFtColor.Disable(); 1429*cdf0e10cSrcweir if(!bSymbols) 1430*cdf0e10cSrcweir aLbColor.Disable(); 1431*cdf0e10cSrcweir aFtLineWidth.Disable(); 1432*cdf0e10cSrcweir aMtrLineWidth.Disable(); 1433*cdf0e10cSrcweir 1434*cdf0e10cSrcweir if( aFlLineEnds.IsEnabled() ) 1435*cdf0e10cSrcweir { 1436*cdf0e10cSrcweir aFtLineEndsStyle.Disable(); 1437*cdf0e10cSrcweir aFtLineEndsWidth.Disable(); 1438*cdf0e10cSrcweir aLbStartStyle.Disable(); 1439*cdf0e10cSrcweir aMtrStartWidth.Disable(); 1440*cdf0e10cSrcweir aTsbCenterStart.Disable(); 1441*cdf0e10cSrcweir aLbEndStyle.Disable(); 1442*cdf0e10cSrcweir aMtrEndWidth.Disable(); 1443*cdf0e10cSrcweir aTsbCenterEnd.Disable(); 1444*cdf0e10cSrcweir aCbxSynchronize.Disable(); 1445*cdf0e10cSrcweir 1446*cdf0e10cSrcweir // #116827# 1447*cdf0e10cSrcweir maFTEdgeStyle.Disable(); 1448*cdf0e10cSrcweir maLBEdgeStyle.Disable(); 1449*cdf0e10cSrcweir } 1450*cdf0e10cSrcweir } 1451*cdf0e10cSrcweir else 1452*cdf0e10cSrcweir { 1453*cdf0e10cSrcweir aFtColor.Enable(); 1454*cdf0e10cSrcweir aLbColor.Enable(); 1455*cdf0e10cSrcweir aFtLineWidth.Enable(); 1456*cdf0e10cSrcweir aMtrLineWidth.Enable(); 1457*cdf0e10cSrcweir 1458*cdf0e10cSrcweir if( aFlLineEnds.IsEnabled() ) 1459*cdf0e10cSrcweir { 1460*cdf0e10cSrcweir aFtLineEndsStyle.Enable(); 1461*cdf0e10cSrcweir aFtLineEndsWidth.Enable(); 1462*cdf0e10cSrcweir aLbStartStyle.Enable(); 1463*cdf0e10cSrcweir aMtrStartWidth.Enable(); 1464*cdf0e10cSrcweir aTsbCenterStart.Enable(); 1465*cdf0e10cSrcweir aLbEndStyle.Enable(); 1466*cdf0e10cSrcweir aMtrEndWidth.Enable(); 1467*cdf0e10cSrcweir aTsbCenterEnd.Enable(); 1468*cdf0e10cSrcweir aCbxSynchronize.Enable(); 1469*cdf0e10cSrcweir 1470*cdf0e10cSrcweir // #116827# 1471*cdf0e10cSrcweir maFTEdgeStyle.Enable(); 1472*cdf0e10cSrcweir maLBEdgeStyle.Enable(); 1473*cdf0e10cSrcweir } 1474*cdf0e10cSrcweir } 1475*cdf0e10cSrcweir ChangePreviewHdl_Impl( NULL ); 1476*cdf0e10cSrcweir 1477*cdf0e10cSrcweir return( 0L ); 1478*cdf0e10cSrcweir } 1479*cdf0e10cSrcweir 1480*cdf0e10cSrcweir //------------------------------------------------------------------------ 1481*cdf0e10cSrcweir 1482*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) 1483*cdf0e10cSrcweir { 1484*cdf0e10cSrcweir if( aCbxSynchronize.IsChecked() ) 1485*cdf0e10cSrcweir { 1486*cdf0e10cSrcweir if( p == &aMtrEndWidth ) 1487*cdf0e10cSrcweir aMtrStartWidth.SetValue( aMtrEndWidth.GetValue() ); 1488*cdf0e10cSrcweir if( p == &aLbEndStyle ) 1489*cdf0e10cSrcweir aLbStartStyle.SelectEntryPos( aLbEndStyle.GetSelectEntryPos() ); 1490*cdf0e10cSrcweir if( p == &aTsbCenterEnd ) 1491*cdf0e10cSrcweir aTsbCenterStart.SetState( aTsbCenterEnd.GetState() ); 1492*cdf0e10cSrcweir } 1493*cdf0e10cSrcweir 1494*cdf0e10cSrcweir ChangePreviewHdl_Impl( this ); 1495*cdf0e10cSrcweir 1496*cdf0e10cSrcweir return( 0L ); 1497*cdf0e10cSrcweir } 1498*cdf0e10cSrcweir 1499*cdf0e10cSrcweir //------------------------------------------------------------------------ 1500*cdf0e10cSrcweir /* 1501*cdf0e10cSrcweir 1502*cdf0e10cSrcweir long SvxLineTabPage::ClickMeasuringHdl_Impl( void* ) 1503*cdf0e10cSrcweir { 1504*cdf0e10cSrcweir if( aTsbShowMeasuring.GetState() == STATE_NOCHECK ) 1505*cdf0e10cSrcweir { 1506*cdf0e10cSrcweir aFtPosition.Disable(); 1507*cdf0e10cSrcweir aCtlPosition.Disable(); 1508*cdf0e10cSrcweir } 1509*cdf0e10cSrcweir else 1510*cdf0e10cSrcweir { 1511*cdf0e10cSrcweir aFtPosition.Enable(); 1512*cdf0e10cSrcweir aCtlPosition.Enable(); 1513*cdf0e10cSrcweir } 1514*cdf0e10cSrcweir aCtlPosition.Invalidate(); 1515*cdf0e10cSrcweir 1516*cdf0e10cSrcweir return( 0L ); 1517*cdf0e10cSrcweir } 1518*cdf0e10cSrcweir */ 1519*cdf0e10cSrcweir //------------------------------------------------------------------------ 1520*cdf0e10cSrcweir 1521*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, ChangeTransparentHdl_Impl, void *, EMPTYARG ) 1522*cdf0e10cSrcweir { 1523*cdf0e10cSrcweir sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); 1524*cdf0e10cSrcweir XLineTransparenceItem aItem( nVal ); 1525*cdf0e10cSrcweir 1526*cdf0e10cSrcweir rXLSet.Put( XLineTransparenceItem( aItem ) ); 1527*cdf0e10cSrcweir 1528*cdf0e10cSrcweir // #116827# 1529*cdf0e10cSrcweir FillXLSet_Impl(); 1530*cdf0e10cSrcweir 1531*cdf0e10cSrcweir aCtlPreview.Invalidate(); 1532*cdf0e10cSrcweir 1533*cdf0e10cSrcweir return( 0L ); 1534*cdf0e10cSrcweir } 1535*cdf0e10cSrcweir 1536*cdf0e10cSrcweir //------------------------------------------------------------------------ 1537*cdf0e10cSrcweir 1538*cdf0e10cSrcweir void SvxLineTabPage::PointChanged( Window*, RECT_POINT eRcPt ) 1539*cdf0e10cSrcweir { 1540*cdf0e10cSrcweir eRP = eRcPt; 1541*cdf0e10cSrcweir } 1542*cdf0e10cSrcweir 1543*cdf0e10cSrcweir //------------------------------------------------------------------------ 1544*cdf0e10cSrcweir 1545*cdf0e10cSrcweir void SvxLineTabPage::FillUserData() 1546*cdf0e10cSrcweir { 1547*cdf0e10cSrcweir // Abgleich wird in der Ini-Datei festgehalten 1548*cdf0e10cSrcweir UniString aStrUserData = UniString::CreateFromInt32( (sal_Int32) aCbxSynchronize.IsChecked() ); 1549*cdf0e10cSrcweir SetUserData( aStrUserData ); 1550*cdf0e10cSrcweir } 1551*cdf0e10cSrcweir 1552*cdf0e10cSrcweir 1553*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) 1554*cdf0e10cSrcweir //Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton) 1555*cdf0e10cSrcweir //der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage 1556*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) 1557*cdf0e10cSrcweir { 1558*cdf0e10cSrcweir //Popup initialisieren 1559*cdf0e10cSrcweir if(!pButton->GetPopupMenu()->GetPopupMenu( MN_GALLERY )) 1560*cdf0e10cSrcweir { 1561*cdf0e10cSrcweir // Gallery-Eintraege besorgen 1562*cdf0e10cSrcweir GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); 1563*cdf0e10cSrcweir 1564*cdf0e10cSrcweir PopupMenu* pPopup = new PopupMenu; 1565*cdf0e10cSrcweir String aEmptyStr; 1566*cdf0e10cSrcweir 1567*cdf0e10cSrcweir nNumMenuGalleryItems=aGrfNames.Count(); 1568*cdf0e10cSrcweir for(long i = 0; i < nNumMenuGalleryItems; i++) 1569*cdf0e10cSrcweir { 1570*cdf0e10cSrcweir const String* pGrfName = (const String*)aGrfNames.GetObject(i); 1571*cdf0e10cSrcweir const String* pUIName = pGrfName; 1572*cdf0e10cSrcweir 1573*cdf0e10cSrcweir // convert URL encodings to UI characters (eg %20 for spaces) 1574*cdf0e10cSrcweir String aPhysicalName; 1575*cdf0e10cSrcweir if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *pGrfName, aPhysicalName )) 1576*cdf0e10cSrcweir pUIName = &aPhysicalName; 1577*cdf0e10cSrcweir 1578*cdf0e10cSrcweir SvxBrushItem* pBrushItem = new SvxBrushItem(*pGrfName, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH); 1579*cdf0e10cSrcweir pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); 1580*cdf0e10cSrcweir 1581*cdf0e10cSrcweir SvxBmpItemInfo* pInfo = new SvxBmpItemInfo(); 1582*cdf0e10cSrcweir pInfo->pBrushItem = pBrushItem; 1583*cdf0e10cSrcweir pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i); 1584*cdf0e10cSrcweir aGrfBrushItems.Insert(pInfo, i); 1585*cdf0e10cSrcweir const Graphic* pGraphic = pBrushItem->GetGraphic(); 1586*cdf0e10cSrcweir 1587*cdf0e10cSrcweir if(pGraphic) 1588*cdf0e10cSrcweir { 1589*cdf0e10cSrcweir Bitmap aBitmap(pGraphic->GetBitmap()); 1590*cdf0e10cSrcweir Size aSize(aBitmap.GetSizePixel()); 1591*cdf0e10cSrcweir if(aSize.Width() > MAX_BMP_WIDTH || 1592*cdf0e10cSrcweir aSize.Height() > MAX_BMP_HEIGHT) 1593*cdf0e10cSrcweir { 1594*cdf0e10cSrcweir sal_Bool bWidth = aSize.Width() > aSize.Height(); 1595*cdf0e10cSrcweir double nScale = bWidth ? 1596*cdf0e10cSrcweir (double)MAX_BMP_WIDTH / (double)aSize.Width(): 1597*cdf0e10cSrcweir (double)MAX_BMP_HEIGHT / (double)aSize.Height(); 1598*cdf0e10cSrcweir aBitmap.Scale(nScale, nScale); 1599*cdf0e10cSrcweir 1600*cdf0e10cSrcweir } 1601*cdf0e10cSrcweir Image aImage(aBitmap); 1602*cdf0e10cSrcweir pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage ); 1603*cdf0e10cSrcweir } 1604*cdf0e10cSrcweir else 1605*cdf0e10cSrcweir { 1606*cdf0e10cSrcweir Image aImage; 1607*cdf0e10cSrcweir pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage ); 1608*cdf0e10cSrcweir } 1609*cdf0e10cSrcweir } 1610*cdf0e10cSrcweir aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup ); 1611*cdf0e10cSrcweir if(!aGrfNames.Count()) 1612*cdf0e10cSrcweir aSymbolMB.GetPopupMenu()->EnableItem(MN_GALLERY, sal_False); 1613*cdf0e10cSrcweir } 1614*cdf0e10cSrcweir 1615*cdf0e10cSrcweir if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList) 1616*cdf0e10cSrcweir { 1617*cdf0e10cSrcweir VirtualDevice aVDev; 1618*cdf0e10cSrcweir aVDev.SetMapMode(MapMode(MAP_100TH_MM)); 1619*cdf0e10cSrcweir SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS); 1620*cdf0e10cSrcweir pModel->GetItemPool().FreezeIdRanges(); 1621*cdf0e10cSrcweir // Page 1622*cdf0e10cSrcweir SdrPage* pPage = new SdrPage( *pModel, sal_False ); 1623*cdf0e10cSrcweir pPage->SetSize(Size(1000,1000)); 1624*cdf0e10cSrcweir pModel->InsertPage( pPage, 0 ); 1625*cdf0e10cSrcweir // 3D View 1626*cdf0e10cSrcweir SdrView* pView = new SdrView( pModel, &aVDev ); 1627*cdf0e10cSrcweir pView->hideMarkHandles(); 1628*cdf0e10cSrcweir // SdrPageView* pPageView = pView->ShowSdrPage(pPage, Point()); 1629*cdf0e10cSrcweir SdrPageView* pPageView = pView->ShowSdrPage(pPage); 1630*cdf0e10cSrcweir 1631*cdf0e10cSrcweir PopupMenu* pPopup = new PopupMenu; 1632*cdf0e10cSrcweir String aEmptyStr; 1633*cdf0e10cSrcweir for(long i=0;; ++i) 1634*cdf0e10cSrcweir { 1635*cdf0e10cSrcweir SdrObject *pObj=pSymbolList->GetObj(i); 1636*cdf0e10cSrcweir if(pObj==NULL) 1637*cdf0e10cSrcweir break; 1638*cdf0e10cSrcweir pObj=pObj->Clone(); 1639*cdf0e10cSrcweir //const String* pGrfName = (const String*)aGrfNames.GetObject(i); 1640*cdf0e10cSrcweir String *pStr=new String();//String(i)); 1641*cdf0e10cSrcweir aGrfNames.Insert(pStr,LIST_APPEND); 1642*cdf0e10cSrcweir //Rectangle aRect(pObj->GetLogicRect()); 1643*cdf0e10cSrcweir pPage->NbcInsertObject(pObj); 1644*cdf0e10cSrcweir pView->MarkObj(pObj,pPageView); 1645*cdf0e10cSrcweir if(pSymbolAttr) 1646*cdf0e10cSrcweir { 1647*cdf0e10cSrcweir pObj->SetMergedItemSet(*pSymbolAttr); 1648*cdf0e10cSrcweir } 1649*cdf0e10cSrcweir else 1650*cdf0e10cSrcweir { 1651*cdf0e10cSrcweir pObj->SetMergedItemSet(rOutAttrs); 1652*cdf0e10cSrcweir } 1653*cdf0e10cSrcweir 1654*cdf0e10cSrcweir Bitmap aBitmap(pView->GetAllMarkedBitmap()); 1655*cdf0e10cSrcweir GDIMetaFile aMeta(pView->GetAllMarkedMetaFile()); 1656*cdf0e10cSrcweir pView->UnmarkAll(); 1657*cdf0e10cSrcweir pObj=pPage->RemoveObject(0); 1658*cdf0e10cSrcweir SdrObject::Free(pObj); 1659*cdf0e10cSrcweir 1660*cdf0e10cSrcweir SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH); 1661*cdf0e10cSrcweir pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); 1662*cdf0e10cSrcweir 1663*cdf0e10cSrcweir SvxBmpItemInfo* pInfo = new SvxBmpItemInfo(); 1664*cdf0e10cSrcweir pInfo->pBrushItem = pBrushItem; 1665*cdf0e10cSrcweir pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i + nNumMenuGalleryItems); 1666*cdf0e10cSrcweir aGrfBrushItems.Insert(pInfo, nNumMenuGalleryItems + i); 1667*cdf0e10cSrcweir 1668*cdf0e10cSrcweir Size aSize(aBitmap.GetSizePixel()); 1669*cdf0e10cSrcweir if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT) 1670*cdf0e10cSrcweir { 1671*cdf0e10cSrcweir sal_Bool bWidth = aSize.Width() > aSize.Height(); 1672*cdf0e10cSrcweir double nScale = bWidth ? 1673*cdf0e10cSrcweir (double)MAX_BMP_WIDTH / (double)aSize.Width(): 1674*cdf0e10cSrcweir (double)MAX_BMP_HEIGHT / (double)aSize.Height(); 1675*cdf0e10cSrcweir aBitmap.Scale(nScale, nScale); 1676*cdf0e10cSrcweir } 1677*cdf0e10cSrcweir Image aImage(aBitmap); 1678*cdf0e10cSrcweir pPopup->InsertItem(pInfo->nItemId,*pStr,aImage); 1679*cdf0e10cSrcweir } 1680*cdf0e10cSrcweir aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup ); 1681*cdf0e10cSrcweir if(!aGrfNames.Count()) 1682*cdf0e10cSrcweir aSymbolMB.GetPopupMenu()->EnableItem(MN_SYMBOLS, sal_False); 1683*cdf0e10cSrcweir 1684*cdf0e10cSrcweir delete pView; 1685*cdf0e10cSrcweir delete pModel; 1686*cdf0e10cSrcweir } 1687*cdf0e10cSrcweir return 0; 1688*cdf0e10cSrcweir } 1689*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) 1690*cdf0e10cSrcweir //Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton) 1691*cdf0e10cSrcweir //der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage: 1692*cdf0e10cSrcweir IMPL_STATIC_LINK(SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem*, pItem) 1693*cdf0e10cSrcweir { 1694*cdf0e10cSrcweir PopupMenu* pPopup = pThis->aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); 1695*cdf0e10cSrcweir 1696*cdf0e10cSrcweir SvxBmpItemInfo* pBmpInfo = 0; 1697*cdf0e10cSrcweir for ( sal_uInt16 i = 0; i < pThis->aGrfBrushItems.Count(); i++ ) 1698*cdf0e10cSrcweir { 1699*cdf0e10cSrcweir SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)pThis->aGrfBrushItems.GetObject(i); 1700*cdf0e10cSrcweir if( pInfo->pBrushItem == pItem ) 1701*cdf0e10cSrcweir { 1702*cdf0e10cSrcweir pBmpInfo = pInfo; break; 1703*cdf0e10cSrcweir } 1704*cdf0e10cSrcweir } 1705*cdf0e10cSrcweir if( pBmpInfo ) 1706*cdf0e10cSrcweir { 1707*cdf0e10cSrcweir if( pItem->GetGraphic() ) 1708*cdf0e10cSrcweir { 1709*cdf0e10cSrcweir Bitmap aBitmap(pItem->GetGraphic()->GetBitmap()); 1710*cdf0e10cSrcweir Size aSize(aBitmap.GetSizePixel()); 1711*cdf0e10cSrcweir if(aSize.Width() > MAX_BMP_WIDTH || 1712*cdf0e10cSrcweir aSize.Height() > MAX_BMP_HEIGHT) 1713*cdf0e10cSrcweir { 1714*cdf0e10cSrcweir sal_Bool bWidth = aSize.Width() > aSize.Height(); 1715*cdf0e10cSrcweir double nScale = bWidth ? 1716*cdf0e10cSrcweir (double)MAX_BMP_WIDTH / (double)aSize.Width(): 1717*cdf0e10cSrcweir (double)MAX_BMP_HEIGHT / (double)aSize.Height(); 1718*cdf0e10cSrcweir aBitmap.Scale(nScale, nScale); 1719*cdf0e10cSrcweir } 1720*cdf0e10cSrcweir Image aImage(aBitmap); 1721*cdf0e10cSrcweir pPopup->SetItemImage( pBmpInfo->nItemId, aImage ); 1722*cdf0e10cSrcweir } 1723*cdf0e10cSrcweir } 1724*cdf0e10cSrcweir 1725*cdf0e10cSrcweir return 0; 1726*cdf0e10cSrcweir } 1727*cdf0e10cSrcweir 1728*cdf0e10cSrcweir //#58425# Symbole auf einer Linie (z.B. StarChart) 1729*cdf0e10cSrcweir //Handler f�r Menuebutton 1730*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, GraphicHdl_Impl, MenuButton *, pButton ) 1731*cdf0e10cSrcweir { 1732*cdf0e10cSrcweir sal_uInt16 nItemId = pButton->GetCurItemId(); 1733*cdf0e10cSrcweir const Graphic* pGraphic = 0; 1734*cdf0e10cSrcweir Graphic aGraphic; 1735*cdf0e10cSrcweir String aGrfName; 1736*cdf0e10cSrcweir sal_Bool bResetSize = sal_False; 1737*cdf0e10cSrcweir sal_Bool bEnable=sal_True; 1738*cdf0e10cSrcweir long nPreviousSymbolType = nSymbolType; 1739*cdf0e10cSrcweir 1740*cdf0e10cSrcweir if(nItemId >= MN_GALLERY_ENTRY) 1741*cdf0e10cSrcweir { 1742*cdf0e10cSrcweir if( (nItemId-MN_GALLERY_ENTRY) >= nNumMenuGalleryItems) 1743*cdf0e10cSrcweir { 1744*cdf0e10cSrcweir nSymbolType=nItemId-MN_GALLERY_ENTRY-nNumMenuGalleryItems; //Index der Liste 1745*cdf0e10cSrcweir } 1746*cdf0e10cSrcweir else 1747*cdf0e10cSrcweir { 1748*cdf0e10cSrcweir nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM; 1749*cdf0e10cSrcweir bResetSize = sal_True; 1750*cdf0e10cSrcweir } 1751*cdf0e10cSrcweir SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)aGrfBrushItems.GetObject(nItemId - MN_GALLERY_ENTRY); 1752*cdf0e10cSrcweir pGraphic = pInfo->pBrushItem->GetGraphic(); 1753*cdf0e10cSrcweir } 1754*cdf0e10cSrcweir else switch(nItemId) 1755*cdf0e10cSrcweir { 1756*cdf0e10cSrcweir case MN_SYMBOLS_AUTO: 1757*cdf0e10cSrcweir { 1758*cdf0e10cSrcweir pGraphic=&aAutoSymbolGraphic; 1759*cdf0e10cSrcweir aAutoSymbolGraphic.SetPrefSize( Size(253,253) ); 1760*cdf0e10cSrcweir nSymbolType=SVX_SYMBOLTYPE_AUTO; 1761*cdf0e10cSrcweir } 1762*cdf0e10cSrcweir break; 1763*cdf0e10cSrcweir 1764*cdf0e10cSrcweir case MN_SYMBOLS_NONE: 1765*cdf0e10cSrcweir { 1766*cdf0e10cSrcweir nSymbolType=SVX_SYMBOLTYPE_NONE; 1767*cdf0e10cSrcweir pGraphic=NULL; 1768*cdf0e10cSrcweir bEnable=sal_False; 1769*cdf0e10cSrcweir } 1770*cdf0e10cSrcweir break; 1771*cdf0e10cSrcweir default: 1772*cdf0e10cSrcweir { 1773*cdf0e10cSrcweir SvxOpenGraphicDialog aGrfDlg(CUI_RES(RID_STR_EDIT_GRAPHIC)); 1774*cdf0e10cSrcweir aGrfDlg.EnableLink(sal_False); 1775*cdf0e10cSrcweir aGrfDlg.AsLink(sal_False); 1776*cdf0e10cSrcweir if( !aGrfDlg.Execute() ) 1777*cdf0e10cSrcweir { 1778*cdf0e10cSrcweir // ausgewaehlten Filter merken 1779*cdf0e10cSrcweir aGrfName = aGrfDlg.GetPath(); 1780*cdf0e10cSrcweir if( !aGrfDlg.GetGraphic(aGraphic) ) 1781*cdf0e10cSrcweir { 1782*cdf0e10cSrcweir nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM; 1783*cdf0e10cSrcweir pGraphic = &aGraphic; 1784*cdf0e10cSrcweir bResetSize = sal_True; 1785*cdf0e10cSrcweir } 1786*cdf0e10cSrcweir } 1787*cdf0e10cSrcweir if( !pGraphic ) 1788*cdf0e10cSrcweir return 0; 1789*cdf0e10cSrcweir } 1790*cdf0e10cSrcweir break; 1791*cdf0e10cSrcweir } 1792*cdf0e10cSrcweir 1793*cdf0e10cSrcweir if(pGraphic) 1794*cdf0e10cSrcweir { 1795*cdf0e10cSrcweir Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic); 1796*cdf0e10cSrcweir aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)ePoolUnit); 1797*cdf0e10cSrcweir aSymbolGraphic=*pGraphic; 1798*cdf0e10cSrcweir if( bResetSize ) 1799*cdf0e10cSrcweir { 1800*cdf0e10cSrcweir aSymbolSize=aSize; 1801*cdf0e10cSrcweir } 1802*cdf0e10cSrcweir else if( nPreviousSymbolType == SVX_SYMBOLTYPE_BRUSHITEM ) 1803*cdf0e10cSrcweir { //#i31097# Data Point Symbol size changes when a different symbol is choosen(maoyg) 1804*cdf0e10cSrcweir if( aSymbolSize.Width() != aSymbolSize.Height() ) 1805*cdf0e10cSrcweir { 1806*cdf0e10cSrcweir aSize.setWidth( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 ); 1807*cdf0e10cSrcweir aSize.setHeight( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 ); 1808*cdf0e10cSrcweir aSymbolSize = aSize; 1809*cdf0e10cSrcweir } 1810*cdf0e10cSrcweir } 1811*cdf0e10cSrcweir aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize); 1812*cdf0e10cSrcweir } 1813*cdf0e10cSrcweir else 1814*cdf0e10cSrcweir { 1815*cdf0e10cSrcweir aSymbolGraphic=Graphic(); 1816*cdf0e10cSrcweir aCtlPreview.SetSymbol(NULL,aSymbolSize); 1817*cdf0e10cSrcweir bEnable=sal_False; 1818*cdf0e10cSrcweir } 1819*cdf0e10cSrcweir aSymbolLastSize=aSymbolSize; 1820*cdf0e10cSrcweir SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit); 1821*cdf0e10cSrcweir SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(), ePoolUnit); 1822*cdf0e10cSrcweir aSymbolRatioCB.Enable(bEnable); 1823*cdf0e10cSrcweir aSymbolHeightFT.Enable(bEnable); 1824*cdf0e10cSrcweir aSymbolWidthFT.Enable(bEnable); 1825*cdf0e10cSrcweir aSymbolWidthMF.Enable(bEnable); 1826*cdf0e10cSrcweir aSymbolHeightMF.Enable(bEnable); 1827*cdf0e10cSrcweir aCtlPreview.Invalidate(); 1828*cdf0e10cSrcweir 1829*cdf0e10cSrcweir return 0; 1830*cdf0e10cSrcweir } 1831*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, MetricField *, pField) 1832*cdf0e10cSrcweir { 1833*cdf0e10cSrcweir bNewSize=true; 1834*cdf0e10cSrcweir sal_Bool bWidth = (sal_Bool)(pField == &aSymbolWidthMF); 1835*cdf0e10cSrcweir bLastWidthModified = bWidth; 1836*cdf0e10cSrcweir sal_Bool bRatio = aSymbolRatioCB.IsChecked(); 1837*cdf0e10cSrcweir long nWidthVal = static_cast<long>(aSymbolWidthMF.Denormalize(aSymbolWidthMF.GetValue(FUNIT_100TH_MM))); 1838*cdf0e10cSrcweir long nHeightVal= static_cast<long>(aSymbolHeightMF.Denormalize(aSymbolHeightMF.GetValue(FUNIT_100TH_MM))); 1839*cdf0e10cSrcweir nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MAP_100TH_MM,(MapUnit)ePoolUnit ); 1840*cdf0e10cSrcweir nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MAP_100TH_MM,(MapUnit)ePoolUnit); 1841*cdf0e10cSrcweir aSymbolSize=Size(nWidthVal,nHeightVal); 1842*cdf0e10cSrcweir double fSizeRatio = (double)1; 1843*cdf0e10cSrcweir 1844*cdf0e10cSrcweir if(bRatio) 1845*cdf0e10cSrcweir { 1846*cdf0e10cSrcweir if (aSymbolLastSize.Height() && aSymbolLastSize.Width()) 1847*cdf0e10cSrcweir fSizeRatio = (double)aSymbolLastSize.Width() / aSymbolLastSize.Height(); 1848*cdf0e10cSrcweir } 1849*cdf0e10cSrcweir 1850*cdf0e10cSrcweir //Size aSymbolSize(aSymbolLastSize); 1851*cdf0e10cSrcweir 1852*cdf0e10cSrcweir if(bWidth) 1853*cdf0e10cSrcweir { 1854*cdf0e10cSrcweir long nDelta = nWidthVal - aSymbolLastSize.Width(); 1855*cdf0e10cSrcweir aSymbolSize.Width() = nWidthVal; 1856*cdf0e10cSrcweir if (bRatio) 1857*cdf0e10cSrcweir { 1858*cdf0e10cSrcweir aSymbolSize.Height() = aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio); 1859*cdf0e10cSrcweir aSymbolSize.Height() = OutputDevice::LogicToLogic( aSymbolSize.Height(),(MapUnit)ePoolUnit, MAP_100TH_MM ); 1860*cdf0e10cSrcweir aSymbolHeightMF.SetUserValue(aSymbolHeightMF.Normalize(aSymbolSize.Height()), FUNIT_100TH_MM); 1861*cdf0e10cSrcweir } 1862*cdf0e10cSrcweir } 1863*cdf0e10cSrcweir else 1864*cdf0e10cSrcweir { 1865*cdf0e10cSrcweir long nDelta = nHeightVal - aSymbolLastSize.Height(); 1866*cdf0e10cSrcweir aSymbolSize.Height() = nHeightVal; 1867*cdf0e10cSrcweir if (bRatio) 1868*cdf0e10cSrcweir { 1869*cdf0e10cSrcweir aSymbolSize.Width() = aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio); 1870*cdf0e10cSrcweir aSymbolSize.Width() = OutputDevice::LogicToLogic( aSymbolSize.Width(), 1871*cdf0e10cSrcweir (MapUnit)ePoolUnit, MAP_100TH_MM ); 1872*cdf0e10cSrcweir aSymbolWidthMF.SetUserValue(aSymbolWidthMF.Normalize(aSymbolSize.Width()), FUNIT_100TH_MM); 1873*cdf0e10cSrcweir } 1874*cdf0e10cSrcweir } 1875*cdf0e10cSrcweir aCtlPreview.ResizeSymbol(aSymbolSize); 1876*cdf0e10cSrcweir aSymbolLastSize=aSymbolSize; 1877*cdf0e10cSrcweir return 0; 1878*cdf0e10cSrcweir } 1879*cdf0e10cSrcweir IMPL_LINK( SvxLineTabPage, RatioHdl_Impl, CheckBox *, pBox ) 1880*cdf0e10cSrcweir { 1881*cdf0e10cSrcweir if (pBox->IsChecked()) 1882*cdf0e10cSrcweir { 1883*cdf0e10cSrcweir if (bLastWidthModified) 1884*cdf0e10cSrcweir SizeHdl_Impl(&aSymbolWidthMF); 1885*cdf0e10cSrcweir else 1886*cdf0e10cSrcweir SizeHdl_Impl(&aSymbolHeightMF); 1887*cdf0e10cSrcweir } 1888*cdf0e10cSrcweir return 0; 1889*cdf0e10cSrcweir } 1890*cdf0e10cSrcweir 1891*cdf0e10cSrcweir 1892*cdf0e10cSrcweir void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt ) 1893*cdf0e10cSrcweir { 1894*cdf0e10cSrcweir SvxTabPage::DataChanged( rDCEvt ); 1895*cdf0e10cSrcweir 1896*cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) 1897*cdf0e10cSrcweir { 1898*cdf0e10cSrcweir FillListboxes(); 1899*cdf0e10cSrcweir } 1900*cdf0e10cSrcweir } 1901*cdf0e10cSrcweir 1902*cdf0e10cSrcweir void SvxLineTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001 1903*cdf0e10cSrcweir { 1904*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False); 1905*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST,sal_False); 1906*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST,sal_False); 1907*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); 1908*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); 1909*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pSdrObjListItem,OfaPtrItem,SID_OBJECT_LIST,sal_False); 1910*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pSymbolAttrItem,SfxTabDialogItem,SID_ATTR_SET,sal_False); 1911*cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC,sal_False); 1912*cdf0e10cSrcweir 1913*cdf0e10cSrcweir if (pColorTabItem) 1914*cdf0e10cSrcweir SetColorTable(pColorTabItem->GetColorTable()); 1915*cdf0e10cSrcweir if (pDashListItem) 1916*cdf0e10cSrcweir SetDashList(pDashListItem->GetDashList()); 1917*cdf0e10cSrcweir if (pLineEndListItem) 1918*cdf0e10cSrcweir SetLineEndList(pLineEndListItem->GetLineEndList()); 1919*cdf0e10cSrcweir if (pPageTypeItem) 1920*cdf0e10cSrcweir SetPageType(pPageTypeItem->GetValue()); 1921*cdf0e10cSrcweir if (pDlgTypeItem) 1922*cdf0e10cSrcweir SetDlgType(pDlgTypeItem->GetValue()); 1923*cdf0e10cSrcweir Construct(); 1924*cdf0e10cSrcweir 1925*cdf0e10cSrcweir if(pSdrObjListItem) //symbols 1926*cdf0e10cSrcweir { 1927*cdf0e10cSrcweir ShowSymbolControls(sal_True); 1928*cdf0e10cSrcweir pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue()); 1929*cdf0e10cSrcweir if (pSymbolAttrItem) 1930*cdf0e10cSrcweir pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet()); 1931*cdf0e10cSrcweir if(pGraphicItem) 1932*cdf0e10cSrcweir aAutoSymbolGraphic = pGraphicItem->GetGraphic(); 1933*cdf0e10cSrcweir } 1934*cdf0e10cSrcweir } 1935