incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1339213 [10/11] - in /incubator/ooo/branches/alg/aw080: ./ ext_sources/ extras/l10n/source/en-GB/ extras/l10n/source/pt-BR/ extras/l10n/source/zh-CN/ extras/l10n/source/zh-TW/ main/ main/apache-commons/java/codec/ main/apache-commons/java/...
Date Wed, 16 May 2012 15:07:08 GMT
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx Wed May 16 15:07:00 2012
@@ -26,12 +26,13 @@
 
 #include <vector>
 #include <editeng/editeng.hxx>
-#include "svx/xexch.hxx"
+#include <svx/xexch.hxx>
 #include <svx/xflclit.hxx>
 #include <svx/svdxcgv.hxx>
 #include <svx/svdoutl.hxx>
 #include <editeng/editdata.hxx>
 #include <svx/svditext.hxx>
+#include <svx/svditext.hxx>
 #include <svx/svdetc.hxx>
 #include <svx/svdundo.hxx>
 #include <svx/svdograf.hxx>
@@ -55,75 +56,8 @@
 #include <svl/style.hxx>
 #include "fmobj.hxx"
 #include <svx/svdlegacy.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-Graphic GetObjGraphic(const SdrObject& rObj)
-{
-    Graphic aRet;
-
-    // try to get a graphic from the object first
-	const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
-	const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
-        
-	if(pSdrGrafObj)
-    {
-        if(pSdrGrafObj->isEmbeddedSvg())
-        {
-            // get Metafile for Svg content
-            aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
-        }
-        else
-        {
-            // #110981# Make behaviour coherent with metafile
-            // recording below (which of course also takes
-            // view-transformed objects)
-            aRet = pSdrGrafObj->GetTransformedGraphic();
-        }
-    }
-    else if(pSdrOle2Obj)
-    {
-        if ( pSdrOle2Obj->GetGraphic() )
-		{
-            aRet = *pSdrOle2Obj->GetGraphic();
-        }
-    }
-
-    if(GRAPHIC_NONE == aRet.GetType() || GRAPHIC_DEFAULT == aRet.GetType())
-    {
-        // if graphic could not be retrieved => go the hard way and create a MetaFile
-    	const SdrModel& rSdrModel = rObj.getSdrModelFromSdrObject();
-		const MapMode aMap(
-            rSdrModel.GetExchangeObjectUnit(), 
-            Point(), 
-            rSdrModel.GetExchangeObjectScale(), 
-            rSdrModel.GetExchangeObjectScale());
-        VirtualDevice aOut;
-        GDIMetaFile aMtf;
-    	const basegfx::B2DRange aBoundRange(rObj.getObjectRange(0));
-
-        aOut.EnableOutput(false);
-		aOut.SetMapMode(aMap);
-		aMtf.Record(&aOut);
-        rObj.SingleObjectPainter(aOut);
-        aMtf.Stop();
-		aMtf.WindStart();
-
-        if(aMtf.GetActionCount())
-		{
-		    // #i99268# replace the original offset from using XOutDev's SetOffset
-		    // NOT (as tried with #i92760#) with another MapMode which gets recorded
-		    // by the Metafile itself (what always leads to problems), but by
-		    // translating the result the hard way
-		    aMtf.Move(-basegfx::fround(aBoundRange.getMinX()), -basegfx::fround(aBoundRange.getMinY()));
-            aMtf.SetPrefMapMode(aMap);
-		    aMtf.SetPrefSize(Size(basegfx::fround(aBoundRange.getWidth()), basegfx::fround(aBoundRange.getHeight())));
-            aRet = aMtf;
-        }
-    }
-
-    return aRet;
-}
+#include <fmobj.hxx>
+#include <vcl/svgdata.hxx>
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -652,8 +586,6 @@ void SdrExchangeView::ImpPasteObject(Sdr
 	}
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
 BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked) const
 {
 	BitmapEx aBmp;
@@ -679,17 +611,12 @@ BitmapEx SdrExchangeView::GetMarkedObjBi
 
 		if( !aBmp )
 		{
-			const Graphic aGraphic(GetMarkedObjMetaFile(bNoVDevIfOneBmpMarked));
-            
-            // #i102089# support user's settings of AA and LineSnap when the MetaFile gets
-            // rasterconverted to a bitmap
-            const GraphicConversionParameters aParameters(
-                Size(),
-                false,
-                getOptionsDrawinglayer().IsAntiAliasing(),
-                getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
-
-            aBmp = aGraphic.GetBitmapEx(aParameters);
+            const GDIMetaFile aGDIMetaFile(GetMarkedObjMetaFile(bNoVDevIfOneBmpMarked));
+            const basegfx::B2DRange aAllObjRange(sdr::legacy::GetAllObjBoundRange(getSelectedSdrObjectVectorFromSdrMarkView()));
+           
+            aBmp = convertMetafileToBitmapEx(
+                aGDIMetaFile,
+                aAllObjRange);
 		}
 	}
 
@@ -733,28 +660,28 @@ GDIMetaFile SdrExchangeView::GetMarkedOb
 
 		if( !aMtf.GetActionCount() )
 		{
-			VirtualDevice   aOut;
-            Size            aDummySize( 2, 2 );
+			VirtualDevice aOut;
+            const Size aDummySize(2, 2);
 
             aOut.SetOutputSizePixel( aDummySize );
 			aOut.EnableOutput(false);
 			aOut.SetMapMode( aMap );
-
             aMtf.Clear();
-			aMtf.Record( &aOut );
-
-			// Replace offset given formally to DrawMarkedObj and used at XOutDev with relative
-			// MapMode (which was also used in XOutDev in that case). Goal is to paint the object
-			// as if TopLeft point is (0,0)
-			const Fraction aNeutralFraction(1, 1);
-			const MapMode aRelativeMapMode(MAP_RELATIVE, Point(-aBound.Left(), -aBound.Top()), aNeutralFraction, aNeutralFraction);
-			aOut.SetMapMode(aRelativeMapMode);
+			aMtf.Record(&aOut);
 
             DrawMarkedObj(aOut);
 
             aMtf.Stop();
 			aMtf.WindStart();
-		    aMtf.SetPrefMapMode( aMap );
+			
+            // moving the result is more reliable then setting a relative MapMode at the VDev (used
+            // before), also see #i99268# in GetObjGraphic() below. Some draw actions at
+            // the OutDev are simply not handled correctly when a MapMode is set at the
+            // target devive, e.g. MetaFloatTransparentAction. Even the Move for this action
+            // was missing the manipulation of the embedded Metafile
+			aMtf.Move(-aBound.Left(), -aBound.Top());
+
+            aMtf.SetPrefMapMode( aMap );
 
 			// removed PrefSize extension. It is principially wrong to set a reduced size at
 			// the created MetaFile. The mentioned errors occurr at output time since the integer
@@ -792,6 +719,76 @@ Graphic SdrExchangeView::GetAllMarkedGra
 
 // -----------------------------------------------------------------------------
 
+Graphic GetObjGraphic(const SdrObject& rObj)
+{
+    Graphic aRet;
+
+    // try to get a graphic from the object first
+	const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
+	const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
+        
+	if(pSdrGrafObj)
+    {
+        if(pSdrGrafObj->isEmbeddedSvg())
+        {
+            // get Metafile for Svg content
+            aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
+        }
+        else
+        {
+            // #110981# Make behaviour coherent with metafile
+            // recording below (which of course also takes
+            // view-transformed objects)
+            aRet = pSdrGrafObj->GetTransformedGraphic();
+        }
+    }
+    else if(pSdrOle2Obj)
+    {
+        if ( pSdrOle2Obj->GetGraphic() )
+		{
+            aRet = *pSdrOle2Obj->GetGraphic();
+        }
+    }
+
+        // if graphic could not be retrieved => go the hard way and create a MetaFile
+    if(GRAPHIC_NONE == aRet.GetType() || GRAPHIC_DEFAULT == aRet.GetType())
+    {
+    	const SdrModel& rSdrModel = rObj.getSdrModelFromSdrObject();
+		const MapMode aMap(
+            rSdrModel.GetExchangeObjectUnit(), 
+            Point(), 
+            rSdrModel.GetExchangeObjectScale(), 
+            rSdrModel.GetExchangeObjectScale());
+        VirtualDevice aOut;
+        GDIMetaFile aMtf;
+
+        aOut.EnableOutput(false);
+		aOut.SetMapMode(aMap);
+		aMtf.Record(&aOut);
+        rObj.SingleObjectPainter(aOut);
+        aMtf.Stop();
+		aMtf.WindStart();
+
+        if(aMtf.GetActionCount())
+		{
+		    // #i99268# replace the original offset from using XOutDev's SetOffset
+		    // NOT (as tried with #i92760#) with another MapMode which gets recorded
+		    // by the Metafile itself (what always leads to problems), but by
+		    // translating the result the hard way
+        	const basegfx::B2DRange aBoundRange(rObj.getObjectRange(0));
+            aMtf.Move(-basegfx::fround(aBoundRange.getMinX()), -basegfx::fround(aBoundRange.getMinY()));
+            
+            aMtf.SetPrefMapMode(aMap);
+		    aMtf.SetPrefSize(Size(basegfx::fround(aBoundRange.getWidth()), basegfx::fround(aBoundRange.getHeight())));
+            aRet = aMtf;
+        }
+    }
+
+    return aRet;
+}
+
+// -----------------------------------------------------------------------------
+
 void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const
 {
 	if(areSdrObjectsSelected())

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fillctrl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fillctrl.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fillctrl.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fillctrl.cxx Wed May 16 15:07:00 2012
@@ -422,12 +422,10 @@ void SvxFillToolBoxControl::Update( cons
 						aTmpStr += aString;
 						aTmpStr += TMP_STR_END;
 
-						XBitmapEntry* pEntry = new XBitmapEntry( pBitmapItem->GetBitmapValue(), aTmpStr );
+						XBitmapEntry* pEntry = new XBitmapEntry(pBitmapItem->GetGraphicObject(), aTmpStr);
 						XBitmapList aBitmapList( String::CreateFromAscii("TmpList") );
 						aBitmapList.Insert( pEntry );
 						aBitmapList.SetDirty( sal_False );
-						//Bitmap* pBmp = aBitmapList.GetBitmap( 0 );
-						//( (ListBox*)pFillAttrLB )->InsertEntry( pEntry->GetName(), *pBmp );
 						pFillAttrLB->Fill( &aBitmapList );
 						pFillAttrLB->SelectEntryPos( pFillAttrLB->GetEntryCount() - 1 );
 						aBitmapList.Remove( 0 );
@@ -771,14 +769,13 @@ IMPL_LINK( FillControl, SelectFillAttrHd
 
                     if ( nPos < aItem.GetBitmapList()->Count() )  // kein temp. Eintrag ?
                     {
-                        XOBitmap aXOBitmap = aItem.GetBitmapList()->GetBitmap( nPos )->GetXBitmap();
-                        XFillBitmapItem aXFillBitmapItem( pLbFillAttr->GetSelectEntry(), aXOBitmap );
+                        const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos);
+                        const XFillBitmapItem aXFillBitmapItem(pLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject());
 
                         aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillBitmap" ));
                         aXFillBitmapItem.QueryValue( a );
                         aArgs[0].Value = a;
-                        ((SvxFillToolBoxControl*)GetData())->Dispatch( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillBitmap" )),
-                                                                       aArgs );
+                        ((SvxFillToolBoxControl*)GetData())->Dispatch(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillBitmap")), aArgs);
                     }
                 }
             }

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/XPropertyTable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/XPropertyTable.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/XPropertyTable.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/XPropertyTable.cxx Wed May 16 15:07:00 2012
@@ -696,8 +696,9 @@ uno::Reference< uno::XInterface > SAL_CA
 // SvxUnoXPropertyTable
 uno::Any SvxUnoXBitmapTable::getAny( const XPropertyEntry* pEntry ) const throw()
 {
-	OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));			
-	aURL += OUString::createFromAscii( ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID().GetBuffer() );
+	OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
+    const GraphicObject& rGraphicObject(((XBitmapEntry*)pEntry)->GetGraphicObject());
+	aURL += OUString::createFromAscii(rGraphicObject.GetUniqueID().GetBuffer());
 	
 	uno::Any aAny;
 	aAny <<= aURL;
@@ -710,11 +711,10 @@ XPropertyEntry* SvxUnoXBitmapTable::getE
 	if(!(rAny >>= aURL))
 		return NULL;
 
-	GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
-	XOBitmap aBMP( aGrafObj );
-	
-	const String aName( rName );
-	return new XBitmapEntry( aBMP, aName );
+	const GraphicObject aGrafObj(GraphicObject::CreateGraphicObjectFromURL(aURL));
+	const String aName(rName);
+
+    return new XBitmapEntry(aGrafObj, aName);
 }
 
 // XElementAccess

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unobtabl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unobtabl.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unobtabl.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unobtabl.cxx Wed May 16 15:07:00 2012
@@ -75,8 +75,9 @@ bool SvxUnoBitmapTable::isValid( const N
 		const XFillBitmapItem* pBitmapItem = dynamic_cast< const XFillBitmapItem* >( pItem );
 		if( pBitmapItem )
 		{
-			const GraphicObject& rGraphic = pBitmapItem->GetBitmapValue().GetGraphicObject();
-			return rGraphic.GetSizeBytes() > 0;
+			const Graphic& rGraphic = pBitmapItem->GetGraphicObject().GetGraphic();
+			
+            return rGraphic.GetSizeBytes() > 0;
 		}
 	}
 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx Wed May 16 15:07:00 2012
@@ -1671,7 +1671,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;
 		    }
