1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <editeng/sizeitem.hxx>
21 #include <tools/shl.hxx>
22 #include <tools/urlobj.hxx>
23 #include <sfx2/app.hxx>
24 #include <sfx2/module.hxx>
27 #include "tabline.hrc"
28 #include "svx/xattr.hxx"
29 #include <svx/xpool.hxx>
30 #include <svx/xtable.hxx>
31 #include "svx/drawitem.hxx"
32 #include "cuitabline.hxx"
33 #include "dlgname.hxx"
34 #include <dialmgr.hxx>
35 #include "svx/dlgutil.hxx"
36 #include "svx/svxgrahicitem.hxx"
37 #include <sfx2/request.hxx>
38 #include "svx/ofaitem.hxx"
39 #include <svx/svdobj.hxx>
40 #include <svx/svdview.hxx>
41 #include <svx/svdmodel.hxx>
42 #include <svx/numvset.hxx>
43 #include <vcl/msgbox.hxx>
44 #include <editeng/numitem.hxx>
45 #include <editeng/svxenum.hxx>
46 #include <sfx2/objsh.hxx>
47 #include <editeng/brushitem.hxx>
48 #include <svx/gallery.hxx>
49 #include <unotools/localfilehelper.hxx>
50 #include "paragrph.hrc"
51 #include "sfx2/opengrf.hxx"
52 #include <svx/dialmgr.hxx>
53 #include <svx/dialogs.hrc>
55 #define MAX_BMP_WIDTH 16
56 #define MAX_BMP_HEIGHT 16
58 // static ----------------------------------------------------------------
60 static sal_uInt16 pLineRanges
[] =
62 XATTR_LINETRANSPARENCE
,
63 XATTR_LINETRANSPARENCE
,
65 SID_ATTR_LINE_ENDCENTER
,
69 SvxLineTabPage::SvxLineTabPage
72 const SfxItemSet
& rInAttrs
74 SvxTabPage ( pParent
, CUI_RES( RID_SVXPAGE_LINE
), rInAttrs
),
75 aFlLine ( this, CUI_RES( FL_LINE
) ),
76 aFtLineStyle ( this, CUI_RES( FT_LINE_STYLE
) ),
77 aLbLineStyle ( this, CUI_RES( LB_LINE_STYLE
) ),
78 aFtColor ( this, CUI_RES( FT_COLOR
) ),
79 aLbColor ( this, CUI_RES( LB_COLOR
) ),
80 aFtLineWidth ( this, CUI_RES( FT_LINE_WIDTH
) ),
81 aMtrLineWidth ( this, CUI_RES( MTR_FLD_LINE_WIDTH
) ),
82 aFtTransparent ( this, CUI_RES( FT_TRANSPARENT
) ),
83 aMtrTransparent ( this, CUI_RES( MTR_LINE_TRANSPARENT
) ),
84 aFlLineEnds ( this, CUI_RES( FL_LINE_ENDS
) ),
85 aLbStartStyle ( this, CUI_RES( LB_START_STYLE
) ),
86 aMtrStartWidth ( this, CUI_RES( MTR_FLD_START_WIDTH
) ),
87 aTsbCenterStart ( this, CUI_RES( TSB_CENTER_START
) ),
88 aFtLineEndsStyle ( this, CUI_RES( FT_LINE_ENDS_STYLE
) ),
89 aLbEndStyle ( this, CUI_RES( LB_END_STYLE
) ),
90 aFtLineEndsWidth ( this, CUI_RES( FT_LINE_ENDS_WIDTH
) ),
91 aMtrEndWidth ( this, CUI_RES( MTR_FLD_END_WIDTH
) ),
92 aTsbCenterEnd ( this, CUI_RES( TSB_CENTER_END
) ),
93 aCbxSynchronize ( this, CUI_RES( CBX_SYNCHRONIZE
) ),
94 aFLSeparator ( this, CUI_RES( FL_SEPARATOR
) ),
95 aCtlPreview ( this, CUI_RES( CTL_PREVIEW
) ),
98 maFLEdgeStyle ( this, CUI_RES( FL_EDGE_STYLE
) ),
99 maFTEdgeStyle ( this, CUI_RES( FT_EDGE_STYLE
) ),
100 maLBEdgeStyle ( this, CUI_RES( LB_EDGE_STYLE
) ),
103 maFTCapStyle ( this, CUI_RES( FT_CAP_STYLE
) ),
104 maLBCapStyle ( this, CUI_RES( LB_CAP_STYLE
) ),
108 nNumMenuGalleryItems(0),
109 nSymbolType(SVX_SYMBOLTYPE_UNKNOWN
), // unknown respectively unchanged
111 //#58425# Symbols on a line (e.g. StarChart)
112 aFlSymbol ( this, CUI_RES(FL_SYMBOL_FORMAT
)),
113 aSymbolMB ( this, CUI_RES(MB_SYMBOL_BITMAP
)),
114 aSymbolWidthFT ( this, CUI_RES(FT_SYMBOL_WIDTH
)),
115 aSymbolWidthMF ( this, CUI_RES(MF_SYMBOL_WIDTH
)),
116 aSymbolHeightFT ( this, CUI_RES(FT_SYMBOL_HEIGHT
)),
117 aSymbolHeightMF ( this, CUI_RES(MF_SYMBOL_HEIGHT
)),
118 aSymbolRatioCB ( this, CUI_RES(CB_SYMBOL_RATIO
)),
120 bLastWidthModified(sal_False
),
121 aSymbolLastSize(Size(0,0)),
124 rOutAttrs ( rInAttrs
),
125 bObjSelected( sal_False
),
127 pXPool ( (XOutdevItemPool
*) rInAttrs
.GetPool() ),
128 aXLStyle ( XLINE_DASH
),
130 aXDash ( OUString(), XDash( XDASH_RECT
, 3, 7, 2, 40, 15 ) ),
131 aXColor ( OUString(), COL_LIGHTRED
),
132 aXLineAttr ( pXPool
),
133 rXLSet ( aXLineAttr
.GetItemSet() ),
134 pnLineEndListState( 0 ),
135 pnDashListState( 0 ),
136 pnColorListState( 0 ),
139 aLbEndStyle
.SetAccessibleName(OUString(CUI_RES(STR_STYLE
)));
140 aLbStartStyle
.SetAccessibleName(OUString(CUI_RES( STR_LB_START_STYLE
) ) );
141 aMtrStartWidth
.SetAccessibleName(OUString(CUI_RES( STR_MTR_FLD_START_WIDTH
) ) );
142 aLbEndStyle
.SetAccessibleName(OUString(CUI_RES( STR_LB_END_STYLE
) ) );
143 aMtrEndWidth
.SetAccessibleName(OUString(CUI_RES( STR_MTR_FLD_END_WIDTH
) ) );
144 aTsbCenterStart
.SetAccessibleName(OUString(CUI_RES( STR_CENTER_START
) ) );
145 aTsbCenterEnd
.SetAccessibleName(OUString(CUI_RES( STR_CENTER_END
) ) );
149 aCtlPreview
.SetAccessibleName(OUString(CUI_RES(STR_EXAMPLE
)));
151 // This Page requires ExchangeSupport
152 SetExchangeSupport();
155 FieldUnit eFUnit
= GetModuleFieldUnit( rInAttrs
);
162 // no break -> we now have mm
164 aMtrLineWidth
.SetSpinSize( 50 );
165 aMtrStartWidth
.SetSpinSize( 50 );
166 aMtrEndWidth
.SetSpinSize( 50 );
170 aMtrLineWidth
.SetSpinSize( 2 );
171 aMtrStartWidth
.SetSpinSize( 2 );
172 aMtrEndWidth
.SetSpinSize( 2 );
174 default: ;// prevent warning
176 SetFieldUnit( aMtrLineWidth
, eFUnit
);
177 SetFieldUnit( aMtrStartWidth
, eFUnit
);
178 SetFieldUnit( aMtrEndWidth
, eFUnit
);
180 // determine PoolUnit
181 SfxItemPool
* pPool
= rOutAttrs
.GetPool();
182 DBG_ASSERT( pPool
, "Where is the pool?" );
183 ePoolUnit
= pPool
->GetMetric( SID_ATTR_LINE_WIDTH
);
185 aLbLineStyle
.SetSelectHdl(
186 LINK( this, SvxLineTabPage
, ClickInvisibleHdl_Impl
) );
187 aLbColor
.SetSelectHdl(
188 LINK( this, SvxLineTabPage
, ChangePreviewHdl_Impl
) );
189 aMtrLineWidth
.SetModifyHdl(
190 LINK( this, SvxLineTabPage
, ChangePreviewHdl_Impl
) );
191 aMtrTransparent
.SetModifyHdl(
192 LINK( this, SvxLineTabPage
, ChangeTransparentHdl_Impl
) );
194 Link aStart
= LINK( this, SvxLineTabPage
, ChangeStartHdl_Impl
);
195 Link aEnd
= LINK( this, SvxLineTabPage
, ChangeEndHdl_Impl
);
196 aLbStartStyle
.SetSelectHdl( aStart
);
197 aLbEndStyle
.SetSelectHdl( aEnd
);
198 aMtrStartWidth
.SetModifyHdl( aStart
);
199 aMtrEndWidth
.SetModifyHdl( aEnd
);
200 aTsbCenterStart
.SetClickHdl( aStart
);
201 aTsbCenterEnd
.SetClickHdl( aEnd
);
204 Link aEdgeStyle
= LINK( this, SvxLineTabPage
, ChangeEdgeStyleHdl_Impl
);
205 maLBEdgeStyle
.SetSelectHdl( aEdgeStyle
);
208 Link aCapStyle
= LINK( this, SvxLineTabPage
, ChangeCapStyleHdl_Impl
);
209 maLBCapStyle
.SetSelectHdl( aCapStyle
);
211 // Symbols on a line (eg star charts), MB-handler set
212 aSymbolMB
.SetSelectHdl(LINK(this, SvxLineTabPage
, GraphicHdl_Impl
));
213 aSymbolMB
.SetActivateHdl(LINK(this, SvxLineTabPage
, MenuCreateHdl_Impl
));
214 aSymbolWidthMF
.SetModifyHdl(LINK(this, SvxLineTabPage
, SizeHdl_Impl
));
215 aSymbolHeightMF
.SetModifyHdl(LINK(this, SvxLineTabPage
, SizeHdl_Impl
));
216 aSymbolRatioCB
.SetClickHdl(LINK(this, SvxLineTabPage
, RatioHdl_Impl
));
218 aSymbolRatioCB
.Check(sal_True
);
219 ShowSymbolControls(sal_False
);
224 void SvxLineTabPage::ShowSymbolControls(sal_Bool bOn
)
226 // Symbols on a line (e.g. StarCharts), symbol-enable controls
229 aSymbolWidthFT
.Show(bOn
);
230 aSymbolWidthMF
.Show(bOn
);
231 aSymbolHeightFT
.Show(bOn
);
232 aSymbolHeightMF
.Show(bOn
);
234 aSymbolRatioCB
.Show(bOn
);
236 aCtlPreview
.ShowSymbol(bOn
);
239 SvxLineTabPage::~SvxLineTabPage()
241 // Symbols on a line (e.g. StarCharts), dtor new!
243 delete aSymbolMB
.GetPopupMenu()->GetPopupMenu( MN_GALLERY
);
246 delete aSymbolMB
.GetPopupMenu()->GetPopupMenu( MN_SYMBOLS
);
248 for ( size_t i
= 0, n
= aGrfBrushItems
.size(); i
< n
; ++i
)
250 SvxBmpItemInfo
* pInfo
= aGrfBrushItems
[ i
];
251 delete pInfo
->pBrushItem
;
255 void SvxLineTabPage::Construct()
258 aLbColor
.Fill( pColorList
);
262 void SvxLineTabPage::InitSymbols(MenuButton
* pButton
)
265 if(!pButton
->GetPopupMenu()->GetPopupMenu( MN_GALLERY
))
267 // Get gallery entries
268 GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS
, aGrfNames
);
270 PopupMenu
* pPopup
= new PopupMenu
;
272 const OUString
*pUIName
= NULL
;
274 nNumMenuGalleryItems
= aGrfNames
.size();
275 for(std::vector
<OUString
>::iterator it
= aGrfNames
.begin(); it
!= aGrfNames
.end(); ++it
, ++i
)
279 // Convert URL encodings to UI characters (e.g. %20 for spaces)
280 OUString aPhysicalName
;
281 if (utl::LocalFileHelper::ConvertURLToPhysicalName(*it
, aPhysicalName
))
283 pUIName
= &aPhysicalName
;
286 SvxBrushItem
* pBrushItem
= new SvxBrushItem(*it
, aEmptyStr
, GPOS_AREA
, SID_ATTR_BRUSH
);
287 pBrushItem
->SetDoneLink(STATIC_LINK(this, SvxLineTabPage
, GraphicArrivedHdl_Impl
));
289 SvxBmpItemInfo
* pInfo
= new SvxBmpItemInfo();
290 pInfo
->pBrushItem
= pBrushItem
;
291 pInfo
->nItemId
= (sal_uInt16
)(MN_GALLERY_ENTRY
+ i
);
292 if ( i
< aGrfBrushItems
.size() ) {
293 aGrfBrushItems
.insert( aGrfBrushItems
.begin() + i
, pInfo
);
295 aGrfBrushItems
.push_back( pInfo
);
297 const Graphic
* pGraphic
= pBrushItem
->GetGraphic();
301 Bitmap
aBitmap(pGraphic
->GetBitmap());
302 Size
aSize(aBitmap
.GetSizePixel());
303 if(aSize
.Width() > MAX_BMP_WIDTH
||
304 aSize
.Height() > MAX_BMP_HEIGHT
)
306 sal_Bool bWidth
= aSize
.Width() > aSize
.Height();
307 double nScale
= bWidth
?
308 (double)MAX_BMP_WIDTH
/ (double)aSize
.Width():
309 (double)MAX_BMP_HEIGHT
/ (double)aSize
.Height();
310 aBitmap
.Scale(nScale
, nScale
);
313 Image
aImage(aBitmap
);
314 pPopup
->InsertItem(pInfo
->nItemId
, *pUIName
, aImage
);
319 pPopup
->InsertItem(pInfo
->nItemId
, *pUIName
, aImage
);
322 aSymbolMB
.GetPopupMenu()->SetPopupMenu( MN_GALLERY
, pPopup
);
324 if(aGrfNames
.empty())
325 aSymbolMB
.GetPopupMenu()->EnableItem(MN_GALLERY
, sal_False
);
328 if(!pButton
->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS
) && pSymbolList
)
331 aVDev
.SetMapMode(MapMode(MAP_100TH_MM
));
332 SdrModel
* pModel
= new SdrModel(NULL
, NULL
, LOADREFCOUNTS
);
333 pModel
->GetItemPool().FreezeIdRanges();
335 SdrPage
* pPage
= new SdrPage( *pModel
, sal_False
);
336 pPage
->SetSize(Size(1000,1000));
337 pModel
->InsertPage( pPage
, 0 );
339 SdrView
* pView
= new SdrView( pModel
, &aVDev
);
340 pView
->hideMarkHandles();
341 pView
->ShowSdrPage(pPage
);
343 PopupMenu
* pPopup
= new PopupMenu
;
346 // Generate invisible square to give all symbols a
347 // bitmap size, which is independent from specific glyph
348 SdrObject
*pInvisibleSquare
=pSymbolList
->GetObj(0);
349 pInvisibleSquare
=pInvisibleSquare
->Clone();
350 pPage
->NbcInsertObject(pInvisibleSquare
);
351 pInvisibleSquare
->SetMergedItem(XFillTransparenceItem(100));
352 pInvisibleSquare
->SetMergedItem(XLineTransparenceItem(100));
356 SdrObject
*pObj
=pSymbolList
->GetObj(i
);
360 aGrfNames
.push_back(aEmptyStr
);
361 pPage
->NbcInsertObject(pObj
);
364 pObj
->SetMergedItemSet(*pSymbolAttr
);
368 pObj
->SetMergedItemSet(rOutAttrs
);
371 BitmapEx
aBitmapEx(pView
->GetMarkedObjBitmapEx());
372 GDIMetaFile
aMeta(pView
->GetMarkedObjMetaFile());
374 pObj
=pPage
->RemoveObject(1);
375 SdrObject::Free(pObj
);
377 SvxBrushItem
* pBrushItem
= new SvxBrushItem(Graphic(aMeta
), GPOS_AREA
, SID_ATTR_BRUSH
);
378 pBrushItem
->SetDoneLink(STATIC_LINK(this, SvxLineTabPage
, GraphicArrivedHdl_Impl
));
380 SvxBmpItemInfo
* pInfo
= new SvxBmpItemInfo();
381 pInfo
->pBrushItem
= pBrushItem
;
382 pInfo
->nItemId
= (sal_uInt16
)(MN_GALLERY_ENTRY
+ i
+ nNumMenuGalleryItems
);
383 if ( (size_t)(nNumMenuGalleryItems
+ i
) < aGrfBrushItems
.size() ) {
384 aGrfBrushItems
.insert( aGrfBrushItems
.begin() + nNumMenuGalleryItems
+ i
, pInfo
);
386 aGrfBrushItems
.push_back( pInfo
);
389 Size
aSize(aBitmapEx
.GetSizePixel());
390 if(aSize
.Width() > MAX_BMP_WIDTH
|| aSize
.Height() > MAX_BMP_HEIGHT
)
392 sal_Bool bWidth
= aSize
.Width() > aSize
.Height();
393 double nScale
= bWidth
?
394 (double)MAX_BMP_WIDTH
/ (double)aSize
.Width():
395 (double)MAX_BMP_HEIGHT
/ (double)aSize
.Height();
396 aBitmapEx
.Scale(nScale
, nScale
);
398 Image
aImage(aBitmapEx
);
399 pPopup
->InsertItem(pInfo
->nItemId
,aEmptyStr
,aImage
);
401 pInvisibleSquare
=pPage
->RemoveObject(0);
402 SdrObject::Free(pInvisibleSquare
);
404 aSymbolMB
.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS
, pPopup
);
406 if(aGrfNames
.empty())
407 aSymbolMB
.GetPopupMenu()->EnableItem(MN_SYMBOLS
, sal_False
);
414 void SvxLineTabPage::SymbolSelected(MenuButton
* pButton
)
416 sal_uInt16 nItemId
= pButton
->GetCurItemId();
417 const Graphic
* pGraphic
= 0;
419 bool bResetSize
= false;
421 long nPreviousSymbolType
= nSymbolType
;
423 if(nItemId
>= MN_GALLERY_ENTRY
)
425 if( (nItemId
-MN_GALLERY_ENTRY
) >= nNumMenuGalleryItems
)
427 nSymbolType
=nItemId
-MN_GALLERY_ENTRY
-nNumMenuGalleryItems
; // List's index
431 nSymbolType
=SVX_SYMBOLTYPE_BRUSHITEM
;
434 SvxBmpItemInfo
* pInfo
= aGrfBrushItems
[ nItemId
- MN_GALLERY_ENTRY
];
435 pGraphic
= pInfo
->pBrushItem
->GetGraphic();
439 case MN_SYMBOLS_AUTO
:
441 pGraphic
=&aAutoSymbolGraphic
;
442 aAutoSymbolGraphic
.SetPrefSize( Size(253,253) );
443 nSymbolType
=SVX_SYMBOLTYPE_AUTO
;
447 case MN_SYMBOLS_NONE
:
449 nSymbolType
=SVX_SYMBOLTYPE_NONE
;
456 SvxOpenGraphicDialog
aGrfDlg(CUI_RES(RID_SVXSTR_EDIT_GRAPHIC
));
457 aGrfDlg
.EnableLink(false);
458 aGrfDlg
.AsLink(false);
459 if( !aGrfDlg
.Execute() )
461 // Remember selected filters
462 if( !aGrfDlg
.GetGraphic(aGraphic
) )
464 nSymbolType
=SVX_SYMBOLTYPE_BRUSHITEM
;
465 pGraphic
= &aGraphic
;
477 Size aSize
= SvxNumberFormat::GetGraphicSizeMM100(pGraphic
);
478 aSize
= OutputDevice::LogicToLogic(aSize
, MAP_100TH_MM
, (MapUnit
)ePoolUnit
);
479 aSymbolGraphic
=*pGraphic
;
484 else if( nPreviousSymbolType
== SVX_SYMBOLTYPE_BRUSHITEM
)
485 { //#i31097# Data Point Symbol size changes when a different symbol is choosen(maoyg)
486 if( aSymbolSize
.Width() != aSymbolSize
.Height() )
488 aSize
.setWidth( (long)( aSymbolSize
.Width() + aSymbolSize
.Height() )/2 );
489 aSize
.setHeight( (long)( aSymbolSize
.Width() + aSymbolSize
.Height() )/2 );
493 aCtlPreview
.SetSymbol(&aSymbolGraphic
,aSymbolSize
);
497 aSymbolGraphic
=Graphic();
498 aCtlPreview
.SetSymbol(NULL
,aSymbolSize
);
501 aSymbolLastSize
=aSymbolSize
;
502 SetMetricValue(aSymbolWidthMF
, aSymbolSize
.Width(), ePoolUnit
);
503 SetMetricValue(aSymbolHeightMF
, aSymbolSize
.Height(), ePoolUnit
);
504 aSymbolRatioCB
.Enable(bEnable
);
505 aSymbolHeightFT
.Enable(bEnable
);
506 aSymbolWidthFT
.Enable(bEnable
);
507 aSymbolWidthMF
.Enable(bEnable
);
508 aSymbolHeightMF
.Enable(bEnable
);
509 aCtlPreview
.Invalidate();
512 void SvxLineTabPage::FillListboxes()
515 sal_uInt16 nOldSelect
= aLbLineStyle
.GetSelectEntryPos();
516 // aLbLineStyle.FillStyles();
517 aLbLineStyle
.Fill( pDashList
);
518 aLbLineStyle
.SelectEntryPos( nOldSelect
);
521 OUString
sNone( SVX_RES( RID_SVXSTR_NONE
) );
522 nOldSelect
= aLbStartStyle
.GetSelectEntryPos();
523 aLbStartStyle
.Clear();
524 aLbStartStyle
.InsertEntry( sNone
);
525 aLbStartStyle
.Fill( pLineEndList
);
526 aLbStartStyle
.SelectEntryPos( nOldSelect
);
527 nOldSelect
= aLbEndStyle
.GetSelectEntryPos();
529 aLbEndStyle
.InsertEntry( sNone
);
530 aLbEndStyle
.Fill( pLineEndList
, sal_False
);
531 aLbEndStyle
.SelectEntryPos( nOldSelect
);
534 // -----------------------------------------------------------------------
536 void SvxLineTabPage::ActivatePage( const SfxItemSet
& rSet
)
538 SFX_ITEMSET_ARG (&rSet
,pPageTypeItem
,CntUInt16Item
,SID_PAGE_TYPE
,sal_False
);
540 SetPageType(pPageTypeItem
->GetValue());
541 if( nDlgType
== 0 && pDashList
.is() )
547 if( ( *pnDashListState
& CT_MODIFIED
) ||
548 ( *pnDashListState
& CT_CHANGED
) )
550 if( *pnDashListState
& CT_CHANGED
)
551 pDashList
= ( (SvxLineTabDialog
*) GetParentDialog() )->
553 *pnDashListState
= CT_NONE
;
556 nPos
= aLbLineStyle
.GetSelectEntryPos();
558 aLbLineStyle
.Clear();
559 aLbLineStyle
.InsertEntry(
560 SVX_RESSTR( RID_SVXSTR_INVISIBLE
) );
561 aLbLineStyle
.InsertEntry(
562 SVX_RESSTR( RID_SVXSTR_SOLID
) );
563 aLbLineStyle
.Fill( pDashList
);
564 nCount
= aLbLineStyle
.GetEntryCount();
567 ; // This case should never occur
568 else if( nCount
<= nPos
)
569 aLbLineStyle
.SelectEntryPos( 0 );
571 aLbLineStyle
.SelectEntryPos( nPos
);
572 // SelectStyleHdl_Impl( this );
575 INetURLObject
aDashURL( pDashList
->GetPath() );
577 aDashURL
.Append( pDashList
->GetName() );
578 DBG_ASSERT( aDashURL
.GetProtocol() != INET_PROT_NOT_VALID
, "invalid URL" );
580 if( ( *pnLineEndListState
& CT_MODIFIED
) ||
581 ( *pnLineEndListState
& CT_CHANGED
) )
583 if( *pnLineEndListState
& CT_CHANGED
)
584 pLineEndList
= ( (SvxLineTabDialog
*) GetParentDialog() )->
586 *pnLineEndListState
= CT_NONE
;
588 nPos
= aLbLineStyle
.GetSelectEntryPos();
589 OUString
sNone( SVX_RES( RID_SVXSTR_NONE
) );
590 aLbStartStyle
.Clear();
591 aLbStartStyle
.InsertEntry( sNone
);
593 aLbStartStyle
.Fill( pLineEndList
);
594 nCount
= aLbStartStyle
.GetEntryCount();
596 ; // This case should never occur
597 else if( nCount
<= nPos
)
598 aLbStartStyle
.SelectEntryPos( 0 );
600 aLbStartStyle
.SelectEntryPos( nPos
);
603 aLbEndStyle
.InsertEntry( sNone
);
605 aLbEndStyle
.Fill( pLineEndList
, sal_False
);
606 nCount
= aLbEndStyle
.GetEntryCount();
609 ; // This case should never occur
610 else if( nCount
<= nPos
)
611 aLbEndStyle
.SelectEntryPos( 0 );
613 aLbEndStyle
.SelectEntryPos( nPos
);
615 INetURLObject
aLineURL( pLineEndList
->GetPath() );
617 aLineURL
.Append( pLineEndList
->GetName() );
618 DBG_ASSERT( aLineURL
.GetProtocol() != INET_PROT_NOT_VALID
, "invalid URL" );
619 // Evaluate if another TabPage set another fill type
620 if( aLbLineStyle
.GetSelectEntryPos() != 0 )
622 if( nPageType
== 2 ) // 1
624 aLbLineStyle
.SelectEntryPos( *pPosDashLb
+ 2 ); // +2 due to SOLID and INVLISIBLE
625 ChangePreviewHdl_Impl( this );
629 aLbStartStyle
.SelectEntryPos( *pPosLineEndLb
+ 1 );// +1 due to SOLID
630 aLbEndStyle
.SelectEntryPos( *pPosLineEndLb
+ 1 );// +1 due to SOLID
631 ChangePreviewHdl_Impl( this );
636 if( *pnColorListState
)
638 if( *pnColorListState
& CT_CHANGED
)
639 pColorList
= ( (SvxLineTabDialog
*) GetParentDialog() )->GetNewColorList();
641 sal_uInt16 nColorPos
= aLbColor
.GetSelectEntryPos();
643 aLbColor
.Fill( pColorList
);
644 nCount
= aLbColor
.GetEntryCount();
646 ; // This case should never occur
647 else if( nCount
<= nColorPos
)
648 aLbColor
.SelectEntryPos( 0 );
650 aLbColor
.SelectEntryPos( nColorPos
);
652 ChangePreviewHdl_Impl( this );
657 // Page does not yet exist in the ctor, that's why we do it here!
659 else if ( nDlgType
== 1100 ||
662 aFtLineEndsStyle
.Hide();
663 aFtLineEndsWidth
.Hide();
664 aLbStartStyle
.Hide();
665 aMtrStartWidth
.Hide();
666 aTsbCenterStart
.Hide();
669 aTsbCenterEnd
.Hide();
670 aCbxSynchronize
.Hide();
674 maFLEdgeStyle
.Hide();
675 maFTEdgeStyle
.Hide();
676 maLBEdgeStyle
.Hide();
684 // -----------------------------------------------------------------------
686 int SvxLineTabPage::DeactivatePage( SfxItemSet
* _pSet
)
688 if( nDlgType
== 0 ) // Line dialog
690 nPageType
= 1; // possibly for extensions
691 *pPosDashLb
= aLbLineStyle
.GetSelectEntryPos() - 2;// First entry SOLID!!!
692 sal_uInt16 nPos
= aLbStartStyle
.GetSelectEntryPos();
693 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
695 *pPosLineEndLb
= nPos
;
699 FillItemSet( *_pSet
);
701 return( LEAVE_PAGE
);
704 // -----------------------------------------------------------------------
706 sal_Bool
SvxLineTabPage::FillItemSet( SfxItemSet
& rAttrs
)
708 const SfxPoolItem
* pOld
= NULL
;
710 sal_Bool bModified
= sal_False
;
712 // To prevent modifications to the list, we do not set other page's items.
713 if( nDlgType
!= 0 || nPageType
!= 2 )
715 nPos
= aLbLineStyle
.GetSelectEntryPos();
716 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
&&
717 nPos
!= aLbLineStyle
.GetSavedValue() )
719 XLineStyleItem
* pStyleItem
= NULL
;
722 pStyleItem
= new XLineStyleItem( XLINE_NONE
);
724 pStyleItem
= new XLineStyleItem( XLINE_SOLID
);
727 pStyleItem
= new XLineStyleItem( XLINE_DASH
);
729 // For added security
730 if( pDashList
->Count() > (long) ( nPos
- 2 ) )
732 XLineDashItem
aDashItem( aLbLineStyle
.GetSelectEntry(),
733 pDashList
->GetDash( nPos
- 2 )->GetDash() );
734 pOld
= GetOldItem( rAttrs
, XATTR_LINEDASH
);
735 if ( !pOld
|| !( *(const XLineDashItem
*)pOld
== aDashItem
) )
737 rAttrs
.Put( aDashItem
);
738 bModified
= sal_True
;
742 pOld
= GetOldItem( rAttrs
, XATTR_LINESTYLE
);
743 if ( !pOld
|| !( *(const XLineStyleItem
*)pOld
== *pStyleItem
) )
745 rAttrs
.Put( *pStyleItem
);
746 bModified
= sal_True
;
752 // GetSavedValue() returns OUString!
753 if( aMtrLineWidth
.GetText() != aMtrLineWidth
.GetSavedValue() )
755 XLineWidthItem
aItem( GetCoreValue( aMtrLineWidth
, ePoolUnit
) );
756 pOld
= GetOldItem( rAttrs
, XATTR_LINEWIDTH
);
757 if ( !pOld
|| !( *(const XLineWidthItem
*)pOld
== aItem
) )
760 bModified
= sal_True
;
764 if( aMtrStartWidth
.GetText() != aMtrStartWidth
.GetSavedValue() )
766 XLineStartWidthItem
aItem( GetCoreValue( aMtrStartWidth
, ePoolUnit
) );
767 pOld
= GetOldItem( rAttrs
, XATTR_LINESTARTWIDTH
);
768 if ( !pOld
|| !( *(const XLineStartWidthItem
*)pOld
== aItem
) )
771 bModified
= sal_True
;
775 if( aMtrEndWidth
.GetText() != aMtrEndWidth
.GetSavedValue() )
777 XLineEndWidthItem
aItem( GetCoreValue( aMtrEndWidth
, ePoolUnit
) );
778 pOld
= GetOldItem( rAttrs
, XATTR_LINEENDWIDTH
);
779 if ( !pOld
|| !( *(const XLineEndWidthItem
*)pOld
== aItem
) )
782 bModified
= sal_True
;
787 if( aLbColor
.GetSelectEntryPos() != aLbColor
.GetSavedValue() )
789 XLineColorItem
aItem( aLbColor
.GetSelectEntry(),
790 aLbColor
.GetSelectEntryColor() );
791 pOld
= GetOldItem( rAttrs
, XATTR_LINECOLOR
);
792 if ( !pOld
|| !( *(const XLineColorItem
*)pOld
== aItem
) )
795 bModified
= sal_True
;
799 if( nDlgType
!= 0 || nPageType
!= 3 )
802 nPos
= aLbStartStyle
.GetSelectEntryPos();
803 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
&&
804 nPos
!= aLbStartStyle
.GetSavedValue() )
806 XLineStartItem
* pItem
= NULL
;
808 pItem
= new XLineStartItem();
809 else if( pLineEndList
->Count() > (long) ( nPos
- 1 ) )
810 pItem
= new XLineStartItem( aLbStartStyle
.GetSelectEntry(),
811 pLineEndList
->GetLineEnd( nPos
- 1 )->GetLineEnd() );
812 pOld
= GetOldItem( rAttrs
, XATTR_LINESTART
);
814 ( !pOld
|| !( *(const XLineEndItem
*)pOld
== *pItem
) ) )
816 rAttrs
.Put( *pItem
);
817 bModified
= sal_True
;
822 nPos
= aLbEndStyle
.GetSelectEntryPos();
823 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
&&
824 nPos
!= aLbEndStyle
.GetSavedValue() )
826 XLineEndItem
* pItem
= NULL
;
828 pItem
= new XLineEndItem();
829 else if( pLineEndList
->Count() > (long) ( nPos
- 1 ) )
830 pItem
= new XLineEndItem( aLbEndStyle
.GetSelectEntry(),
831 pLineEndList
->GetLineEnd( nPos
- 1 )->GetLineEnd() );
832 pOld
= GetOldItem( rAttrs
, XATTR_LINEEND
);
834 ( !pOld
|| !( *(const XLineEndItem
*)pOld
== *pItem
) ) )
836 rAttrs
.Put( *pItem
);
837 bModified
= sal_True
;
844 TriState eState
= aTsbCenterStart
.GetState();
845 if( eState
!= aTsbCenterStart
.GetSavedValue() )
847 XLineStartCenterItem
aItem( sal::static_int_cast
< sal_Bool
>( eState
) );
848 pOld
= GetOldItem( rAttrs
, XATTR_LINESTARTCENTER
);
849 if ( !pOld
|| !( *(const XLineStartCenterItem
*)pOld
== aItem
) )
852 bModified
= sal_True
;
855 eState
= aTsbCenterEnd
.GetState();
856 if( eState
!= aTsbCenterEnd
.GetSavedValue() )
858 XLineEndCenterItem
aItem( sal::static_int_cast
< sal_Bool
>( eState
) );
859 pOld
= GetOldItem( rAttrs
, XATTR_LINEENDCENTER
);
860 if ( !pOld
|| !( *(const XLineEndCenterItem
*)pOld
== aItem
) )
863 bModified
= sal_True
;
868 sal_uInt16 nVal
= (sal_uInt16
)aMtrTransparent
.GetValue();
869 if( nVal
!= (sal_uInt16
)aMtrTransparent
.GetSavedValue().toInt32() )
871 XLineTransparenceItem
aItem( nVal
);
872 pOld
= GetOldItem( rAttrs
, XATTR_LINETRANSPARENCE
);
873 if ( !pOld
|| !( *(const XLineTransparenceItem
*)pOld
== aItem
) )
876 bModified
= sal_True
;
881 nPos
= maLBEdgeStyle
.GetSelectEntryPos();
882 if( LISTBOX_ENTRY_NOTFOUND
!= nPos
&& nPos
!= maLBEdgeStyle
.GetSavedValue() )
884 XLineJointItem
* pNew
= 0L;
888 case 0: // Rounded, default
890 pNew
= new XLineJointItem(com::sun::star::drawing::LineJoint_ROUND
);
895 pNew
= new XLineJointItem(com::sun::star::drawing::LineJoint_NONE
);
900 pNew
= new XLineJointItem(com::sun::star::drawing::LineJoint_MITER
);
905 pNew
= new XLineJointItem(com::sun::star::drawing::LineJoint_BEVEL
);
912 pOld
= GetOldItem( rAttrs
, XATTR_LINEJOINT
);
914 if(!pOld
|| !(*(const XLineJointItem
*)pOld
== *pNew
))
917 bModified
= sal_True
;
925 nPos
= maLBCapStyle
.GetSelectEntryPos();
926 if( LISTBOX_ENTRY_NOTFOUND
!= nPos
&& nPos
!= maLBCapStyle
.GetSavedValue() )
928 XLineCapItem
* pNew
= 0L;
932 case 0: // Butt (=Flat), default
934 pNew
= new XLineCapItem(com::sun::star::drawing::LineCap_BUTT
);
939 pNew
= new XLineCapItem(com::sun::star::drawing::LineCap_ROUND
);
944 pNew
= new XLineCapItem(com::sun::star::drawing::LineCap_SQUARE
);
951 pOld
= GetOldItem( rAttrs
, XATTR_LINECAP
);
953 if(!pOld
|| !(*(const XLineCapItem
*)pOld
== *pNew
))
956 bModified
= sal_True
;
963 if(nSymbolType
!=SVX_SYMBOLTYPE_UNKNOWN
|| bNewSize
)
965 // Was set by selection or the size is different
966 SvxSizeItem
aSItem(rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE
),aSymbolSize
);
967 const SfxPoolItem
* pSOld
= GetOldItem( rAttrs
, rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE
) );
968 bNewSize
= pSOld
? *(const SvxSizeItem
*)pSOld
!= aSItem
: bNewSize
;
975 SfxInt32Item
aTItem(rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE
),nSymbolType
);
976 const SfxPoolItem
* pTOld
= GetOldItem( rAttrs
, rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE
) );
977 bool bNewType
= pTOld
== NULL
|| *(const SfxInt32Item
*)pTOld
!= aTItem
;
978 if(bNewType
&& nSymbolType
==SVX_SYMBOLTYPE_UNKNOWN
)
979 bNewType
=false; // a small fix, type wasn't set -> don't create a type item after all!
986 if(nSymbolType
!=SVX_SYMBOLTYPE_NONE
)
988 SvxBrushItem
aBItem(aSymbolGraphic
,GPOS_MM
,rAttrs
.GetPool()->GetWhich(SID_ATTR_BRUSH
));
989 const SfxPoolItem
* pBOld
= GetOldItem( rAttrs
, rAttrs
.GetPool()->GetWhich(SID_ATTR_BRUSH
) );
991 pBOld
== NULL
|| *(const SvxBrushItem
*)pBOld
!= aBItem
;
999 rAttrs
.Put (CntUInt16Item(SID_PAGE_TYPE
,nPageType
));
1000 return( bModified
);
1003 // -----------------------------------------------------------------------
1005 sal_Bool
SvxLineTabPage::FillXLSet_Impl()
1009 if( aLbLineStyle
.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND
)
1011 rXLSet
.Put( XLineStyleItem( XLINE_NONE
) );
1013 else if( aLbLineStyle
.IsEntryPosSelected( 0 ) )
1014 rXLSet
.Put( XLineStyleItem( XLINE_NONE
) );
1015 else if( aLbLineStyle
.IsEntryPosSelected( 1 ) )
1016 rXLSet
.Put( XLineStyleItem( XLINE_SOLID
) );
1019 rXLSet
.Put( XLineStyleItem( XLINE_DASH
) );
1021 nPos
= aLbLineStyle
.GetSelectEntryPos();
1022 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
1024 rXLSet
.Put( XLineDashItem( aLbLineStyle
.GetSelectEntry(),
1025 pDashList
->GetDash( nPos
- 2 )->GetDash() ) );
1029 nPos
= aLbStartStyle
.GetSelectEntryPos();
1030 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
1033 rXLSet
.Put( XLineStartItem() );
1035 rXLSet
.Put( XLineStartItem( aLbStartStyle
.GetSelectEntry(),
1036 pLineEndList
->GetLineEnd( nPos
- 1 )->GetLineEnd() ) );
1038 nPos
= aLbEndStyle
.GetSelectEntryPos();
1039 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
1042 rXLSet
.Put( XLineEndItem() );
1044 rXLSet
.Put( XLineEndItem( aLbEndStyle
.GetSelectEntry(),
1045 pLineEndList
->GetLineEnd( nPos
- 1 )->GetLineEnd() ) );
1049 nPos
= maLBEdgeStyle
.GetSelectEntryPos();
1050 if(LISTBOX_ENTRY_NOTFOUND
!= nPos
)
1054 case 0: // Rounded, default
1056 rXLSet
.Put(XLineJointItem(com::sun::star::drawing::LineJoint_ROUND
));
1061 rXLSet
.Put(XLineJointItem(com::sun::star::drawing::LineJoint_NONE
));
1066 rXLSet
.Put(XLineJointItem(com::sun::star::drawing::LineJoint_MITER
));
1071 rXLSet
.Put(XLineJointItem(com::sun::star::drawing::LineJoint_BEVEL
));
1078 nPos
= maLBCapStyle
.GetSelectEntryPos();
1079 if(LISTBOX_ENTRY_NOTFOUND
!= nPos
)
1083 case 0: // Butt (=Flat), default
1085 rXLSet
.Put(XLineCapItem(com::sun::star::drawing::LineCap_BUTT
));
1090 rXLSet
.Put(XLineCapItem(com::sun::star::drawing::LineCap_ROUND
));
1095 rXLSet
.Put(XLineCapItem(com::sun::star::drawing::LineCap_SQUARE
));
1101 rXLSet
.Put( XLineStartWidthItem( GetCoreValue( aMtrStartWidth
, ePoolUnit
) ) );
1102 rXLSet
.Put( XLineEndWidthItem( GetCoreValue( aMtrEndWidth
, ePoolUnit
) ) );
1104 rXLSet
.Put( XLineWidthItem( GetCoreValue( aMtrLineWidth
, ePoolUnit
) ) );
1105 rXLSet
.Put( XLineColorItem( aLbColor
.GetSelectEntry(),
1106 aLbColor
.GetSelectEntryColor() ) );
1108 // Centered line end
1109 if( aTsbCenterStart
.GetState() == STATE_CHECK
)
1110 rXLSet
.Put( XLineStartCenterItem( sal_True
) );
1111 else if( aTsbCenterStart
.GetState() == STATE_NOCHECK
)
1112 rXLSet
.Put( XLineStartCenterItem( sal_False
) );
1114 if( aTsbCenterEnd
.GetState() == STATE_CHECK
)
1115 rXLSet
.Put( XLineEndCenterItem( sal_True
) );
1116 else if( aTsbCenterEnd
.GetState() == STATE_NOCHECK
)
1117 rXLSet
.Put( XLineEndCenterItem( sal_False
) );
1120 sal_uInt16 nVal
= (sal_uInt16
)aMtrTransparent
.GetValue();
1121 rXLSet
.Put( XLineTransparenceItem( nVal
) );
1124 aCtlPreview
.SetLineAttributes(aXLineAttr
.GetItemSet());
1129 // -----------------------------------------------------------------------
1131 void SvxLineTabPage::Reset( const SfxItemSet
& rAttrs
)
1133 XLineStyle eXLS
; // XLINE_NONE, XLINE_SOLID, XLINE_DASH
1136 const SfxPoolItem
*pPoolItem
;
1137 long nSymType
=SVX_SYMBOLTYPE_UNKNOWN
;
1138 sal_Bool bPrevSym
=sal_False
;
1139 sal_Bool bEnable
=sal_True
;
1140 sal_Bool bIgnoreGraphic
=sal_False
;
1141 sal_Bool bIgnoreSize
=sal_False
;
1142 if(rAttrs
.GetItemState(rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE
),sal_True
,&pPoolItem
) == SFX_ITEM_SET
)
1144 nSymType
=((const SfxInt32Item
*)pPoolItem
)->GetValue();
1147 if(nSymType
== SVX_SYMBOLTYPE_AUTO
)
1149 aSymbolGraphic
=aAutoSymbolGraphic
;
1150 aSymbolSize
=aSymbolLastSize
=aAutoSymbolGraphic
.GetPrefSize();
1153 else if(nSymType
== SVX_SYMBOLTYPE_NONE
)
1156 bIgnoreGraphic
=sal_True
;
1157 bIgnoreSize
=sal_True
;
1159 else if(nSymType
>= 0)
1161 VirtualDevice aVDev
;
1162 aVDev
.SetMapMode(MapMode(MAP_100TH_MM
));
1164 SdrModel
* pModel
= new SdrModel(NULL
, NULL
, LOADREFCOUNTS
);
1165 pModel
->GetItemPool().FreezeIdRanges();
1166 SdrPage
* pPage
= new SdrPage( *pModel
, sal_False
);
1167 pPage
->SetSize(Size(1000,1000));
1168 pModel
->InsertPage( pPage
, 0 );
1169 SdrView
* pView
= new SdrView( pModel
, &aVDev
);
1170 pView
->hideMarkHandles();
1171 pView
->ShowSdrPage(pPage
);
1172 SdrObject
*pObj
=NULL
;
1173 long nSymTmp
=nSymType
;
1176 if(pSymbolList
->GetObjCount())
1178 nSymTmp
=nSymTmp
%pSymbolList
->GetObjCount(); // Treat list as cyclic!
1179 pObj
=pSymbolList
->GetObj(nSymTmp
);
1185 pObj
->SetMergedItemSet(*pSymbolAttr
);
1189 pObj
->SetMergedItemSet(rOutAttrs
);
1192 pPage
->NbcInsertObject(pObj
);
1194 // Generate invisible square to give all symbol types a
1195 // bitmap size, which is independent from specific glyph
1196 SdrObject
*pInvisibleSquare
=pSymbolList
->GetObj(0);
1197 pInvisibleSquare
=pInvisibleSquare
->Clone();
1198 pPage
->NbcInsertObject(pInvisibleSquare
);
1199 pInvisibleSquare
->SetMergedItem(XFillTransparenceItem(100));
1200 pInvisibleSquare
->SetMergedItem(XLineTransparenceItem(100));
1203 GDIMetaFile
aMeta(pView
->GetMarkedObjMetaFile());
1205 aSymbolGraphic
=Graphic(aMeta
);
1206 aSymbolSize
=pObj
->GetSnapRect().GetSize();
1207 aSymbolGraphic
.SetPrefSize(pInvisibleSquare
->GetSnapRect().GetSize());
1208 aSymbolGraphic
.SetPrefMapMode(MAP_100TH_MM
);
1211 bIgnoreGraphic
=sal_True
;
1214 pInvisibleSquare
=pPage
->RemoveObject(1);
1215 SdrObject::Free( pInvisibleSquare
);
1216 pObj
=pPage
->RemoveObject(0);
1217 SdrObject::Free( pObj
);
1224 if(rAttrs
.GetItemState(rAttrs
.GetPool()->GetWhich(SID_ATTR_BRUSH
),sal_True
,&pPoolItem
) == SFX_ITEM_SET
)
1226 const Graphic
* pGraphic
= ((const SvxBrushItem
*)pPoolItem
)->GetGraphic();
1231 aSymbolGraphic
=*pGraphic
;
1235 aSymbolSize
=OutputDevice::LogicToLogic( pGraphic
->GetPrefSize(),
1236 pGraphic
->GetPrefMapMode(),
1243 if(rAttrs
.GetItemState(rAttrs
.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE
),sal_True
,&pPoolItem
) == SFX_ITEM_SET
)
1245 aSymbolSize
= ((const SvxSizeItem
*)pPoolItem
)->GetSize();
1248 aSymbolRatioCB
.Enable(bEnable
);
1249 aSymbolHeightFT
.Enable(bEnable
);
1250 aSymbolWidthFT
.Enable(bEnable
);
1251 aSymbolWidthMF
.Enable(bEnable
);
1252 aSymbolHeightMF
.Enable(bEnable
);
1255 SetMetricValue(aSymbolWidthMF
, aSymbolSize
.Width(), ePoolUnit
);
1256 SetMetricValue(aSymbolHeightMF
, aSymbolSize
.Height(),ePoolUnit
);
1257 aCtlPreview
.SetSymbol(&aSymbolGraphic
,aSymbolSize
);
1258 aSymbolLastSize
=aSymbolSize
;
1261 if( rAttrs
.GetItemState( XATTR_LINESTYLE
) != SFX_ITEM_DONTCARE
)
1263 eXLS
= (XLineStyle
) ( ( const XLineStyleItem
& ) rAttrs
.Get( XATTR_LINESTYLE
) ).GetValue();
1268 aLbLineStyle
.SelectEntryPos( 0 );
1271 aLbLineStyle
.SelectEntryPos( 1 );
1275 aLbLineStyle
.SetNoSelection();
1276 aLbLineStyle
.SelectEntry( ( ( const XLineDashItem
& ) rAttrs
.
1277 Get( XATTR_LINEDASH
) ).GetName() );
1286 aLbLineStyle
.SetNoSelection();
1290 if( rAttrs
.GetItemState( XATTR_LINEWIDTH
) != SFX_ITEM_DONTCARE
)
1292 SetMetricValue( aMtrLineWidth
, ( ( const XLineWidthItem
& ) rAttrs
.
1293 Get( XATTR_LINEWIDTH
) ).GetValue(), ePoolUnit
);
1296 aMtrLineWidth
.SetText( OUString() );
1299 aLbColor
.SetNoSelection();
1301 if ( rAttrs
.GetItemState( XATTR_LINECOLOR
) != SFX_ITEM_DONTCARE
)
1303 Color aCol
= ( ( const XLineColorItem
& ) rAttrs
.Get( XATTR_LINECOLOR
) ).GetColorValue();
1304 aLbColor
.SelectEntry( aCol
);
1305 if( aLbColor
.GetSelectEntryCount() == 0 )
1307 aLbColor
.InsertEntry( aCol
, OUString() );
1308 aLbColor
.SelectEntry( aCol
);
1314 rAttrs
.GetItemState( XATTR_LINESTART
) == SFX_ITEM_DEFAULT
)
1316 aLbStartStyle
.Disable();
1318 else if( rAttrs
.GetItemState( XATTR_LINESTART
) != SFX_ITEM_DONTCARE
)
1320 // #86265# select entry using list and polygon, not string
1321 sal_Bool
bSelected(sal_False
);
1322 const basegfx::B2DPolyPolygon
& rItemPolygon
= ((const XLineStartItem
&)rAttrs
.Get(XATTR_LINESTART
)).GetLineStartValue();
1324 for(sal_Int32
a(0);!bSelected
&& a
< pLineEndList
->Count(); a
++)
1326 XLineEndEntry
* pEntry
= pLineEndList
->GetLineEnd(a
);
1327 const basegfx::B2DPolyPolygon
& rEntryPolygon
= pEntry
->GetLineEnd();
1329 if(rItemPolygon
== rEntryPolygon
)
1331 // select this entry
1332 aLbStartStyle
.SelectEntryPos((sal_uInt16
)a
+ 1);
1333 bSelected
= sal_True
;
1338 aLbStartStyle
.SelectEntryPos( 0 );
1342 aLbStartStyle
.SetNoSelection();
1347 rAttrs
.GetItemState( XATTR_LINEEND
) == SFX_ITEM_DEFAULT
)
1349 aLbEndStyle
.Disable();
1351 else if( rAttrs
.GetItemState( XATTR_LINEEND
) != SFX_ITEM_DONTCARE
)
1353 // #86265# select entry using list and polygon, not string
1354 sal_Bool
bSelected(sal_False
);
1355 const basegfx::B2DPolyPolygon
& rItemPolygon
= ((const XLineEndItem
&)rAttrs
.Get(XATTR_LINEEND
)).GetLineEndValue();
1357 for(sal_Int32
a(0);!bSelected
&& a
< pLineEndList
->Count(); a
++)
1359 XLineEndEntry
* pEntry
= pLineEndList
->GetLineEnd(a
);
1360 const basegfx::B2DPolyPolygon
& rEntryPolygon
= pEntry
->GetLineEnd();
1362 if(rItemPolygon
== rEntryPolygon
)
1364 // select this entry
1365 aLbEndStyle
.SelectEntryPos((sal_uInt16
)a
+ 1);
1366 bSelected
= sal_True
;
1371 aLbEndStyle
.SelectEntryPos( 0 );
1375 aLbEndStyle
.SetNoSelection();
1378 // Line start strength
1380 rAttrs
.GetItemState( XATTR_LINESTARTWIDTH
) == SFX_ITEM_DEFAULT
)
1382 aMtrStartWidth
.Disable();
1384 else if( rAttrs
.GetItemState( XATTR_LINESTARTWIDTH
) != SFX_ITEM_DONTCARE
)
1386 SetMetricValue( aMtrStartWidth
, ( ( const XLineStartWidthItem
& ) rAttrs
.
1387 Get( XATTR_LINESTARTWIDTH
) ).GetValue(), ePoolUnit
);
1390 aMtrStartWidth
.SetText( OUString() );
1392 // Line end strength
1394 rAttrs
.GetItemState( XATTR_LINEENDWIDTH
) == SFX_ITEM_DEFAULT
)
1396 aMtrEndWidth
.Disable();
1398 else if( rAttrs
.GetItemState( XATTR_LINEENDWIDTH
) != SFX_ITEM_DONTCARE
)
1400 SetMetricValue( aMtrEndWidth
, ( ( const XLineEndWidthItem
& ) rAttrs
.
1401 Get( XATTR_LINEENDWIDTH
) ).GetValue(), ePoolUnit
);
1404 aMtrEndWidth
.SetText( OUString() );
1406 // Centered line end (start)
1408 rAttrs
.GetItemState( XATTR_LINESTARTCENTER
) == SFX_ITEM_DEFAULT
)
1410 aTsbCenterStart
.Disable();
1412 else if( rAttrs
.GetItemState( XATTR_LINESTARTCENTER
) != SFX_ITEM_DONTCARE
)
1414 aTsbCenterStart
.EnableTriState( sal_False
);
1416 if( ( ( const XLineStartCenterItem
& ) rAttrs
.Get( XATTR_LINESTARTCENTER
) ).GetValue() )
1417 aTsbCenterStart
.SetState( STATE_CHECK
);
1419 aTsbCenterStart
.SetState( STATE_NOCHECK
);
1423 aTsbCenterStart
.SetState( STATE_DONTKNOW
);
1426 // Centered line end (end)
1428 rAttrs
.GetItemState( XATTR_LINEENDCENTER
) == SFX_ITEM_DEFAULT
)
1430 aTsbCenterEnd
.Disable();
1432 else if( rAttrs
.GetItemState( XATTR_LINEENDCENTER
) != SFX_ITEM_DONTCARE
)
1434 aTsbCenterEnd
.EnableTriState( sal_False
);
1436 if( ( ( const XLineEndCenterItem
& ) rAttrs
.Get( XATTR_LINEENDCENTER
) ).GetValue() )
1437 aTsbCenterEnd
.SetState( STATE_CHECK
);
1439 aTsbCenterEnd
.SetState( STATE_NOCHECK
);
1443 aTsbCenterEnd
.SetState( STATE_DONTKNOW
);
1447 if( rAttrs
.GetItemState( XATTR_LINETRANSPARENCE
) != SFX_ITEM_DONTCARE
)
1449 sal_uInt16 nTransp
= ( ( const XLineTransparenceItem
& ) rAttrs
.
1450 Get( XATTR_LINETRANSPARENCE
) ).GetValue();
1451 aMtrTransparent
.SetValue( nTransp
);
1452 ChangeTransparentHdl_Impl( NULL
);
1455 aMtrTransparent
.SetText( OUString() );
1457 if( !aLbStartStyle
.IsEnabled() &&
1458 !aLbEndStyle
.IsEnabled() &&
1459 !aMtrStartWidth
.IsEnabled() &&
1460 !aMtrEndWidth
.IsEnabled() &&
1461 !aTsbCenterStart
.IsEnabled()&&
1462 !aTsbCenterEnd
.IsEnabled() )
1464 aCbxSynchronize
.Disable();
1465 aFtLineEndsStyle
.Disable();
1466 aFtLineEndsWidth
.Disable();
1467 aFlLineEnds
.Disable();
1471 // We get the value from the INI file now
1472 OUString aStr
= GetUserData();
1473 aCbxSynchronize
.Check( (sal_Bool
)aStr
.toInt32() );
1476 if(bObjSelected
&& SFX_ITEM_DEFAULT
== rAttrs
.GetItemState(XATTR_LINEJOINT
))
1478 maFTEdgeStyle
.Disable();
1479 maLBEdgeStyle
.Disable();
1481 else if(SFX_ITEM_DONTCARE
!= rAttrs
.GetItemState(XATTR_LINEJOINT
))
1483 const com::sun::star::drawing::LineJoint eLineJoint
= ((const XLineJointItem
&)(rAttrs
.Get(XATTR_LINEJOINT
))).GetValue();
1487 case com::sun::star::drawing::LineJoint_MAKE_FIXED_SIZE
: // fallback to round, unused value
1488 case com::sun::star::drawing::LineJoint_MIDDLE
: // fallback to round, unused value
1489 case com::sun::star::drawing::LineJoint_ROUND
: maLBEdgeStyle
.SelectEntryPos(0); break;
1490 case com::sun::star::drawing::LineJoint_NONE
: maLBEdgeStyle
.SelectEntryPos(1); break;
1491 case com::sun::star::drawing::LineJoint_MITER
: maLBEdgeStyle
.SelectEntryPos(2); break;
1492 case com::sun::star::drawing::LineJoint_BEVEL
: maLBEdgeStyle
.SelectEntryPos(3); break;
1497 maLBEdgeStyle
.SetNoSelection();
1501 if(bObjSelected
&& SFX_ITEM_DEFAULT
== rAttrs
.GetItemState(XATTR_LINECAP
))
1503 maFTCapStyle
.Disable();
1504 maLBCapStyle
.Disable();
1506 else if(SFX_ITEM_DONTCARE
!= rAttrs
.GetItemState(XATTR_LINECAP
))
1508 const com::sun::star::drawing::LineCap
eLineCap(((const XLineCapItem
&)(rAttrs
.Get(XATTR_LINECAP
))).GetValue());
1512 case com::sun::star::drawing::LineCap_ROUND
: maLBCapStyle
.SelectEntryPos(1); break;
1513 case com::sun::star::drawing::LineCap_SQUARE
: maLBCapStyle
.SelectEntryPos(2); break;
1514 default /*com::sun::star::drawing::LineCap_BUTT*/: maLBCapStyle
.SelectEntryPos(0); break;
1519 maLBCapStyle
.SetNoSelection();
1523 aLbLineStyle
.SaveValue();
1524 aMtrLineWidth
.SaveValue();
1525 aLbColor
.SaveValue();
1526 aLbStartStyle
.SaveValue();
1527 aLbEndStyle
.SaveValue();
1528 aMtrStartWidth
.SaveValue();
1529 aMtrEndWidth
.SaveValue();
1530 aTsbCenterStart
.SaveValue();
1531 aTsbCenterEnd
.SaveValue();
1532 aMtrTransparent
.SaveValue();
1535 maLBEdgeStyle
.SaveValue();
1538 maLBCapStyle
.SaveValue();
1540 ClickInvisibleHdl_Impl( this );
1542 ChangePreviewHdl_Impl( NULL
);
1545 // -----------------------------------------------------------------------
1547 SfxTabPage
* SvxLineTabPage::Create( Window
* pWindow
,
1548 const SfxItemSet
& rAttrs
)
1550 return( new SvxLineTabPage( pWindow
, rAttrs
) );
1553 //------------------------------------------------------------------------
1555 sal_uInt16
* SvxLineTabPage::GetRanges()
1560 //------------------------------------------------------------------------
1562 IMPL_LINK( SvxLineTabPage
, ChangePreviewHdl_Impl
, void *, pCntrl
)
1564 if(pCntrl
== &aMtrLineWidth
)
1566 // Line width and start end width
1567 sal_Int32 nNewLineWidth
= GetCoreValue( aMtrLineWidth
, ePoolUnit
);
1568 if(nActLineWidth
== -1)
1570 // Don't initialize yet, get the start value
1571 const SfxPoolItem
* pOld
= GetOldItem( rXLSet
, XATTR_LINEWIDTH
);
1572 sal_Int32 nStartLineWidth
= 0;
1574 nStartLineWidth
= (( const XLineWidthItem
*)pOld
)->GetValue();
1575 nActLineWidth
= nStartLineWidth
;
1578 if(nActLineWidth
!= nNewLineWidth
)
1580 // Adapt start/end width
1581 sal_Int32 nValAct
= GetCoreValue( aMtrStartWidth
, ePoolUnit
);
1582 sal_Int32 nValNew
= nValAct
+ (((nNewLineWidth
- nActLineWidth
) * 15) / 10);
1585 SetMetricValue( aMtrStartWidth
, nValNew
, ePoolUnit
);
1587 nValAct
= GetCoreValue( aMtrEndWidth
, ePoolUnit
);
1588 nValNew
= nValAct
+ (((nNewLineWidth
- nActLineWidth
) * 15) / 10);
1591 SetMetricValue( aMtrEndWidth
, nValNew
, ePoolUnit
);
1594 // Remember current value
1595 nActLineWidth
= nNewLineWidth
;
1599 aCtlPreview
.Invalidate();
1601 // Make transparency accessible accordingly
1602 if( aLbLineStyle
.GetSelectEntryPos() == 0 ) // invisible
1604 aFtTransparent
.Disable();
1605 aMtrTransparent
.Disable();
1609 aFtTransparent
.Enable();
1610 aMtrTransparent
.Enable();
1613 const bool bHasLineStart
= aLbStartStyle
.GetSelectEntryPos() != 0;
1614 const bool bHasLineEnd
= aLbEndStyle
.GetSelectEntryPos() != 0;
1616 aFtLineEndsWidth
.Enable( bHasLineStart
|| bHasLineEnd
);
1617 aMtrStartWidth
.Enable( bHasLineStart
);
1618 aTsbCenterStart
.Enable( bHasLineStart
);
1619 aMtrEndWidth
.Enable( bHasLineEnd
);
1620 aTsbCenterEnd
.Enable( bHasLineEnd
);
1625 //------------------------------------------------------------------------
1627 IMPL_LINK( SvxLineTabPage
, ChangeStartHdl_Impl
, void *, p
)
1629 if( aCbxSynchronize
.IsChecked() )
1631 if( p
== &aMtrStartWidth
)
1632 aMtrEndWidth
.SetValue( aMtrStartWidth
.GetValue() );
1633 if( p
== &aLbStartStyle
)
1634 aLbEndStyle
.SelectEntryPos( aLbStartStyle
.GetSelectEntryPos() );
1635 if( p
== &aTsbCenterStart
)
1636 aTsbCenterEnd
.SetState( aTsbCenterStart
.GetState() );
1639 ChangePreviewHdl_Impl( this );
1644 //------------------------------------------------------------------------
1647 IMPL_LINK_NOARG(SvxLineTabPage
, ChangeEdgeStyleHdl_Impl
)
1649 ChangePreviewHdl_Impl( this );
1654 //------------------------------------------------------------------------
1657 IMPL_LINK( SvxLineTabPage
, ChangeCapStyleHdl_Impl
, void *, EMPTYARG
)
1659 ChangePreviewHdl_Impl( this );
1663 //------------------------------------------------------------------------
1665 IMPL_LINK_NOARG(SvxLineTabPage
, ClickInvisibleHdl_Impl
)
1667 if( aLbLineStyle
.GetSelectEntryPos() == 0 ) // invisible
1672 aFtLineWidth
.Disable();
1673 aMtrLineWidth
.Disable();
1675 if( aFlLineEnds
.IsEnabled() )
1677 aFtLineEndsStyle
.Disable();
1678 aFtLineEndsWidth
.Disable();
1679 aLbStartStyle
.Disable();
1680 aMtrStartWidth
.Disable();
1681 aTsbCenterStart
.Disable();
1682 aLbEndStyle
.Disable();
1683 aMtrEndWidth
.Disable();
1684 aTsbCenterEnd
.Disable();
1685 aCbxSynchronize
.Disable();
1688 maFTEdgeStyle
.Disable();
1689 maLBEdgeStyle
.Disable();
1692 maFTCapStyle
.Disable();
1693 maLBCapStyle
.Disable();
1700 aFtLineWidth
.Enable();
1701 aMtrLineWidth
.Enable();
1703 if( aFlLineEnds
.IsEnabled() )
1705 aFtLineEndsStyle
.Enable();
1706 aFtLineEndsWidth
.Enable();
1707 aLbStartStyle
.Enable();
1708 aMtrStartWidth
.Enable();
1709 aTsbCenterStart
.Enable();
1710 aLbEndStyle
.Enable();
1711 aMtrEndWidth
.Enable();
1712 aTsbCenterEnd
.Enable();
1713 aCbxSynchronize
.Enable();
1716 maFTEdgeStyle
.Enable();
1717 maLBEdgeStyle
.Enable();
1720 maFTCapStyle
.Enable();
1721 maLBCapStyle
.Enable();
1724 ChangePreviewHdl_Impl( NULL
);
1729 //------------------------------------------------------------------------
1731 IMPL_LINK( SvxLineTabPage
, ChangeEndHdl_Impl
, void *, p
)
1733 if( aCbxSynchronize
.IsChecked() )
1735 if( p
== &aMtrEndWidth
)
1736 aMtrStartWidth
.SetValue( aMtrEndWidth
.GetValue() );
1737 if( p
== &aLbEndStyle
)
1738 aLbStartStyle
.SelectEntryPos( aLbEndStyle
.GetSelectEntryPos() );
1739 if( p
== &aTsbCenterEnd
)
1740 aTsbCenterStart
.SetState( aTsbCenterEnd
.GetState() );
1743 ChangePreviewHdl_Impl( this );
1748 //------------------------------------------------------------------------
1750 IMPL_LINK_NOARG(SvxLineTabPage
, ChangeTransparentHdl_Impl
)
1752 sal_uInt16 nVal
= (sal_uInt16
)aMtrTransparent
.GetValue();
1753 XLineTransparenceItem
aItem( nVal
);
1755 rXLSet
.Put( XLineTransparenceItem( aItem
) );
1760 aCtlPreview
.Invalidate();
1765 //------------------------------------------------------------------------
1767 void SvxLineTabPage::PointChanged( Window
*, RECT_POINT eRcPt
)
1772 //------------------------------------------------------------------------
1774 void SvxLineTabPage::FillUserData()
1776 // Write the synched value to the INI file
1777 OUString aStrUserData
= OUString::valueOf( (sal_Int32
) aCbxSynchronize
.IsChecked() );
1778 SetUserData( aStrUserData
);
1782 // #58425# Symbols on a list (e.g. StarChart)
1783 // Handler for the symbol selection's popup menu (NumMenueButton)
1784 // The following link originates from SvxNumOptionsTabPage
1785 IMPL_LINK( SvxLineTabPage
, MenuCreateHdl_Impl
, MenuButton
*, pButton
)
1787 InitSymbols(pButton
);
1790 // #58425# Symbols on a list (e.g. StarChart)
1791 // Handler for the symbol selection's popup menu (NumMenueButton)
1792 // The following link originates from SvxNumOptionsTabPage
1793 IMPL_STATIC_LINK(SvxLineTabPage
, GraphicArrivedHdl_Impl
, SvxBrushItem
*, pItem
)
1795 PopupMenu
* pPopup
= pThis
->aSymbolMB
.GetPopupMenu()->GetPopupMenu( MN_GALLERY
);
1797 SvxBmpItemInfo
* pBmpInfo
= 0;
1798 for ( size_t i
= 0; i
< pThis
->aGrfBrushItems
.size(); i
++ )
1800 SvxBmpItemInfo
* pInfo
= pThis
->aGrfBrushItems
[ i
];
1801 if( pInfo
->pBrushItem
== pItem
)
1803 pBmpInfo
= pInfo
; break;
1808 if( pItem
->GetGraphic() )
1810 Bitmap
aBitmap(pItem
->GetGraphic()->GetBitmap());
1811 Size
aSize(aBitmap
.GetSizePixel());
1812 if(aSize
.Width() > MAX_BMP_WIDTH
||
1813 aSize
.Height() > MAX_BMP_HEIGHT
)
1815 sal_Bool bWidth
= aSize
.Width() > aSize
.Height();
1816 double nScale
= bWidth
?
1817 (double)MAX_BMP_WIDTH
/ (double)aSize
.Width():
1818 (double)MAX_BMP_HEIGHT
/ (double)aSize
.Height();
1819 aBitmap
.Scale(nScale
, nScale
);
1821 Image
aImage(aBitmap
);
1822 pPopup
->SetItemImage( pBmpInfo
->nItemId
, aImage
);
1829 // #58425# Symbols on a list (e.g. StarChart)
1830 // Handler for menu button
1831 IMPL_LINK( SvxLineTabPage
, GraphicHdl_Impl
, MenuButton
*, pButton
)
1833 SymbolSelected(pButton
);
1836 IMPL_LINK( SvxLineTabPage
, SizeHdl_Impl
, MetricField
*, pField
)
1839 sal_Bool bWidth
= (sal_Bool
)(pField
== &aSymbolWidthMF
);
1840 bLastWidthModified
= bWidth
;
1841 sal_Bool bRatio
= aSymbolRatioCB
.IsChecked();
1842 long nWidthVal
= static_cast<long>(aSymbolWidthMF
.Denormalize(aSymbolWidthMF
.GetValue(FUNIT_100TH_MM
)));
1843 long nHeightVal
= static_cast<long>(aSymbolHeightMF
.Denormalize(aSymbolHeightMF
.GetValue(FUNIT_100TH_MM
)));
1844 nWidthVal
= OutputDevice::LogicToLogic(nWidthVal
,MAP_100TH_MM
,(MapUnit
)ePoolUnit
);
1845 nHeightVal
= OutputDevice::LogicToLogic(nHeightVal
,MAP_100TH_MM
,(MapUnit
)ePoolUnit
);
1846 aSymbolSize
=Size(nWidthVal
,nHeightVal
);
1847 double fSizeRatio
= (double)1;
1851 if (aSymbolLastSize
.Height() && aSymbolLastSize
.Width())
1852 fSizeRatio
= (double)aSymbolLastSize
.Width() / aSymbolLastSize
.Height();
1855 //Size aSymbolSize(aSymbolLastSize);
1859 long nDelta
= nWidthVal
- aSymbolLastSize
.Width();
1860 aSymbolSize
.Width() = nWidthVal
;
1863 aSymbolSize
.Height() = aSymbolLastSize
.Height() + (long)((double)nDelta
/ fSizeRatio
);
1864 aSymbolSize
.Height() = OutputDevice::LogicToLogic( aSymbolSize
.Height(),(MapUnit
)ePoolUnit
, MAP_100TH_MM
);
1865 aSymbolHeightMF
.SetUserValue(aSymbolHeightMF
.Normalize(aSymbolSize
.Height()), FUNIT_100TH_MM
);
1870 long nDelta
= nHeightVal
- aSymbolLastSize
.Height();
1871 aSymbolSize
.Height() = nHeightVal
;
1874 aSymbolSize
.Width() = aSymbolLastSize
.Width() + (long)((double)nDelta
* fSizeRatio
);
1875 aSymbolSize
.Width() = OutputDevice::LogicToLogic( aSymbolSize
.Width(),
1876 (MapUnit
)ePoolUnit
, MAP_100TH_MM
);
1877 aSymbolWidthMF
.SetUserValue(aSymbolWidthMF
.Normalize(aSymbolSize
.Width()), FUNIT_100TH_MM
);
1880 aCtlPreview
.ResizeSymbol(aSymbolSize
);
1881 aSymbolLastSize
=aSymbolSize
;
1884 IMPL_LINK( SvxLineTabPage
, RatioHdl_Impl
, CheckBox
*, pBox
)
1886 if (pBox
->IsChecked())
1888 if (bLastWidthModified
)
1889 SizeHdl_Impl(&aSymbolWidthMF
);
1891 SizeHdl_Impl(&aSymbolHeightMF
);
1897 void SvxLineTabPage::DataChanged( const DataChangedEvent
& rDCEvt
)
1899 SvxTabPage::DataChanged( rDCEvt
);
1901 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) && (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
1907 void SvxLineTabPage::PageCreated (SfxAllItemSet aSet
)
1909 SFX_ITEMSET_ARG (&aSet
,pColorListItem
,SvxColorListItem
,SID_COLOR_TABLE
,sal_False
);
1910 SFX_ITEMSET_ARG (&aSet
,pDashListItem
,SvxDashListItem
,SID_DASH_LIST
,sal_False
);
1911 SFX_ITEMSET_ARG (&aSet
,pLineEndListItem
,SvxLineEndListItem
,SID_LINEEND_LIST
,sal_False
);
1912 SFX_ITEMSET_ARG (&aSet
,pPageTypeItem
,SfxUInt16Item
,SID_PAGE_TYPE
,sal_False
);
1913 SFX_ITEMSET_ARG (&aSet
,pDlgTypeItem
,SfxUInt16Item
,SID_DLG_TYPE
,sal_False
);
1914 SFX_ITEMSET_ARG (&aSet
,pSdrObjListItem
,OfaPtrItem
,SID_OBJECT_LIST
,sal_False
);
1915 SFX_ITEMSET_ARG (&aSet
,pSymbolAttrItem
,SfxTabDialogItem
,SID_ATTR_SET
,sal_False
);
1916 SFX_ITEMSET_ARG (&aSet
,pGraphicItem
,SvxGraphicItem
,SID_GRAPHIC
,sal_False
);
1919 SetColorList(pColorListItem
->GetColorList());
1921 SetDashList(pDashListItem
->GetDashList());
1922 if (pLineEndListItem
)
1923 SetLineEndList(pLineEndListItem
->GetLineEndList());
1925 SetPageType(pPageTypeItem
->GetValue());
1927 SetDlgType(pDlgTypeItem
->GetValue());
1930 if(pSdrObjListItem
) //symbols
1932 ShowSymbolControls(sal_True
);
1933 pSymbolList
= static_cast<SdrObjList
*>(pSdrObjListItem
->GetValue());
1934 if (pSymbolAttrItem
)
1935 pSymbolAttr
= new SfxItemSet(pSymbolAttrItem
->GetItemSet());
1937 aAutoSymbolGraphic
= pGraphicItem
->GetGraphic();
1941 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */