You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/05/10 12:29:57 UTC
svn commit: r1336585 [2/2] - in /incubator/ooo/trunk/main:
cui/source/tabpages/ drawinglayer/inc/drawinglayer/attribute/
drawinglayer/source/attribute/ filter/source/msfilter/
sc/source/filter/excel/ sc/source/ui/view/ sd/source/core/
sd/source/ui/func...
Modified: incubator/ooo/trunk/main/svx/source/unodraw/unoshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/unodraw/unoshape.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/unodraw/unoshape.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/unodraw/unoshape.cxx Thu May 10 10:29:55 2012
@@ -1580,7 +1580,7 @@ sal_Bool SAL_CALL SvxShape::SetFillAttri
XFillBitmapItem aBmpItem;
aBmpItem.SetWhich( XATTR_FILLBITMAP );
aBmpItem.SetName( rName );
- aBmpItem.SetBitmapValue( pEntry->GetXBitmap() );
+ aBmpItem.SetGraphicObject(pEntry->GetGraphicObject());
rSet.Put( aBmpItem );
break;
}
@@ -1737,193 +1737,6 @@ sal_Bool SAL_CALL SvxShape::SetFillAttri
//----------------------------------------------------------------------
-// static
-/* os: unused function
- uno::Any SAL_CALL SvxShape::GetFillAttributeByName(
- const ::rtl::OUString& rPropertyName, const ::rtl::OUString& rName, SdrModel* pModel )
-{
- uno::Any aResult;
- DBG_ASSERT( pModel, "Invalid Model in GetFillAttributeByName()" );
- if( ! pModel )
- return aResult;
-
- sal_Int16 nWhich = SvxUnoGetWhichIdForNamedProperty( rPropertyName );
-
- // search pool for item
- const SfxItemPool& rPool = pModel->GetItemPool();
-
- const String aSearchName( rName );
- const sal_uInt32 nCount = rPool.GetItemCount((sal_uInt16)nWhich);
- const NameOrIndex* pItem = 0;
- bool bFound = false;
-
- for( sal_uInt32 nSurrogate = 0; ! bFound && nSurrogate < nCount; nSurrogate++ )
- {
- pItem = (NameOrIndex*)rPool.GetItem((sal_uInt16)nWhich, nSurrogate);
- if( pItem && ( pItem->GetName() == aSearchName ) )
- {
- bFound = true;
- }
- }
-
- // check the property lists that are loaded for the model for items that
- // support such.
- String aStrName;
- SvxUnogetInternalNameForItem( nWhich, rName, aStrName );
-
- switch( nWhich )
- {
- case XATTR_FILLBITMAP:
- {
- XFillBitmapItem aBmpItem;
- if( ! bFound )
- {
- XBitmapList* pBitmapList = pModel->GetBitmapList();
-
- if( !pBitmapList )
- break;
-
- long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
- if( nPos == -1 )
- break;
-
- XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
- aBmpItem.SetWhich( XATTR_FILLBITMAP );
- aBmpItem.SetName( rName );
- aBmpItem.SetBitmapValue( pEntry->GetXBitmap() );
- pItem = & aBmpItem;
- }
- DBG_ASSERT( pItem, "Invalid Item" );
- if( pItem )
- pItem->QueryValue( aResult ); // default: XBitmap. MID_GRAFURL instead?
- }
- break;
-
- case XATTR_FILLGRADIENT:
- {
- XFillGradientItem aGrdItem;
- if( ! bFound )
- {
- XGradientList* pGradientList = pModel->GetGradientList();
-
- if( !pGradientList )
- break;
-
- long nPos = ((XPropertyList*)pGradientList)->Get(aStrName);
- if( nPos == -1 )
- break;
-
- XGradientEntry* pEntry = pGradientList->GetGradient( nPos );
- aGrdItem.SetWhich( XATTR_FILLGRADIENT );
- aGrdItem.SetName( rName );
- aGrdItem.SetGradientValue( pEntry->GetGradient() );
- pItem = & aGrdItem;
- }
- DBG_ASSERT( pItem, "Invalid Item" );
- if( pItem )
- pItem->QueryValue( aResult, MID_FILLGRADIENT );
- }
- break;
-
- case XATTR_FILLHATCH:
- {
- XFillHatchItem aHatchItem;
- if( ! bFound )
- {
- XHatchList* pHatchList = pModel->GetHatchList();
-
- if( !pHatchList )
- break;
-
- long nPos = ((XPropertyList*)pHatchList)->Get(aStrName);
- if( nPos == -1 )
- break;
-
- XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
- aHatchItem.SetWhich( XATTR_FILLHATCH );
- aHatchItem.SetName( rName );
- aHatchItem.SetHatchValue( pEntry->GetHatch() );
- pItem = & aHatchItem;
- }
- DBG_ASSERT( pItem, "Invalid Item" );
- if( pItem )
- pItem->QueryValue( aResult, MID_FILLHATCH );
- }
- break;
-
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- {
- if( ! bFound )
- {
- XLineEndList* pLineEndList = pModel->GetLineEndList();
-
- if( !pLineEndList )
- break;
-
- long nPos = ((XPropertyList*)pLineEndList)->Get(aStrName);
- if( nPos == -1 )
- break;
-
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
- if( nWhich == XATTR_LINEEND )
- {
- XLineEndItem aLEItem;
- aLEItem.SetWhich( XATTR_LINEEND );
- aLEItem.SetName( rName );
- aLEItem.SetLineEndValue( pEntry->GetLineEnd() );
- aLEItem.QueryValue( aResult );
- }
- else
- {
- XLineStartItem aLSItem;
- aLSItem.SetWhich( XATTR_LINESTART );
- aLSItem.SetName( rName );
- aLSItem.SetLineStartValue( pEntry->GetLineEnd() );
- aLSItem.QueryValue( aResult );
- }
- }
- else
- {
- DBG_ASSERT( pItem, "Invalid Item" );
- if( pItem )
- pItem->QueryValue( aResult );
- }
- }
- break;
-
- case XATTR_LINEDASH:
- {
- XLineDashItem aDashItem;
- if( ! bFound )
- {
- XDashList* pDashList = pModel->GetDashList();
-
- if( !pDashList )
- break;
-
- long nPos = ((XPropertyList*)pDashList)->Get(aStrName);
- if( nPos == -1 )
- break;
-
- XDashEntry* pEntry = pDashList->GetDash( nPos );
- aDashItem.SetWhich( XATTR_LINEDASH );
- aDashItem.SetName( rName );
- aDashItem.SetDashValue( pEntry->GetDash() );
- pItem = & aDashItem;
- }
- DBG_ASSERT( pItem, "Invalid Item" );
- if( pItem )
- pItem->QueryValue( aResult, MID_LINEDASH );
- }
- break;
- }
-
- return aResult;
-} */
-
-//----------------------------------------------------------------------
-
void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
Modified: incubator/ooo/trunk/main/svx/source/xoutdev/xattr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/xattr.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/xattr.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/xattr.cxx Thu May 10 10:29:55 2012
@@ -291,9 +291,13 @@ String NameOrIndex::CheckNamedItem( cons
switch( nWhich )
{
case XATTR_FILLBITMAP:
- bFound = (((XFillBitmapItem*)pCheckItem)->GetBitmapValue().GetGraphicObject().GetUniqueID() ==
- ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID());
+ {
+ const GraphicObject& rGraphicObjectA(((XFillBitmapItem*)pCheckItem)->GetGraphicObject());
+ const GraphicObject& rGraphicObjectB(((XBitmapEntry*)pEntry)->GetGraphicObject());
+
+ bFound = (rGraphicObjectA == rGraphicObjectB);
break;
+ }
case XATTR_LINEDASH:
bFound = (((XLineDashItem*)pCheckItem)->GetDashValue() == ((XDashEntry*)pEntry) ->GetDash());
break;
Modified: incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx Thu May 10 10:29:55 2012
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <tools/stream.hxx>
@@ -32,671 +31,266 @@
#include <toolkit/unohlp.hxx>
#include <svl/style.hxx>
#include <editeng/memberids.hrc>
-
#include <svx/dialogs.hrc>
#include "svx/xattr.hxx"
#include <svx/xtable.hxx>
#include <svx/xdef.hxx>
#include <svx/unomid.hxx>
#include <editeng/unoprnms.hxx>
-
-#include "svx/unoapi.hxx"
+#include <svx/unoapi.hxx>
#include <svx/svdmodel.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-
-#define GLOBALOVERFLOW
+#include <vcl/salbtype.hxx>
+#include <vcl/bmpacc.hxx>
using namespace ::com::sun::star;
-// ---------------
-// class XOBitmap
-// ---------------
-
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap()
-|*
-|* Beschreibung
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
-
-XOBitmap::XOBitmap() :
- eType ( XBITMAP_NONE ),
- eStyle ( XBITMAP_STRETCH ),
- pPixelArray ( NULL ),
- bGraphicDirty ( sal_False )
-{
-}
-
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap( Bitmap aBitmap, XBitmapStyle eStyle = XBITMAP_TILE )
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-XOBitmap::XOBitmap( const Bitmap& rBmp, XBitmapStyle eInStyle ) :
- eType ( XBITMAP_IMPORT ),
- eStyle ( eInStyle ),
- aGraphicObject ( rBmp ),
- pPixelArray ( NULL ),
- bGraphicDirty ( sal_False )
-{
-}
-
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap( Bitmap aBitmap, XBitmapStyle eStyle = XBITMAP_TILE )
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-XOBitmap::XOBitmap( const GraphicObject& rGraphicObject, XBitmapStyle eInStyle ) :
- eType ( XBITMAP_IMPORT ),
- eStyle ( eInStyle ),
- aGraphicObject ( rGraphicObject ),
- pPixelArray ( NULL ),
- bGraphicDirty ( sal_False )
-{
-}
-
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap( sal_uInt16* pArray, const Color& aPixelColor,
-|* const Color& aBckgrColor, const Size& rSize = Size( 8, 8 ),
-|* XBitmapStyle eStyle = XBITMAP_TILE )
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-XOBitmap::XOBitmap( const sal_uInt16* pArray, const Color& rPixelColor,
- const Color& rBckgrColor, const Size& rSize,
- XBitmapStyle eInStyle ) :
- eStyle ( eInStyle ),
- pPixelArray ( NULL ),
- aArraySize ( rSize ),
- aPixelColor ( rPixelColor ),
- aBckgrColor ( rBckgrColor ),
- bGraphicDirty ( sal_True )
-
-{
- if( aArraySize.Width() == 8 && aArraySize.Height() == 8 )
- {
- eType = XBITMAP_8X8;
- pPixelArray = new sal_uInt16[ 64 ];
-
- for( sal_uInt16 i = 0; i < 64; i++ )
- *( pPixelArray + i ) = *( pArray + i );
- }
- else
- {
- DBG_ASSERT( 0, "Nicht unterstuetzte Bitmapgroesse" );
- }
-}
-
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap( const XOBitmap& rXBmp )
-|*
-|* Beschreibung
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
-
-XOBitmap::XOBitmap( const XOBitmap& rXBmp ) :
- pPixelArray ( NULL )
-{
- eType = rXBmp.eType;
- eStyle = rXBmp.eStyle;
- aGraphicObject = rXBmp.aGraphicObject;
- aArraySize = rXBmp.aArraySize;
- aPixelColor = rXBmp.aPixelColor;
- aBckgrColor = rXBmp.aBckgrColor;
- bGraphicDirty = rXBmp.bGraphicDirty;
+// -----------------------
+// class XFillBitmapItem
+// -----------------------
+TYPEINIT1_AUTOFACTORY(XFillBitmapItem, NameOrIndex);
- if( rXBmp.pPixelArray )
- {
- if( eType == XBITMAP_8X8 )
- {
- pPixelArray = new sal_uInt16[ 64 ];
+//////////////////////////////////////////////////////////////////////////////
- for( sal_uInt16 i = 0; i < 64; i++ )
- *( pPixelArray + i ) = *( rXBmp.pPixelArray + i );
- }
- }
+XFillBitmapItem::XFillBitmapItem(long nIndex, const GraphicObject& rGraphicObject)
+: NameOrIndex(XATTR_FILLBITMAP, nIndex),
+ maGraphicObject(rGraphicObject)
+{
}
-/*************************************************************************
-|*
-|* XOBitmap::XOBitmap( Bitmap aBitmap, XBitmapStyle eStyle = XBITMAP_TILE )
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-XOBitmap::~XOBitmap()
-{
- if( pPixelArray )
- delete []pPixelArray;
-}
-
-/*************************************************************************
-|*
-|* XOBitmap& XOBitmap::operator=( const XOBitmap& rXBmp )
-|*
-|* Beschreibung
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
-
-XOBitmap& XOBitmap::operator=( const XOBitmap& rXBmp )
-{
- eType = rXBmp.eType;
- eStyle = rXBmp.eStyle;
- aGraphicObject = rXBmp.aGraphicObject;
- aArraySize = rXBmp.aArraySize;
- aPixelColor = rXBmp.aPixelColor;
- aBckgrColor = rXBmp.aBckgrColor;
- bGraphicDirty = rXBmp.bGraphicDirty;
+//////////////////////////////////////////////////////////////////////////////
- if( rXBmp.pPixelArray )
- {
- if( eType == XBITMAP_8X8 )
- {
- pPixelArray = new sal_uInt16[ 64 ];
-
- for( sal_uInt16 i = 0; i < 64; i++ )
- *( pPixelArray + i ) = *( rXBmp.pPixelArray + i );
- }
- }
- return( *this );
+XFillBitmapItem::XFillBitmapItem(const XubString& rName, const GraphicObject& rGraphicObject)
+: NameOrIndex(XATTR_FILLBITMAP, rName),
+ maGraphicObject(rGraphicObject)
+{
}
-/*************************************************************************
-|*
-|* int XOBitmap::operator==( const XOBitmap& rXOBitmap ) const
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-int XOBitmap::operator==( const XOBitmap& rXOBitmap ) const
-{
- if( eType != rXOBitmap.eType ||
- eStyle != rXOBitmap.eStyle ||
- aGraphicObject != rXOBitmap.aGraphicObject ||
- aArraySize != rXOBitmap.aArraySize ||
- aPixelColor != rXOBitmap.aPixelColor ||
- aBckgrColor != rXOBitmap.aBckgrColor ||
- bGraphicDirty != rXOBitmap.bGraphicDirty )
- {
- return( sal_False );
- }
+//////////////////////////////////////////////////////////////////////////////
- if( pPixelArray && rXOBitmap.pPixelArray )
- {
- sal_uInt16 nCount = (sal_uInt16) ( aArraySize.Width() * aArraySize.Height() );
- for( sal_uInt16 i = 0; i < nCount; i++ )
- {
- if( *( pPixelArray + i ) != *( rXOBitmap.pPixelArray + i ) )
- return( sal_False );
- }
- }
- return( sal_True );
+XFillBitmapItem::XFillBitmapItem(const XFillBitmapItem& rItem)
+: NameOrIndex(rItem),
+ maGraphicObject(rItem.maGraphicObject)
+{
}
-/*************************************************************************
-|*
-|* void SetPixelArray( const sal_uInt16* pArray )
-|*
-|* Beschreibung
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
-void XOBitmap::SetPixelArray( const sal_uInt16* pArray )
+Bitmap createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, Color aColorBack)
{
- if( eType == XBITMAP_8X8 )
- {
- if( pPixelArray )
- delete []pPixelArray;
+ BitmapPalette aPalette(2);
- pPixelArray = new sal_uInt16[ 64 ];
+ aPalette[0] = BitmapColor(aColorBack);
+ aPalette[1] = BitmapColor(aColorPix);
- for( sal_uInt16 i = 0; i < 64; i++ )
- *( pPixelArray + i ) = *( pArray + i );
+ Bitmap aBitmap(Size(8, 8), 1, &aPalette);
+ BitmapWriteAccess* pContent = aBitmap.AcquireWriteAccess();
- bGraphicDirty = sal_True;
- }
- else
- {
- DBG_ASSERT( 0, "Nicht unterstuetzter Bitmaptyp" );
- }
-}
+ if(pContent)
+ {
+ for(sal_uInt16 a(0); a < 8; a++)
+ {
+ for(sal_uInt16 b(0); b < 8; b++)
+ {
+ if(pArray[(a * 8) + b])
+ {
+ pContent->SetPixel(b, a, sal_uInt8(1));
+ }
+ else
+ {
+ pContent->SetPixel(b, a, sal_uInt8(0));
+ }
+ }
+ }
-/*************************************************************************
-|*
-|* Bitmap XOBitmap::GetBitmap()
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
-
-Bitmap XOBitmap::GetBitmap() const
-{
- return GetGraphicObject().GetGraphic().GetBitmap();
-}
-
-/*************************************************************************
-|*
-|* Bitmap XOBitmap::GetGraphicObject()
-|*
-|* Beschreibung
-|* Ersterstellung
-|* Letzte Aenderung
-|*
-*************************************************************************/
-
-const GraphicObject& XOBitmap::GetGraphicObject() const
-{
- if( bGraphicDirty )
- ( (XOBitmap*) this )->Array2Bitmap();
-
- return aGraphicObject;
-}
-
-/*************************************************************************
-|*
-|* void XOBitmap::Bitmap2Array()
-|*
-|* Beschreibung Umwandlung der Bitmap in Array, Hinter- u.
-|* Vordergrundfarbe
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
-
-void XOBitmap::Bitmap2Array()
-{
- VirtualDevice aVD;
- sal_Bool bPixelColor = sal_False;
- const Bitmap aBitmap( GetBitmap() );
- const sal_uInt16 nLines = 8; // von Type abhaengig
-
- if( !pPixelArray )
- pPixelArray = new sal_uInt16[ nLines * nLines ];
-
- aVD.SetOutputSizePixel( aBitmap.GetSizePixel() );
- aVD.DrawBitmap( Point(), aBitmap );
- aPixelColor = aBckgrColor = aVD.GetPixel( Point() );
-
- // Aufbau des Arrays und Ermittlung der Vorder-, bzw.
- // Hintergrundfarbe
- for( sal_uInt16 i = 0; i < nLines; i++ )
- {
- for( sal_uInt16 j = 0; j < nLines; j++ )
- {
- if ( aVD.GetPixel( Point( j, i ) ) == aBckgrColor )
- *( pPixelArray + j + i * nLines ) = 0;
- else
- {
- *( pPixelArray + j + i * nLines ) = 1;
- if( !bPixelColor )
- {
- aPixelColor = aVD.GetPixel( Point( j, i ) );
- bPixelColor = sal_True;
- }
- }
- }
- }
+ aBitmap.ReleaseAccess(pContent);
+ }
+
+ return aBitmap;
}
-/*************************************************************************
-|*
-|* void XOBitmap::Array2Bitmap()
-|*
-|* Beschreibung Umwandlung des Arrays, Hinter- u.
-|* Vordergrundfarbe in eine Bitmap
-|* Ersterstellung 27.07.95
-|* Letzte Aenderung 27.07.95
-|*
-*************************************************************************/
-
-void XOBitmap::Array2Bitmap()
-{
- VirtualDevice aVD;
- sal_uInt16 nLines = 8; // von Type abhaengig
+//////////////////////////////////////////////////////////////////////////////
- if( !pPixelArray )
- return;
+bool SVX_DLLPUBLIC isHistorical8x8(const BitmapEx& rBitmapEx, BitmapColor& o_rBack, BitmapColor& o_rFront)
+{
+ if(!rBitmapEx.IsTransparent())
+ {
+ Bitmap aBitmap(rBitmapEx.GetBitmap());
- aVD.SetOutputSizePixel( Size( nLines, nLines ) );
+ if(8 == aBitmap.GetSizePixel().Width() && 8 == aBitmap.GetSizePixel().Height())
+ {
+ if(2 == aBitmap.GetColorCount())
+ {
+ BitmapReadAccess* pRead = aBitmap.AcquireReadAccess();
- // Aufbau der Bitmap
- for( sal_uInt16 i = 0; i < nLines; i++ )
- {
- for( sal_uInt16 j = 0; j < nLines; j++ )
- {
- if( *( pPixelArray + j + i * nLines ) == 0 )
- aVD.DrawPixel( Point( j, i ), aBckgrColor );
- else
- aVD.DrawPixel( Point( j, i ), aPixelColor );
- }
- }
+ if(pRead)
+ {
+ if(pRead->HasPalette() && 2 == pRead->GetPaletteEntryCount())
+ {
+ const BitmapPalette& rPalette = pRead->GetPalette();
+
+ o_rBack = rPalette[1];
+ o_rFront = rPalette[0];
+
+ return true;
+ }
+ }
+ }
+ }
+ }
- aGraphicObject = GraphicObject( aVD.GetBitmap( Point(), Size( nLines, nLines ) ) );
- bGraphicDirty = sal_False;
+ return false;
}
-// -----------------------
-// class XFillBitmapItem
-// -----------------------
-TYPEINIT1_AUTOFACTORY(XFillBitmapItem, NameOrIndex);
-
-/*************************************************************************
-|*
-|* XFillBitmapItem::XFillBitmapItem(long nIndex,
-|* const Bitmap& rTheBitmap)
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 17.11.94
-|*
-*************************************************************************/
-
-XFillBitmapItem::XFillBitmapItem(long nIndex,
- const XOBitmap& rTheBitmap) :
- NameOrIndex( XATTR_FILLBITMAP, nIndex ),
- aXOBitmap( rTheBitmap )
-{
-}
-
-/*************************************************************************
-|*
-|* XFillBitmapItem::XFillBitmapItem(const XubString& rName,
-|* const Bitmap& rTheBitmap)
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 17.11.94
-|*
-*************************************************************************/
-
-XFillBitmapItem::XFillBitmapItem(const XubString& rName,
- const XOBitmap& rTheBitmap) :
- NameOrIndex( XATTR_FILLBITMAP, rName ),
- aXOBitmap( rTheBitmap )
-{
-}
-
-/*************************************************************************
-|*
-|* XFillBitmapItem::XFillBitmapItem(const XFillBitmapItem& rItem)
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 17.11.94
-|*
-*************************************************************************/
-
-XFillBitmapItem::XFillBitmapItem(const XFillBitmapItem& rItem) :
- NameOrIndex( rItem ),
- aXOBitmap( rItem.aXOBitmap )
-{
-}
-
-/*************************************************************************
-|*
-|* XFillBitmapItem::XFillBitmapItem(SvStream& rIn)
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 26.07.94
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
-XFillBitmapItem::XFillBitmapItem( SvStream& rIn, sal_uInt16 nVer ) :
- NameOrIndex( XATTR_FILLBITMAP, rIn )
+XFillBitmapItem::XFillBitmapItem(SvStream& rIn, sal_uInt16 nVer)
+: NameOrIndex(XATTR_FILLBITMAP, rIn)
{
- if( nVer == 0 )
+ if (!IsIndex())
{
- if (!IsIndex())
- {
- // Behandlung der alten Bitmaps
- Bitmap aBmp;
-
- rIn >> aBmp;
+ if(0 == nVer)
+ {
+ // Behandlung der alten Bitmaps
+ Bitmap aBmp;
+
+ rIn >> aBmp;
+ maGraphicObject = Graphic(aBmp);
+ }
+ else if(1 == nVer)
+ {
+ enum XBitmapType
+ {
+ XBITMAP_IMPORT,
+ XBITMAP_8X8
+ };
+
+ sal_Int16 iTmp;
+
+ rIn >> iTmp; // former XBitmapStyle
+ rIn >> iTmp; // former XBitmapType
+
+ if(XBITMAP_IMPORT == iTmp)
+ {
+ Bitmap aBmp;
+
+ rIn >> aBmp;
+ maGraphicObject = Graphic(aBmp);
+ }
+ else if(XBITMAP_8X8 == iTmp)
+ {
+ sal_uInt16 aArray[64];
+
+ for(sal_uInt16 i(0); i < 64; i++)
+ {
+ rIn >> aArray[i];
+ }
+
+ Color aColorPix;
+ Color aColorBack;
- aXOBitmap.SetBitmap( aBmp );
- aXOBitmap.SetBitmapStyle( XBITMAP_TILE );
+ rIn >> aColorPix;
+ rIn >> aColorBack;
- if( aBmp.GetSizePixel().Width() == 8 &&
- aBmp.GetSizePixel().Height() == 8 )
- {
- aXOBitmap.SetBitmapType( XBITMAP_8X8 );
- aXOBitmap.Bitmap2Array();
- }
- else
- aXOBitmap.SetBitmapType( XBITMAP_IMPORT );
- }
- }
- else if( nVer == 1 )
- {
- if (!IsIndex())
- {
- sal_Int16 iTmp;
- rIn >> iTmp;
- aXOBitmap.SetBitmapStyle( (XBitmapStyle) iTmp );
- rIn >> iTmp;
- aXOBitmap.SetBitmapType( (XBitmapType) iTmp );
-
- if( aXOBitmap.GetBitmapType() == XBITMAP_IMPORT )
- {
- Bitmap aBmp;
- rIn >> aBmp;
- aXOBitmap.SetBitmap( aBmp );
- }
- else if( aXOBitmap.GetBitmapType() == XBITMAP_8X8 )
- {
- sal_uInt16* pArray = new sal_uInt16[ 64 ];
- Color aColor;
-
- for( sal_uInt16 i = 0; i < 64; i++ )
- rIn >> *( pArray + i );
- aXOBitmap.SetPixelArray( pArray );
-
- rIn >> aColor;
- aXOBitmap.SetPixelColor( aColor );
- rIn >> aColor;
- aXOBitmap.SetBackgroundColor( aColor );
+ const Bitmap aBitmap(createHistorical8x8FromArray(aArray, aColorPix, aColorBack));
- delete []pArray;
- }
- }
- }
+ maGraphicObject = Graphic(aBitmap);
+ }
+ }
+ else if(2 == nVer)
+ {
+ BitmapEx aBmpEx;
- // #81908# force bitmap to exist
- aXOBitmap.GetBitmap();
+ rIn >> aBmpEx;
+ maGraphicObject = Graphic(aBmpEx);
+ }
+ }
}
-//*************************************************************************
+//////////////////////////////////////////////////////////////////////////////
-XFillBitmapItem::XFillBitmapItem( SfxItemPool* /*pPool*/, const XOBitmap& rTheBitmap )
-: NameOrIndex( XATTR_FILLBITMAP, -1 ),
- aXOBitmap( rTheBitmap )
+XFillBitmapItem::XFillBitmapItem(SfxItemPool* /*pPool*/, const GraphicObject& rGraphicObject)
+: NameOrIndex( XATTR_FILLBITMAP, -1),
+ maGraphicObject(rGraphicObject)
{
}
-//*************************************************************************
+//////////////////////////////////////////////////////////////////////////////
-XFillBitmapItem::XFillBitmapItem( SfxItemPool* /*pPool*/)
-: NameOrIndex(XATTR_FILLBITMAP, -1 )
+XFillBitmapItem::XFillBitmapItem(SfxItemPool* /*pPool*/)
+: NameOrIndex(XATTR_FILLBITMAP, -1),
+ maGraphicObject()
{
}
-/*************************************************************************
-|*
-|* XFillBitmapItem::Clone(SfxItemPool* pPool) const
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 17.11.94
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
SfxPoolItem* XFillBitmapItem::Clone(SfxItemPool* /*pPool*/) const
{
return new XFillBitmapItem(*this);
}
-/*************************************************************************
-|*
-|* int XFillBitmapItem::operator==(const SfxPoolItem& rItem) const
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
int XFillBitmapItem::operator==(const SfxPoolItem& rItem) const
{
- return ( NameOrIndex::operator==(rItem) &&
- aXOBitmap == ((const XFillBitmapItem&) rItem).aXOBitmap );
+ return (NameOrIndex::operator==(rItem)
+ && maGraphicObject == ((const XFillBitmapItem&)rItem).maGraphicObject);
}
-/*************************************************************************
-|*
-|* SfxPoolItem* XFillBitmapItem::Create(SvStream& rIn, sal_uInt16 nVer) const
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 17.11.94
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
SfxPoolItem* XFillBitmapItem::Create(SvStream& rIn, sal_uInt16 nVer) const
{
return new XFillBitmapItem( rIn, nVer );
}
-/*************************************************************************
-|*
-|* SfxPoolItem* XFillBitmapItem::Store(SvStream& rOut) const
-|*
-|* Beschreibung
-|* Ersterstellung 17.11.94
-|* Letzte Aenderung 26.07.94
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
SvStream& XFillBitmapItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
{
- NameOrIndex::Store( rOut, nItemVersion );
+ NameOrIndex::Store(rOut, nItemVersion);
- if (!IsIndex())
+ if(!IsIndex())
{
- rOut << (sal_Int16) aXOBitmap.GetBitmapStyle();
- if( !aXOBitmap.GetBitmap() )
- rOut << (sal_Int16) XBITMAP_NONE;
- else
- {
- rOut << (sal_Int16) aXOBitmap.GetBitmapType();
- if( aXOBitmap.GetBitmapType() == XBITMAP_IMPORT )
- {
- const sal_uInt16 nOldComprMode = rOut.GetCompressMode();
- sal_uInt16 nNewComprMode = nOldComprMode;
-
- if( rOut.GetVersion() >= SOFFICE_FILEFORMAT_50 )
- nNewComprMode |= COMPRESSMODE_ZBITMAP;
- else
- nNewComprMode &= ~COMPRESSMODE_ZBITMAP;
-
- rOut.SetCompressMode( nNewComprMode );
- rOut << aXOBitmap.GetBitmap();
- rOut.SetCompressMode( nOldComprMode );
- }
- else if( aXOBitmap.GetBitmapType() == XBITMAP_8X8 )
- {
- sal_uInt16* pArray = aXOBitmap.GetPixelArray();
- for( sal_uInt16 i = 0; i < 64; i++ )
- rOut << (sal_uInt16) *( pArray + i );
-
- rOut << aXOBitmap.GetPixelColor();
- rOut << aXOBitmap.GetBackgroundColor();
- }
- }
+ rOut << maGraphicObject.GetGraphic().GetBitmapEx();
}
return rOut;
}
-/*************************************************************************
-|*
-|* const Bitmap& XFillBitmapItem::GetValue(const XBitmapTable* pTable) const
-|*
-|* Beschreibung
-|* Ersterstellung 15.11.94
-|* Letzte Aenderung 26.07.94
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
-const XOBitmap& XFillBitmapItem::GetBitmapValue(const XBitmapTable* pTable) const // GetValue -> GetBitmapValue
+const GraphicObject& XFillBitmapItem::GetGraphicObject() const
{
- if (!IsIndex())
- return aXOBitmap;
- else
- return pTable->GetBitmap(GetIndex())->GetXBitmap();
+ return maGraphicObject;
}
+//////////////////////////////////////////////////////////////////////////////
+
+void XFillBitmapItem::SetGraphicObject(const GraphicObject& rGraphicObject)
+{
+ maGraphicObject = rGraphicObject;
+}
-/*************************************************************************
-|*
-|* sal_uInt16 XFillBitmapItem::GetVersion() const
-|*
-|* Beschreibung
-|* Ersterstellung 26.07.95
-|* Letzte Aenderung 26.07.95
-|*
-*************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
-sal_uInt16 XFillBitmapItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
+sal_uInt16 XFillBitmapItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const
{
- // 2. Version
- return( 1 );
+ // version three
+ return(2);
}
-//------------------------------------------------------------------------
+//////////////////////////////////////////////////////////////////////////////
-SfxItemPresentation XFillBitmapItem::GetPresentation
-(
+SfxItemPresentation XFillBitmapItem::GetPresentation(
SfxItemPresentation ePres,
- SfxMapUnit /*eCoreUnit*/,
- SfxMapUnit /*ePresUnit*/,
- XubString& rText, const IntlWrapper *
-) const
+ SfxMapUnit /*eCoreUnit*/,
+ SfxMapUnit /*ePresUnit*/,
+ XubString& rText,
+ const IntlWrapper*) const
{
- switch ( ePres )
+ switch (ePres)
{
case SFX_ITEM_PRESENTATION_NONE:
rText.Erase();
@@ -710,11 +304,10 @@ SfxItemPresentation XFillBitmapItem::Get
}
}
-//------------------------------------------------------------------------
+//////////////////////////////////////////////////////////////////////////////
-sal_Bool XFillBitmapItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
+sal_Bool XFillBitmapItem::QueryValue(::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId) const
{
-// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
// needed for MID_NAME
@@ -737,18 +330,13 @@ sal_Bool XFillBitmapItem::QueryValue( ::
if( nMemberId == MID_GRAFURL ||
nMemberId == 0 )
{
- XOBitmap aLocalXOBitmap( GetBitmapValue() );
- aURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
- aURL += ::rtl::OUString::createFromAscii( aLocalXOBitmap.GetGraphicObject().GetUniqueID().GetBuffer() );
+ aURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
+ aURL += ::rtl::OUString::createFromAscii(GetGraphicObject().GetUniqueID().GetBuffer() );
}
if( nMemberId == MID_BITMAP ||
nMemberId == 0 )
{
- XOBitmap aLocalXOBitmap( GetBitmapValue() );
- Bitmap aBmp( aLocalXOBitmap.GetBitmap() );
- BitmapEx aBmpEx( aBmp );
-
- xBmp.set( VCLUnoHelper::CreateBitmap( aBmpEx ) );
+ xBmp.set(VCLUnoHelper::CreateBitmap(GetGraphicObject().GetGraphic().GetBitmapEx()));
}
if( nMemberId == MID_NAME )
@@ -776,11 +364,10 @@ sal_Bool XFillBitmapItem::QueryValue( ::
return sal_True;
}
-//------------------------------------------------------------------------
+//////////////////////////////////////////////////////////////////////////////
sal_Bool XFillBitmapItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
{
-// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
::rtl::OUString aName;
@@ -826,47 +413,35 @@ sal_Bool XFillBitmapItem::PutValue( cons
}
if( bSetURL )
{
- GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
- XOBitmap aBMP( aGrafObj );
- SetBitmapValue( aBMP );
+ maGraphicObject = GraphicObject::CreateGraphicObjectFromURL(aURL);
}
if( bSetBitmap )
{
- Bitmap aInput;
- if ( xBmp.is() )
+ if(xBmp.is())
{
- BitmapEx aInputEx( VCLUnoHelper::GetBitmap( xBmp ) );
- aInput = aInputEx.GetBitmap();
+ maGraphicObject = Graphic(VCLUnoHelper::GetBitmap(xBmp));
}
- else if ( xGraphic.is() )
+ else if(xGraphic.is())
{
- Graphic aGraphic( xGraphic );
- aInput = aGraphic.GetBitmap();
+ maGraphicObject = Graphic(xGraphic);
}
-
- // note: aXOBitmap is the member bitmap
- aXOBitmap.SetBitmap( aInput );
- aXOBitmap.SetBitmapType(XBITMAP_IMPORT);
-
- if(aInput.GetSizePixel().Width() == 8
- && aInput.GetSizePixel().Height() == 8
- && aInput.GetColorCount() == 2)
- {
- aXOBitmap.Bitmap2Array();
- aXOBitmap.SetBitmapType(XBITMAP_8X8);
- aXOBitmap.SetPixelSize(aInput.GetSizePixel());
- }
}
return (bSetName || bSetURL || bSetBitmap);
}
+//////////////////////////////////////////////////////////////////////////////
+
sal_Bool XFillBitmapItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 )
{
- return ((XFillBitmapItem*)p1)->GetBitmapValue().GetGraphicObject().GetUniqueID() ==
- ((XFillBitmapItem*)p2)->GetBitmapValue().GetGraphicObject().GetUniqueID();
+ const GraphicObject& aGraphicObjectA(((XFillBitmapItem*)p1)->GetGraphicObject());
+ const GraphicObject& aGraphicObjectB(((XFillBitmapItem*)p2)->GetGraphicObject());
+
+ return aGraphicObjectA == aGraphicObjectB;
}
+//////////////////////////////////////////////////////////////////////////////
+
XFillBitmapItem* XFillBitmapItem::checkForUniqueItem( SdrModel* pModel ) const
{
if( pModel )
@@ -882,9 +457,12 @@ XFillBitmapItem* XFillBitmapItem::checkF
// if the given name is not valid, replace it!
if( aUniqueName != GetName() )
{
- return new XFillBitmapItem( aUniqueName, aXOBitmap );
+ return new XFillBitmapItem(aUniqueName, maGraphicObject);
}
}
return (XFillBitmapItem*)this;
}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
Modified: incubator/ooo/trunk/main/svx/source/xoutdev/xpool.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/xpool.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/xpool.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/xpool.cxx Thu May 10 10:29:55 2012
@@ -46,7 +46,7 @@ XOutdevItemPool::XOutdevItemPool(
{
// prepare some defaults
const XubString aNullStr;
- const Bitmap aNullBmp;
+ const Graphic aNullGraphic;
const basegfx::B2DPolyPolygon aNullPol;
const Color aNullLineCol(RGB_Color(COL_BLACK));
const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 ));
@@ -92,7 +92,7 @@ XOutdevItemPool::XOutdevItemPool(
mppLocalPoolDefaults[XATTR_FILLCOLOR -XATTR_START] = new XFillColorItem (aNullStr,aNullFillCol);
mppLocalPoolDefaults[XATTR_FILLGRADIENT -XATTR_START] = new XFillGradientItem(this,aNullGrad);
mppLocalPoolDefaults[XATTR_FILLHATCH -XATTR_START] = new XFillHatchItem (this,aNullHatch);
- mppLocalPoolDefaults[XATTR_FILLBITMAP -XATTR_START] = new XFillBitmapItem (this,aNullBmp);
+ mppLocalPoolDefaults[XATTR_FILLBITMAP -XATTR_START] = new XFillBitmapItem (this, aNullGraphic);
mppLocalPoolDefaults[XATTR_FILLTRANSPARENCE -XATTR_START] = new XFillTransparenceItem;
mppLocalPoolDefaults[XATTR_GRADIENTSTEPCOUNT -XATTR_START] = new XGradientStepCountItem;
mppLocalPoolDefaults[XATTR_FILLBMP_TILE -XATTR_START] = new XFillBmpTileItem;
Modified: incubator/ooo/trunk/main/svx/source/xoutdev/xtabbtmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/xtabbtmp.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/xtabbtmp.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/xtabbtmp.cxx Thu May 10 10:29:55 2012
@@ -24,17 +24,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#ifndef SVX_LIGHT
-
#include <com/sun/star/container/XNameContainer.hpp>
#include "svx/XPropertyTable.hxx"
#include <unotools/ucbstreamhelper.hxx>
-
-#include "xmlxtexp.hxx"
-#include "xmlxtimp.hxx"
-
-#endif
-
+#include <xmlxtexp.hxx>
+#include <xmlxtimp.hxx>
#include <tools/urlobj.hxx>
#include <vcl/virdev.hxx>
#include <svl/itemset.hxx>
@@ -43,6 +37,7 @@
#include <svx/dialmgr.hxx>
#include <svx/xtable.hxx>
#include <svx/xpool.hxx>
+#include <svx/xbtmpit.hxx>
#define GLOBALOVERFLOW
@@ -234,7 +229,6 @@ sal_Bool XBitmapList::Save()
sal_Bool XBitmapList::Create()
{
- // Array der Bitmap
//-----------------------
// 00 01 02 03 04 05 06 07
// 08 09 10 11 12 13 14 15
@@ -244,31 +238,38 @@ sal_Bool XBitmapList::Create()
// 40 41 42 43 44 45 46 47
// 48 49 50 51 52 53 54 55
// 56 57 58 59 60 61 62 63
+ String aStr(SVX_RES(RID_SVXSTR_BITMAP));
+ sal_uInt16 aArray[64];
+ Bitmap aBitmap;
+ const xub_StrLen nLen(aStr.Len() - 1);
- String aStr( SVX_RES( RID_SVXSTR_BITMAP ) );
- Color aColWhite( RGB_Color( COL_WHITE ) );
- xub_StrLen nLen;
- sal_uInt16 aArray[64];
+ memset(aArray, 0, sizeof(aArray));
- memset( aArray, 0, sizeof( aArray ) );
+ // white/white bitmap
aStr.AppendAscii(" 1");
- nLen = aStr.Len() - 1;
- Insert( new XBitmapEntry( XOBitmap( aArray, aColWhite, aColWhite ), aStr ) );
+ aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_WHITE), RGB_Color(COL_WHITE));
+ Insert(new XBitmapEntry(Graphic(aBitmap), aStr));
+ // black/white bitmap
aArray[ 0] = 1; aArray[ 9] = 1; aArray[18] = 1; aArray[27] = 1;
aArray[36] = 1; aArray[45] = 1; aArray[54] = 1; aArray[63] = 1;
aStr.SetChar(nLen, sal_Unicode('2'));
- Insert( new XBitmapEntry( XOBitmap( aArray, RGB_Color( COL_BLACK ), aColWhite ), aStr ) );
+ aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
+ Insert(new XBitmapEntry(Graphic(aBitmap), aStr));
+ // lightred/white bitmap
aArray[ 7] = 1; aArray[14] = 1; aArray[21] = 1; aArray[28] = 1;
aArray[35] = 1; aArray[42] = 1; aArray[49] = 1; aArray[56] = 1;
aStr.SetChar(nLen, sal_Unicode('3'));
- Insert( new XBitmapEntry( XOBitmap( aArray, RGB_Color( COL_LIGHTRED ), aColWhite ), aStr ) );
+ aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTRED), RGB_Color(COL_WHITE));
+ Insert(new XBitmapEntry(Graphic(aBitmap), aStr));
+ // lightblue/white bitmap
aArray[24] = 1; aArray[25] = 1; aArray[26] = 1;
aArray[29] = 1; aArray[30] = 1; aArray[31] = 1;
aStr.SetChar(nLen, sal_Unicode('4'));
- Insert( new XBitmapEntry( XOBitmap( aArray, RGB_Color( COL_LIGHTBLUE ), aColWhite ), aStr ) );
+ aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTBLUE), RGB_Color(COL_WHITE));
+ Insert(new XBitmapEntry(Graphic(aBitmap), aStr));
return( sal_True );
}
Modified: incubator/ooo/trunk/main/sw/source/core/frmedt/fecopy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/frmedt/fecopy.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/frmedt/fecopy.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/frmedt/fecopy.cxx Thu May 10 10:29:55 2012
@@ -1540,11 +1540,11 @@ sal_Bool SwFEShell::Paste( const Graphic
if( bRet )
{
- XOBitmap aXOBitmap( rGrf.GetBitmap() );
- SfxItemSet aSet( GetAttrPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP );
- aSet.Put( XFillStyleItem( XFILL_BITMAP ));
- aSet.Put( XFillBitmapItem( aEmptyStr, aXOBitmap ));
- pView->SetAttributes( aSet, sal_False );
+ SfxItemSet aSet(GetAttrPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
+
+ aSet.Put(XFillStyleItem(XFILL_BITMAP));
+ aSet.Put(XFillBitmapItem(aEmptyStr, rGrf));
+ pView->SetAttributes(aSet, false);
}
return bRet;
}
Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx?rev=1336585&r1=1336584&r2=1336585&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx Thu May 10 10:29:55 2012
@@ -1914,28 +1914,19 @@ void SwWW8ImplReader::MatchSdrItemsIntoF
break;
case XFILL_BITMAP:
{
- const Graphic aGraphic(
- static_cast< XFillBitmapItem const & >(
- rOldSet.Get(XATTR_FILLBITMAP)).
- GetBitmapValue().GetBitmap());
- bool bTile = WW8ITEMVALUE(rOldSet, XATTR_FILLBMP_TILE,
- SfxBoolItem) ? true: false;
- GraphicObject aGrfObj(aGraphic);
+ GraphicObject aGrfObj(static_cast< XFillBitmapItem const & >(rOldSet.Get(XATTR_FILLBITMAP)).GetGraphicObject());
+ const bool bTile(WW8ITEMVALUE(rOldSet, XATTR_FILLBMP_TILE, SfxBoolItem) ? true: false);
- aBrushItem.SetGraphicObject(aGrfObj);
-
- if (bBrushItemOk) //has trans
+ if(bBrushItemOk) //has trans
{
- GraphicObject *pGraphicObject =
- const_cast<GraphicObject *>
- (aBrushItem.GetGraphicObject());
- GraphicAttr aAttr(pGraphicObject->GetAttr());
+ GraphicAttr aAttr(aGrfObj.GetAttr());
+
aAttr.SetTransparency(nTrans);
- pGraphicObject->SetAttr(aAttr);
+ aGrfObj.SetAttr(aAttr);
}
+ aBrushItem.SetGraphicObject(aGrfObj);
aBrushItem.SetGraphicPos(bTile ? GPOS_TILED : GPOS_AREA);
-
bBrushItemOk = true;
}
break;