@@ -1829,193 +1829,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/branches/alg/aw080/main/svx/source/xoutdev/xattr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattr.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattr.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattr.cxx Wed May 16 15:07:00 2012
@@ -286,25 +286,29 @@ String NameOrIndex::CheckNamedItem( cons
 
 					switch( nWhich )
 					{
-					    case XATTR_FILLBITMAP:
-						    bFound =  (((XFillBitmapItem*)pCheckItem)->GetBitmapValue().GetGraphicObject().GetUniqueID() ==
-							    ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID());
-						    break;
-					    case XATTR_LINEDASH:
-						    bFound = (((XLineDashItem*)pCheckItem)->GetDashValue() == ((XDashEntry*)pEntry) ->GetDash());
-						    break;
-					    case XATTR_LINESTART:
-						    bFound = (((XLineStartItem*)pCheckItem)->GetLineStartValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
-						    break;
-					    case XATTR_LINEEND:
-						    bFound = (((XLineEndItem*)pCheckItem)->GetLineEndValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
-						    break;
-					    case XATTR_FILLGRADIENT:
-						    bFound = (((XFillGradientItem*)pCheckItem)->GetGradientValue() == ((XGradientEntry*)pEntry)->GetGradient());
-						    break;
-					    case XATTR_FILLHATCH:
-						    bFound = (((XFillHatchItem*)pCheckItem)->GetHatchValue() == ((XHatchEntry*)pEntry)->GetHatch());
-						    break;
+					case XATTR_FILLBITMAP:
+                    {
+                        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;
+					case XATTR_LINESTART:
+						bFound = (((XLineStartItem*)pCheckItem)->GetLineStartValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
+						break;
+					case XATTR_LINEEND:
+						bFound = (((XLineEndItem*)pCheckItem)->GetLineEndValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
+						break;
+					case XATTR_FILLGRADIENT:
+						bFound = (((XFillGradientItem*)pCheckItem)->GetGradientValue() == ((XGradientEntry*)pEntry)->GetGradient());
+						break;
+					case XATTR_FILLHATCH:
+						bFound = (((XFillHatchItem*)pCheckItem)->GetHatchValue() == ((XHatchEntry*)pEntry)->GetHatch());
+						break;
 					}
 
 					if( bFound )

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattrbmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattrbmp.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattrbmp.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xattrbmp.cxx Wed May 16 15:07:00 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,672 +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" );
-	}
-}
+//////////////////////////////////////////////////////////////////////////////
+// class XFillBitmapItem
 
-/*************************************************************************
-|*
-|*    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;
+IMPL_POOLITEM_FACTORY(XFillBitmapItem)
 
-	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
-// -----------------------
-
-IMPL_POOLITEM_FACTORY(XFillBitmapItem)
-
-/*************************************************************************
-|*
-|*    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;
 }
 
+//////////////////////////////////////////////////////////////////////////////
 
-/*************************************************************************
-|*
-|*    sal_uInt16 XFillBitmapItem::GetVersion() const
-|*
-|*    Beschreibung
-|*    Ersterstellung    26.07.95
-|*    Letzte Aenderung  26.07.95
-|*
-*************************************************************************/
+void XFillBitmapItem::SetGraphicObject(const GraphicObject& rGraphicObject)
+{
+    maGraphicObject = rGraphicObject;
+}
+
+//////////////////////////////////////////////////////////////////////////////
 
-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();
@@ -711,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
@@ -738,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 )
@@ -777,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;
@@ -827,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 )
@@ -883,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/branches/alg/aw080/main/svx/source/xoutdev/xpool.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xpool.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xpool.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xpool.cxx Wed May 16 15:07:00 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/branches/alg/aw080/main/svx/source/xoutdev/xtabbtmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xtabbtmp.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xtabbtmp.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/xoutdev/xtabbtmp.cxx Wed May 16 15:07:00 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/branches/alg/aw080/main/sw/inc/doc.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/inc/doc.hxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/inc/doc.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/inc/doc.hxx Wed May 16 15:07:00 2012
@@ -495,6 +495,10 @@ private:
     bool mbApplyWorkaroundForB6375613 : 1;
     // <--
 
+    // true: Document contains at least one anchored object, which is anchored AT_PAGE with a content position.
+    //       Thus, certain adjustment needed during formatting for these kind of anchored objects.
+    bool mbContainsAtPageObjWithContentAnchor : 1;
+
     //
     // COMPATIBILITY FLAGS START
     //
@@ -1038,6 +1042,15 @@ public:
     void SetXMLExport( bool bFlag )     { mbXMLExport = bFlag; }
 #endif
 
+    void SetContainsAtPageObjWithContentAnchor( const bool bFlag )
+    {
+        mbContainsAtPageObjWithContentAnchor = bFlag;
+    }
+    bool DoesContainAtPageObjWithContentAnchor()
+    {
+        return mbContainsAtPageObjWithContentAnchor;
+    }
+
 	// liefert zu allen fliegenden Rahmen die Position im Dokument.
 	// Wird ein Pam-Pointer uebergeben, muessen die absatzgebundenen
 	// FlyFrames von der ::com::sun::star::awt::Selection vollstaendig umschlossen sein

Modified: incubator/ooo/branches/alg/aw080/main/sw/inc/ndgrf.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/inc/ndgrf.hxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/inc/ndgrf.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/inc/ndgrf.hxx Wed May 16 15:07:00 2012
@@ -45,7 +45,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwN
 {
 	friend class SwNodes;
 
-	GraphicObject aGrfObj;
+	GraphicObject maGrfObj;
 	GraphicObject* mpReplacementGraphic;
     ::sfx2::SvBaseLinkRef refLink;       // falls Grafik nur als Link, dann Pointer gesetzt
 	Size nGrfSize;
@@ -89,7 +89,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwN
 
 	void InsertLink( const String& rGrfName, const String& rFltName );
 	sal_Bool ImportGraphic( SvStream& rStrm );
-	sal_Bool HasStreamName() const { return aGrfObj.HasUserData(); }
+	sal_Bool HasStreamName() const { return maGrfObj.HasUserData(); }
     // --> OD 2005-05-04 #i48434# - adjust return type and rename method to
     // indicate that its an private one.
     // --> OD 2005-08-17 #i53025#
@@ -144,20 +144,31 @@ class SW_DLLPUBLIC SwGrfNode: public SwN
 
 public:
 	virtual ~SwGrfNode();
-	const Graphic& 			GetGrf() const  	{ return aGrfObj.GetGraphic(); }
-	const GraphicObject&	GetGrfObj() const  	{ return aGrfObj; }
-		  GraphicObject&	GetGrfObj() 		{ return aGrfObj; }
+	const Graphic& 			GetGrf() const  	{ return maGrfObj.GetGraphic(); }
+	const GraphicObject&	GetGrfObj() const  	{ return maGrfObj; }
     const GraphicObject* GetReplacementGrfObj() const;
-
     virtual SwCntntNode *SplitCntntNode( const SwPosition & );
 
-	virtual Size GetTwipSize() const;
+    /// isolated only way to set GraphicObject to allow more actions when doing so
+    void SetGraphic(const Graphic& rGraphic, const String& rLink);
+
+    /// wrappers for non-const calls at GraphicObject
+    void ReleaseGraphicFromCache() { maGrfObj.ReleaseFromCache(); }
+    void DrawGraphicWithPDFHandling(OutputDevice& rOutDev, const Point& rPt, const Size& rSz, const GraphicAttr* pGrfAttr = NULL, const sal_uLong nFlags = GRFMGR_DRAW_STANDARD) { maGrfObj.DrawWithPDFHandling(rOutDev, rPt, rSz, pGrfAttr, nFlags); }
+    void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0, const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD, OutputDevice* pFirstFrameOutDev = NULL) { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pAttr, nFlags, pFirstFrameOutDev); }
+    void StopGraphicAnimation(OutputDevice* pOut = NULL, long nExtraData = 0) { maGrfObj.StopAnimation(pOut, nExtraData); }
+
+    /// allow reaction on change of content of GraphicObject, so always call
+    /// when GraphicObject content changes
+    void onGraphicChanged();
+
+    virtual Size GetTwipSize() const;
 #ifndef _FESHVIEW_ONLY_INLINE_NEEDED
 	void SetTwipSize( const Size& rSz );
 
 	sal_Bool IsTransparent() const;
 
-	inline sal_Bool IsAnimated() const				{ return aGrfObj.IsAnimated(); }
+	inline sal_Bool IsAnimated() const				{ return maGrfObj.IsAnimated(); }
 
 	inline sal_Bool IsChgTwipSize() const			{ return bChgTwipSize; }
 	inline sal_Bool IsChgTwipSizeFromPixel() const	{ return bChgTwipSizeFromPixel; }
@@ -187,7 +198,7 @@ public:
 		// Entfernen der Grafik, um Speicher freizugeben
 	short SwapOut();
 		// Zugriff auf den Storage-Streamnamen
-	void SetStreamName( const String& r ) { aGrfObj.SetUserData( r ); }
+	void SetStreamName( const String& r ) { maGrfObj.SetUserData( r ); }
 	void SetNewStreamName( const String& r ) { aNewStrmName = r; }
 	// is this node selected by any shell?
 	sal_Bool IsSelected() const;

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/crsr/findtxt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/crsr/findtxt.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/crsr/findtxt.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/crsr/findtxt.cxx Wed May 16 15:07:00 2012
@@ -676,36 +676,17 @@ String *ReplaceBackReferences( const Sea
         if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( sal_False ) )
         {
             utl::TextSearch aSTxt( rSearchOpt );
-            String aStr( pPam->GetTxt() );
-            String aSearchStr( rSearchOpt.searchString );
-            String aReplaceStr( rSearchOpt.replaceString );
- 			aStr.EraseAllChars( CH_TXTATR_BREAKWORD );
- 			aStr.EraseAllChars( CH_TXTATR_INWORD );
-            xub_StrLen nStart = 0;
-            String sX( 'x' );
-            if( pPam->Start()->nContent > 0 )
-            {
-                aStr.Insert( sX, 0 );
-                ++nStart;
-            }
-            xub_StrLen nEnd = aStr.Len();
-            bool bDeleteLastX = false;
-            if( pPam->End()->nContent < (static_cast<const SwTxtNode*>(pTxtNode))->GetTxt().Len() )
-            {
-                aStr.Insert( sX );
-                bDeleteLastX = true;
-            }
+            const String& rStr = static_cast<const SwTxtNode*>(pTxtNode)->GetTxt();
+			xub_StrLen nStart = pPam->Start()->nContent.GetIndex();
+			xub_StrLen nEnd = pPam->End()->nContent.GetIndex();
             SearchResult aResult;
-            if( aSTxt.SearchFrwrd( aStr, &nStart, &nEnd, &aResult ) )
+            if( aSTxt.SearchFrwrd( rStr, &nStart, &nEnd, &aResult ) )
             {
-                if( bDeleteLastX )
-                    aStr.Erase( aStr.Len() - 1 );
-                aSTxt.ReplaceBackReferences( aReplaceStr, aStr, aResult );
+                String aReplaceStr( rSearchOpt.replaceString );
+                aSTxt.ReplaceBackReferences( aReplaceStr, rStr, aResult );
                 pRet = new String( aReplaceStr );
             }
         }
     }
     return pRet;
 }
