incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1338651 - in /incubator/ooo/trunk/main: drawinglayer/ drawinglayer/inc/drawinglayer/processor2d/ drawinglayer/source/processor2d/ svgio/source/svgreader/ svx/inc/svx/ svx/source/svdraw/ sw/inc/ sw/source/core/doc/ sw/source/core/docnode/ s...
Date Tue, 15 May 2012 11:16:24 GMT
Author: alg
Date: Tue May 15 11:16:23 2012
New Revision: 1338651

URL: http://svn.apache.org/viewvc?rev=1338651&view=rev
Log:
#118780# Moved ObjectInfoPrimitive2D extractor to drawinglayer, changed name to be the filename
only, added code to SW to set Title and Desc

Added:
    incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
  (with props)
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx   (with
props)
Modified:
    incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk
    incubator/ooo/trunk/main/drawinglayer/Package_inc.mk
    incubator/ooo/trunk/main/svgio/source/svgreader/svgnode.cxx
    incubator/ooo/trunk/main/svx/inc/svx/svdograf.hxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx
    incubator/ooo/trunk/main/sw/inc/ndgrf.hxx
    incubator/ooo/trunk/main/sw/source/core/doc/doc.cxx
    incubator/ooo/trunk/main/sw/source/core/doc/notxtfrm.cxx
    incubator/ooo/trunk/main/sw/source/core/docnode/swbaslnk.cxx
    incubator/ooo/trunk/main/sw/source/core/graphic/ndgrf.cxx
    incubator/ooo/trunk/main/sw/source/filter/rtf/rtffly.cxx

Modified: incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk (original)
+++ incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk Tue May 15 11:16:23 2012
@@ -168,6 +168,7 @@ $(eval $(call gb_Library_add_exception_o
 	drawinglayer/source/processor2d/canvasprocessor \
 	drawinglayer/source/processor2d/hittestprocessor2d \
 	drawinglayer/source/processor2d/textaspolygonextractor2d \
+	drawinglayer/source/processor2d/objectinfoextractor2d \
 	drawinglayer/source/processor3d/baseprocessor3d \
 	drawinglayer/source/processor3d/cutfindprocessor3d \
 	drawinglayer/source/processor3d/defaultprocessor3d \

Modified: incubator/ooo/trunk/main/drawinglayer/Package_inc.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/Package_inc.mk?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/Package_inc.mk (original)
+++ incubator/ooo/trunk/main/drawinglayer/Package_inc.mk Tue May 15 11:16:23 2012
@@ -109,6 +109,7 @@ $(eval $(call gb_Package_add_file,drawin
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/linegeometryextractor2d.hxx,drawinglayer/processor2d/linegeometryextractor2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/hittestprocessor2d.hxx,drawinglayer/processor2d/hittestprocessor2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx,drawinglayer/processor2d/textaspolygonextractor2d.hxx))
+$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/objectinfoextractor2d.hxx,drawinglayer/processor2d/objectinfoextractor2d.hxx))
 
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/baseprocessor3d.hxx,drawinglayer/processor3d/baseprocessor3d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/cutfindprocessor3d.hxx,drawinglayer/processor3d/cutfindprocessor3d.hxx))

Added: incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx?rev=1338651&view=auto
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
(added)
+++ incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
Tue May 15 11:16:23 2012
@@ -0,0 +1,65 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer { namespace primitive2d { class ObjectInfoPrimitive2D; }}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+	namespace processor2d
+	{
+        /** ObjectInfoPrimitiveExtractor2D class
+
+            A processor to find the first incarnation of ObjectInfoPrimitive2D
+            in a given hierarchy
+         */
+		class DRAWINGLAYER_DLLPUBLIC ObjectInfoPrimitiveExtractor2D : public BaseProcessor2D
+		{
+		private:
+            /// the target
+            const primitive2d::ObjectInfoPrimitive2D*      mpFound;
+
+			/// tooling methods
+			void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+		public:
+			ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+			virtual ~ObjectInfoPrimitiveExtractor2D();
+		
+            const primitive2d::ObjectInfoPrimitive2D* getResult() const { return mpFound;
}
+		};
+	} // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+
+// eof

Propchange: incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx?rev=1338651&view=auto
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx (added)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx Tue
May 15 11:16:23 2012
@@ -0,0 +1,75 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+	namespace processor2d
+	{
+        void ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D&
rCandidate)
+        {
+            if(!mpFound)
+            {
+			    switch(rCandidate.getPrimitive2DID())
+			    {
+				    case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D :
+                    {
+                        mpFound = dynamic_cast< const primitive2d::ObjectInfoPrimitive2D*
>(&rCandidate);
+                        break;
+                    }
+				    default :
+				    {
+					    // process recursively
+					    process(rCandidate.get2DDecomposition(getViewInformation2D()));
+					    break;
+				    }
+			    }
+            }
+        }
+
+		ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D&
rViewInformation)
+        :   BaseProcessor2D(rViewInformation),
+            mpFound(0)
+        {
+        }
+
+		ObjectInfoPrimitiveExtractor2D::~ObjectInfoPrimitiveExtractor2D()
+        {
+        }
+	} // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof

Propchange: incubator/ooo/trunk/main/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/ooo/trunk/main/svgio/source/svgreader/svgnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svgio/source/svgreader/svgnode.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svgio/source/svgreader/svgnode.cxx (original)
+++ incubator/ooo/trunk/main/svgio/source/svgreader/svgnode.cxx Tue May 15 11:16:23 2012
@@ -28,6 +28,7 @@
 #include <svgio/svgreader/svgnode.hxx>
 #include <svgio/svgreader/svgstyleattributes.hxx>
 #include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+#include <tools/urlobj.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -210,6 +211,16 @@ namespace svgio
                             if(SVGTokenSvg == getType())
                             {
                                 aObjectName = getDocument().getAbsolutePath();
+
+                                if(aObjectName.getLength())
+                                {
+                            		INetURLObject aURL(aObjectName);
+
+                                    aObjectName = aURL.getName(
+                                        INetURLObject::LAST_SEGMENT,
+                                        true,
+                                        INetURLObject::DECODE_WITH_CHARSET);
+                                }
                             }
 
                             // pack in ObjectInfoPrimitive2D group

Modified: incubator/ooo/trunk/main/svx/inc/svx/svdograf.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/inc/svx/svdograf.hxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/inc/svx/svdograf.hxx (original)
+++ incubator/ooo/trunk/main/svx/inc/svx/svdograf.hxx Tue May 15 11:16:23 2012
@@ -120,6 +120,7 @@ protected:
 	sal_Bool				ImpUpdateGraphicLink( sal_Bool bAsynchron = sal_True ) const;
 	void					ImpSetLinkedGraphic( const Graphic& rGraphic );
 							DECL_LINK( ImpSwapHdl, GraphicObject* );
+    void onGraphicChanged();
 
 public:
 

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx Tue May 15 11:16:23 2012
@@ -67,6 +67,8 @@
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <osl/thread.hxx>
 #include <vos/mutex.hxx>
+#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::io;
@@ -309,6 +311,58 @@ sdr::contact::ViewContact* SdrGrafObj::C
 }
 
 //////////////////////////////////////////////////////////////////////////////
+// check if SVG and if try to get ObjectInfoPrimitive2D and extract info
+
+void SdrGrafObj::onGraphicChanged()
+{
+    String aName;
+    String aTitle;
+    String aDesc;
+
+    if(pGraphic)
+    {
+        const SvgDataPtr& rSvgDataPtr = pGraphic->GetGraphic().getSvgData();
+
+        if(rSvgDataPtr.get())
+        {
+            const drawinglayer::primitive2d::Primitive2DSequence aSequence(rSvgDataPtr->getPrimitive2DSequence());
+
+            if(aSequence.hasElements())
+            {
+                drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+                drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D);
+
+                aProcessor.process(aSequence);
+
+                const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult();
+
+                if(pResult)
+                {
+                    aName = pResult->getName();
+			        aTitle = pResult->getTitle();
+			        aDesc = pResult->getDesc();
+                }
+            }
+        }
+    }
+
+    if(aName.Len())
+    {
+        SetName(aName);
+    }
+
+    if(aTitle.Len())
+    {
+    	SetTitle(aTitle);
+    }
+
+    if(aDesc.Len())
+    {
+    	SetDescription(aDesc);
+    }
+}
+
+//////////////////////////////////////////////////////////////////////////////
 
 TYPEINIT1(SdrGrafObj,SdrRectObj);
 
