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

Radek Doulík rodo at kemper.freedesktop.org
Thu Apr 22 02:06:46 PDT 2010


 patches/dev300/apply                                           |    3 
 patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff |  170 +++++-----
 2 files changed, 90 insertions(+), 83 deletions(-)

New commits:
commit 90efa597cc544d104ff8ea5bf95cec07c1052292
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Apr 22 11:04:09 2010 +0200

    updated oox-pptx-import-fix-placeholder-text-style.diff to m15
    
    * patches/dev300/apply:
    * patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index c87518b..f0a0dbb 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3518,8 +3518,7 @@ fontconfig-cache-pre-substitution.diff, n#529532, kohei
 oox-pptx-import-fix-placeholder-text-style-m14.diff, n#479834, rodo
 oox-pptx-import-fix-text-body-properties-priority-m14.diff, n#403402, rodo
 [ OOXML >= ooo320-m15 ]
-# FIXME_ 2010-04-20: big part is applied in ooo320-m15, is it still needed? --pmladek
-# oox-pptx-import-fix-placeholder-text-style.diff, n#479834, rodo
+oox-pptx-import-fix-placeholder-text-style.diff, n#479834, rodo
 # FIXME_ 2010-04-20: needs porting for ooo320-m15 --pmladek
 # oox-pptx-import-fix-text-body-properties-priority.diff, n#403402, rodo
 
diff --git a/patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff b/patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff
index b03fa93..6b7dcfa 100644
--- a/patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff
+++ b/patches/dev300/oox-pptx-import-fix-placeholder-text-style.diff
@@ -1,51 +1,54 @@
-diff -rup oox-orig-1/inc/oox/ppt/pptshape.hxx oox/inc/oox/ppt/pptshape.hxx
---- oox-orig-1/inc/oox/ppt/pptshape.hxx	2009-05-20 12:26:31.000000000 +0200
-+++ oox/inc/oox/ppt/pptshape.hxx	2009-05-20 12:42:49.000000000 +0200
-@@ -66,6 +66,10 @@ public:
- 	void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; };
+diff -rup ../ooo320-m15-orig/oox-orig-1/inc/oox/ppt/pptshape.hxx oox/inc/oox/ppt/pptshape.hxx
+--- ../ooo320-m15-orig/oox-orig-1/inc/oox/ppt/pptshape.hxx	2010-04-22 09:55:23.000000000 +0200
++++ oox/inc/oox/ppt/pptshape.hxx	2010-04-22 10:49:51.000000000 +0200
+@@ -63,6 +63,10 @@ public:
+     void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; };
          void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
  
-+	static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
++        static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes );
 +	static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes );
-+	static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
++        static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes );
 +
  protected:
  
          oox::drawingml::ShapePtr mpPlaceholder;