-
-

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doc.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doc.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doc.cxx Wed May 16 15:07:00 2012
@@ -976,11 +976,14 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM 
 {
 	if( !pFrmFmt )
 		pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC );
-	return _InsNoTxtNode( *rRg.GetPoint(), GetNodes().MakeGrfNode(
+    SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode(
 							SwNodeIndex( GetNodes().GetEndOfAutotext() ),
 							rGrfName, rFltName, pGraphic,
-							pDfltGrfFmtColl ),
+							pDfltGrfFmtColl );
+    SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode,
 							pFlyAttrSet, pGrfAttrSet, pFrmFmt );
+    pSwGrfNode->onGraphicChanged();
+    return pSwFlyFrmFmt;
 }
 SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj,
 							const SfxItemSet* pFlyAttrSet,
@@ -989,10 +992,13 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM 
 {
 	if( !pFrmFmt )
 		pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC );
-	return _InsNoTxtNode( *rRg.GetPoint(), GetNodes().MakeGrfNode(
+    SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode(
 							SwNodeIndex( GetNodes().GetEndOfAutotext() ),
-							rGrfObj, pDfltGrfFmtColl ),
+							rGrfObj, pDfltGrfFmtColl );
+	SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode,
 							pFlyAttrSet, pGrfAttrSet, pFrmFmt );
