[ooo-build-commit] .: patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Wed Apr 21 06:10:28 PDT 2010


 patches/dev300/apply                           |    3 
 patches/dev300/oox-fix-placeholder-layout.diff |  137 +++++++++++--------------
 2 files changed, 66 insertions(+), 74 deletions(-)

New commits:
commit 52c972eb931facd2b8cba07c2e907ba92277c2bc
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Apr 21 15:08:33 2010 +0200

    updated oox-fix-placeholder-layout.diff to m15
    
    * patches/dev300/apply:
    * patches/dev300/oox-fix-placeholder-layout.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 8927c7a..db67d31 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2324,8 +2324,7 @@ buildfix-oox-depends-on-unotools.diff
 [ OOXML < ooo320-m15 ]
 oox-fix-placeholder-layout-m14.diff, n#485316, n#480223, rodo
 [ OOXML >= ooo320-m15 ]
-# FIXME_ 2010-04-20: need port to ooo320-m15, --pmladek
-#oox-fix-placeholder-layout.diff, n#485316, n#480223, rodo
+oox-fix-placeholder-layout.diff, n#485316, n#480223, rodo
 
 [ OOXML < ooo320-m15 ]
 oox-fix-list-style-apply-m14.diff, n#485417, rodo
diff --git a/patches/dev300/oox-fix-placeholder-layout.diff b/patches/dev300/oox-fix-placeholder-layout.diff
index ea4847b..6f8239e 100644
--- a/patches/dev300/oox-fix-placeholder-layout.diff
+++ b/patches/dev300/oox-fix-placeholder-layout.diff
@@ -1,21 +1,19 @@
-diff --git oox/inc/oox/drawingml/shape.hxx oox/inc/oox/drawingml/shape.hxx
-index 5a7e7e5..5405d9d 100644
---- oox/inc/oox/drawingml/shape.hxx
-+++ oox/inc/oox/drawingml/shape.hxx
-@@ -112,6 +112,7 @@ public:
+diff -wrup ../ooo320-m15-orig/oox/inc/oox/drawingml/shape.hxx oox/inc/oox/drawingml/shape.hxx
+--- ../ooo320-m15-orig/oox/inc/oox/drawingml/shape.hxx	2010-04-21 15:01:17.000000000 +0200
++++ oox/inc/oox/drawingml/shape.hxx	2010-04-21 14:53:39.000000000 +0200
+@@ -138,6 +138,7 @@ public:
      sal_Int32                       getSubType() const { return mnSubType; }
      void                            setSubTypeIndex( sal_uInt32 nSubTypeIndex ) { mnSubTypeIndex = nSubTypeIndex; }
      sal_Int32						getSubTypeIndex() const { return mnSubTypeIndex; }
-+    sal_Int32                       getIndex() { return mnIndex; }
++    sal_Int32                       getSubTypeIndex() { return mnSubTypeIndex; }
  
      // setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
      void                            setDefaults();
-diff --git oox/source/ppt/pptshapecontext.cxx oox/source/ppt/pptshapecontext.cxx
-index f87d03d..5acf932 100644
---- oox/source/ppt/pptshapecontext.cxx
-+++ oox/source/ppt/pptshapecontext.cxx
-@@ -85,6 +85,26 @@ oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, st
- 	return aShapePtr;
+diff -wrup ../ooo320-m15-orig/oox/source/ppt/pptshapecontext.cxx oox/source/ppt/pptshapecontext.cxx
+--- ../ooo320-m15-orig/oox/source/ppt/pptshapecontext.cxx	2010-04-21 15:00:58.000000000 +0200
++++ oox/source/ppt/pptshapecontext.cxx	2010-04-21 14:53:58.000000000 +0200
+@@ -86,6 +86,26 @@ oox::drawingml::ShapePtr findPlaceholder
+     return aShapePtr;
  }
  
 +oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes )
@@ -24,7 +22,7 @@ index f87d03d..5acf932 100644
 +	std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
 +	while( aRevIter != rShapes.rend() )
 +	{
-+		if ( (*aRevIter)->getIndex() == nIdx )
++		if ( (*aRevIter)->getSubTypeIndex() == nIdx )
 +		{
 +			aShapePtr = *aRevIter;
 +			break;
@@ -41,65 +39,60 @@ index f87d03d..5acf932 100644
  // if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
  oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder,
      sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
-@@ -109,14 +129,27 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
- 	{
- 		sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
- 		mpShapePtr->setSubType( nSubType );
--		mpShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
--		if ( nSubType )
-+		OUString sIdx( xAttribs->getOptionalValue( XML_idx ) );
-+		sal_Bool bHasIdx = sIdx.getLength() > 0;
-+		sal_Int32 nIdx = sIdx.toInt32();
-+		mpShapePtr->setIndex( nIdx );
+@@ -111,14 +131,27 @@ Reference< XFastContextHandler > PPTShap
+     {
+         sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
+         mpShapePtr->setSubType( nSubType );
+-        mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+-        if ( nSubType )
++	OUString sIdx( xAttribs->getOptionalValue( XML_idx ) );
++	sal_Bool bHasIdx = sIdx.getLength() > 0;
++	sal_Int32 nIdx = sIdx.toInt32();
++	mpShapePtr->setSubTypeIndex( nIdx );
 +
-+		if ( nSubType || bHasIdx )
- 		{
- 			PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
- 			if ( pPPTShapePtr )
- 			{
- 				oox::ppt::ShapeLocation eShapeLocation = pPPTShapePtr->getShapeLocation();
--				if ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) )
-+				oox::drawingml::ShapePtr pPlaceholder;
++	if ( nSubType || bHasIdx )
+         {
+             PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
+             if ( pPPTShapePtr )
+             {
+                 oox::ppt::ShapeLocation eShapeLocation = pPPTShapePtr->getShapeLocation();
+-                if ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) )
++		oox::drawingml::ShapePtr pPlaceholder;
 +
-+				if ( bHasIdx && eShapeLocation == Slide )
-+				{
-+				    // TODO: use id to shape map
-+				    SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
-+				    if ( pMasterPersist.get() )
-+					pPlaceholder = findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
-+				}
-+				if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
- 				{
- 					// inheriting properties from placeholder objects by cloning shape
++		if ( bHasIdx && eShapeLocation == Slide )
++		{
++		    // TODO: use id to shape map
++		  SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
++		  if ( pMasterPersist.get() )
++		      pPlaceholder = findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
++		}
++		if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
+                 {
+                     // inheriting properties from placeholder objects by cloning shape
  
-@@ -154,7 +187,6 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
- 					}
- 					if ( nFirstPlaceholder )
- 					{
--						oox::drawingml::ShapePtr pPlaceholder;
- 						if ( eShapeLocation == Layout )		// for layout objects the referenced object can be found within the same shape tree
-                             pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, mpSlidePersistPtr->getShapes()->getChildren() );
- 						else if ( eShapeLocation == Slide )	// normal slide shapes have to search within the corresponding master tree for referenced objects
-@@ -163,15 +195,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
- 							if ( pMasterPersist.get() )
-                                 pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pMasterPersist->getShapes()->getChildren() );
- 						}
--						if ( pPlaceholder.get() )
--						{
--							mpShapePtr->applyShapeReference( *pPlaceholder.get() );
--							PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
--							if ( pPPTShape )
--								pPPTShape->setReferenced( sal_True );
--						}
- 					}
- 				}
-+				if ( pPlaceholder.get() )
-+				{
-+				    mpShapePtr->applyShapeReference( *pPlaceholder.get() );
-+				    PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
-+				    if ( pPPTShape )
-+					pPPTShape->setReferenced( sal_True );
-+				}
- 			}
- 		}
- 		break;
+@@ -157,7 +190,6 @@ Reference< XFastContextHandler > PPTShap
+                     }
+                     if ( nFirstPlaceholder )
+                     {
+-                        oox::drawingml::ShapePtr pPlaceholder;
+                         if ( eShapeLocation == Layout )		// for layout objects the referenced object can be found within the same shape tree
+                             pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, -1, mpSlidePersistPtr->getShapes()->getChildren() );
+                         else if ( eShapeLocation == Slide )	// normal slide shapes have to search within the corresponding master tree for referenced objects
+@@ -167,15 +199,14 @@ Reference< XFastContextHandler > PPTShap
+                                 pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder,
+                                     pPPTShapePtr->getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() );
+                         }
++                    }
++                }
+                         if ( pPlaceholder.get() )
+                         {
+                             mpShapePtr->applyShapeReference( *pPlaceholder.get() );
+                             PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
+                             if ( pPPTShape )
+                                 pPPTShape->setReferenced( sal_True );
+-				    pPPTShapePtr->setPlaceholder( pPlaceholder );
+-                        }
+-                    }
+                 }
+             }
+         }


More information about the ooo-build-commit mailing list