xref: /AOO41X/main/cui/source/tabpages/tpbitmap.cxx (revision 70d3707ac8de2c13f15b54a698b22c6ac9b73267)
12ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32ee96f1cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42ee96f1cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52ee96f1cSAndrew Rist  * distributed with this work for additional information
62ee96f1cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72ee96f1cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
82ee96f1cSAndrew Rist  * "License"); you may not use this file except in compliance
92ee96f1cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
112ee96f1cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
132ee96f1cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
142ee96f1cSAndrew Rist  * software distributed under the License is distributed on an
152ee96f1cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162ee96f1cSAndrew Rist  * KIND, either express or implied.  See the License for the
172ee96f1cSAndrew Rist  * specific language governing permissions and limitations
182ee96f1cSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
202ee96f1cSAndrew Rist  *************************************************************/
212ee96f1cSAndrew Rist 
222ee96f1cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir 
29cdf0e10cSrcweir //svdraw.hxx
30cdf0e10cSrcweir #define _SVDRAW_HXX
31cdf0e10cSrcweir #define _SDR_NOITEMS
32cdf0e10cSrcweir #define _SDR_NOTOUCH
33cdf0e10cSrcweir #define _SDR_NOTRANSFORM
34cdf0e10cSrcweir #define _SDR_NOOBJECTS
35cdf0e10cSrcweir #define _SDR_NOVIEWS
36cdf0e10cSrcweir #define _SDR_NOVIEWMARKER
37cdf0e10cSrcweir #define _SDR_NODRAGMETHODS
38cdf0e10cSrcweir #define _SDR_NOUNDO
39cdf0e10cSrcweir #define _SDR_NOXOUTDEV
40cdf0e10cSrcweir #include <vcl/wrkwin.hxx>
41cdf0e10cSrcweir #include <tools/shl.hxx>
42cdf0e10cSrcweir #include <vcl/msgbox.hxx>
43cdf0e10cSrcweir #include <tools/urlobj.hxx>
44cdf0e10cSrcweir #include <unotools/ucbstreamhelper.hxx>
45cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
46cdf0e10cSrcweir #include <sfx2/app.hxx>
47cdf0e10cSrcweir #include <sfx2/filedlghelper.hxx>
48cdf0e10cSrcweir #include <unotools/localfilehelper.hxx>
49cdf0e10cSrcweir #include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
50cdf0e10cSrcweir #include <svx/dialmgr.hxx>
51cdf0e10cSrcweir #include <vcl/bmpacc.hxx>
52cdf0e10cSrcweir #include <svx/dialogs.hrc>
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #define _SVX_TPBITMAP_CXX
55cdf0e10cSrcweir 
56cdf0e10cSrcweir #include <cuires.hrc>
57cdf0e10cSrcweir #include "helpid.hrc"
58cdf0e10cSrcweir #include "svx/xattr.hxx"
59cdf0e10cSrcweir #include <svx/xpool.hxx>
60cdf0e10cSrcweir #include <svx/xtable.hxx>
61cdf0e10cSrcweir #include "svx/xoutbmp.hxx"
62cdf0e10cSrcweir #include "svx/drawitem.hxx"
63cdf0e10cSrcweir #include "cuitabarea.hxx"
64cdf0e10cSrcweir #include "tabarea.hrc"
65cdf0e10cSrcweir #include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
66cdf0e10cSrcweir //#include "dlgname.hrc"
67cdf0e10cSrcweir #include <svx/svxdlg.hxx> //CHINA001
68cdf0e10cSrcweir #include <dialmgr.hxx>
69cdf0e10cSrcweir #include "sfx2/opengrf.hxx"
70cdf0e10cSrcweir #include "paragrph.hrc"
71cdf0e10cSrcweir 
72cdf0e10cSrcweir #define DLGWIN this->GetParent()->GetParent()
73cdf0e10cSrcweir 
74cdf0e10cSrcweir /*************************************************************************
75cdf0e10cSrcweir |*
76cdf0e10cSrcweir |*	Dialog zum Aendern und Definieren der Bitmaps
77cdf0e10cSrcweir |*
78cdf0e10cSrcweir \************************************************************************/
79cdf0e10cSrcweir 
80cdf0e10cSrcweir SvxBitmapTabPage::SvxBitmapTabPage
81cdf0e10cSrcweir (
82cdf0e10cSrcweir 	Window* pParent,
83cdf0e10cSrcweir 	const SfxItemSet& rInAttrs
84cdf0e10cSrcweir ) :
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	SvxTabPage			( pParent, CUI_RES( RID_SVXPAGE_BITMAP ), rInAttrs ),
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     aCtlPixel           ( this, CUI_RES( CTL_PIXEL ) ),
89cdf0e10cSrcweir     aFtPixelEdit        ( this, CUI_RES( FT_PIXEL_EDIT ) ),
90cdf0e10cSrcweir     aFtColor            ( this, CUI_RES( FT_COLOR ) ),
91cdf0e10cSrcweir 	aLbColor			( this, CUI_RES( LB_COLOR ) ),
92cdf0e10cSrcweir 	aFtBackgroundColor	( this, CUI_RES( FT_BACKGROUND_COLOR ) ),
93cdf0e10cSrcweir 	aLbBackgroundColor	( this, CUI_RES( LB_BACKGROUND_COLOR ) ),
94cdf0e10cSrcweir     // This fix text is used only to provide the name for the following
95cdf0e10cSrcweir     // bitmap list box.  The fixed text is not displayed.
96cdf0e10cSrcweir     aLbBitmapsHidden    ( this, CUI_RES( FT_BITMAPS_HIDDEN ) ),
97cdf0e10cSrcweir 	aLbBitmaps			( this, CUI_RES( LB_BITMAPS ) ),
98cdf0e10cSrcweir     aFlProp             ( this, CUI_RES( FL_PROP ) ),
99cdf0e10cSrcweir 	aCtlPreview			( this, CUI_RES( CTL_PREVIEW ) ),
100cdf0e10cSrcweir 	aBtnAdd				( this, CUI_RES( BTN_ADD ) ),
101cdf0e10cSrcweir     aBtnModify          ( this, CUI_RES( BTN_MODIFY ) ),
102cdf0e10cSrcweir     aBtnImport          ( this, CUI_RES( BTN_IMPORT ) ),
103cdf0e10cSrcweir     aBtnDelete          ( this, CUI_RES( BTN_DELETE ) ),
104cdf0e10cSrcweir 	aBtnLoad			( this, CUI_RES( BTN_LOAD ) ),
105cdf0e10cSrcweir 	aBtnSave			( this, CUI_RES( BTN_SAVE ) ),
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     aBitmapCtl          ( this, aCtlPreview.GetSizePixel() ),
108cdf0e10cSrcweir     rOutAttrs           ( rInAttrs ),
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     pColorTab( NULL ),
111cdf0e10cSrcweir     pBitmapList( NULL ),
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     pXPool              ( (XOutdevItemPool*) rInAttrs.GetPool() ),
114cdf0e10cSrcweir     aXFStyleItem        ( XFILL_BITMAP ),
115*70d3707aSArmin Le Grand     aXBitmapItem        ( String(), Graphic() ),
116cdf0e10cSrcweir     aXFillAttr          ( pXPool ),
117cdf0e10cSrcweir     rXFSet              ( aXFillAttr.GetItemSet() )
118cdf0e10cSrcweir {
119cdf0e10cSrcweir 	aBtnLoad.SetModeImage( Image( CUI_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
120cdf0e10cSrcweir 	aBtnSave.SetModeImage( Image( CUI_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
121cdf0e10cSrcweir 	FreeResource();
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 	// diese Page braucht ExchangeSupport
124cdf0e10cSrcweir 	SetExchangeSupport();
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	// Setzen des Output-Devices
127cdf0e10cSrcweir 	rXFSet.Put( aXFStyleItem );
128cdf0e10cSrcweir 	rXFSet.Put( aXBitmapItem );
129cdf0e10cSrcweir 	//aCtlPreview.SetAttributes( aXFillAttr );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	aBtnAdd.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickAddHdl_Impl ) );
132cdf0e10cSrcweir 	aBtnImport.SetClickHdl(
133cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ClickImportHdl_Impl ) );
134cdf0e10cSrcweir 	aBtnModify.SetClickHdl(
135cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ClickModifyHdl_Impl ) );
136cdf0e10cSrcweir 	aBtnDelete.SetClickHdl(
137cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ClickDeleteHdl_Impl ) );
138cdf0e10cSrcweir 	aBtnLoad.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickLoadHdl_Impl ) );
139cdf0e10cSrcweir 	aBtnSave.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickSaveHdl_Impl ) );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	aLbBitmaps.SetSelectHdl(
142cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ChangeBitmapHdl_Impl ) );
143cdf0e10cSrcweir 	aLbColor.SetSelectHdl(
144cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ChangePixelColorHdl_Impl ) );
145cdf0e10cSrcweir 	aLbBackgroundColor.SetSelectHdl(
146cdf0e10cSrcweir 		LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) );
147cdf0e10cSrcweir 
14800d11a91SMathias Bauer 	String accName = String(CUI_RES(STR_EXAMPLE));
149cdf0e10cSrcweir 	aCtlPreview.SetAccessibleName(accName);
150cdf0e10cSrcweir 	aCtlPixel.SetAccessibleRelationMemberOf( &aFlProp );
151cdf0e10cSrcweir 	aCtlPixel.SetAccessibleRelationLabeledBy( &aFtPixelEdit );
152cdf0e10cSrcweir 	aLbBitmaps.SetAccessibleRelationLabeledBy(&aLbBitmaps);
153cdf0e10cSrcweir 	aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
154cdf0e10cSrcweir 	aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
155cdf0e10cSrcweir 	aBtnImport.SetAccessibleRelationMemberOf( &aFlProp );
156cdf0e10cSrcweir 	aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
157cdf0e10cSrcweir 
158cdf0e10cSrcweir }
159cdf0e10cSrcweir 
160cdf0e10cSrcweir // -----------------------------------------------------------------------
161cdf0e10cSrcweir 
162cdf0e10cSrcweir void SvxBitmapTabPage::Construct()
163cdf0e10cSrcweir {
164cdf0e10cSrcweir 	// Farbtabellen
165cdf0e10cSrcweir 	aLbColor.Fill( pColorTab );
166cdf0e10cSrcweir 	aLbBackgroundColor.CopyEntries( aLbColor );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	// Bitmaptabelle
169cdf0e10cSrcweir 	aLbBitmaps.Fill( pBitmapList );
170cdf0e10cSrcweir }
171cdf0e10cSrcweir 
172cdf0e10cSrcweir // -----------------------------------------------------------------------
173cdf0e10cSrcweir 
174cdf0e10cSrcweir void SvxBitmapTabPage::ActivatePage( const SfxItemSet&  )
175cdf0e10cSrcweir {
176cdf0e10cSrcweir 	sal_uInt16 nPos;
177cdf0e10cSrcweir 	sal_uInt16 nCount;
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	if( *pDlgType == 0 ) // Flaechen-Dialog
180cdf0e10cSrcweir 	{
181cdf0e10cSrcweir 		*pbAreaTP = sal_False;
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 		if( pColorTab )
184cdf0e10cSrcweir 		{
185cdf0e10cSrcweir 			// ColorTable
186cdf0e10cSrcweir 			if( *pnColorTableState & CT_CHANGED ||
187cdf0e10cSrcweir 				*pnColorTableState & CT_MODIFIED )
188cdf0e10cSrcweir 			{
189cdf0e10cSrcweir 				if( *pnColorTableState & CT_CHANGED )
190cdf0e10cSrcweir 					pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable();
191cdf0e10cSrcweir 
192cdf0e10cSrcweir 				// LbColor
193cdf0e10cSrcweir 				nPos = aLbColor.GetSelectEntryPos();
194cdf0e10cSrcweir 				aLbColor.Clear();
195cdf0e10cSrcweir 				aLbColor.Fill( pColorTab );
196cdf0e10cSrcweir 				nCount = aLbColor.GetEntryCount();
197cdf0e10cSrcweir 				if( nCount == 0 )
198cdf0e10cSrcweir 					; // Dieser Fall sollte nicht auftreten
199cdf0e10cSrcweir 				else if( nCount <= nPos )
200cdf0e10cSrcweir 					aLbColor.SelectEntryPos( 0 );
201cdf0e10cSrcweir 				else
202cdf0e10cSrcweir 					aLbColor.SelectEntryPos( nPos );
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 				// LbColorBackground
205cdf0e10cSrcweir 				nPos = aLbBackgroundColor.GetSelectEntryPos();
206cdf0e10cSrcweir 				aLbBackgroundColor.Clear();
207cdf0e10cSrcweir 				aLbBackgroundColor.CopyEntries( aLbColor );
208cdf0e10cSrcweir 				nCount = aLbBackgroundColor.GetEntryCount();
209cdf0e10cSrcweir 				if( nCount == 0 )
210cdf0e10cSrcweir 					; // Dieser Fall sollte nicht auftreten
211cdf0e10cSrcweir 				else if( nCount <= nPos )
212cdf0e10cSrcweir 					aLbBackgroundColor.SelectEntryPos( 0 );
213cdf0e10cSrcweir 				else
214cdf0e10cSrcweir 					aLbBackgroundColor.SelectEntryPos( nPos );
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 				ChangePixelColorHdl_Impl( this );
217cdf0e10cSrcweir 				ChangeBackgrndColorHdl_Impl( this );
218cdf0e10cSrcweir 			}
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 			// Ermitteln (evtl. abschneiden) des Namens und in
221cdf0e10cSrcweir 			// der GroupBox darstellen
222cdf0e10cSrcweir 			String			aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
223cdf0e10cSrcweir 			INetURLObject	aURL( pBitmapList->GetPath() );
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 			aURL.Append( pBitmapList->GetName() );
226cdf0e10cSrcweir 			DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
227cdf0e10cSrcweir 
228cdf0e10cSrcweir 			if( aURL.getBase().getLength() > 18 )
229cdf0e10cSrcweir 			{
230cdf0e10cSrcweir 				aString += String(aURL.getBase()).Copy( 0, 15 );
231cdf0e10cSrcweir 				aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
232cdf0e10cSrcweir 			}
233cdf0e10cSrcweir 			else
234cdf0e10cSrcweir 				aString += String(aURL.getBase());
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 			if( *pPageType == PT_BITMAP && *pPos != LISTBOX_ENTRY_NOTFOUND )
237cdf0e10cSrcweir 			{
238cdf0e10cSrcweir 				aLbBitmaps.SelectEntryPos( *pPos );
239cdf0e10cSrcweir 			}
240cdf0e10cSrcweir 			// Farben koennten geloescht worden sein
241cdf0e10cSrcweir 			ChangeBitmapHdl_Impl( this );
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 			*pPageType = PT_BITMAP;
244cdf0e10cSrcweir 			*pPos = LISTBOX_ENTRY_NOTFOUND;
245cdf0e10cSrcweir 		}
246cdf0e10cSrcweir 	}
247cdf0e10cSrcweir }
248cdf0e10cSrcweir 
249cdf0e10cSrcweir // -----------------------------------------------------------------------
250cdf0e10cSrcweir 
251cdf0e10cSrcweir int SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet)
252cdf0e10cSrcweir {
253cdf0e10cSrcweir 	if ( CheckChanges_Impl() == -1L )
254cdf0e10cSrcweir 		return KEEP_PAGE;
255cdf0e10cSrcweir 
256cdf0e10cSrcweir     if( _pSet )
257cdf0e10cSrcweir         FillItemSet( *_pSet );
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	return LEAVE_PAGE;
260cdf0e10cSrcweir }
261cdf0e10cSrcweir 
262cdf0e10cSrcweir // -----------------------------------------------------------------------
263cdf0e10cSrcweir 
264cdf0e10cSrcweir sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
265cdf0e10cSrcweir {
266cdf0e10cSrcweir 	if( *pDlgType == 0 && *pbAreaTP == sal_False ) // Flaechen-Dialog
267cdf0e10cSrcweir 	{
268*70d3707aSArmin Le Grand 		if(PT_BITMAP == *pPageType)
269cdf0e10cSrcweir 		{
270*70d3707aSArmin Le Grand 			const sal_uInt16 nPos(aLbBitmaps.GetSelectEntryPos());
271cdf0e10cSrcweir 
272*70d3707aSArmin Le Grand             _rOutAttrs.Put(XFillStyleItem(XFILL_BITMAP));
273*70d3707aSArmin Le Grand 
274*70d3707aSArmin Le Grand             if(LISTBOX_ENTRY_NOTFOUND != nPos)
275cdf0e10cSrcweir 			{
276*70d3707aSArmin Le Grand                 const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos);
277*70d3707aSArmin Le Grand 				const String aString(aLbBitmaps.GetSelectEntry());
278cdf0e10cSrcweir 
279*70d3707aSArmin Le Grand                 _rOutAttrs.Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
280cdf0e10cSrcweir 			}
281cdf0e10cSrcweir 			else
282cdf0e10cSrcweir 			{
283*70d3707aSArmin Le Grand 				const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
284cdf0e10cSrcweir 
285*70d3707aSArmin Le Grand                 _rOutAttrs.Put(XFillBitmapItem(String(), Graphic(aBitmapEx)));
286*70d3707aSArmin Le Grand 			}
287*70d3707aSArmin Le Grand 		}
288*70d3707aSArmin Le Grand 	}
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     return sal_True;
291cdf0e10cSrcweir }
292cdf0e10cSrcweir 
293cdf0e10cSrcweir // -----------------------------------------------------------------------
294cdf0e10cSrcweir 
295cdf0e10cSrcweir void SvxBitmapTabPage::Reset( const SfxItemSet&  )
296cdf0e10cSrcweir {
297cdf0e10cSrcweir 	// aLbBitmaps.SelectEntryPos( 0 );
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	aBitmapCtl.SetLines( aCtlPixel.GetLineCount() );
300cdf0e10cSrcweir 	aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
301cdf0e10cSrcweir 	aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
302cdf0e10cSrcweir 	aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 	// Bitmap holen und darstellen
305*70d3707aSArmin Le Grand 	const XFillBitmapItem aBmpItem(String(), Graphic(aBitmapCtl.GetBitmapEx()));
306cdf0e10cSrcweir 	rXFSet.Put( aBmpItem );
307cdf0e10cSrcweir 	aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
308cdf0e10cSrcweir 	aCtlPreview.Invalidate();
309cdf0e10cSrcweir 
310cdf0e10cSrcweir 	ChangeBitmapHdl_Impl( this );
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 	// Status der Buttons ermitteln
313cdf0e10cSrcweir 	if( pBitmapList->Count() )
314cdf0e10cSrcweir 	{
315cdf0e10cSrcweir 		aBtnAdd.Enable();
316cdf0e10cSrcweir 		aBtnModify.Enable();
317cdf0e10cSrcweir 		aBtnDelete.Enable();
318cdf0e10cSrcweir 		aBtnSave.Enable();
319cdf0e10cSrcweir 	}
320cdf0e10cSrcweir 	else
321cdf0e10cSrcweir 	{
322cdf0e10cSrcweir 		aBtnModify.Disable();
323cdf0e10cSrcweir 		aBtnDelete.Disable();
324cdf0e10cSrcweir 		aBtnSave.Disable();
325cdf0e10cSrcweir 	}
326cdf0e10cSrcweir }
327cdf0e10cSrcweir 
328cdf0e10cSrcweir // -----------------------------------------------------------------------
329cdf0e10cSrcweir 
330cdf0e10cSrcweir SfxTabPage* SvxBitmapTabPage::Create( Window* pWindow,
331cdf0e10cSrcweir                 const SfxItemSet& rSet )
332cdf0e10cSrcweir {
333cdf0e10cSrcweir     return new SvxBitmapTabPage( pWindow, rSet );
334cdf0e10cSrcweir }
335cdf0e10cSrcweir 
336cdf0e10cSrcweir //------------------------------------------------------------------------
337cdf0e10cSrcweir 
338cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ChangeBitmapHdl_Impl, void *, EMPTYARG )
339cdf0e10cSrcweir {
340*70d3707aSArmin Le Grand     GraphicObject* pGraphicObject = 0;
341*70d3707aSArmin Le Grand 	int nPos(aLbBitmaps.GetSelectEntryPos());
342cdf0e10cSrcweir 
343*70d3707aSArmin Le Grand 	if(LISTBOX_ENTRY_NOTFOUND != nPos)
344*70d3707aSArmin Le Grand     {
345*70d3707aSArmin Le Grand         pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
346*70d3707aSArmin Le Grand     }
347cdf0e10cSrcweir 	else
348cdf0e10cSrcweir 	{
349*70d3707aSArmin Le Grand 		const SfxPoolItem* pPoolItem = 0;
350*70d3707aSArmin Le Grand 
351*70d3707aSArmin Le Grand         if(SFX_ITEM_SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLSTYLE), true, &pPoolItem))
352cdf0e10cSrcweir 		{
353*70d3707aSArmin Le Grand 			const XFillStyle eXFS((XFillStyle)((const XFillStyleItem*)pPoolItem)->GetValue());
354*70d3707aSArmin Le Grand 
355*70d3707aSArmin Le Grand             if((XFILL_BITMAP == eXFS) && (SFX_ITEM_SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
356cdf0e10cSrcweir 			{
357*70d3707aSArmin Le Grand                 pGraphicObject = new GraphicObject(((const XFillBitmapItem*)pPoolItem)->GetGraphicObject());
358cdf0e10cSrcweir 			}
359cdf0e10cSrcweir 		}
360*70d3707aSArmin Le Grand 
361*70d3707aSArmin Le Grand         if(!pGraphicObject)
362cdf0e10cSrcweir 		{
363cdf0e10cSrcweir 			aLbBitmaps.SelectEntryPos(0);
364cdf0e10cSrcweir 			nPos = aLbBitmaps.GetSelectEntryPos();
365cdf0e10cSrcweir 
366*70d3707aSArmin Le Grand             if(LISTBOX_ENTRY_NOTFOUND != nPos)
367cdf0e10cSrcweir             {
368*70d3707aSArmin Le Grand                 pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
369cdf0e10cSrcweir             }
370cdf0e10cSrcweir 		}
371cdf0e10cSrcweir 	}
372cdf0e10cSrcweir 
373*70d3707aSArmin Le Grand     if(pGraphicObject)
374cdf0e10cSrcweir 	{
375*70d3707aSArmin Le Grand         BitmapColor aBack;
376*70d3707aSArmin Le Grand         BitmapColor aFront;
377*70d3707aSArmin Le Grand         bool bIs8x8(isHistorical8x8(pGraphicObject->GetGraphic().GetBitmap(), aBack, aFront));
378cdf0e10cSrcweir 
379cdf0e10cSrcweir         aLbColor.SetNoSelection();
380cdf0e10cSrcweir 		aLbBackgroundColor.SetNoSelection();
381cdf0e10cSrcweir 
382*70d3707aSArmin Le Grand 		if(bIs8x8)
383cdf0e10cSrcweir 		{
384cdf0e10cSrcweir 			aCtlPixel.SetPaintable( sal_True );
385cdf0e10cSrcweir 			aCtlPixel.Enable();
386cdf0e10cSrcweir             aFtPixelEdit.Enable();
387cdf0e10cSrcweir 			aFtColor.Enable();
388cdf0e10cSrcweir 			aLbColor.Enable();
389cdf0e10cSrcweir 			aFtBackgroundColor.Enable();
390cdf0e10cSrcweir 			aLbBackgroundColor.Enable();
391cdf0e10cSrcweir 			aBtnModify.Enable();
392cdf0e10cSrcweir 			aBtnAdd.Enable();
393cdf0e10cSrcweir 
394cdf0e10cSrcweir 			// Setzen des PixelControls
395*70d3707aSArmin Le Grand 			aCtlPixel.SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
396cdf0e10cSrcweir 
397*70d3707aSArmin Le Grand 			Color aPixelColor = aFront;
398*70d3707aSArmin Le Grand 			Color aBackColor = aBack;
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 			aBitmapCtl.SetPixelColor( aPixelColor );
401cdf0e10cSrcweir 			aBitmapCtl.SetBackgroundColor( aBackColor );
402cdf0e10cSrcweir 
403cdf0e10cSrcweir 			// Wenn der Eintrag nicht in der Listbox ist, wird die Farbe
404cdf0e10cSrcweir 			// temporaer hinzugenommen
405cdf0e10cSrcweir 			if( 0 == aLbBitmaps.GetSelectEntryPos() )
406cdf0e10cSrcweir 			{
407cdf0e10cSrcweir 				aLbColor.SelectEntry( Color( COL_BLACK ) );
408cdf0e10cSrcweir 				ChangePixelColorHdl_Impl( this );
409cdf0e10cSrcweir 			}
410cdf0e10cSrcweir 			else
411cdf0e10cSrcweir 				aLbColor.SelectEntry( aPixelColor );
412cdf0e10cSrcweir 			if( aLbColor.GetSelectEntryCount() == 0 )
413cdf0e10cSrcweir 			{
414cdf0e10cSrcweir 				aLbColor.InsertEntry( aPixelColor, String() );
415cdf0e10cSrcweir 				aLbColor.SelectEntry( aPixelColor );
416cdf0e10cSrcweir 			}
417cdf0e10cSrcweir 			aLbBackgroundColor.SelectEntry( aBackColor );
418cdf0e10cSrcweir 			if( aLbBackgroundColor.GetSelectEntryCount() == 0 )
419cdf0e10cSrcweir 			{
420cdf0e10cSrcweir 				aLbBackgroundColor.InsertEntry( aBackColor, String() );
421cdf0e10cSrcweir 				aLbBackgroundColor.SelectEntry( aBackColor );
422cdf0e10cSrcweir 			}
423cdf0e10cSrcweir 		}
424*70d3707aSArmin Le Grand         else
425*70d3707aSArmin Le Grand 		{
426*70d3707aSArmin Le Grand 			aCtlPixel.Reset();
427*70d3707aSArmin Le Grand 			aCtlPixel.SetPaintable( sal_False );
428*70d3707aSArmin Le Grand 			aCtlPixel.Disable();
429*70d3707aSArmin Le Grand             aFtPixelEdit.Disable();
430*70d3707aSArmin Le Grand 			aFtColor.Disable();
431*70d3707aSArmin Le Grand 			aLbColor.Disable();
432*70d3707aSArmin Le Grand 			aFtBackgroundColor.Disable();
433*70d3707aSArmin Le Grand 			aLbBackgroundColor.Disable();
434*70d3707aSArmin Le Grand 			aBtnModify.Disable();
435*70d3707aSArmin Le Grand 			aBtnAdd.Disable();
436*70d3707aSArmin Le Grand 		}
437*70d3707aSArmin Le Grand 
438cdf0e10cSrcweir         aCtlPixel.Invalidate();
439cdf0e10cSrcweir 
440cdf0e10cSrcweir 		// Bitmap darstellen
441*70d3707aSArmin Le Grand 		const XFillBitmapItem aXBmpItem(String(), *pGraphicObject);
442cdf0e10cSrcweir 		rXFSet.Put( aXBmpItem );
443cdf0e10cSrcweir 
444cdf0e10cSrcweir 		aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
445cdf0e10cSrcweir 		aCtlPreview.Invalidate();
446cdf0e10cSrcweir 
447cdf0e10cSrcweir 		bBmpChanged = sal_False;
448*70d3707aSArmin Le Grand 		delete pGraphicObject;
449cdf0e10cSrcweir 	}
450*70d3707aSArmin Le Grand 
451*70d3707aSArmin Le Grand     return 0;
452cdf0e10cSrcweir }
453cdf0e10cSrcweir 
454cdf0e10cSrcweir // -----------------------------------------------------------------------
455cdf0e10cSrcweir 
456cdf0e10cSrcweir long SvxBitmapTabPage::CheckChanges_Impl()
457cdf0e10cSrcweir {
458cdf0e10cSrcweir 	sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
459cdf0e10cSrcweir 	if( nPos != LISTBOX_ENTRY_NOTFOUND )
460cdf0e10cSrcweir 	{
461cdf0e10cSrcweir 		String aString = aLbBitmaps.GetSelectEntry();
462cdf0e10cSrcweir 
463cdf0e10cSrcweir 		if( bBmpChanged )
464cdf0e10cSrcweir 		{
465cdf0e10cSrcweir 			ResMgr& rMgr = CUI_MGR();
466cdf0e10cSrcweir             Image aWarningBoxImage = WarningBox::GetStandardImage();
467cdf0e10cSrcweir 			SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
468cdf0e10cSrcweir 			DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
469cdf0e10cSrcweir 			AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
470cdf0e10cSrcweir 														String( SVX_RES( RID_SVXSTR_BITMAP ) ),
471cdf0e10cSrcweir 														String( CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ) ),
472cdf0e10cSrcweir 														&aWarningBoxImage  );
473cdf0e10cSrcweir 			DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
474cdf0e10cSrcweir 			aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
475cdf0e10cSrcweir 									String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
476cdf0e10cSrcweir 			aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
477cdf0e10cSrcweir 									String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
478cdf0e10cSrcweir 
479cdf0e10cSrcweir 			short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
480cdf0e10cSrcweir 
481cdf0e10cSrcweir 			switch( nRet )
482cdf0e10cSrcweir 			{
483cdf0e10cSrcweir 				case RET_BTN_1: // Aendern
484cdf0e10cSrcweir 				{
485cdf0e10cSrcweir 					ClickModifyHdl_Impl( this );
486cdf0e10cSrcweir 				}
487cdf0e10cSrcweir 				break;
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 				case RET_BTN_2: // Hinzufuegen
490cdf0e10cSrcweir 				{
491cdf0e10cSrcweir 					ClickAddHdl_Impl( this );
492cdf0e10cSrcweir 					nPos = aLbBitmaps.GetSelectEntryPos();
493cdf0e10cSrcweir 				}
494cdf0e10cSrcweir 				break;
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 				case RET_CANCEL:
497cdf0e10cSrcweir 					// return( -1L );
498cdf0e10cSrcweir 				break;
499cdf0e10cSrcweir 				// return( sal_True ); // Abbruch
500cdf0e10cSrcweir 			}
501cdf0e10cSrcweir 			delete aMessDlg; //add by CHINA001
502cdf0e10cSrcweir 		}
503cdf0e10cSrcweir 	}
504cdf0e10cSrcweir 	nPos = aLbBitmaps.GetSelectEntryPos();
505cdf0e10cSrcweir 	if( nPos != LISTBOX_ENTRY_NOTFOUND )
506cdf0e10cSrcweir 		*pPos = nPos;
507cdf0e10cSrcweir 	return 0L;
508cdf0e10cSrcweir }
509cdf0e10cSrcweir 
510cdf0e10cSrcweir //------------------------------------------------------------------------
511cdf0e10cSrcweir 
512cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
513cdf0e10cSrcweir {
514cdf0e10cSrcweir 	ResMgr& rMgr = CUI_MGR();
515cdf0e10cSrcweir 	String aNewName( SVX_RES( RID_SVXSTR_BITMAP ) );
516cdf0e10cSrcweir 	String aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_BITMAP ) );
517cdf0e10cSrcweir 	String aName;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	long nCount = pBitmapList->Count();
520cdf0e10cSrcweir 	long j = 1;
521cdf0e10cSrcweir 	sal_Bool bDifferent = sal_False;
522cdf0e10cSrcweir 
523cdf0e10cSrcweir 	while( !bDifferent )
524cdf0e10cSrcweir 	{
525cdf0e10cSrcweir 		aName  = aNewName;
526cdf0e10cSrcweir 		aName += sal_Unicode(' ');
527cdf0e10cSrcweir 		aName += UniString::CreateFromInt32( j++ );
528cdf0e10cSrcweir 		bDifferent = sal_True;
529cdf0e10cSrcweir 
530cdf0e10cSrcweir 		for( long i = 0; i < nCount && bDifferent; i++ )
531cdf0e10cSrcweir             if( aName == pBitmapList->GetBitmap( i )->GetName() )
532cdf0e10cSrcweir 				bDifferent = sal_False;
533cdf0e10cSrcweir 	}
534cdf0e10cSrcweir 
535cdf0e10cSrcweir 	SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
536cdf0e10cSrcweir 	DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
537cdf0e10cSrcweir 	AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc );
538cdf0e10cSrcweir 	DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
539cdf0e10cSrcweir 	WarningBox*    pWarnBox = NULL;
540cdf0e10cSrcweir 	sal_uInt16         nError   = RID_SVXSTR_WARN_NAME_DUPLICATE;
541cdf0e10cSrcweir 
542cdf0e10cSrcweir 	while( pDlg->Execute() == RET_OK )
543cdf0e10cSrcweir 	{
544cdf0e10cSrcweir 		pDlg->GetName( aName );
545cdf0e10cSrcweir 
546cdf0e10cSrcweir 		bDifferent = sal_True;
547cdf0e10cSrcweir 
548cdf0e10cSrcweir 		for( long i = 0; i < nCount && bDifferent; i++ )
549cdf0e10cSrcweir             if( aName == pBitmapList->GetBitmap( i )->GetName() )
550cdf0e10cSrcweir 				bDifferent = sal_False;
551cdf0e10cSrcweir 
552cdf0e10cSrcweir 		if( bDifferent ) {
553cdf0e10cSrcweir 			nError = 0;
554cdf0e10cSrcweir 			break;
555cdf0e10cSrcweir 		}
556cdf0e10cSrcweir 
557cdf0e10cSrcweir 		if( !pWarnBox )
558cdf0e10cSrcweir 		{
559cdf0e10cSrcweir 			pWarnBox = new WarningBox( DLGWIN,
560cdf0e10cSrcweir 									   WinBits( WB_OK_CANCEL ),
561cdf0e10cSrcweir 									   String( ResId( nError, rMgr ) ) );
562cdf0e10cSrcweir 			pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
563cdf0e10cSrcweir 		}
564cdf0e10cSrcweir 
565cdf0e10cSrcweir 		if( pWarnBox->Execute() != RET_OK )
566cdf0e10cSrcweir 			break;
567cdf0e10cSrcweir 	}
568cdf0e10cSrcweir 	//Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
569cdf0e10cSrcweir 	delete pDlg;
570cdf0e10cSrcweir 	delete pWarnBox;
571cdf0e10cSrcweir 
572cdf0e10cSrcweir 	if( !nError )
573cdf0e10cSrcweir 	{
574cdf0e10cSrcweir 		XBitmapEntry* pEntry = 0;
575cdf0e10cSrcweir 		if( aCtlPixel.IsEnabled() )
576cdf0e10cSrcweir 		{
577*70d3707aSArmin Le Grand 			const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
578cdf0e10cSrcweir 
579*70d3707aSArmin Le Grand 			pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName);
580cdf0e10cSrcweir 		}
581cdf0e10cSrcweir 		else // Es muss sich um eine nicht vorhandene importierte Bitmap handeln
582cdf0e10cSrcweir 		{
583*70d3707aSArmin Le Grand 			const SfxPoolItem* pPoolItem = 0;
584*70d3707aSArmin Le Grand 
585*70d3707aSArmin Le Grand             if(SFX_ITEM_SET == rOutAttrs.GetItemState(XATTR_FILLBITMAP, true, &pPoolItem))
586cdf0e10cSrcweir 			{
587*70d3707aSArmin Le Grand                 pEntry = new XBitmapEntry(dynamic_cast< const XFillBitmapItem* >(pPoolItem)->GetGraphicObject(), aName);
588cdf0e10cSrcweir 			}
589cdf0e10cSrcweir 		}
590cdf0e10cSrcweir 
591cdf0e10cSrcweir 		DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" );
592cdf0e10cSrcweir 
593cdf0e10cSrcweir 		if( pEntry )
594cdf0e10cSrcweir 		{
595cdf0e10cSrcweir 			pBitmapList->Insert( pEntry );
596cdf0e10cSrcweir 
597cdf0e10cSrcweir 			aLbBitmaps.Append( pEntry );
598cdf0e10cSrcweir 			aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
599cdf0e10cSrcweir 
600cdf0e10cSrcweir #ifdef WNT
601cdf0e10cSrcweir 			// hack: #31355# W.P.
602cdf0e10cSrcweir 			Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );
603cdf0e10cSrcweir 			if( sal_True ) {				// ??? overlapped with pDlg
604cdf0e10cSrcweir 										// and srolling
605cdf0e10cSrcweir 				Invalidate( aRect );
606cdf0e10cSrcweir 				//aLbBitmaps.Invalidate();
607cdf0e10cSrcweir 			}
608cdf0e10cSrcweir #endif
609cdf0e10cSrcweir 
610cdf0e10cSrcweir 			// Flag fuer modifiziert setzen
611cdf0e10cSrcweir 			*pnBitmapListState |= CT_MODIFIED;
612cdf0e10cSrcweir 
613cdf0e10cSrcweir 			ChangeBitmapHdl_Impl( this );
614cdf0e10cSrcweir 		}
615cdf0e10cSrcweir 	}
616cdf0e10cSrcweir 
617cdf0e10cSrcweir 	// Status der Buttons ermitteln
618cdf0e10cSrcweir 	if( pBitmapList->Count() )
619cdf0e10cSrcweir 	{
620cdf0e10cSrcweir 		aBtnModify.Enable();
621cdf0e10cSrcweir 		aBtnDelete.Enable();
622cdf0e10cSrcweir 		aBtnSave.Enable();
623cdf0e10cSrcweir 	}
624cdf0e10cSrcweir 	return 0L;
625cdf0e10cSrcweir }
626cdf0e10cSrcweir 
627cdf0e10cSrcweir 
628cdf0e10cSrcweir /******************************************************************************/
629cdf0e10cSrcweir /******************************************************************************/
630cdf0e10cSrcweir 
631cdf0e10cSrcweir 
632cdf0e10cSrcweir //------------------------------------------------------------------------
633cdf0e10cSrcweir 
634cdf0e10cSrcweir #ifdef _MSC_VER
635cdf0e10cSrcweir #pragma optimize ( "", off )
636cdf0e10cSrcweir #endif
637cdf0e10cSrcweir 
638cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickImportHdl_Impl, void *, EMPTYARG )
639cdf0e10cSrcweir {
640cdf0e10cSrcweir 	ResMgr& rMgr = CUI_MGR();
641cdf0e10cSrcweir 	SvxOpenGraphicDialog aDlg( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Import" ) ) );
642cdf0e10cSrcweir 	aDlg.EnableLink(sal_False);
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 	if( !aDlg.Execute() )
645cdf0e10cSrcweir 	{
646cdf0e10cSrcweir 		Graphic 		aGraphic;
647cdf0e10cSrcweir 		int 			nError = 1;
648cdf0e10cSrcweir 
649cdf0e10cSrcweir 		EnterWait();
650cdf0e10cSrcweir 		nError = aDlg.GetGraphic( aGraphic );
651cdf0e10cSrcweir 		LeaveWait();
652cdf0e10cSrcweir 
653cdf0e10cSrcweir 		if( !nError )
654cdf0e10cSrcweir 		{
655cdf0e10cSrcweir 			String aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) );
656cdf0e10cSrcweir 			WarningBox*    pWarnBox = NULL;
657cdf0e10cSrcweir 
658cdf0e10cSrcweir 			// convert file URL to UI name
659cdf0e10cSrcweir 			String 			aName;
660cdf0e10cSrcweir 			INetURLObject	aURL( aDlg.GetPath() );
661cdf0e10cSrcweir 			SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
662cdf0e10cSrcweir 			DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
663cdf0e10cSrcweir 			AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, String(aURL.GetName()).GetToken( 0, '.' ), aDesc );
664cdf0e10cSrcweir 			DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
665cdf0e10cSrcweir 			nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
666cdf0e10cSrcweir 
667cdf0e10cSrcweir 			while( pDlg->Execute() == RET_OK )
668cdf0e10cSrcweir 			{
669cdf0e10cSrcweir 				pDlg->GetName( aName );
670cdf0e10cSrcweir 
671cdf0e10cSrcweir 				sal_Bool bDifferent = sal_True;
672cdf0e10cSrcweir 				long nCount     = pBitmapList->Count();
673cdf0e10cSrcweir 
674cdf0e10cSrcweir 				for( long i = 0; i < nCount && bDifferent; i++ )
675cdf0e10cSrcweir                     if( aName == pBitmapList->GetBitmap( i )->GetName() )
676cdf0e10cSrcweir 						bDifferent = sal_False;
677cdf0e10cSrcweir 
678cdf0e10cSrcweir 				if( bDifferent ) {
679cdf0e10cSrcweir 					nError = 0;
680cdf0e10cSrcweir 					break;
681cdf0e10cSrcweir 				}
682cdf0e10cSrcweir 
683cdf0e10cSrcweir 				if( !pWarnBox )
684cdf0e10cSrcweir 				{
685cdf0e10cSrcweir 					pWarnBox = new WarningBox( DLGWIN,
686cdf0e10cSrcweir 											   WinBits( WB_OK_CANCEL ),
687cdf0e10cSrcweir 											   String( ResId( nError, rMgr ) ) );
688cdf0e10cSrcweir 					pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
689cdf0e10cSrcweir 				}
690cdf0e10cSrcweir 
691cdf0e10cSrcweir 
692cdf0e10cSrcweir 				if( pWarnBox->Execute() != RET_OK )
693cdf0e10cSrcweir 					break;
694cdf0e10cSrcweir 			}
695cdf0e10cSrcweir 			//Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
696cdf0e10cSrcweir 			delete pDlg;
697cdf0e10cSrcweir 			delete pWarnBox;
698cdf0e10cSrcweir 
699cdf0e10cSrcweir 			if( !nError )
700cdf0e10cSrcweir 			{
701*70d3707aSArmin Le Grand 				XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName );
702cdf0e10cSrcweir 				pBitmapList->Insert( pEntry );
703cdf0e10cSrcweir 
704cdf0e10cSrcweir 				aLbBitmaps.Append( pEntry );
705cdf0e10cSrcweir 				aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
706cdf0e10cSrcweir 
707cdf0e10cSrcweir #ifdef WNT
708cdf0e10cSrcweir 				// hack: #31355# W.P.
709cdf0e10cSrcweir 				Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );
710cdf0e10cSrcweir 				if( sal_True ) {				// ??? overlapped with pDlg
711cdf0e10cSrcweir 											// and srolling
712cdf0e10cSrcweir 					Invalidate( aRect );
713cdf0e10cSrcweir 					//aLbBitmaps.Invalidate();
714cdf0e10cSrcweir 				}
715cdf0e10cSrcweir #endif
716cdf0e10cSrcweir 
717cdf0e10cSrcweir 				// Flag fuer modifiziert setzen
718cdf0e10cSrcweir 				*pnBitmapListState |= CT_MODIFIED;
719cdf0e10cSrcweir 
720cdf0e10cSrcweir 				ChangeBitmapHdl_Impl( this );
721cdf0e10cSrcweir 			}
722cdf0e10cSrcweir 		}
723cdf0e10cSrcweir 		else
724cdf0e10cSrcweir 			// Graphik konnte nicht geladen werden
725cdf0e10cSrcweir 			ErrorBox( DLGWIN,
726cdf0e10cSrcweir 					  WinBits( WB_OK ),
727cdf0e10cSrcweir 					  String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
728cdf0e10cSrcweir 	}
729cdf0e10cSrcweir 
730cdf0e10cSrcweir 	return 0L;
731cdf0e10cSrcweir }
732cdf0e10cSrcweir 
733cdf0e10cSrcweir #ifdef _MSC_VER
734cdf0e10cSrcweir #pragma optimize ( "", on )
735cdf0e10cSrcweir #endif
736cdf0e10cSrcweir 
737cdf0e10cSrcweir //------------------------------------------------------------------------
738cdf0e10cSrcweir 
739cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
740cdf0e10cSrcweir {
741cdf0e10cSrcweir 	sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
742cdf0e10cSrcweir 
743cdf0e10cSrcweir 	if ( nPos != LISTBOX_ENTRY_NOTFOUND )
744cdf0e10cSrcweir 	{
745cdf0e10cSrcweir 		ResMgr& rMgr = CUI_MGR();
746cdf0e10cSrcweir 		String aNewName( SVX_RES( RID_SVXSTR_BITMAP ) );
747cdf0e10cSrcweir 		String aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) );
748cdf0e10cSrcweir         String aName( pBitmapList->GetBitmap( nPos )->GetName() );
749cdf0e10cSrcweir 		String aOldName = aName;
750cdf0e10cSrcweir 
751cdf0e10cSrcweir 		SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
752cdf0e10cSrcweir 		DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
753cdf0e10cSrcweir 		AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc );
754cdf0e10cSrcweir 		DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
755cdf0e10cSrcweir 
756cdf0e10cSrcweir 		long nCount = pBitmapList->Count();
757cdf0e10cSrcweir 		sal_Bool bDifferent = sal_False;
758cdf0e10cSrcweir 		sal_Bool bLoop = sal_True;
759cdf0e10cSrcweir 
760cdf0e10cSrcweir 		while( bLoop && pDlg->Execute() == RET_OK )
761cdf0e10cSrcweir 		{
762cdf0e10cSrcweir 			pDlg->GetName( aName );
763cdf0e10cSrcweir 			bDifferent = sal_True;
764cdf0e10cSrcweir 
765cdf0e10cSrcweir 			for( long i = 0; i < nCount && bDifferent; i++ )
766cdf0e10cSrcweir 			{
767cdf0e10cSrcweir                 if( aName == pBitmapList->GetBitmap( i )->GetName() &&
768cdf0e10cSrcweir 					aName != aOldName )
769cdf0e10cSrcweir 					bDifferent = sal_False;
770cdf0e10cSrcweir 			}
771cdf0e10cSrcweir 
772cdf0e10cSrcweir 			if( bDifferent )
773cdf0e10cSrcweir 			{
774cdf0e10cSrcweir 				bLoop = sal_False;
775cdf0e10cSrcweir                 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
776cdf0e10cSrcweir 
777cdf0e10cSrcweir 				pEntry->SetName( aName );
778cdf0e10cSrcweir 
779*70d3707aSArmin Le Grand 				const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
780cdf0e10cSrcweir 
781*70d3707aSArmin Le Grand 				pEntry->SetGraphicObject(Graphic(aBitmapEx));
782cdf0e10cSrcweir 
783cdf0e10cSrcweir 				aLbBitmaps.Modify( pEntry, nPos );
784cdf0e10cSrcweir 				aLbBitmaps.SelectEntryPos( nPos );
785cdf0e10cSrcweir 
786cdf0e10cSrcweir 				// Flag fuer modifiziert setzen
787cdf0e10cSrcweir 				*pnBitmapListState |= CT_MODIFIED;
788cdf0e10cSrcweir 
789cdf0e10cSrcweir 				bBmpChanged = sal_False;
790cdf0e10cSrcweir 			}
791cdf0e10cSrcweir 			else
792cdf0e10cSrcweir 			{
793cdf0e10cSrcweir 				WarningBox aBox( DLGWIN, WinBits( WB_OK ), String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
794cdf0e10cSrcweir 				aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
795cdf0e10cSrcweir 				aBox.Execute();
796cdf0e10cSrcweir 			}
797cdf0e10cSrcweir 		}
798cdf0e10cSrcweir 		delete pDlg;
799cdf0e10cSrcweir 	}
800cdf0e10cSrcweir 	return 0L;
801cdf0e10cSrcweir }
802cdf0e10cSrcweir 
803cdf0e10cSrcweir //------------------------------------------------------------------------
804cdf0e10cSrcweir 
805cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
806cdf0e10cSrcweir {
807cdf0e10cSrcweir 	sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
808cdf0e10cSrcweir 
809cdf0e10cSrcweir 	if( nPos != LISTBOX_ENTRY_NOTFOUND )
810cdf0e10cSrcweir 	{
811cdf0e10cSrcweir 		QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
812cdf0e10cSrcweir 			String( CUI_RES( RID_SVXSTR_ASK_DEL_BITMAP ) ) );
813cdf0e10cSrcweir 
814cdf0e10cSrcweir 		if( aQueryBox.Execute() == RET_YES )
815cdf0e10cSrcweir 		{
816cdf0e10cSrcweir 			delete pBitmapList->Remove( nPos );
817cdf0e10cSrcweir 			aLbBitmaps.RemoveEntry( nPos );
818cdf0e10cSrcweir 			aLbBitmaps.SelectEntryPos( 0 );
819cdf0e10cSrcweir 
820cdf0e10cSrcweir 			aCtlPreview.Invalidate();
821cdf0e10cSrcweir 			aCtlPixel.Invalidate();
822cdf0e10cSrcweir 
823cdf0e10cSrcweir 			ChangeBitmapHdl_Impl( this );
824cdf0e10cSrcweir 
825cdf0e10cSrcweir 			// Flag fuer modifiziert setzen
826cdf0e10cSrcweir 			*pnBitmapListState |= CT_MODIFIED;
827cdf0e10cSrcweir 		}
828cdf0e10cSrcweir 	}
829cdf0e10cSrcweir 	// Status der Buttons ermitteln
830cdf0e10cSrcweir 	if( !pBitmapList->Count() )
831cdf0e10cSrcweir 	{
832cdf0e10cSrcweir 		aBtnModify.Disable();
833cdf0e10cSrcweir 		aBtnDelete.Disable();
834cdf0e10cSrcweir 		aBtnSave.Disable();
835cdf0e10cSrcweir 	}
836cdf0e10cSrcweir 	return 0L;
837cdf0e10cSrcweir }
838cdf0e10cSrcweir 
839cdf0e10cSrcweir // -----------------------------------------------------------------------
840cdf0e10cSrcweir 
841cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
842cdf0e10cSrcweir {
843cdf0e10cSrcweir 	sal_uInt16 nReturn = RET_YES;
844cdf0e10cSrcweir 	ResMgr& rMgr = CUI_MGR();
845cdf0e10cSrcweir 
846cdf0e10cSrcweir 	if ( *pnBitmapListState & CT_MODIFIED )
847cdf0e10cSrcweir 	{
848cdf0e10cSrcweir 		nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
849cdf0e10cSrcweir 			String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
850cdf0e10cSrcweir 
851cdf0e10cSrcweir 		if ( nReturn == RET_YES )
852cdf0e10cSrcweir 			pBitmapList->Save();
853cdf0e10cSrcweir 	}
854cdf0e10cSrcweir 
855cdf0e10cSrcweir 	if ( nReturn != RET_CANCEL )
856cdf0e10cSrcweir 	{
857cdf0e10cSrcweir     	::sfx2::FileDialogHelper aDlg(
858cdf0e10cSrcweir             com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
859cdf0e10cSrcweir             0 );
860cdf0e10cSrcweir 		String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) );
861cdf0e10cSrcweir 		aDlg.AddFilter( aStrFilterType, aStrFilterType );
862cdf0e10cSrcweir 		INetURLObject aFile( SvtPathOptions().GetPalettePath() );
863cdf0e10cSrcweir 		aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
864cdf0e10cSrcweir 
865cdf0e10cSrcweir     	if ( aDlg.Execute() == ERRCODE_NONE )
866cdf0e10cSrcweir 		{
867cdf0e10cSrcweir 			EnterWait();
868cdf0e10cSrcweir 			INetURLObject aURL( aDlg.GetPath() );
869cdf0e10cSrcweir 			INetURLObject aPathURL( aURL );
870cdf0e10cSrcweir 
871cdf0e10cSrcweir 			aPathURL.removeSegment();
872cdf0e10cSrcweir 			aPathURL.removeFinalSlash();
873cdf0e10cSrcweir 
874cdf0e10cSrcweir 			// Tabelle speichern
875cdf0e10cSrcweir 			XBitmapList* pBmpList = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
876cdf0e10cSrcweir 			pBmpList->SetName( aURL.getName() );
877cdf0e10cSrcweir 			if( pBmpList->Load() )
878cdf0e10cSrcweir 			{
879cdf0e10cSrcweir 				if( pBmpList )
880cdf0e10cSrcweir 				{
881cdf0e10cSrcweir 					// Pruefen, ob Tabelle geloescht werden darf:
882cdf0e10cSrcweir 					if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() )
883cdf0e10cSrcweir 						delete pBitmapList;
884cdf0e10cSrcweir 
885cdf0e10cSrcweir 					pBitmapList = pBmpList;
886cdf0e10cSrcweir 					( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList );
887cdf0e10cSrcweir 
888cdf0e10cSrcweir 					aLbBitmaps.Clear();
889cdf0e10cSrcweir 					aLbBitmaps.Fill( pBitmapList );
890cdf0e10cSrcweir 					Reset( rOutAttrs );
891cdf0e10cSrcweir 
892cdf0e10cSrcweir 					pBitmapList->SetName( aURL.getName() );
893cdf0e10cSrcweir 
894cdf0e10cSrcweir 					// Ermitteln (evtl. abschneiden) des Namens und in
895cdf0e10cSrcweir 					// der GroupBox darstellen
896cdf0e10cSrcweir 					String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
897cdf0e10cSrcweir 					aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
898cdf0e10cSrcweir 
899cdf0e10cSrcweir 					if ( aURL.getBase().getLength() > 18 )
900cdf0e10cSrcweir 					{
901cdf0e10cSrcweir 						aString += String(aURL.getBase()).Copy( 0, 15 );
902cdf0e10cSrcweir 						aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
903cdf0e10cSrcweir 					}
904cdf0e10cSrcweir 					else
905cdf0e10cSrcweir 						aString += String(aURL.getBase());
906cdf0e10cSrcweir 
907cdf0e10cSrcweir 					// Flag fuer gewechselt setzen
908cdf0e10cSrcweir 					*pnBitmapListState |= CT_CHANGED;
909cdf0e10cSrcweir 					// Flag fuer modifiziert entfernen
910cdf0e10cSrcweir 					*pnBitmapListState &= ~CT_MODIFIED;
911cdf0e10cSrcweir 				}
912cdf0e10cSrcweir 				LeaveWait();
913cdf0e10cSrcweir 			}
914cdf0e10cSrcweir 			else
915cdf0e10cSrcweir 			{
916cdf0e10cSrcweir 				LeaveWait();
917cdf0e10cSrcweir 				ErrorBox( DLGWIN, WinBits( WB_OK ),
918cdf0e10cSrcweir 					String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
919cdf0e10cSrcweir 			}
920cdf0e10cSrcweir 		}
921cdf0e10cSrcweir 	}
922cdf0e10cSrcweir 
923cdf0e10cSrcweir 	// Status der Buttons ermitteln
924cdf0e10cSrcweir 	if( pBitmapList->Count() )
925cdf0e10cSrcweir 	{
926cdf0e10cSrcweir 		aBtnModify.Enable();
927cdf0e10cSrcweir 		aBtnDelete.Enable();
928cdf0e10cSrcweir 		aBtnSave.Enable();
929cdf0e10cSrcweir 	}
930cdf0e10cSrcweir 	else
931cdf0e10cSrcweir 	{
932cdf0e10cSrcweir 		aBtnModify.Disable();
933cdf0e10cSrcweir 		aBtnDelete.Disable();
934cdf0e10cSrcweir 		aBtnSave.Disable();
935cdf0e10cSrcweir 	}
936cdf0e10cSrcweir 	return 0L;
937cdf0e10cSrcweir }
938cdf0e10cSrcweir 
939cdf0e10cSrcweir // -----------------------------------------------------------------------
940cdf0e10cSrcweir 
941cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
942cdf0e10cSrcweir {
943cdf0e10cSrcweir    	::sfx2::FileDialogHelper aDlg(
944cdf0e10cSrcweir         com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
945cdf0e10cSrcweir 	String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) );
946cdf0e10cSrcweir 	aDlg.AddFilter( aStrFilterType, aStrFilterType );
947cdf0e10cSrcweir 
948cdf0e10cSrcweir 	INetURLObject aFile( SvtPathOptions().GetPalettePath() );
949cdf0e10cSrcweir 	DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
950cdf0e10cSrcweir 
951cdf0e10cSrcweir 	if( pBitmapList->GetName().Len() )
952cdf0e10cSrcweir 	{
953cdf0e10cSrcweir 		aFile.Append( pBitmapList->GetName() );
954cdf0e10cSrcweir 
955cdf0e10cSrcweir 		if( !aFile.getExtension().getLength() )
956cdf0e10cSrcweir 			aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sob" ) ) );
957cdf0e10cSrcweir 	}
958cdf0e10cSrcweir 
959cdf0e10cSrcweir 	aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
960cdf0e10cSrcweir 	if ( aDlg.Execute() == ERRCODE_NONE )
961cdf0e10cSrcweir 	{
962cdf0e10cSrcweir 		INetURLObject	aURL( aDlg.GetPath() );
963cdf0e10cSrcweir 		INetURLObject	aPathURL( aURL );
964cdf0e10cSrcweir 
965cdf0e10cSrcweir 		aPathURL.removeSegment();
966cdf0e10cSrcweir 		aPathURL.removeFinalSlash();
967cdf0e10cSrcweir 
968cdf0e10cSrcweir 		pBitmapList->SetName( aURL.getName() );
969cdf0e10cSrcweir 		pBitmapList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
970cdf0e10cSrcweir 
971cdf0e10cSrcweir 		if( pBitmapList->Save() )
972cdf0e10cSrcweir 		{
973cdf0e10cSrcweir 			// Ermitteln (evtl. abschneiden) des Namens und in
974cdf0e10cSrcweir 			// der GroupBox darstellen
975cdf0e10cSrcweir 			String aString( CUI_RES( RID_SVXSTR_TABLE ) );
976cdf0e10cSrcweir 			aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
977cdf0e10cSrcweir 
978cdf0e10cSrcweir 			if ( aURL.getBase().getLength() > 18 )
979cdf0e10cSrcweir 			{
980cdf0e10cSrcweir 				aString += String(aURL.getBase()).Copy( 0, 15 );
981cdf0e10cSrcweir 				aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
982cdf0e10cSrcweir 			}
983cdf0e10cSrcweir 			else
984cdf0e10cSrcweir 				aString += String(aURL.getBase());
985cdf0e10cSrcweir 
986cdf0e10cSrcweir 			// Flag fuer gespeichert setzen
987cdf0e10cSrcweir 			*pnBitmapListState |= CT_SAVED;
988cdf0e10cSrcweir 			// Flag fuer modifiziert entfernen
989cdf0e10cSrcweir 			*pnBitmapListState &= ~CT_MODIFIED;
990cdf0e10cSrcweir 		}
991cdf0e10cSrcweir 		else
992cdf0e10cSrcweir 		{
993cdf0e10cSrcweir 			ErrorBox( DLGWIN, WinBits( WB_OK ),
994cdf0e10cSrcweir 				String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
995cdf0e10cSrcweir 		}
996cdf0e10cSrcweir 	}
997cdf0e10cSrcweir 
998cdf0e10cSrcweir 	return 0L;
999cdf0e10cSrcweir }
1000cdf0e10cSrcweir 
1001cdf0e10cSrcweir //------------------------------------------------------------------------
1002cdf0e10cSrcweir 
1003cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ChangePixelColorHdl_Impl, void *, EMPTYARG )
1004cdf0e10cSrcweir {
1005cdf0e10cSrcweir 	aCtlPixel.SetPixelColor( aLbColor.GetSelectEntryColor() );
1006cdf0e10cSrcweir 	aCtlPixel.Invalidate();
1007cdf0e10cSrcweir 
1008cdf0e10cSrcweir 	aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
1009cdf0e10cSrcweir 
1010cdf0e10cSrcweir 	// Bitmap holen und darstellen
1011*70d3707aSArmin Le Grand 	rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1012cdf0e10cSrcweir 	aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1013cdf0e10cSrcweir 	aCtlPreview.Invalidate();
1014cdf0e10cSrcweir 
1015cdf0e10cSrcweir 	bBmpChanged = sal_True;
1016cdf0e10cSrcweir 
1017cdf0e10cSrcweir 	return 0L;
1018cdf0e10cSrcweir }
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir //------------------------------------------------------------------------
1021cdf0e10cSrcweir 
1022cdf0e10cSrcweir IMPL_LINK( SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, void *, EMPTYARG )
1023cdf0e10cSrcweir {
1024cdf0e10cSrcweir 	aCtlPixel.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1025cdf0e10cSrcweir 	aCtlPixel.Invalidate();
1026cdf0e10cSrcweir 
1027cdf0e10cSrcweir 	aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1028cdf0e10cSrcweir 
1029cdf0e10cSrcweir 	// Bitmap holen und darstellen
1030*70d3707aSArmin Le Grand 	rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1031cdf0e10cSrcweir 	aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1032cdf0e10cSrcweir 	aCtlPreview.Invalidate();
1033cdf0e10cSrcweir 
1034cdf0e10cSrcweir 	bBmpChanged = sal_True;
1035cdf0e10cSrcweir 
1036cdf0e10cSrcweir 	return 0L;
1037cdf0e10cSrcweir }
1038cdf0e10cSrcweir 
1039cdf0e10cSrcweir //------------------------------------------------------------------------
1040cdf0e10cSrcweir 
1041cdf0e10cSrcweir void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT )
1042cdf0e10cSrcweir {
1043cdf0e10cSrcweir 	if( pWindow == &aCtlPixel )
1044cdf0e10cSrcweir 	{
1045cdf0e10cSrcweir         aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
1046cdf0e10cSrcweir 
1047cdf0e10cSrcweir 		// Bitmap holen und darstellen
1048*70d3707aSArmin Le Grand 		rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1049cdf0e10cSrcweir 		aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1050cdf0e10cSrcweir 		aCtlPreview.Invalidate();
1051cdf0e10cSrcweir 
1052cdf0e10cSrcweir 		bBmpChanged = sal_True;
1053cdf0e10cSrcweir 	}
1054cdf0e10cSrcweir }
1055cdf0e10cSrcweir 
1056cdf0e10cSrcweir 
1057cdf0e10cSrcweir 
1058cdf0e10cSrcweir 
1059cdf0e10cSrcweir Window*	SvxBitmapTabPage::GetParentLabeledBy( const Window* pLabeled ) const
1060cdf0e10cSrcweir {
1061cdf0e10cSrcweir     if (pLabeled == &aLbBitmaps)
1062cdf0e10cSrcweir         return const_cast<FixedText*>(&aLbBitmapsHidden);
1063cdf0e10cSrcweir     else
1064cdf0e10cSrcweir         return SvxTabPage::GetParentLabeledBy (pLabeled);
1065cdf0e10cSrcweir }
1066