+    pSwGrfNode->onGraphicChanged();
+    return pSwFlyFrmFmt;
 }
 
 SwFlyFrmFmt* SwDoc::Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj,

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doclay.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doclay.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doclay.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/doclay.cxx Wed May 16 15:07:00 2012
@@ -2147,7 +2147,7 @@ void SwDoc::SetAllUniqueFlyNames()
 		n = 255;
 	SwSpzFrmFmts aArr( (sal_Int8)n, 10 );
 	SwFrmFmtPtr pFlyFmt;
-	sal_Bool bLoadedFlag = sal_True;			// noch etwas fuers Layout
+	bool bContainsAtPageObjWithContentAnchor = false;
 
 	for( n = GetSpzFrmFmts()->Count(); n; )
 	{
@@ -2173,22 +2173,17 @@ void SwDoc::SetAllUniqueFlyNames()
 				aArr.Insert( pFlyFmt, aArr.Count() );
 
 		}
-		if( bLoadedFlag )
+		if ( !bContainsAtPageObjWithContentAnchor )
 		{
 			const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor();
-            if (((FLY_AT_PAGE == rAnchor.GetAnchorId()) &&
-                 rAnchor.GetCntntAnchor()) ||
-				// oder werden DrawObjecte rel. zu irgendetwas ausgerichtet?
-				( RES_DRAWFRMFMT == pFlyFmt->Which() && (
-					SFX_ITEM_SET == pFlyFmt->GetItemState(
-										RES_VERT_ORIENT )||
-					SFX_ITEM_SET == pFlyFmt->GetItemState(
-										RES_HORI_ORIENT ))) )
+            if ( (FLY_AT_PAGE == rAnchor.GetAnchorId()) &&
+                 rAnchor.GetCntntAnchor() )
             {
-				bLoadedFlag = sal_False;
+				bContainsAtPageObjWithContentAnchor = true;
             }
 		}
 	}