@@ -322,6 +376,7 @@ SdrGrafObj::SdrGrafObj()
 	pGraphic = new GraphicObject;
     mpReplacementGraphic = 0;
 	pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT
);
+    onGraphicChanged();
 	
     // #i118485# Shear allowed and possible now
     bNoShear = false;
@@ -348,6 +403,7 @@ SdrGrafObj::SdrGrafObj(const Graphic& rG
 	pGraphic = new GraphicObject( rGrf );
     mpReplacementGraphic = 0;
 	pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT
);
+    onGraphicChanged();
 
     // #i118485# Shear allowed and possible now
     bNoShear = false;
@@ -374,6 +430,7 @@ SdrGrafObj::SdrGrafObj( const Graphic& r
 	pGraphic = new GraphicObject( rGrf );
     mpReplacementGraphic = 0;
 	pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT
);
+    onGraphicChanged();
 
     // #i118485# Shear allowed and possible now
     bNoShear = false;
@@ -411,6 +468,7 @@ void SdrGrafObj::SetGraphicObject( const
 	mbIsPreview = sal_False;
 	SetChanged();
 	BroadcastObjectChange();
+    onGraphicChanged();
 }
 
 // -----------------------------------------------------------------------------
@@ -449,6 +507,7 @@ void SdrGrafObj::NbcSetGraphic( const Gr
     mpReplacementGraphic = 0;
 	pGraphic->SetUserData();
 	mbIsPreview = sal_False;
+    onGraphicChanged();
 }
 
 void SdrGrafObj::SetGraphic( const Graphic& rGrf )

Modified: incubator/ooo/trunk/main/sw/inc/ndgrf.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/inc/ndgrf.hxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/inc/ndgrf.hxx (original)
+++ incubator/ooo/trunk/main/sw/inc/ndgrf.hxx Tue May 15 11:16:23 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/trunk/main/sw/source/core/doc/doc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/doc/doc.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/doc/doc.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/doc/doc.cxx Tue May 15 11:16:23 2012
@@ -975,11 +975,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,
@@ -988,10 +991,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/trunk/main/sw/source/core/doc/notxtfrm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/doc/notxtfrm.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/doc/notxtfrm.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/doc/notxtfrm.cxx Tue May 15 11:16:23 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;
 			}
 		}
@@ -1027,7 +1027,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 );
 				}
@@ -1060,7 +1060,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);
                     }
                 }
 			}
@@ -1221,9 +1221,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/trunk/main/sw/source/core/docnode/swbaslnk.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/docnode/swbaslnk.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/docnode/swbaslnk.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/docnode/swbaslnk.cxx Tue May 15 11:16:23 2012
@@ -144,13 +144,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 ) &&
@@ -158,7 +160,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 =
@@ -170,7 +172,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() ) )
@@ -183,7 +185,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
@@ -196,11 +198,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/trunk/main/sw/source/core/graphic/ndgrf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/graphic/ndgrf.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/graphic/ndgrf.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/graphic/ndgrf.cxx Tue May 15 11:16:23 2012
@@ -57,9 +57,10 @@
 #include <tools/link.hxx>
 #include <vcl/svapp.hxx>
 #include <com/sun/star/io/XSeekable.hpp>
-// --> OD 2007-03-28 #i73788#
 #include <retrieveinputstreamconsumer.hxx>
-// <--
+#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+
 
 using namespace com::sun::star;
 
@@ -73,14 +74,14 @@ SwGrfNode::SwGrfNode(
         SwGrfFmtColl *pGrfColl,
         SwAttrSet* pAutoAttr ) :
     SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
