colrctrl.cxx (28bcfa49) colrctrl.cxx (c7be74b1)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 243 unchanged lines hidden (view full) ---

252 SfxBindings* _pBindings,
253 SfxChildWindow* pCW,
254 Window* _pParent,
255 const ResId& rResId
256) :
257
258 SfxDockingWindow( _pBindings, pCW, _pParent, rResId ),
259
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 243 unchanged lines hidden (view full) ---

252 SfxBindings* _pBindings,
253 SfxChildWindow* pCW,
254 Window* _pParent,
255 const ResId& rResId
256) :
257
258 SfxDockingWindow( _pBindings, pCW, _pParent, rResId ),
259
260 pColorTable ( NULL ),
260 maColorTable(),
261 aColorSet ( this, ResId( 1, *rResId.GetResMgr() ) ),
262 nLeftSlot ( SID_ATTR_FILL_COLOR ),
263 nRightSlot ( SID_ATTR_LINE_COLOR ),
264 nCols ( 20 ),
265 nLines ( 1 )
266
267{
268 FreeResource();

--- 19 unchanged lines hidden (view full) ---

288 }
289 }
290
291 if ( pDocSh )
292 {
293 const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
294 if( pItem )
295 {
261 aColorSet ( this, ResId( 1, *rResId.GetResMgr() ) ),
262 nLeftSlot ( SID_ATTR_FILL_COLOR ),
263 nRightSlot ( SID_ATTR_LINE_COLOR ),
264 nCols ( 20 ),
265 nLines ( 1 )
266
267{
268 FreeResource();

--- 19 unchanged lines hidden (view full) ---

288 }
289 }
290
291 if ( pDocSh )
292 {
293 const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
294 if( pItem )
295 {
296 pColorTable = ( (SvxColorTableItem*) pItem )->GetColorTable();
296 maColorTable = static_cast< const SvxColorTableItem* >(pItem)->GetColorTable();
297 FillValueSet();
298 }
299 }
300
301 aItemSize = aColorSet.CalcItemSizePixel(Size(aColorSet.getEntryEdgeLength(), aColorSet.getEntryEdgeLength()));
302 aItemSize.Width() = aItemSize.Width() + aColorSet.getEntryEdgeLength();
303 aItemSize.Width() /= 2;
304 aItemSize.Height() = aItemSize.Height() + aColorSet.getEntryEdgeLength();

--- 24 unchanged lines hidden (view full) ---

329
330void SvxColorDockingWindow::Notify( SfxBroadcaster& , const SfxHint& rHint )
331{
332 const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
333 if ( pPoolItemHint
334 && ( pPoolItemHint->GetObject()->ISA( SvxColorTableItem ) ) )
335 {
336 // Die Liste der Farben hat sich geaendert
297 FillValueSet();
298 }
299 }
300
301 aItemSize = aColorSet.CalcItemSizePixel(Size(aColorSet.getEntryEdgeLength(), aColorSet.getEntryEdgeLength()));
302 aItemSize.Width() = aItemSize.Width() + aColorSet.getEntryEdgeLength();
303 aItemSize.Width() /= 2;
304 aItemSize.Height() = aItemSize.Height() + aColorSet.getEntryEdgeLength();

--- 24 unchanged lines hidden (view full) ---

329
330void SvxColorDockingWindow::Notify( SfxBroadcaster& , const SfxHint& rHint )
331{
332 const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
333 if ( pPoolItemHint
334 && ( pPoolItemHint->GetObject()->ISA( SvxColorTableItem ) ) )
335 {
336 // Die Liste der Farben hat sich geaendert
337 pColorTable = ( (SvxColorTableItem*) pPoolItemHint->GetObject() )->GetColorTable();
337 maColorTable = static_cast< SvxColorTableItem* >(pPoolItemHint->GetObject())->GetColorTable();
338 FillValueSet();
339 }
340}
341
342/*************************************************************************
343|*
344|* FillValueSet
345|*
346\************************************************************************/
347
348void SvxColorDockingWindow::FillValueSet()
349{
338 FillValueSet();
339 }
340}
341
342/*************************************************************************
343|*
344|* FillValueSet
345|*
346\************************************************************************/
347
348void SvxColorDockingWindow::FillValueSet()
349{
350 if( pColorTable )
350 if( maColorTable.get() )
351 {
351 {
352 nCount = pColorTable->Count();
352 nCount = maColorTable->Count();
353 aColorSet.Clear();
354
355 // create the first entry for 'invisible/none'
356 const Size aColorSize(aColorSet.getEntryEdgeLength(), aColorSet.getEntryEdgeLength());
357 long nPtX = aColorSize.Width() - 1;
358 long nPtY = aColorSize.Height() - 1;
359 VirtualDevice aVD;
360
361 aVD.SetOutputSizePixel( aColorSize );
362 aVD.SetLineColor( Color( COL_BLACK ) );
363 aVD.SetBackground( Wallpaper( Color( COL_WHITE ) ) );
364 aVD.DrawLine( Point(), Point( nPtX, nPtY ) );
365 aVD.DrawLine( Point( 0, nPtY ), Point( nPtX, 0 ) );
366
367 Bitmap aBmp( aVD.GetBitmap( Point(), aColorSize ) );
368
369 aColorSet.InsertItem( (sal_uInt16)1, Image(aBmp), SVX_RESSTR( RID_SVXSTR_INVISIBLE ) );
353 aColorSet.Clear();
354
355 // create the first entry for 'invisible/none'
356 const Size aColorSize(aColorSet.getEntryEdgeLength(), aColorSet.getEntryEdgeLength());
357 long nPtX = aColorSize.Width() - 1;
358 long nPtY = aColorSize.Height() - 1;
359 VirtualDevice aVD;
360
361 aVD.SetOutputSizePixel( aColorSize );
362 aVD.SetLineColor( Color( COL_BLACK ) );
363 aVD.SetBackground( Wallpaper( Color( COL_WHITE ) ) );
364 aVD.DrawLine( Point(), Point( nPtX, nPtY ) );
365 aVD.DrawLine( Point( 0, nPtY ), Point( nPtX, 0 ) );
366
367 Bitmap aBmp( aVD.GetBitmap( Point(), aColorSize ) );
368
369 aColorSet.InsertItem( (sal_uInt16)1, Image(aBmp), SVX_RESSTR( RID_SVXSTR_INVISIBLE ) );
370 aColorSet.addEntriesForXColorList(*pColorTable, 2);
370 aColorSet.addEntriesForXColorList(maColorTable, 2);
371 }
372}
373
374/*************************************************************************
375|*
376|* SetSize
377|*
378\************************************************************************/

--- 250 unchanged lines hidden ---
371 }
372}
373
374/*************************************************************************
375|*
376|* SetSize
377|*
378\************************************************************************/

--- 250 unchanged lines hidden ---