+    SetContainsAtPageObjWithContentAnchor( bContainsAtPageObjWithContentAnchor );
 
 	const SwNodeIndex* pIdx;
 
@@ -2235,11 +2230,6 @@ void SwDoc::SetAllUniqueFlyNames()
             GetFtnIdxs().UpdateFtn( aTmp );
         }
     }
-
-	// neues Document und keine seitengebundenen Rahmen/DrawObjecte gefunden,
-	// die an einem Node verankert sind.
-	if( bLoadedFlag )
-		SetLoaded( sal_True );
 }
 
 sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/docnew.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/docnew.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/docnew.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/docnew.cxx Wed May 16 15:07:00 2012
@@ -292,6 +292,7 @@ SwDoc::SwDoc()
     mbLinksUpdated( sal_False ),
     mbClipBoard( false ),
     mbColumnSelection( false ),
+    mbContainsAtPageObjWithContentAnchor( false ),
     // i#78591#
 	mbProtectForm(false),
     mbLastBrowseMode( false ),

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/notxtfrm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/notxtfrm.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/notxtfrm.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/doc/notxtfrm.cxx Wed May 16 15:07:00 2012
@@ -653,7 +653,7 @@ sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosit
 }
 
 #define CLEARCACHE( pNd ) {\
-	(pNd)->GetGrfObj().ReleaseFromCache();\
+	(pNd)->ReleaseGraphicFromCache();\
 	SwFlyFrm* pFly = FindFlyFrm();\
 	if( pFly && pFly->GetFmt()->GetSurround().IsContour() )\
 	{\
@@ -948,7 +948,7 @@ void SwNoTxtFrm::PaintPicture( OutputDev
     if( pGrfNd )
 	{
 		sal_Bool bForceSwap = sal_False, bContinue = sal_True;
-		GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
+		const GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
 
 		GraphicAttr aGrfAttr;
 		pGrfNd->GetGraphicAttr( aGrfAttr, this );
@@ -991,9 +991,9 @@ void SwNoTxtFrm::PaintPicture( OutputDev
             else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(),
                                     aAlignedGrfArea.SSize(), &aGrfAttr ))
 			{
-                rGrfObj.DrawWithPDFHandling( *pOut,
-                                             aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
-                                             &aGrfAttr );
+                pGrfNd->DrawGraphicWithPDFHandling(*pOut,
+                    aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
+                    &aGrfAttr );
 				bContinue = sal_False;
 			}
 		}
@@ -1026,7 +1026,7 @@ void SwNoTxtFrm::PaintPicture( OutputDev
                             pShell->GetViewOptions()->IsPDFExport(),
                             "pOut sollte kein virtuelles Device sein" );
 
-                    rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(),
+                    pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(),
                                         aAlignedGrfArea.SSize(), long(this),
 										0, GRFMGR_DRAW_STANDARD, pVout );
 				}