-diff -rup oox-orig-1/source/ppt/pptshapecontext.cxx oox/source/ppt/pptshapecontext.cxx
---- oox-orig-1/source/ppt/pptshapecontext.cxx	2009-05-20 12:26:32.000000000 +0200
-+++ oox/source/ppt/pptshapecontext.cxx	2009-05-20 12:44:46.000000000 +0200
-@@ -65,53 +65,6 @@ PPTShapeContext::PPTShapeContext( Contex
+diff -rup ../ooo320-m15-orig/oox-orig-1/source/ppt/pptshapecontext.cxx oox/source/ppt/pptshapecontext.cxx
+--- ../ooo320-m15-orig/oox-orig-1/source/ppt/pptshapecontext.cxx	2010-04-22 09:55:23.000000000 +0200
++++ oox/source/ppt/pptshapecontext.cxx	2010-04-22 10:58:38.000000000 +0200
+@@ -63,57 +63,6 @@ PPTShapeContext::PPTShapeContext( Contex
  {
  }
  
--static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+-oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
 -{
--	oox::drawingml::ShapePtr aShapePtr;
--	std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
--	while( aRevIter != rShapes.rend() )
--	{
--		if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
--		{
--			aShapePtr = *aRevIter;
--			break;
--		}
+-    oox::drawingml::ShapePtr aShapePtr;
+-    std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
+-    while( aRevIter != rShapes.rend() )
+-    {
+-        if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
+-        {
+-            if ( ( nSubTypeIndex == -1 ) || ( nSubTypeIndex == (*aRevIter)->getSubTypeIndex() ) )
+-            {
+-                aShapePtr = *aRevIter;
+-                break;
+-            }
+-        }
 -        std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
--        aShapePtr = findPlaceholder( nMasterPlaceholder, rChildren );
--		if ( aShapePtr.get() )
--			break;
--		aRevIter++;
--	}
--	return aShapePtr;
+-        aShapePtr = findPlaceholder( nMasterPlaceholder, nSubTypeIndex, rChildren );
+-        if ( aShapePtr.get() )
+-            break;
+-        aRevIter++;
+-    }
+-    return aShapePtr;
 -}
 -
--static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes )
+-oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes )
 -{
 -	oox::drawingml::ShapePtr aShapePtr;
 -	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;
@@ -60,65 +63,68 @@ diff -rup oox-orig-1/source/ppt/pptshapecontext.cxx oox/source/ppt/pptshapeconte
 -}
 -
 -// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
--static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+-oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder,
+-    sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
 -{
--	oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
--	return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, rShapes );
+-    oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, nSubTypeIndex, rShapes );
+-    return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, nSubTypeIndex, rShapes );
 -}
 -
  Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
  {
- 	Reference< XFastContextHandler > xRet;
-@@ -147,7 +100,7 @@ Reference< XFastContextHandler > PPTShap
- 				    // TODO: use id to shape map
- 				    SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
- 				    if ( pMasterPersist.get() )
--					pPlaceholder = findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
-+					pPlaceholder = PPTShape::findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
- 				}
- 				if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
- 				{
-@@ -188,12 +141,12 @@ Reference< XFastContextHandler > PPTShap
- 					if ( nFirstPlaceholder )
- 					{
- 						if ( eShapeLocation == Layout )		// for layout objects the referenced object can be found within the same shape tree
--                            pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, mpSlidePersistPtr->getShapes()->getChildren() );
-+						    pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, mpSlidePersistPtr->getShapes()->getChildren() );
- 						else if ( eShapeLocation == Slide )	// normal slide shapes have to search within the corresponding master tree for referenced objects
- 						{
- 							SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
- 							if ( pMasterPersist.get() )
--                                pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pMasterPersist->getShapes()->getChildren() );
-+							    pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pMasterPersist->getShapes()->getChildren() );
- 						}
- 					}
- 				}
-diff -rup oox-orig-1/source/ppt/pptshape.cxx oox/source/ppt/pptshape.cxx
---- oox-orig-1/source/ppt/pptshape.cxx	2009-05-20 12:26:32.000000000 +0200
-+++ oox/source/ppt/pptshape.cxx	2009-05-20 14:01:11.000000000 +0200
-@@ -163,6 +163,17 @@ void PPTShape::addShape(
- 				}
- 			}
+     Reference< XFastContextHandler > xRet;
+@@ -149,7 +98,7 @@ Reference< XFastContextHandler > PPTShap
+ 		    // TODO: use id to shape map
+ 		  SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
+ 		  if ( pMasterPersist.get() )
+-		      pPlaceholder = findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
++		    pPlaceholder = PPTShape::findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
+ 		}
+ 		if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
+                 {
+@@ -191,13 +140,13 @@ Reference< XFastContextHandler > PPTShap
+                     if ( nFirstPlaceholder )
+                     {
+                         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() );
++			  pPlaceholder = PPTShape::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
+                         {
+                             SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
+                             if ( pMasterPersist.get() )
+-                                pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder,
+-                                    pPPTShapePtr->getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() );
++                                pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pPPTShapePtr->getSubTypeIndex(),
++                                    pMasterPersist->getShapes()->getChildren() );
+                         }
+                     }
+                 }
+diff -rup ../ooo320-m15-orig/oox-orig-1/source/ppt/pptshape.cxx oox/source/ppt/pptshape.cxx
+--- ../ooo320-m15-orig/oox-orig-1/source/ppt/pptshape.cxx	2010-04-22 09:55:23.000000000 +0200
++++ oox/source/ppt/pptshape.cxx	2010-04-22 10:53:56.000000000 +0200
+@@ -171,6 +171,17 @@ void PPTShape::addShape(
  
-+			// use placeholder index if possible
-+			if( mnSubType && getIndex() && rSlidePersist.getMasterPersist().get() ) {
-+			    oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getIndex(), rSlidePersist.getMasterPersist()->getShapes()->getChildren() );
-+			    if( pPlaceholder.get() && pPlaceholder->getTextBody() ) {
-+				TextListStylePtr pNewTextListStyle (new TextListStyle());
+             if ( sServiceName.getLength() )
+             {
++	        // use placeholder index if possible
++	        if( mnSubType && getSubTypeIndex() && rSlidePersist.getMasterPersist().get() ) {
++		    oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getSubTypeIndex(), rSlidePersist.getMasterPersist()->getShapes()->getChildren() );
++		    if( pPlaceholder.get() && pPlaceholder->getTextBody() ) {
++		        TextListStylePtr pNewTextListStyle (new TextListStyle());
 +				
-+				pNewTextListStyle->apply( pPlaceholder->getTextBody()->getTextListStyle() );
-+				aMasterTextListStyle = pNewTextListStyle;
-+			    }
-+			}
++			pNewTextListStyle->apply( pPlaceholder->getTextBody()->getTextListStyle() );
++			aMasterTextListStyle = pNewTextListStyle;
++		    }
++		}
 +
  			// use style from master slide for placeholders only, otherwise use slide's style, which might be the default style from presentation