-    aGrfObj(),
+    maGrfObj(),
     mpReplacementGraphic(0),
     // --> OD 2007-01-23 #i73788#
     mbLinkedInputStreamReady( false ),
     mbIsStreamReadOnly( sal_False )
     // <--
 {
-	aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+	maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
 	bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
 		bFrameInPaint = bScaleImageMap = sal_False;
 
@@ -92,17 +93,17 @@ SwGrfNode::SwGrfNode( const SwNodeIndex 
 				  		const GraphicObject& rGrfObj,
                       SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) :
     SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
-	aGrfObj(rGrfObj),
+	maGrfObj(rGrfObj),
     mpReplacementGraphic(0),
     // --> OD 2007-01-23 #i73788#
     mbLinkedInputStreamReady( false ),
     mbIsStreamReadOnly( sal_False )
     // <--
 {
-	aGrfObj = rGrfObj;
-	aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+	maGrfObj = rGrfObj;
+	maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
 	if( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
-		aGrfObj.SetSwapState();
+		maGrfObj.SetSwapState();
 	bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
 		bFrameInPaint = bScaleImageMap = sal_False;
 	bGrafikArrived = sal_True;
@@ -117,17 +118,17 @@ SwGrfNode::SwGrfNode( const SwNodeIndex 
                       SwGrfFmtColl *pGrfColl,
                       SwAttrSet* pAutoAttr ) :
     SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
-    aGrfObj(),
+    maGrfObj(),
     mpReplacementGraphic(0),
     // --> OD 2007-01-23 #i73788#
     mbLinkedInputStreamReady( false ),
     mbIsStreamReadOnly( sal_False )
     // <--
 {
-	aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+	maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
 
 	Graphic aGrf; aGrf.SetDefaultType();
-	aGrfObj.SetGraphic( aGrf, rGrfName );
+	maGrfObj.SetGraphic( aGrf, rGrfName );
 
 	bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
 		bFrameInPaint = bScaleImageMap = sal_False;
@@ -196,15 +197,17 @@ sal_Bool SwGrfNode::ReRead(
 
 		if( pGraphic )
 		{
-			aGrfObj.SetGraphic( *pGraphic, rGrfName );
+			maGrfObj.SetGraphic( *pGraphic, rGrfName );
+            onGraphicChanged();
 			bReadGrf = sal_True;
 		}
 		else if( pGrfObj )
 		{
-			aGrfObj = *pGrfObj;
+			maGrfObj = *pGrfObj;
 			if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
-				aGrfObj.SetSwapState();
-			aGrfObj.SetLink( rGrfName );
+				maGrfObj.SetSwapState();
+			maGrfObj.SetLink( rGrfName );
+            onGraphicChanged();
 			bReadGrf = sal_True;
 		}
 		else
@@ -213,7 +216,7 @@ sal_Bool SwGrfNode::ReRead(
 			// die korrekte Ersatz-Darstellung erscheint, wenn die
 			// der neue Link nicht geladen werden konnte.
 			Graphic aGrf; aGrf.SetDefaultType();
-			aGrfObj.SetGraphic( aGrf, rGrfName );
+			maGrfObj.SetGraphic( aGrf, rGrfName );
 
 			if( refLink.Is() )
 			{
@@ -232,6 +235,7 @@ sal_Bool SwGrfNode::ReRead(
                     ((SwBaseLink*)&refLink)->SwapIn();
                 }
 			}
+            onGraphicChanged();
 			bSetTwipSize = sal_False;
 		}
 	}
@@ -241,7 +245,8 @@ sal_Bool SwGrfNode::ReRead(
 		if( HasStreamName() )
 			DelStreamName();
 
-		aGrfObj.SetGraphic( *pGraphic );
+		maGrfObj.SetGraphic( *pGraphic );
+        onGraphicChanged();
 		bReadGrf = sal_True;
 	}
 	else if( pGrfObj && !rGrfName.Len() )
@@ -250,14 +255,15 @@ sal_Bool SwGrfNode::ReRead(
 		if( HasStreamName() )
 			DelStreamName();
 
-		aGrfObj = *pGrfObj;
+		maGrfObj = *pGrfObj;
+        onGraphicChanged();
 		if( pGrfObj->HasUserData() && pGrfObj->IsSwappedOut() )
-			aGrfObj.SetSwapState();
+			maGrfObj.SetSwapState();
 		bReadGrf = sal_True;
 	}
 		// Import einer Grafik:
 		// Ist die Grafik bereits geladen?
-	else if( !bNewGrf && GRAPHIC_NONE != aGrfObj.GetType() )
+	else if( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() )
 		return sal_True;
 
 	else
@@ -272,15 +278,17 @@ sal_Bool SwGrfNode::ReRead(
 		{
 			if( pGraphic )
 			{
-				aGrfObj.SetGraphic( *pGraphic, rGrfName );
+				maGrfObj.SetGraphic( *pGraphic, rGrfName );
+                onGraphicChanged();
 				bReadGrf = sal_True;
 				// Verbindung herstellen ohne ein Update; Grafik haben wir!
 				((SwBaseLink*)&refLink)->Connect();
 			}
 			else if( pGrfObj )
 			{
-				aGrfObj = *pGrfObj;
-				aGrfObj.SetLink( rGrfName );
+				maGrfObj = *pGrfObj;
+				maGrfObj.SetLink( rGrfName );
+                onGraphicChanged();
 				bReadGrf = sal_True;
 				// Verbindung herstellen ohne ein Update; Grafik haben wir!
 				((SwBaseLink*)&refLink)->Connect();
@@ -291,7 +299,8 @@ sal_Bool SwGrfNode::ReRead(
 				// die korrekte Ersatz-Darstellung erscheint, wenn die
 				// der neue Kink nicht geladen werden konnte.
 				Graphic aGrf; aGrf.SetDefaultType();
-				aGrfObj.SetGraphic( aGrf, rGrfName );
+				maGrfObj.SetGraphic( aGrf, rGrfName );
+                onGraphicChanged();
                 // --> OD 2006-11-03 #i59688#
                 // do not load linked graphic, if it isn't a new linked graphic.
 //                //TODO refLink->setInputStream(getInputStream());
@@ -308,7 +317,7 @@ sal_Bool SwGrfNode::ReRead(
 	// Bug 39281: Size nicht sofort loeschen - Events auf ImageMaps
 	//			  sollten nicht beim Austauschen nicht ins "leere greifen"
 	if( bSetTwipSize )
-		SetTwipSize( ::GetGraphicSizeTwip( aGrfObj.GetGraphic(), 0 ) );
+		SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) );
 
 	// erzeuge noch einen Update auf die Frames
 	if( bReadGrf && bNewGrf )
@@ -358,6 +367,67 @@ SwGrfNode::~SwGrfNode()
 		DelFrms();
 }
 
+/// allow reaction on change of content of GraphicObject
+void SwGrfNode::onGraphicChanged()
+{
+    // try to access SwFlyFrmFmt; since title/desc/name are set there, there is no
+    // use to continue if it is not yet set. If not yet set, call onGraphicChanged()
+    // when it is set.
+    SwFlyFrmFmt* pFlyFmt = dynamic_cast< SwFlyFrmFmt* >(GetFlyFmt());
+
+    if(pFlyFmt)
+    {
+        String aName;
+        String aTitle;
+        String aDesc;
+        const SvgDataPtr& rSvgDataPtr = GetGrf().getSvgData();
+
+        if(rSvgDataPtr.get())
+        {
+            const drawinglayer::primitive2d::Primitive2DSequence aSequence(rSvgDataPtr->getPrimitive2DSequence());
+
+            if(aSequence.hasElements())
+            {
+                drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+                drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D aProcessor(aViewInformation2D);
+
+                aProcessor.process(aSequence);
+
+                const drawinglayer::primitive2d::ObjectInfoPrimitive2D* pResult = aProcessor.getResult();
+
+                if(pResult)
+                {
+                    aName = pResult->getName();
+			        aTitle = pResult->getTitle();
+			        aDesc = pResult->getDesc();
+                }
+            }
+        }
+
+        // do not use this currently; it seems that this name has to be unique in
+        // the writer model and is already set to some default
+        //if(aName.Len() && pFlyFmt)
+        //{
+        //    pFlyFmt->SetName(aName);
+        //}
+
+        if(aTitle.Len())
+        {
+    	    SetTitle(aTitle);
+        }
+
+        if(aDesc.Len())
+        {
+    	    SetDescription(aDesc);
+        }
+    }
+}
+
+void SwGrfNode::SetGraphic(const Graphic& rGraphic, const String& rLink) 
+{ 
+    maGrfObj.SetGraphic(rGraphic, rLink); 
+    onGraphicChanged();
+}
 
 const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
 {
@@ -420,15 +490,16 @@ Size SwGrfNode::GetTwipSize() const
 sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
 {
 	Graphic aGraphic;
-    const String aURL(aGrfObj.GetUserData());
+    const String aURL(maGrfObj.GetUserData());
 	
     if(!GraphicFilter::GetGraphicFilter()->ImportGraphic(aGraphic, aURL, rStrm))
 	{
         delete mpReplacementGraphic;
         mpReplacementGraphic = 0;
 		
-        aGrfObj.SetGraphic( aGraphic );
-		aGrfObj.SetUserData( aURL );
+        maGrfObj.SetGraphic( aGraphic );
+		maGrfObj.SetUserData( aURL );
+        onGraphicChanged();
 		return sal_True;
 	}
 
@@ -443,7 +514,7 @@ sal_Bool SwGrfNode::ImportGraphic( SvStr
 short SwGrfNode::SwapIn( sal_Bool bWaitForData )
 {
 	if( bInSwapIn )					// nicht rekuriv!!
-		return !aGrfObj.IsSwappedOut();
+		return !maGrfObj.IsSwappedOut();
 
 	short nRet = 0;
 	bInSwapIn = sal_True;
@@ -451,25 +522,26 @@ short SwGrfNode::SwapIn( sal_Bool bWaitF
 
 	if( pLink )
 	{
-		if( GRAPHIC_NONE == aGrfObj.GetType() ||
-			GRAPHIC_DEFAULT == aGrfObj.GetType() )
+		if( GRAPHIC_NONE == maGrfObj.GetType() ||
+			GRAPHIC_DEFAULT == maGrfObj.GetType() )
 		{
 			// noch nicht geladener Link
             //TODO pLink->setInputStream(getInputStream());
 			if( pLink->SwapIn( bWaitForData ) )
 				nRet = -1;
-			else if( GRAPHIC_DEFAULT == aGrfObj.GetType() )
+			else if( GRAPHIC_DEFAULT == maGrfObj.GetType() )
 			{
 				// keine default Bitmap mehr, also neu Painten!
                 delete mpReplacementGraphic;
                 mpReplacementGraphic = 0;
 
-				aGrfObj.SetGraphic( Graphic() );
+				maGrfObj.SetGraphic( Graphic() );
+                onGraphicChanged();
 				SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
 				ModifyNotification( &aMsgHint, &aMsgHint );
 			}
 		}
-		else if( aGrfObj.IsSwappedOut() ) {
+		else if( maGrfObj.IsSwappedOut() ) {
 			// nachzuladender Link
             //TODO pLink->setInputStream(getInputStream());
             nRet = pLink->SwapIn( bWaitForData ) ? 1 : 0;
@@ -477,11 +549,11 @@ short SwGrfNode::SwapIn( sal_Bool bWaitF
 		else
 			nRet = 1;
 	}
-	else if( aGrfObj.IsSwappedOut() )
+	else if( maGrfObj.IsSwappedOut() )
 	{
 		// Die Grafik ist im Storage oder im TempFile drin
 		if( !HasStreamName() )
-			nRet = (short)aGrfObj.SwapIn();
+			nRet = (short)maGrfObj.SwapIn();
 		else
 		{
 
@@ -526,7 +598,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitF
 	if( nRet )
 	{
 		if( !nGrfSize.Width() && !nGrfSize.Height() )
-			SetTwipSize( ::GetGraphicSizeTwip( aGrfObj.GetGraphic(), 0 ) );
+			SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) );
 	}
 	bInSwapIn = sal_False;
 	return nRet;
@@ -535,9 +607,9 @@ short SwGrfNode::SwapIn( sal_Bool bWaitF
 
 short SwGrfNode::SwapOut()
 {
-	if( aGrfObj.GetType() != GRAPHIC_DEFAULT &&
-		aGrfObj.GetType() != GRAPHIC_NONE &&
-		!aGrfObj.IsSwappedOut() && !bInSwapIn )
+	if( maGrfObj.GetType() != GRAPHIC_DEFAULT &&
+		maGrfObj.GetType() != GRAPHIC_NONE &&
+		!maGrfObj.IsSwappedOut() && !bInSwapIn )
 	{
 		if( !refLink.Is() )
 		{
@@ -546,11 +618,11 @@ short SwGrfNode::SwapOut()
 			// sie frisch eingefuegt war, d.h. wenn es noch keinen
 			// Streamnamen im Storage gibt.
 			if( !HasStreamName() )
-				if( !aGrfObj.SwapOut() )
+				if( !maGrfObj.SwapOut() )
 					return 0;
 		}
 		// Geschriebene Grafiken oder Links werden jetzt weggeschmissen
-		return (short) aGrfObj.SwapOut( NULL );
+		return (short) maGrfObj.SwapOut( NULL );
 	}
 	return 1;
 }
@@ -661,7 +733,7 @@ void SwGrfNode::InsertLink( const String
 								(!bSync && rFltName.Len() ? &rFltName : 0) );
 		}
 	}
-	aGrfObj.SetLink( rGrfName );
+	maGrfObj.SetLink( rGrfName );
 }
 
 
@@ -680,7 +752,7 @@ void SwGrfNode::ReleaseLink()
 		}
         getIDocumentLinksAdministration()->GetLinkManager().Remove( refLink );
 		refLink.Clear();
-		aGrfObj.SetLink();
+		maGrfObj.SetLink();
 	}
 }
 
@@ -787,7 +859,7 @@ void SwGrfNode::DelStreamName()
             }
 		}
 
-		aGrfObj.SetUserData();
+		maGrfObj.SetUserData();
 	}
 }
 
@@ -882,7 +954,7 @@ void SwGrfNode::_GetStreamStorageNames( 
 	rStorName.Erase();
 	rStrmName.Erase();
 
-	String aUserData( aGrfObj.GetUserData() );
+	String aUserData( maGrfObj.GetUserData() );
 	if( !aUserData.Len() )
         return;
 
@@ -936,7 +1008,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc*
             SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
             if ( pStrm )
             {
-                const String aURL(aGrfObj.GetUserData());
+                const String aURL(maGrfObj.GetUserData());
                 GraphicFilter::GetGraphicFilter()->ImportGraphic(aTmpGrf, aURL, *pStrm);
                 delete pStrm;
             }
@@ -952,9 +1024,9 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc*
 	}
 	else
 	{
-		if( aGrfObj.IsSwappedOut() )
+		if( maGrfObj.IsSwappedOut() )
             const_cast<SwGrfNode*>(this)->SwapIn();
-		aTmpGrf = aGrfObj.GetGraphic();
+		aTmpGrf = maGrfObj.GetGraphic();
 	}
 
     const sfx2::LinkManager& rMgr = getIDocumentLinksAdministration()->GetLinkManager();
@@ -1069,7 +1141,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc 
 				pLnk->ISA( SwBaseLink ) && 0 != ( pGrfNd =
 				((SwBaseLink*)pLnk)->GetCntntNode()->GetGrfNode()) )
 			{
-				pGrfNd->GetGrfObj().ReleaseFromCache();
+				pGrfNd->ReleaseGraphicFromCache();
 			}
 		}
 	}
@@ -1133,7 +1205,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( 
 
 sal_Bool SwGrfNode::IsTransparent() const
 {
-	sal_Bool bRet = aGrfObj.IsTransparent();
+	sal_Bool bRet = maGrfObj.IsTransparent();
 	if( !bRet )	// ask the attribut
 		bRet = 0 != GetSwAttrSet().GetTransparencyGrf().GetValue();
 

Modified: incubator/ooo/trunk/main/sw/source/filter/rtf/rtffly.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/rtf/rtffly.cxx?rev=1338651&r1=1338650&r2=1338651&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/rtf/rtffly.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/rtf/rtffly.cxx Tue May 15 11:16:23 2012
@@ -1269,6 +1269,8 @@ void SwRTFParser::InsPicture( const Stri
 			if( pFlySave->nEndNd == rIdx )
 				pFlySave->nEndNd = rIdx.GetIndex() - 1;
 		}
+
+        pGrfNd->onGraphicChanged();
 	}
 	else
 	{



Mime
View raw message