@@ -1059,7 +1059,7 @@ void SwNoTxtFrm::PaintPicture( OutputDev
                     if(!bDone)
                     {
                         // fallback paint, uses replacement image
-                        rGrfObj.DrawWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr);
+                        pGrfNd->DrawGraphicWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr);
                     }
                 }
 			}
@@ -1228,9 +1228,12 @@ sal_Bool SwNoTxtFrm::IsTransparent() con
 void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
 {
 	//animierte Grafiken anhalten
-	SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode();
-	if( pGrfNd && pGrfNd->IsAnimated() )
-		pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) );
+	const SwGrfNode* pGrfNd = dynamic_cast< const SwGrfNode* >(GetNode()->GetGrfNode());
+
+    if( pGrfNd && pGrfNd->IsAnimated() )
+    {
+		const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, long(this) );
+    }
 }
 
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/docnode/swbaslnk.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/docnode/swbaslnk.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/docnode/swbaslnk.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/docnode/swbaslnk.cxx Wed May 16 15:07:00 2012
@@ -142,13 +142,15 @@ void SwBaseLink::DataChanged( const Stri
 
 	if( pCntntNode->IsGrfNode() )
 	{
-		GraphicObject& rGrfObj = ((SwGrfNode*)pCntntNode)->GetGrfObj();
+        SwGrfNode* pSwGrfNode = dynamic_cast< SwGrfNode* >(pCntntNode);
+        OSL_ENSURE(pSwGrfNode, "Error, pSwGrfNode expected when node answers IsGrfNode() with true (!)");
+		const GraphicObject& rGrfObj = pSwGrfNode->GetGrfObj();
 
-		bDontNotify = ((SwGrfNode*)pCntntNode)->IsFrameInPaint();
+		bDontNotify = pSwGrfNode->IsFrameInPaint();
 
 		bGraphicArrived = GetObj()->IsDataComplete();
 		bGraphicPieceArrived = GetObj()->IsPending();
-		((SwGrfNode*)pCntntNode)->SetGrafikArrived( bGraphicArrived );
+		pSwGrfNode->SetGrafikArrived( bGraphicArrived );
 
 		Graphic aGrf;
 		if( sfx2::LinkManager::GetGraphicFromAny( rMimeType, rValue, aGrf ) &&
@@ -156,7 +158,7 @@ void SwBaseLink::DataChanged( const Stri
 			  GRAPHIC_DEFAULT != rGrfObj.GetType() ) )
 		{
 			aGrfSz = ::GetGraphicSizeTwip( aGrf, 0 );
-			if( static_cast< const SwGrfNode * >( pCntntNode )->IsChgTwipSizeFromPixel() )
+			if( pSwGrfNode->IsChgTwipSizeFromPixel() )
 			{
 				const MapMode aMapTwip( MAP_TWIP );
 				aFrmFmtSz =
@@ -168,7 +170,7 @@ void SwBaseLink::DataChanged( const Stri
 			{
 				aFrmFmtSz = aGrfSz;
 			}
-			Size aSz( ((SwGrfNode*)pCntntNode)->GetTwipSize() );
+			Size aSz( pSwGrfNode->GetTwipSize() );
 
 			if( bGraphicPieceArrived && GRAPHIC_DEFAULT != aGrf.GetType() &&
 				( !aSz.Width() || !aSz.Height() ) )
@@ -181,7 +183,7 @@ void SwBaseLink::DataChanged( const Stri
 				bGraphicPieceArrived = sal_False;
 			}
 
-			rGrfObj.SetGraphic( aGrf, rGrfObj.GetLink() );
+            pSwGrfNode->SetGraphic(aGrf, rGrfObj.GetLink());
 			bUpdate = sal_True;
 
 			// Bug 33999: damit der Node den Transparent-Status
@@ -194,11 +196,11 @@ void SwBaseLink::DataChanged( const Stri
 				if( aGrfSz.Height() && aGrfSz.Width() &&
 					aSz.Height() && aSz.Width() &&
 					aGrfSz != aSz )
-					((SwGrfNode*)pCntntNode)->SetTwipSize( aGrfSz );
+					pSwGrfNode->SetTwipSize( aGrfSz );
 			}
 		}
 		if ( bUpdate && !bGraphicArrived && !bGraphicPieceArrived )
-			((SwGrfNode*)pCntntNode)->SetTwipSize( Size(0,0) );
+			pSwGrfNode->SetTwipSize( Size(0,0) );
 	}
 	else if( pCntntNode->IsOLENode() )
 		bUpdate = sal_True;

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx?rev=1339213&r1=1339212&r2=1339213&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx Wed May 16 15:07:00 2012
@@ -1551,11 +1551,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;
 }



Mime
View raw message