1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
31 // include ---------------------------------------------------------------
32 #include <tools/shl.hxx>
33 #include <tools/urlobj.hxx>
34 #include <unotools/pathoptions.hxx>
35 #include <sfx2/app.hxx>
36 #include <sfx2/module.hxx>
37 #include <svtools/colrdlg.hxx>
38 #include <vcl/msgbox.hxx>
39 #include <sfx2/filedlghelper.hxx>
40 #include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
42 #define _SVX_TPCOLOR_CXX
46 #include "svx/xattr.hxx"
47 #include <svx/xpool.hxx>
48 #include <svx/xtable.hxx>
49 #include "svx/drawitem.hxx"
50 #include "cuitabarea.hxx"
51 #include "tabarea.hrc"
52 #include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
53 //#include "dlgname.hrc"
54 #include <svx/svxdlg.hxx> //CHINA001
55 #include <dialmgr.hxx>
56 #include <cuitabline.hxx>
57 #include <svx/dialmgr.hxx>
58 #include <svx/dialogs.hrc>
60 #define DLGWIN GetParentDialog( this )
62 /*************************************************************************
64 |* Dialog zum Aendern und Definieren der Farben
66 \************************************************************************/
68 static Window
* GetParentDialog( Window
* pWindow
)
72 if( pWindow
->IsDialog() )
75 pWindow
= pWindow
->GetParent();
81 SvxColorTabPage::SvxColorTabPage
84 const SfxItemSet
& rInAttrs
87 SfxTabPage ( pParent
, CUI_RES( RID_SVXPAGE_COLOR
), rInAttrs
),
89 aFlProp ( this, CUI_RES( FL_PROP
) ),
90 aFtName ( this, CUI_RES( FT_NAME
) ),
91 aEdtName ( this, CUI_RES( EDT_NAME
) ),
92 aFtColor ( this, CUI_RES( FT_COLOR
) ),
93 aLbColor ( this, CUI_RES( LB_COLOR
) ),
95 aTableNameFT ( this, CUI_RES( FT_TABLE_NAME
) ),
96 aValSetColorTable ( this, CUI_RES( CTL_COLORTABLE
) ),
98 aCtlPreviewOld ( this, CUI_RES( CTL_PREVIEW_OLD
) ),
99 aCtlPreviewNew ( this, CUI_RES( CTL_PREVIEW_NEW
) ),
101 aLbColorModel ( this, CUI_RES( LB_COLORMODEL
) ),
102 aFtColorModel1 ( this, CUI_RES( FT_1
) ),
103 aMtrFldColorModel1 ( this, CUI_RES( MTR_FLD_1
) ),
104 aFtColorModel2 ( this, CUI_RES( FT_2
) ),
105 aMtrFldColorModel2 ( this, CUI_RES( MTR_FLD_2
) ),
106 aFtColorModel3 ( this, CUI_RES( FT_3
) ),
107 aMtrFldColorModel3 ( this, CUI_RES( MTR_FLD_3
) ),
108 aFtColorModel4 ( this, CUI_RES( FT_4
) ),
109 aMtrFldColorModel4 ( this, CUI_RES( MTR_FLD_4
) ),
110 aBtnAdd ( this, CUI_RES( BTN_ADD
) ),
111 aBtnModify ( this, CUI_RES( BTN_MODIFY
) ),
112 aBtnWorkOn ( this, CUI_RES( BTN_WORK_ON
) ),
113 aBtnDelete ( this, CUI_RES( BTN_DELETE
) ),
114 aBtnLoad ( this, CUI_RES( BTN_LOAD
) ),
115 aBtnSave ( this, CUI_RES( BTN_SAVE
) ),
117 rOutAttrs ( rInAttrs
),
120 bDeleteColorTable ( sal_True
),
122 pXPool ( (XOutdevItemPool
*) rInAttrs
.GetPool() ),
123 aXFStyleItem ( XFILL_SOLID
),
124 aXFillColorItem ( String(), Color( COL_BLACK
) ),
125 aXFillAttr ( pXPool
),
126 rXFSet ( aXFillAttr
.GetItemSet() ),
131 aBtnLoad
.SetModeImage( Image( CUI_RES( RID_SVXIMG_LOAD_H
) ), BMP_COLOR_HIGHCONTRAST
);
132 aBtnSave
.SetModeImage( Image( CUI_RES( RID_SVXIMG_SAVE_H
) ), BMP_COLOR_HIGHCONTRAST
);
136 // diese Page braucht ExchangeSupport
137 SetExchangeSupport();
139 // Setzen des Output-Devices
140 rXFSet
.Put( aXFStyleItem
);
141 rXFSet
.Put( aXFillColorItem
);
142 aCtlPreviewOld
.SetAttributes( aXFillAttr
.GetItemSet() );
143 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
145 // Handler ueberladen
146 aLbColor
.SetSelectHdl(
147 LINK( this, SvxColorTabPage
, SelectColorLBHdl_Impl
) );
148 aValSetColorTable
.SetSelectHdl(
149 LINK( this, SvxColorTabPage
, SelectValSetHdl_Impl
) );
150 aLbColorModel
.SetSelectHdl(
151 LINK( this, SvxColorTabPage
, SelectColorModelHdl_Impl
) );
153 Link aLink
= LINK( this, SvxColorTabPage
, ModifiedHdl_Impl
);
154 aMtrFldColorModel1
.SetModifyHdl( aLink
);
155 aMtrFldColorModel2
.SetModifyHdl( aLink
);
156 aMtrFldColorModel3
.SetModifyHdl( aLink
);
157 aMtrFldColorModel4
.SetModifyHdl( aLink
);
159 aBtnAdd
.SetClickHdl( LINK( this, SvxColorTabPage
, ClickAddHdl_Impl
) );
160 aBtnModify
.SetClickHdl(
161 LINK( this, SvxColorTabPage
, ClickModifyHdl_Impl
) );
162 aBtnWorkOn
.SetClickHdl(
163 LINK( this, SvxColorTabPage
, ClickWorkOnHdl_Impl
) );
164 aBtnDelete
.SetClickHdl(
165 LINK( this, SvxColorTabPage
, ClickDeleteHdl_Impl
) );
166 aBtnLoad
.SetClickHdl( LINK( this, SvxColorTabPage
, ClickLoadHdl_Impl
) );
167 aBtnSave
.SetClickHdl( LINK( this, SvxColorTabPage
, ClickSaveHdl_Impl
) );
170 aValSetColorTable
.SetStyle( aValSetColorTable
.GetStyle() | WB_VSCROLL
| WB_ITEMBORDER
);
171 aValSetColorTable
.SetColCount( 8 );
172 aValSetColorTable
.SetLineCount( 10 );
173 aValSetColorTable
.SetExtraSpacing( 0 );
174 aValSetColorTable
.Show();
176 aLbColorModel
.SetAccessibleName( String( CUI_RES(STR_CUI_COLORMODEL
) ) );
177 aBtnAdd
.SetAccessibleRelationMemberOf( &aFlProp
);
178 aBtnModify
.SetAccessibleRelationMemberOf( &aFlProp
);
179 aBtnWorkOn
.SetAccessibleRelationMemberOf( &aFlProp
);
180 aBtnDelete
.SetAccessibleRelationMemberOf( &aFlProp
);
183 // -----------------------------------------------------------------------
185 void SvxColorTabPage::Construct()
187 aLbColor
.Fill( pColorTab
);
188 FillValueSet_Impl( aValSetColorTable
);
191 // -----------------------------------------------------------------------
193 void SvxColorTabPage::ActivatePage( const SfxItemSet
& )
195 if( *pDlgType
== 0 ) // Flaechen-Dialog
197 *pbAreaTP
= sal_False
;
201 if( *pPageType
== PT_COLOR
&& *pPos
!= LISTBOX_ENTRY_NOTFOUND
)
203 aLbColor
.SelectEntryPos( *pPos
);
204 aValSetColorTable
.SelectItem( aLbColor
.GetSelectEntryPos() + 1 );
205 aEdtName
.SetText( aLbColor
.GetSelectEntry() );
207 ChangeColorHdl_Impl( this );
209 else if( *pPageType
== PT_COLOR
&& *pPos
== LISTBOX_ENTRY_NOTFOUND
)
211 const SfxPoolItem
* pPoolItem
= NULL
;
212 if( SFX_ITEM_SET
== rOutAttrs
.GetItemState( GetWhich( XATTR_FILLCOLOR
), sal_True
, &pPoolItem
) )
214 aLbColorModel
.SelectEntryPos( CM_RGB
);
216 aAktuellColor
.SetColor ( ( ( const XFillColorItem
* ) pPoolItem
)->GetColorValue().GetColor() );
218 aEdtName
.SetText( ( ( const XFillColorItem
* ) pPoolItem
)->GetName() );
220 aMtrFldColorModel1
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetRed() ) );
221 aMtrFldColorModel2
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetGreen() ) );
222 aMtrFldColorModel3
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetBlue() ) );
224 // ItemSet fuellen und an XOut weiterleiten
225 rXFSet
.Put( XFillColorItem( String(), aAktuellColor
) );
226 aCtlPreviewOld
.SetAttributes( aXFillAttr
.GetItemSet() );
227 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
229 aCtlPreviewNew
.Invalidate();
230 aCtlPreviewOld
.Invalidate();
234 // Ermitteln (evtl. abschneiden) des Namens und in
235 // der GroupBox darstellen
236 String
aString( CUI_RES( RID_SVXSTR_TABLE
) ); aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
237 INetURLObject
aURL( pColorTab
->GetPath() );
239 aURL
.Append( pColorTab
->GetName() );
240 DBG_ASSERT( aURL
.GetProtocol() != INET_PROT_NOT_VALID
, "invalid URL" );
242 if ( aURL
.getBase().getLength() > 18 )
244 aString
+= String(aURL
.getBase()).Copy( 0, 15 );
245 aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
248 aString
+= String(aURL
.getBase());
250 aTableNameFT
.SetText( aString
);
252 // Damit evtl. geaenderte Farbe verworfen wird
253 SelectColorLBHdl_Impl( this );
255 *pPageType
= PT_COLOR
;
256 *pPos
= LISTBOX_ENTRY_NOTFOUND
;
261 // Buttons werden gehided, weil Paletten z.Z. nur
262 // ueber den AreaDlg funktionieren!!!
263 // ActivatePage() muss von anderen Dialogen explizit
264 // gerufen werden, da ActivatePage() nicht gerufen wird,
265 // wenn Seite als Erste im Dialog angezeigt wird
271 // -----------------------------------------------------------------------
273 int SvxColorTabPage::DeactivatePage( SfxItemSet
* _pSet
)
275 if ( CheckChanges_Impl() == -1L )
279 FillItemSet( *_pSet
);
281 return( LEAVE_PAGE
);
284 // -----------------------------------------------------------------------
286 long SvxColorTabPage::CheckChanges_Impl()
288 // wird hier benutzt, um Aenderungen NICHT zu verlieren
290 Color
aTmpColor (aAktuellColor
);
292 ConvertColorValues (aTmpColor
, CM_RGB
);
294 sal_uInt16 nPos
= aLbColor
.GetSelectEntryPos();
295 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
297 Color aColor
= pColorTab
->GetColor( nPos
)->GetColor();
298 String aString
= aLbColor
.GetSelectEntry();
300 // aNewColor, da COL_USER != COL_irgendwas, auch wenn RGB-Werte gleich
301 // Color aNewColor( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() );
303 if( ColorToPercent_Impl( aTmpColor
.GetRed() ) != ColorToPercent_Impl( aColor
.GetRed() ) ||
304 ColorToPercent_Impl( aTmpColor
.GetGreen() ) != ColorToPercent_Impl( aColor
.GetGreen() ) ||
305 ColorToPercent_Impl( aTmpColor
.GetBlue() ) != ColorToPercent_Impl( aColor
.GetBlue() ) ||
306 aString
!= aEdtName
.GetText() )
308 ResMgr
& rMgr
= CUI_MGR();
309 Image aWarningBoxImage
= WarningBox::GetStandardImage();
310 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
311 DBG_ASSERT(pFact
, "Dialogdiet fail!");//CHINA001
312 AbstractSvxMessDialog
* aMessDlg
= pFact
->CreateSvxMessDialog( DLGWIN
, RID_SVXDLG_MESSBOX
,
313 SVX_RESSTR( RID_SVXSTR_COLOR
),
314 String( ResId( RID_SVXSTR_ASK_CHANGE_COLOR
, rMgr
) ),
316 DBG_ASSERT(aMessDlg
, "Dialogdiet fail!");//CHINA001
317 aMessDlg
->SetButtonText( MESS_BTN_1
, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
318 String( ResId( RID_SVXSTR_CHANGE
, rMgr
) ) );
319 aMessDlg
->SetButtonText( MESS_BTN_2
, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
320 String( ResId( RID_SVXSTR_ADD
, rMgr
) ) );
322 short nRet
= aMessDlg
->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
326 case RET_BTN_1
: // Aendern
328 ClickModifyHdl_Impl( this );
329 aColor
= pColorTab
->GetColor( nPos
)->GetColor();
333 case RET_BTN_2
: // Hinzufuegen
335 ClickAddHdl_Impl( this );
336 nPos
= aLbColor
.GetSelectEntryPos();
337 aColor
= pColorTab
->GetColor( nPos
)->GetColor();
342 // return( -1L ); <-- wuerde die Seite nicht verlassen
344 // return( sal_True ); // Abbruch
346 delete aMessDlg
; //add by CHINA001
349 if( *pDlgType
== 0 ) // Flaechen-Dialog
351 nPos
= aLbColor
.GetSelectEntryPos();
352 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
360 // -----------------------------------------------------------------------
362 sal_Bool
SvxColorTabPage::FillItemSet( SfxItemSet
& rSet
)
364 if( ( *pDlgType
!= 0 ) ||
365 ( *pPageType
== PT_COLOR
&& *pbAreaTP
== sal_False
) )
370 // CheckChanges_Impl(); <-- doppelte Abfrage ?
372 sal_uInt16 nPos
= aLbColor
.GetSelectEntryPos();
373 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
375 aColor
= pColorTab
->GetColor( nPos
)->GetColor();
376 aString
= aLbColor
.GetSelectEntry();
380 aColor
.SetColor (aAktuellColor
.GetColor());
382 ConvertColorValues (aColor
, CM_RGB
);
384 rSet
.Put( XFillColorItem( aString
, aColor
) );
385 rSet
.Put( XFillStyleItem( XFILL_SOLID
) );
391 // -----------------------------------------------------------------------
393 void SvxColorTabPage::Reset( const SfxItemSet
& rSet
)
395 sal_uInt16 nState
= rSet
.GetItemState( XATTR_FILLCOLOR
);
397 if ( nState
>= SFX_ITEM_DEFAULT
)
399 XFillColorItem
aColorItem( (const XFillColorItem
&)rSet
.Get( XATTR_FILLCOLOR
) );
400 aLbColor
.SelectEntry( aColorItem
.GetColorValue() );
401 aValSetColorTable
.SelectItem( aLbColor
.GetSelectEntryPos() + 1 );
402 aEdtName
.SetText( aLbColor
.GetSelectEntry() );
406 String aStr
= GetUserData();
407 aLbColorModel
.SelectEntryPos( (sal_uInt16
) aStr
.ToInt32() );
409 ChangeColorHdl_Impl( this );
410 SelectColorModelHdl_Impl( this );
412 aCtlPreviewOld
.Invalidate();
414 // Status der Buttons ermitteln
415 if( pColorTab
->Count() )
424 aBtnModify
.Disable();
425 aBtnWorkOn
.Disable();
426 aBtnDelete
.Disable();
431 // -----------------------------------------------------------------------
433 SfxTabPage
* SvxColorTabPage::Create( Window
* pWindow
,
434 const SfxItemSet
& rOutAttrs
)
436 return( new SvxColorTabPage( pWindow
, rOutAttrs
) );
439 //------------------------------------------------------------------------
442 // Wird aufgerufen, wenn Inhalt der MtrFileds f�r Farbwerte ver�ndert wird
444 IMPL_LINK( SvxColorTabPage
, ModifiedHdl_Impl
, void *, EMPTYARG
)
446 // lese aktuelle MtrFields aus, wenn cmyk, dann k-Wert als Trans.-Farbe
447 aAktuellColor
.SetColor ( Color( (sal_uInt8
)PercentToColor_Impl( (sal_uInt16
) aMtrFldColorModel4
.GetValue() ),
448 (sal_uInt8
)PercentToColor_Impl( (sal_uInt16
) aMtrFldColorModel1
.GetValue() ),
449 (sal_uInt8
)PercentToColor_Impl( (sal_uInt16
) aMtrFldColorModel2
.GetValue() ),
450 (sal_uInt8
)PercentToColor_Impl( (sal_uInt16
) aMtrFldColorModel3
.GetValue() ) ).GetColor() );
452 Color
aTmpColor(aAktuellColor
);
454 ConvertColorValues (aTmpColor
, CM_RGB
);
456 rXFSet
.Put( XFillColorItem( String(), aTmpColor
) );
457 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
459 aCtlPreviewNew
.Invalidate();
464 //------------------------------------------------------------------------
467 // Button 'Hinzuf�gen'
469 IMPL_LINK( SvxColorTabPage
, ClickAddHdl_Impl
, void *, EMPTYARG
)
471 Window
*pWindow
= this;
475 bEnabled
= pWindow
->IsEnabled();
476 pWindow
= pWindow
->GetParent();
479 ResMgr
& rMgr
= CUI_MGR();
480 String
aDesc( ResId( RID_SVXSTR_DESC_COLOR
, rMgr
) );
481 String
aName( aEdtName
.GetText() );
483 long nCount
= pColorTab
->Count();
484 sal_Bool bDifferent
= sal_True
;
486 // Pruefen, ob Name schon vorhanden ist
487 for ( long i
= 0; i
< nCount
&& bDifferent
; i
++ )
488 if ( aName
== pColorTab
->GetColor( i
)->GetName() )
489 bDifferent
= sal_False
;
491 // Wenn ja, wird wiederholt ein neuer Name angefordert
494 WarningBox
aWarningBox( DLGWIN
, WinBits( WB_OK
),
495 String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE
, rMgr
) ) );
496 aWarningBox
.SetHelpId( HID_WARN_NAME_DUPLICATE
);
497 aWarningBox
.Execute();
499 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
500 DBG_ASSERT(pFact
, "Dialogdiet fail!");//CHINA001
501 AbstractSvxNameDialog
* pDlg
= pFact
->CreateSvxNameDialog( DLGWIN
, aName
, aDesc
);
502 DBG_ASSERT(pDlg
, "Dialogdiet fail!");//CHINA001
503 sal_Bool bLoop
= sal_True
;
505 while ( !bDifferent
&& bLoop
&& pDlg
->Execute() == RET_OK
)
507 pDlg
->GetName( aName
);
508 bDifferent
= sal_True
;
510 for( long i
= 0; i
< nCount
&& bDifferent
; i
++ )
512 if( aName
== pColorTab
->GetColor( i
)->GetName() )
513 bDifferent
= sal_False
;
519 aWarningBox
.Execute();
524 // Wenn nicht vorhanden, wird Eintrag aufgenommen
528 ConvertColorValues (aAktuellColor
, CM_RGB
);
529 pEntry
= new XColorEntry( aAktuellColor
, aName
);
531 pColorTab
->Insert( pColorTab
->Count(), pEntry
);
533 aLbColor
.Append( pEntry
);
534 aValSetColorTable
.InsertItem( aValSetColorTable
.GetItemCount() + 1,
535 pEntry
->GetColor(), pEntry
->GetName() );
537 aLbColor
.SelectEntryPos( aLbColor
.GetEntryCount() - 1 );
539 // Flag fuer modifiziert setzen
540 *pnColorTableState
|= CT_MODIFIED
;
542 SelectColorLBHdl_Impl( this );
544 // Status der Buttons ermitteln
545 if( pColorTab
->Count() )
555 //------------------------------------------------------------------------
560 IMPL_LINK( SvxColorTabPage
, ClickModifyHdl_Impl
, void *, EMPTYARG
)
562 sal_uInt16 nPos
= aLbColor
.GetSelectEntryPos();
564 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
566 ResMgr
& rMgr
= CUI_MGR();
567 String
aDesc( ResId( RID_SVXSTR_DESC_COLOR
, rMgr
) );
568 String
aName( aEdtName
.GetText() );
569 long nCount
= pColorTab
->Count();
570 sal_Bool bDifferent
= sal_True
;
572 // Pruefen, ob Name schon vorhanden ist
573 for ( long i
= 0; i
< nCount
&& bDifferent
; i
++ )
574 if ( aName
== pColorTab
->GetColor( i
)->GetName() && nPos
!= i
)
575 bDifferent
= sal_False
;
577 // Wenn ja, wird wiederholt ein neuer Name angefordert
580 WarningBox
aWarningBox( DLGWIN
, WinBits( WB_OK
),
581 String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE
, rMgr
) ) );
582 aWarningBox
.SetHelpId( HID_WARN_NAME_DUPLICATE
);
583 aWarningBox
.Execute();
585 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
586 DBG_ASSERT(pFact
, "Dialogdiet fail!");//CHINA001
587 AbstractSvxNameDialog
* pDlg
= pFact
->CreateSvxNameDialog( DLGWIN
, aName
, aDesc
);
588 DBG_ASSERT(pDlg
, "Dialogdiet fail!");//CHINA001
589 sal_Bool bLoop
= sal_True
;
591 while ( !bDifferent
&& bLoop
&& pDlg
->Execute() == RET_OK
)
593 pDlg
->GetName( aName
);
594 bDifferent
= sal_True
;
596 for ( long i
= 0; i
< nCount
&& bDifferent
; i
++ )
597 if( aName
== pColorTab
->GetColor( i
)->GetName() && nPos
!= i
)
598 bDifferent
= sal_False
;
603 aWarningBox
.Execute();
608 // Wenn nicht vorhanden, wird Eintrag aufgenommen
611 XColorEntry
* pEntry
= pColorTab
->GetColor( nPos
);
613 Color
aTmpColor (aAktuellColor
);
615 ConvertColorValues (aTmpColor
, CM_RGB
);
617 pEntry
->SetColor( aTmpColor
);
618 pEntry
->SetName( aName
);
620 aLbColor
.Modify( pEntry
, nPos
);
621 aLbColor
.SelectEntryPos( nPos
);
623 aValSetColorTable
.SetItemColor( nPos
+ 1, pEntry
->GetColor() );
624 aValSetColorTable
.SetItemText( nPos
+ 1, pEntry
->GetName() );
625 aEdtName
.SetText( aName
);
627 aCtlPreviewOld
.Invalidate();
629 // Flag fuer modifiziert setzen
630 *pnColorTableState
|= CT_MODIFIED
;
636 //------------------------------------------------------------------------
639 // Button 'Bearbeiten'
641 IMPL_LINK( SvxColorTabPage
, ClickWorkOnHdl_Impl
, void *, EMPTYARG
)
643 SvColorDialog
* pColorDlg
= new SvColorDialog( DLGWIN
);
645 Color
aTmpColor (aAktuellColor
);
647 ConvertColorValues (aTmpColor
, CM_RGB
);
649 pColorDlg
->SetColor (aTmpColor
);
651 if( pColorDlg
->Execute() == RET_OK
)
654 Color aPreviewColor
= pColorDlg
->GetColor();
655 aAktuellColor
= aPreviewColor
;
657 ConvertColorValues (aAktuellColor
, eCM
);
659 aMtrFldColorModel1
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetRed() ) );
660 aMtrFldColorModel2
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetGreen() ) );
661 aMtrFldColorModel3
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetBlue() ) );
662 aMtrFldColorModel4
.SetValue( ColorToPercent_Impl( nK
) );
664 // ItemSet fuellen und an XOut weiterleiten
665 rXFSet
.Put( XFillColorItem( String(), aPreviewColor
) );
666 //aCtlPreviewOld.SetAttributes( aXFillAttr );
667 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
669 aCtlPreviewNew
.Invalidate();
676 //------------------------------------------------------------------------
681 IMPL_LINK( SvxColorTabPage
, ClickDeleteHdl_Impl
, void *, EMPTYARG
)
683 sal_uInt16 nPos
= aLbColor
.GetSelectEntryPos();
685 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
687 QueryBox
aQueryBox( DLGWIN
, WinBits( WB_YES_NO
| WB_DEF_NO
),
688 String( CUI_RES( RID_SVXSTR_ASK_DEL_COLOR
) ) );
690 if( aQueryBox
.Execute() == RET_YES
)
692 // Jetzt wird richtig geloescht
693 sal_uLong nCount
= pColorTab
->Count() - 1;
696 pEntry
= pColorTab
->Remove( nPos
);
697 DBG_ASSERT( pEntry
, "ColorEntry nicht vorhanden (1) !" );
700 for( sal_uLong i
= nPos
; i
< nCount
; i
++ )
702 pEntry
= pColorTab
->Remove( i
+ 1 );
703 DBG_ASSERT( pEntry
, "ColorEntry nicht vorhanden (2) !" );
704 pColorTab
->Insert( i
, pEntry
);
707 // Listbox und ValueSet aktualisieren
708 aLbColor
.RemoveEntry( nPos
);
709 aValSetColorTable
.Clear();
710 FillValueSet_Impl( aValSetColorTable
);
713 aLbColor
.SelectEntryPos( nPos
);
714 SelectColorLBHdl_Impl( this );
716 aCtlPreviewOld
.Invalidate();
718 // Flag fuer modifiziert setzen
719 *pnColorTableState
|= CT_MODIFIED
;
722 // Status der Buttons ermitteln
723 if( !pColorTab
->Count() )
725 aBtnModify
.Disable();
726 aBtnWorkOn
.Disable();
727 aBtnDelete
.Disable();
733 // -----------------------------------------------------------------------
736 // Button 'Farbtabelle laden'
738 IMPL_LINK( SvxColorTabPage
, ClickLoadHdl_Impl
, void *, EMPTYARG
)
740 ResMgr
& rMgr
= CUI_MGR();
741 sal_uInt16 nReturn
= RET_YES
;
743 if( *pnColorTableState
& CT_MODIFIED
)
745 nReturn
= WarningBox( DLGWIN
, WinBits( WB_YES_NO_CANCEL
),
746 String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE
, rMgr
) ) ).Execute();
748 if ( nReturn
== RET_YES
)
752 if ( nReturn
!= RET_CANCEL
)
754 ::sfx2::FileDialogHelper
aDlg(
755 com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE
,
757 String
aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) );
758 aDlg
.AddFilter( aStrFilterType
, aStrFilterType
);
759 INetURLObject
aFile( SvtPathOptions().GetPalettePath() );
760 aDlg
.SetDisplayDirectory( aFile
.GetMainURL( INetURLObject::NO_DECODE
) );
762 if ( aDlg
.Execute() == ERRCODE_NONE
)
764 INetURLObject
aURL( aDlg
.GetPath() );
765 INetURLObject
aPathURL( aURL
);
767 aPathURL
.removeSegment();
768 aPathURL
.removeFinalSlash();
771 XColorTable
* pColTab
= new XColorTable( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), pXPool
);
772 pColTab
->SetName( aURL
.getName() ); // XXX
773 if( pColTab
->Load() )
777 // Pruefen, ob Tabelle geloescht werden darf:
778 const XColorTable
*pTempTable
= 0;
779 SvxAreaTabDialog
* pArea
= dynamic_cast< SvxAreaTabDialog
* >( DLGWIN
);
780 SvxLineTabDialog
* pLine
= dynamic_cast< SvxLineTabDialog
* >( DLGWIN
);
783 pTempTable
= pArea
->GetColorTable();
787 pTempTable
= pLine
->GetColorTable();
790 if( pColorTab
!= pTempTable
)
792 if( bDeleteColorTable
)
795 bDeleteColorTable
= sal_True
;
801 pArea
->SetNewColorTable( pColorTab
);
805 pLine
->SetNewColorTable( pColorTab
);
809 aValSetColorTable
.Clear();
813 pColorTab
->SetName( aURL
.getName() );
815 // Ermitteln (evtl. abschneiden) des Namens und in
816 // der GroupBox darstellen
817 String
aString( ResId( RID_SVXSTR_TABLE
, rMgr
) );
818 aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
820 if ( aURL
.getBase().getLength() > 18 )
822 aString
+= String(aURL
.getBase()).Copy( 0, 15 );
823 aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
826 aString
+= String(aURL
.getBase());
828 aTableNameFT
.SetText( aString
);
830 // Flag fuer gewechselt setzen
831 *pnColorTableState
|= CT_CHANGED
;
832 // Flag fuer modifiziert entfernen
833 *pnColorTableState
&= ~CT_MODIFIED
;
835 if( aLbColor
.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND
)
836 aLbColor
.SelectEntryPos( 0 );
838 aLbColor
.SelectEntryPos( aLbColor
.GetSelectEntryPos() );
840 ChangeColorHdl_Impl( this );
841 SelectColorLBHdl_Impl( this );
847 ErrorBox
aErrorBox( DLGWIN
, WinBits( WB_OK
),
848 String( ResId( RID_SVXSTR_READ_DATA_ERROR
, rMgr
) ) );
854 // Status der Buttons ermitteln
855 if ( pColorTab
->Count() )
864 aBtnModify
.Disable();
865 aBtnWorkOn
.Disable();
866 aBtnDelete
.Disable();
872 // -----------------------------------------------------------------------
875 // Button 'Farbtabelle speichern'
877 IMPL_LINK( SvxColorTabPage
, ClickSaveHdl_Impl
, void *, EMPTYARG
)
879 ::sfx2::FileDialogHelper
aDlg(
880 com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE
, 0 );
881 String
aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) );
882 aDlg
.AddFilter( aStrFilterType
, aStrFilterType
);
884 INetURLObject
aFile( SvtPathOptions().GetPalettePath() );
885 DBG_ASSERT( aFile
.GetProtocol() != INET_PROT_NOT_VALID
, "invalid URL" );
887 if( pColorTab
->GetName().Len() )
889 aFile
.Append( pColorTab
->GetName() );
891 if( !aFile
.getExtension().getLength() )
892 aFile
.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soc" ) ) );
895 aDlg
.SetDisplayDirectory( aFile
.GetMainURL( INetURLObject::NO_DECODE
) );
896 if ( aDlg
.Execute() == ERRCODE_NONE
)
898 INetURLObject
aURL( aDlg
.GetPath() );
899 INetURLObject
aPathURL( aURL
);
901 aPathURL
.removeSegment();
902 aPathURL
.removeFinalSlash();
904 pColorTab
->SetName( aURL
.getName() );
905 pColorTab
->SetPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
907 if( pColorTab
->Save() )
909 // Ermitteln (evtl. abschneiden) des Namens und in
910 // der GroupBox darstellen
911 String
aString( CUI_RES( RID_SVXSTR_TABLE
) );
912 aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
914 if ( aURL
.getBase().getLength() > 18 )
916 aString
+= String(aURL
.getBase()).Copy( 0, 15 );
917 aString
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
920 aString
+= String(aURL
.getBase());
921 aTableNameFT
.SetText( aString
);
923 // Flag fuer gespeichert setzen
924 *pnColorTableState
|= CT_SAVED
;
925 // Flag fuer modifiziert entfernen
926 *pnColorTableState
&= ~CT_MODIFIED
;
930 ErrorBox
aErrorBox( DLGWIN
, WinBits( WB_OK
),
931 String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR
) ) );
938 //------------------------------------------------------------------------
940 IMPL_LINK( SvxColorTabPage
, SelectColorLBHdl_Impl
, void *, EMPTYARG
)
942 sal_uInt16 nPos
= aLbColor
.GetSelectEntryPos();
943 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
945 aValSetColorTable
.SelectItem( nPos
+ 1 );
946 aEdtName
.SetText( aLbColor
.GetSelectEntry() );
948 rXFSet
.Put( XFillColorItem( String(),
949 aLbColor
.GetSelectEntryColor() ) );
950 aCtlPreviewOld
.SetAttributes( aXFillAttr
.GetItemSet() );
951 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
953 aCtlPreviewOld
.Invalidate();
954 aCtlPreviewNew
.Invalidate();
956 ChangeColorHdl_Impl( this );
961 //------------------------------------------------------------------------
963 IMPL_LINK( SvxColorTabPage
, SelectValSetHdl_Impl
, void *, EMPTYARG
)
965 sal_uInt16 nPos
= aValSetColorTable
.GetSelectItemId();
966 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
968 aLbColor
.SelectEntryPos( nPos
- 1 );
969 aEdtName
.SetText( aLbColor
.GetSelectEntry() );
971 rXFSet
.Put( XFillColorItem( String(),
972 aLbColor
.GetSelectEntryColor() ) );
973 aCtlPreviewOld
.SetAttributes( aXFillAttr
.GetItemSet() );
974 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
976 aCtlPreviewOld
.Invalidate();
977 aCtlPreviewNew
.Invalidate();
979 ChangeColorHdl_Impl( this );
984 //------------------------------------------------------------------------
987 // Farbwerte je nach �bergebenes Farbmodell umrechnen
989 void SvxColorTabPage::ConvertColorValues (Color
& rColor
, ColorModel eModell
)
995 CmykToRgb_Impl (rColor
, (sal_uInt16
)rColor
.GetTransparency() );
996 rColor
.SetTransparency ((sal_uInt8
) 0);
1003 RgbToCmyk_Impl (rColor
, nK
);
1004 rColor
.SetTransparency ((sal_uInt8
) nK
);
1011 // Auswahl Listbox 'Farbmodell' (RGB/CMY)
1013 IMPL_LINK( SvxColorTabPage
, SelectColorModelHdl_Impl
, void *, EMPTYARG
)
1015 int nPos
= aLbColorModel
.GetSelectEntryPos();
1016 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
1018 if (eCM
!= (ColorModel
) nPos
)
1020 // wenn Farbmodell geaendert wurde, dann Werte umrechnen
1021 ConvertColorValues (aAktuellColor
, (ColorModel
) nPos
);
1024 eCM
= (ColorModel
) nPos
;
1030 String
aStr( aLbColorModel
.GetSelectEntry() );
1031 String
aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) );
1032 xub_StrLen nIdx
= 1;
1033 aColorStr
.SetChar( nIdx
, aStr
.GetChar( 0 ) );
1034 aFtColorModel1
.SetText( aColorStr
);
1035 aColorStr
.SetChar( nIdx
, aStr
.GetChar( 1 ) );
1036 aFtColorModel2
.SetText( aColorStr
);
1037 aColorStr
.SetChar( nIdx
, aStr
.GetChar( 2 ) );
1038 aFtColorModel3
.SetText( aColorStr
);
1040 aFtColorModel4
.Hide();
1041 aMtrFldColorModel4
.Hide();
1042 aMtrFldColorModel4
.SetValue( 0L );
1044 aMtrFldColorModel1
.SetHelpId( HID_TPCOLOR_RGB_1
);
1045 aMtrFldColorModel2
.SetHelpId( HID_TPCOLOR_RGB_2
);
1046 aMtrFldColorModel3
.SetHelpId( HID_TPCOLOR_RGB_3
);
1048 // Da der alte HelpText noch am Control steht wuerde
1049 // ein Umsetzen der HelpID alleine nichts bewirken
1050 aMtrFldColorModel1
.SetHelpText( String() );
1051 aMtrFldColorModel2
.SetHelpText( String() );
1052 aMtrFldColorModel3
.SetHelpText( String() );
1054 // RGB-Werte im Bereich 0..255 verarbeiten (nicht in %),
1055 // dazu MetricField's entsprechend einstellen
1056 aMtrFldColorModel1
.SetUnit(FUNIT_NONE
);
1057 aMtrFldColorModel1
.SetMin(0);
1058 aMtrFldColorModel1
.SetMax(255);
1059 aMtrFldColorModel1
.SetLast(255);
1061 aMtrFldColorModel2
.SetUnit(FUNIT_NONE
);
1062 aMtrFldColorModel2
.SetMin(0);
1063 aMtrFldColorModel2
.SetMax(255);
1064 aMtrFldColorModel2
.SetLast(255);
1066 aMtrFldColorModel3
.SetUnit(FUNIT_NONE
);
1067 aMtrFldColorModel3
.SetMin(0);
1068 aMtrFldColorModel3
.SetMax(255);
1069 aMtrFldColorModel3
.SetLast(255);
1075 String
aStr( aLbColorModel
.GetSelectEntry() );
1076 String
aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) );
1077 xub_StrLen nIdx
= 1;
1078 aColorStr
.SetChar( nIdx
, aStr
.GetChar( 0 ) );
1079 aFtColorModel1
.SetText( aColorStr
);
1080 aColorStr
.SetChar( nIdx
, aStr
.GetChar( 1 ) );
1081 aFtColorModel2
.SetText( aColorStr
);
1082 aColorStr
.SetChar( nIdx
,aStr
.GetChar( 2 ) );
1083 aFtColorModel3
.SetText( aColorStr
);
1084 aColorStr
.SetChar( nIdx
,aStr
.GetChar( 3 ) );
1085 aFtColorModel4
.SetText( aColorStr
);
1087 aFtColorModel4
.Show();
1088 aMtrFldColorModel4
.Show();
1090 aMtrFldColorModel1
.SetHelpId( HID_TPCOLOR_CMYK_1
);
1091 aMtrFldColorModel2
.SetHelpId( HID_TPCOLOR_CMYK_2
);
1092 aMtrFldColorModel3
.SetHelpId( HID_TPCOLOR_CMYK_3
);
1095 aMtrFldColorModel1
.SetHelpText( String() );
1096 aMtrFldColorModel2
.SetHelpText( String() );
1097 aMtrFldColorModel3
.SetHelpText( String() );
1099 // CMYK-Werte im Bereich 0..100% verarbeiten,
1100 // dazu MetricField's entsprechend einstellen
1101 String
aStrUnit( RTL_CONSTASCII_USTRINGPARAM( " %" ) );
1103 aMtrFldColorModel1
.SetUnit(FUNIT_CUSTOM
);
1104 aMtrFldColorModel1
.SetCustomUnitText( aStrUnit
);
1105 aMtrFldColorModel1
.SetMin(0);
1106 aMtrFldColorModel1
.SetMax(100);
1107 aMtrFldColorModel1
.SetLast(100);
1109 aMtrFldColorModel2
.SetUnit(FUNIT_CUSTOM
);
1110 aMtrFldColorModel2
.SetCustomUnitText( aStrUnit
);
1111 aMtrFldColorModel2
.SetMin(0);
1112 aMtrFldColorModel2
.SetMax(100);
1113 aMtrFldColorModel2
.SetLast(100);
1115 aMtrFldColorModel3
.SetUnit(FUNIT_CUSTOM
);
1116 aMtrFldColorModel3
.SetCustomUnitText( aStrUnit
);
1117 aMtrFldColorModel3
.SetMin(0);
1118 aMtrFldColorModel3
.SetMax(100);
1119 aMtrFldColorModel3
.SetLast(100);
1124 aMtrFldColorModel1
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetRed() ) );
1125 aMtrFldColorModel2
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetGreen() ) );
1126 aMtrFldColorModel3
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetBlue() ) );
1127 aMtrFldColorModel4
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetTransparency() ) );
1130 aMtrFldColorModel1
.SetAccessibleName( GetNonMnemonicString(aFtColorModel1
.GetText()) );
1131 aMtrFldColorModel2
.SetAccessibleName( GetNonMnemonicString(aFtColorModel2
.GetText()) );
1132 aMtrFldColorModel3
.SetAccessibleName( GetNonMnemonicString(aFtColorModel3
.GetText()) );
1133 aMtrFldColorModel4
.SetAccessibleName( GetNonMnemonicString(aFtColorModel4
.GetText()) );
1138 //------------------------------------------------------------------------
1140 long SvxColorTabPage::ChangeColorHdl_Impl( void* )
1142 int nPos
= aLbColor
.GetSelectEntryPos();
1143 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
)
1145 XColorEntry
* pEntry
= pColorTab
->GetColor( nPos
);
1147 aAktuellColor
.SetColor ( pEntry
->GetColor().GetColor() );
1149 ConvertColorValues (aAktuellColor
, eCM
);
1151 aMtrFldColorModel1
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetRed() ) );
1152 aMtrFldColorModel2
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetGreen() ) );
1153 aMtrFldColorModel3
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetBlue() ) );
1154 aMtrFldColorModel4
.SetValue( ColorToPercent_Impl( aAktuellColor
.GetTransparency() ) );
1156 // ItemSet fuellen und an XOut weiterleiten
1157 rXFSet
.Put( XFillColorItem( String(), pEntry
->GetColor() ) );
1158 aCtlPreviewOld
.SetAttributes( aXFillAttr
.GetItemSet() );
1159 aCtlPreviewNew
.SetAttributes( aXFillAttr
.GetItemSet() );
1161 aCtlPreviewNew
.Invalidate();
1166 //------------------------------------------------------------------------
1168 void SvxColorTabPage::FillValueSet_Impl( ValueSet
& rVs
)
1170 long nCount
= pColorTab
->Count();
1171 XColorEntry
* pColorEntry
;
1173 for( long i
= 0; i
< nCount
; i
++ )
1175 pColorEntry
= pColorTab
->GetColor( i
);
1176 rVs
.InsertItem( (sal_uInt16
) i
+ 1, pColorEntry
->GetColor(), pColorEntry
->GetName() );
1180 //------------------------------------------------------------------------
1182 // Ein RGB-Wert wird in einen CMYK-Wert konvertiert, wobei die Color-
1183 // Klasse vergewaltigt wird, da R in C, G in M und B in Y umgewandelt
1184 // wird. Der Wert K wird in einer Extra-Variablen gehalten.
1185 // Bei weiteren Farbmodellen sollte man hierfuer eigene Klassen entwickeln,
1186 // die dann auch entsprechende Casts enthalten.
1188 void SvxColorTabPage::RgbToCmyk_Impl( Color
& rColor
, sal_uInt16
& rK
)
1190 sal_uInt16 nColor1
, nColor2
, nColor3
;
1191 sal_uInt16 nProzent
; // nur temporaer !!!
1193 nColor1
= 255 - rColor
.GetRed();
1194 nProzent
= ColorToPercent_Impl( nColor1
);
1196 nColor2
= 255 - rColor
.GetGreen();
1197 nProzent
= ColorToPercent_Impl( nColor2
);
1199 nColor3
= 255 - rColor
.GetBlue();
1200 nProzent
= ColorToPercent_Impl( nColor3
);
1202 rK
= Min( Min( nColor1
, nColor2
), nColor3
);
1204 rColor
.SetRed( sal::static_int_cast
< sal_uInt8
>( nColor1
- rK
) );
1205 rColor
.SetGreen( sal::static_int_cast
< sal_uInt8
>( nColor2
- rK
) );
1206 rColor
.SetBlue( sal::static_int_cast
< sal_uInt8
>( nColor3
- rK
) );
1209 //------------------------------------------------------------------------
1211 // Umgekehrter Fall zu RgbToCmyk_Impl (s.o.)
1213 void SvxColorTabPage::CmykToRgb_Impl( Color
& rColor
, const sal_uInt16 nK
)
1217 lTemp
= 255 - ( rColor
.GetRed() + nK
);
1221 rColor
.SetRed( (sal_uInt8
)lTemp
);
1223 lTemp
= 255 - ( rColor
.GetGreen() + nK
);
1227 rColor
.SetGreen( (sal_uInt8
)lTemp
);
1229 lTemp
= 255 - ( rColor
.GetBlue() + nK
);
1233 rColor
.SetBlue( (sal_uInt8
)lTemp
);
1236 //------------------------------------------------------------------------
1238 sal_uInt16
SvxColorTabPage::ColorToPercent_Impl( sal_uInt16 nColor
)
1240 sal_uInt16 nWert
= 0;
1249 nWert
= (sal_uInt16
) ( (double) nColor
* 100.0 / 255.0 + 0.5 );
1256 //------------------------------------------------------------------------
1258 sal_uInt16
SvxColorTabPage::PercentToColor_Impl( sal_uInt16 nPercent
)
1260 sal_uInt16 nWert
= 0;
1269 nWert
= (sal_uInt16
) ( (double) nPercent
* 255.0 / 100.0 + 0.5 );
1276 //------------------------------------------------------------------------
1278 void SvxColorTabPage::FillUserData()
1280 // Das Farbmodell wird in der Ini-Datei festgehalten
1281 SetUserData( UniString::CreateFromInt32( eCM
) );