tpbitmap.cxx (2ee96f1c) tpbitmap.cxx (70d3707a)
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

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

107 aBitmapCtl ( this, aCtlPreview.GetSizePixel() ),
108 rOutAttrs ( rInAttrs ),
109
110 pColorTab( NULL ),
111 pBitmapList( NULL ),
112
113 pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
114 aXFStyleItem ( XFILL_BITMAP ),
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

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

107 aBitmapCtl ( this, aCtlPreview.GetSizePixel() ),
108 rOutAttrs ( rInAttrs ),
109
110 pColorTab( NULL ),
111 pBitmapList( NULL ),
112
113 pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
114 aXFStyleItem ( XFILL_BITMAP ),
115 aXBitmapItem ( String(), XOBitmap() ),
115 aXBitmapItem ( String(), Graphic() ),
116 aXFillAttr ( pXPool ),
117 rXFSet ( aXFillAttr.GetItemSet() )
118{
119 aBtnLoad.SetModeImage( Image( CUI_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
120 aBtnSave.SetModeImage( Image( CUI_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
121 FreeResource();
122
123 // diese Page braucht ExchangeSupport

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

260}
261
262// -----------------------------------------------------------------------
263
264sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
265{
266 if( *pDlgType == 0 && *pbAreaTP == sal_False ) // Flaechen-Dialog
267 {
116 aXFillAttr ( pXPool ),
117 rXFSet ( aXFillAttr.GetItemSet() )
118{
119 aBtnLoad.SetModeImage( Image( CUI_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
120 aBtnSave.SetModeImage( Image( CUI_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
121 FreeResource();
122
123 // diese Page braucht ExchangeSupport

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

260}
261
262// -----------------------------------------------------------------------
263
264sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
265{
266 if( *pDlgType == 0 && *pbAreaTP == sal_False ) // Flaechen-Dialog
267 {
268 if( *pPageType == PT_BITMAP )
268 if(PT_BITMAP == *pPageType)
269 {
269 {
270 // CheckChanges_Impl(); <-- doppelte Abfrage ?
271
272 XOBitmap aXOBitmap;
273 String aString;
274 sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
275 if( nPos != LISTBOX_ENTRY_NOTFOUND )
270 const sal_uInt16 nPos(aLbBitmaps.GetSelectEntryPos());
271
272 _rOutAttrs.Put(XFillStyleItem(XFILL_BITMAP));
273
274 if(LISTBOX_ENTRY_NOTFOUND != nPos)
276 {
275 {
277 aXOBitmap = pBitmapList->GetBitmap( nPos )->GetXBitmap();
278 aString = aLbBitmaps.GetSelectEntry();
279
276 const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos);
277 const String aString(aLbBitmaps.GetSelectEntry());
278
279 _rOutAttrs.Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
280 }
281 else
282 {
280 }
281 else
282 {
283 aXOBitmap = aBitmapCtl.GetXBitmap();
283 const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
284
284
285 // #85339# if it's an array, force conversion to bitmap before using it.
286 if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
287 aXOBitmap.GetBitmap();
288
285 _rOutAttrs.Put(XFillBitmapItem(String(), Graphic(aBitmapEx)));
289 }
286 }
290 _rOutAttrs.Put( XFillStyleItem( XFILL_BITMAP ) );
291 _rOutAttrs.Put( XFillBitmapItem( aString, aXOBitmap ) );
292 }
293 }
287 }
288 }
294 return sal_True;
289
290 return sal_True;
295}
296
297// -----------------------------------------------------------------------
298
299void SvxBitmapTabPage::Reset( const SfxItemSet& )
300{
301 // aLbBitmaps.SelectEntryPos( 0 );
302
303 aBitmapCtl.SetLines( aCtlPixel.GetLineCount() );
304 aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
305 aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
306 aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
307
308 // Bitmap holen und darstellen
291}
292
293// -----------------------------------------------------------------------
294
295void SvxBitmapTabPage::Reset( const SfxItemSet& )
296{
297 // aLbBitmaps.SelectEntryPos( 0 );
298
299 aBitmapCtl.SetLines( aCtlPixel.GetLineCount() );
300 aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
301 aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
302 aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
303
304 // Bitmap holen und darstellen
309 XFillBitmapItem aBmpItem( (const String &) String(), aBitmapCtl.GetXBitmap() );
305 const XFillBitmapItem aBmpItem(String(), Graphic(aBitmapCtl.GetBitmapEx()));
310 rXFSet.Put( aBmpItem );
311 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
312 aCtlPreview.Invalidate();
313
314 ChangeBitmapHdl_Impl( this );
315
316 // Status der Buttons ermitteln
317 if( pBitmapList->Count() )

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

336{
337 return new SvxBitmapTabPage( pWindow, rSet );
338}
339
340//------------------------------------------------------------------------
341
342IMPL_LINK( SvxBitmapTabPage, ChangeBitmapHdl_Impl, void *, EMPTYARG )
343{
306 rXFSet.Put( aBmpItem );
307 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
308 aCtlPreview.Invalidate();
309
310 ChangeBitmapHdl_Impl( this );
311
312 // Status der Buttons ermitteln
313 if( pBitmapList->Count() )

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

332{
333 return new SvxBitmapTabPage( pWindow, rSet );
334}
335
336//------------------------------------------------------------------------
337
338IMPL_LINK( SvxBitmapTabPage, ChangeBitmapHdl_Impl, void *, EMPTYARG )
339{
344 XOBitmap* pXOBitmap = NULL;
345 int nPos = aLbBitmaps.GetSelectEntryPos();
340 GraphicObject* pGraphicObject = 0;
341 int nPos(aLbBitmaps.GetSelectEntryPos());
346
342
347 if( nPos != LISTBOX_ENTRY_NOTFOUND )
348 pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() );
343 if(LISTBOX_ENTRY_NOTFOUND != nPos)
344 {
345 pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
346 }
349 else
350 {
347 else
348 {
351 const SfxPoolItem* pPoolItem = NULL;
352 if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), sal_True, &pPoolItem ) )
349 const SfxPoolItem* pPoolItem = 0;
350
351 if(SFX_ITEM_SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLSTYLE), true, &pPoolItem))
353 {
352 {
354 XFillStyle eXFS = (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue();
355 if( ( XFILL_BITMAP == eXFS ) &&
356 ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True, &pPoolItem ) ) )
353 const XFillStyle eXFS((XFillStyle)((const XFillStyleItem*)pPoolItem)->GetValue());
354
355 if((XFILL_BITMAP == eXFS) && (SFX_ITEM_SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
357 {
356 {
358 pXOBitmap = new XOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() );
357 pGraphicObject = new GraphicObject(((const XFillBitmapItem*)pPoolItem)->GetGraphicObject());
359 }
360 }
358 }
359 }
361 if( !pXOBitmap )
360
361 if(!pGraphicObject)
362 {
362 {
363 aLbBitmaps.SelectEntryPos( 0 );
363 aLbBitmaps.SelectEntryPos(0);
364 nPos = aLbBitmaps.GetSelectEntryPos();
364 nPos = aLbBitmaps.GetSelectEntryPos();
365 if( nPos != LISTBOX_ENTRY_NOTFOUND )
366 pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() );
365
366 if(LISTBOX_ENTRY_NOTFOUND != nPos)
367 {
368 pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
369 }
367 }
368 }
370 }
371 }
369 if( pXOBitmap )
372
373 if(pGraphicObject)
370 {
374 {
371 //WorkWindow aTmpWW( DLGWIN );
372 //VirtualDevice aVD( aTmpWW );
373 //sal_uInt16 nLines = aCtlPixel.GetLineCount();
374 //Color aPixelColor, aBackColor;
375 //sal_Bool bPixelColor = sal_False;
376 //sal_uInt16 nWidth = pBitmap->GetSizePixel().Width();
377 //sal_uInt16 nHeight = pBitmap->GetSizePixel().Height();
375 BitmapColor aBack;
376 BitmapColor aFront;
377 bool bIs8x8(isHistorical8x8(pGraphicObject->GetGraphic().GetBitmap(), aBack, aFront));
378
378
379 // #85339# try to convert bitmapped item to array item.
380 if(pXOBitmap->GetBitmapType() == XBITMAP_IMPORT)
381 {
382 Bitmap aBitmap(pXOBitmap->GetBitmap());
383 Size aSizePixel(aBitmap.GetSizePixel());
384
385 if(8 == aSizePixel.Width() && 8 == aSizePixel.Height())
386 {
387 sal_uInt16* pPixelArray = new sal_uInt16[64];
388 sal_uInt32 nCol1(0xffffffff); // background
389 sal_uInt32 nCol2(0xffffffff); // pixel
390 BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
391 sal_Bool bValid(sal_True);
392
393 if(pAccess)
394 {
395 for(sal_uInt32 a(0); bValid && a < 64; a++)
396 {
397 const BitmapColor aBmCol = pAccess->GetColor(a>>3, a%8);
398 Color aRgbCol(aBmCol.GetRed(), aBmCol.GetGreen(), aBmCol.GetBlue());
399 sal_uInt32 nColVal = aRgbCol.GetRGBColor();
400
401 // test with nCol1
402 if(nCol1 != nColVal)
403 {
404 if(0xffffffff == nCol1)
405 {
406 // nCol1 is used first time
407 nCol1 = nColVal;
408 pPixelArray[a] = 0;
409 }
410 else
411 {
412 // test with nCol2
413 if(nCol2 != nColVal)
414 {
415 if(0xffffffff == nCol2)
416 {
417 // nCol2 used first time
418 nCol2 = nColVal;
419 pPixelArray[a] = 1;
420 }
421 else
422 {
423 // Third color detected
424 bValid = sal_False;
425 }
426 }
427 else
428 {
429 // color is pixel color
430 pPixelArray[a] = 1;
431 }
432 }
433 }
434 else
435 {
436 // color is background color
437 pPixelArray[a] = 0;
438 }
439 }
440
441 // release ReadAccess
442 aBitmap.ReleaseAccess(pAccess);
443 }
444 else
445 {
446 // no access -> no success
447 bValid = sal_False;
448 }
449
450 if(bValid)
451 {
452 Color aCol1(nCol1);
453 Color aCol2(nCol2);
454
455 // no pixel color found? Use opposite od background color.
456 if(0xffffffff == nCol2)
457 {
458 aCol2 = Color(
459 0xff - aCol1.GetRed(),
460 0xff - aCol1.GetGreen(),
461 0xff - aCol1.GetBlue());
462 }
463
464 // transformation did work, create a new Item
465 delete pXOBitmap;
466 pXOBitmap = new XOBitmap(pPixelArray, aCol2, aCol1);
467 }
468
469 // cleanup
470 delete[] pPixelArray;
471 }
472 }
473
474 aLbColor.SetNoSelection();
379 aLbColor.SetNoSelection();
475 aLbBackgroundColor.SetNoSelection();
476
380 aLbBackgroundColor.SetNoSelection();
381
477 if( pXOBitmap->GetBitmapType() == XBITMAP_IMPORT )
382 if(bIs8x8)
478 {
383 {
479 aCtlPixel.Reset();
480 aCtlPixel.SetPaintable( sal_False );
481 aCtlPixel.Disable();
482 aFtPixelEdit.Disable();
483 aFtColor.Disable();
484 aLbColor.Disable();
485 aFtBackgroundColor.Disable();
486 aLbBackgroundColor.Disable();
487 aBtnModify.Disable();
488 aBtnAdd.Disable();
489 }
490 else if( pXOBitmap->GetBitmapType() == XBITMAP_8X8 )
491 {
492 aCtlPixel.SetPaintable( sal_True );
493 aCtlPixel.Enable();
494 aFtPixelEdit.Enable();
495 aFtColor.Enable();
496 aLbColor.Enable();
497 aFtBackgroundColor.Enable();
498 aLbBackgroundColor.Enable();
499 aBtnModify.Enable();
500 aBtnAdd.Enable();
501
502 // Setzen des PixelControls
384 aCtlPixel.SetPaintable( sal_True );
385 aCtlPixel.Enable();
386 aFtPixelEdit.Enable();
387 aFtColor.Enable();
388 aLbColor.Enable();
389 aFtBackgroundColor.Enable();
390 aLbBackgroundColor.Enable();
391 aBtnModify.Enable();
392 aBtnAdd.Enable();
393
394 // Setzen des PixelControls
503 aCtlPixel.SetXBitmap( *pXOBitmap );
395 aCtlPixel.SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
504
396
505 Color aPixelColor = pXOBitmap->GetPixelColor();
506 Color aBackColor = pXOBitmap->GetBackgroundColor();
397 Color aPixelColor = aFront;
398 Color aBackColor = aBack;
507
508 aBitmapCtl.SetPixelColor( aPixelColor );
509 aBitmapCtl.SetBackgroundColor( aBackColor );
510
511 // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe
512 // temporaer hinzugenommen
513 if( 0 == aLbBitmaps.GetSelectEntryPos() )
514 {

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

524 }
525 aLbBackgroundColor.SelectEntry( aBackColor );
526 if( aLbBackgroundColor.GetSelectEntryCount() == 0 )
527 {
528 aLbBackgroundColor.InsertEntry( aBackColor, String() );
529 aLbBackgroundColor.SelectEntry( aBackColor );
530 }
531 }
399
400 aBitmapCtl.SetPixelColor( aPixelColor );
401 aBitmapCtl.SetBackgroundColor( aBackColor );
402
403 // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe
404 // temporaer hinzugenommen
405 if( 0 == aLbBitmaps.GetSelectEntryPos() )
406 {

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

416 }
417 aLbBackgroundColor.SelectEntry( aBackColor );
418 if( aLbBackgroundColor.GetSelectEntryCount() == 0 )
419 {
420 aLbBackgroundColor.InsertEntry( aBackColor, String() );
421 aLbBackgroundColor.SelectEntry( aBackColor );
422 }
423 }
532 aCtlPixel.Invalidate();
424 else
425 {
426 aCtlPixel.Reset();
427 aCtlPixel.SetPaintable( sal_False );
428 aCtlPixel.Disable();
429 aFtPixelEdit.Disable();
430 aFtColor.Disable();
431 aLbColor.Disable();
432 aFtBackgroundColor.Disable();
433 aLbBackgroundColor.Disable();
434 aBtnModify.Disable();
435 aBtnAdd.Disable();
436 }
533
437
438 aCtlPixel.Invalidate();
439
534 // Bitmap darstellen
440 // Bitmap darstellen
535 XFillBitmapItem aXBmpItem( (const String &) String(), *pXOBitmap );
441 const XFillBitmapItem aXBmpItem(String(), *pGraphicObject);
536 rXFSet.Put( aXBmpItem );
537
538 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
539 aCtlPreview.Invalidate();
540
541 bBmpChanged = sal_False;
442 rXFSet.Put( aXBmpItem );
443
444 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
445 aCtlPreview.Invalidate();
446
447 bBmpChanged = sal_False;
542 delete pXOBitmap;
448 delete pGraphicObject;
543 }
449 }
544 return 0L;
450
451 return 0;
545}
546
547// -----------------------------------------------------------------------
548
549long SvxBitmapTabPage::CheckChanges_Impl()
550{
551 sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
552 if( nPos != LISTBOX_ENTRY_NOTFOUND )

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

662 delete pDlg;
663 delete pWarnBox;
664
665 if( !nError )
666 {
667 XBitmapEntry* pEntry = 0;
668 if( aCtlPixel.IsEnabled() )
669 {
452}
453
454// -----------------------------------------------------------------------
455
456long SvxBitmapTabPage::CheckChanges_Impl()
457{
458 sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos();
459 if( nPos != LISTBOX_ENTRY_NOTFOUND )

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

569 delete pDlg;
570 delete pWarnBox;
571
572 if( !nError )
573 {
574 XBitmapEntry* pEntry = 0;
575 if( aCtlPixel.IsEnabled() )
576 {
670 XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap();
577 const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
671
578
672 // #85339# if it's an array, force conversion to bitmap before using it.
673 if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
674 aXOBitmap.GetBitmap();
675
676 pEntry = new XBitmapEntry( aXOBitmap, aName );
579 pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName);
677 }
678 else // Es muss sich um eine nicht vorhandene importierte Bitmap handeln
679 {
580 }
581 else // Es muss sich um eine nicht vorhandene importierte Bitmap handeln
582 {
680 const SfxPoolItem* pPoolItem = NULL;
681 if( SFX_ITEM_SET == rOutAttrs.GetItemState( XATTR_FILLBITMAP, sal_True, &pPoolItem ) )
583 const SfxPoolItem* pPoolItem = 0;
584
585 if(SFX_ITEM_SET == rOutAttrs.GetItemState(XATTR_FILLBITMAP, true, &pPoolItem))
682 {
586 {
683 XOBitmap aXOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() );
684 pEntry = new XBitmapEntry( aXOBitmap, aName );
587 pEntry = new XBitmapEntry(dynamic_cast< const XFillBitmapItem* >(pPoolItem)->GetGraphicObject(), aName);
685 }
686 }
687
688 DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" );
689
690 if( pEntry )
691 {
692 pBitmapList->Insert( pEntry );

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

790 break;
791 }
792 //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
793 delete pDlg;
794 delete pWarnBox;
795
796 if( !nError )
797 {
588 }
589 }
590
591 DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" );
592
593 if( pEntry )
594 {
595 pBitmapList->Insert( pEntry );

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

693 break;
694 }
695 //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
696 delete pDlg;
697 delete pWarnBox;
698
699 if( !nError )
700 {
798 Bitmap aBmp( aGraphic.GetBitmap() );
799 XBitmapEntry* pEntry =
800 new XBitmapEntry( XOBitmap( aBmp ), aName );
701 XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName );
801 pBitmapList->Insert( pEntry );
802
803 aLbBitmaps.Append( pEntry );
804 aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
805
806#ifdef WNT
807 // hack: #31355# W.P.
808 Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );

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

870
871 if( bDifferent )
872 {
873 bLoop = sal_False;
874 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
875
876 pEntry->SetName( aName );
877
702 pBitmapList->Insert( pEntry );
703
704 aLbBitmaps.Append( pEntry );
705 aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
706
707#ifdef WNT
708 // hack: #31355# W.P.
709 Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );

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

771
772 if( bDifferent )
773 {
774 bLoop = sal_False;
775 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
776
777 pEntry->SetName( aName );
778
878 XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap();
779 const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
879
780
880 // #85339# if it's an array, force conversion to bitmap before using it.
881 if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
882 aXOBitmap.GetBitmap();
781 pEntry->SetGraphicObject(Graphic(aBitmapEx));
883
782
884 pEntry->SetXBitmap( aXOBitmap );
885
886 aLbBitmaps.Modify( pEntry, nPos );
887 aLbBitmaps.SelectEntryPos( nPos );
888
889 // Flag fuer modifiziert setzen
890 *pnBitmapListState |= CT_MODIFIED;
891
892 bBmpChanged = sal_False;
893 }

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

1106IMPL_LINK( SvxBitmapTabPage, ChangePixelColorHdl_Impl, void *, EMPTYARG )
1107{
1108 aCtlPixel.SetPixelColor( aLbColor.GetSelectEntryColor() );
1109 aCtlPixel.Invalidate();
1110
1111 aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
1112
1113 // Bitmap holen und darstellen
783 aLbBitmaps.Modify( pEntry, nPos );
784 aLbBitmaps.SelectEntryPos( nPos );
785
786 // Flag fuer modifiziert setzen
787 *pnBitmapListState |= CT_MODIFIED;
788
789 bBmpChanged = sal_False;
790 }

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

1003IMPL_LINK( SvxBitmapTabPage, ChangePixelColorHdl_Impl, void *, EMPTYARG )
1004{
1005 aCtlPixel.SetPixelColor( aLbColor.GetSelectEntryColor() );
1006 aCtlPixel.Invalidate();
1007
1008 aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
1009
1010 // Bitmap holen und darstellen
1114 rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
1011 rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1115 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1116 aCtlPreview.Invalidate();
1117
1118 bBmpChanged = sal_True;
1119
1120 return 0L;
1121}
1122
1123//------------------------------------------------------------------------
1124
1125IMPL_LINK( SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, void *, EMPTYARG )
1126{
1127 aCtlPixel.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1128 aCtlPixel.Invalidate();
1129
1130 aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1131
1132 // Bitmap holen und darstellen
1012 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1013 aCtlPreview.Invalidate();
1014
1015 bBmpChanged = sal_True;
1016
1017 return 0L;
1018}
1019
1020//------------------------------------------------------------------------
1021
1022IMPL_LINK( SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, void *, EMPTYARG )
1023{
1024 aCtlPixel.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1025 aCtlPixel.Invalidate();
1026
1027 aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
1028
1029 // Bitmap holen und darstellen
1133 rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
1030 rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1134 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1135 aCtlPreview.Invalidate();
1136
1137 bBmpChanged = sal_True;
1138
1139 return 0L;
1140}
1141
1142//------------------------------------------------------------------------
1143
1144void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT )
1145{
1146 if( pWindow == &aCtlPixel )
1147 {
1148 aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
1149
1150 // Bitmap holen und darstellen
1031 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1032 aCtlPreview.Invalidate();
1033
1034 bBmpChanged = sal_True;
1035
1036 return 0L;
1037}
1038
1039//------------------------------------------------------------------------
1040
1041void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT )
1042{
1043 if( pWindow == &aCtlPixel )
1044 {
1045 aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
1046
1047 // Bitmap holen und darstellen
1151 rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
1048 rXFSet.Put(XFillBitmapItem(String(), Graphic(aBitmapCtl.GetBitmapEx())));
1152 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1153 aCtlPreview.Invalidate();
1154
1155 bBmpChanged = sal_True;
1156 }
1157}
1158
1159
1160
1161
1162Window* SvxBitmapTabPage::GetParentLabeledBy( const Window* pLabeled ) const
1163{
1164 if (pLabeled == &aLbBitmaps)
1165 return const_cast<FixedText*>(&aLbBitmapsHidden);
1166 else
1167 return SvxTabPage::GetParentLabeledBy (pLabeled);
1168}
1049 aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
1050 aCtlPreview.Invalidate();
1051
1052 bBmpChanged = sal_True;
1053 }
1054}
1055
1056
1057
1058
1059Window* SvxBitmapTabPage::GetParentLabeledBy( const Window* pLabeled ) const
1060{
1061 if (pLabeled == &aLbBitmaps)
1062 return const_cast<FixedText*>(&aLbBitmapsHidden);
1063 else
1064 return SvxTabPage::GetParentLabeledBy (pLabeled);
1065}