- 			if ( !aMasterTextListStyle.get() )
+                 if ( !aMasterTextListStyle.get() )
  			        aMasterTextListStyle = ( mnSubType && rSlidePersist.getMasterPersist().get() ) ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
-@@ -203,4 +214,51 @@ void PPTShape::applyShapeReference( cons
- 	Shape::applyShapeReference( rReferencedShape );
+@@ -228,4 +239,53 @@ void PPTShape::applyShapeReference( cons
+     Shape::applyShapeReference( rReferencedShape );
  }
  
-+oox::drawingml::ShapePtr PPTShape::findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
++oox::drawingml::ShapePtr PPTShape::findPlaceholder( const sal_Int32 nMasterPlaceholder, const sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
 +{
 +	oox::drawingml::ShapePtr aShapePtr;
 +	std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
@@ -126,11 +132,13 @@ diff -rup oox-orig-1/source/ppt/pptshape.cxx oox/source/ppt/pptshape.cxx
 +	{
 +		if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
 +		{
++		    if ( ( nSubTypeIndex == -1 ) || ( nSubTypeIndex == (*aRevIter)->getSubTypeIndex() ) ) {
 +			aShapePtr = *aRevIter;
 +			break;
++		    }
 +		}
 +        std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
-+        aShapePtr = findPlaceholder( nMasterPlaceholder, rChildren );
++        aShapePtr = findPlaceholder( nMasterPlaceholder, nSubTypeIndex, rChildren );
 +		if ( aShapePtr.get() )
 +			break;
 +		aRevIter++;
@@ -144,7 +152,7 @@ diff -rup oox-orig-1/source/ppt/pptshape.cxx oox/source/ppt/pptshape.cxx
 +	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;
@@ -159,10 +167,10 @@ diff -rup oox-orig-1/source/ppt/pptshape.cxx oox/source/ppt/pptshape.cxx
 +}
 +
 +// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
-+oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
++oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, const sal_Int32 nSubtypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
 +{
-+	oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
-+	return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, rShapes );
++  oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, nSubtypeIndex, rShapes );
++	return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, nSubtypeIndex, rShapes );
 +}
 +
  } }


More information about the ooo-build-commit mailing list