[ooo-build-commit] 2 commits - patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Wed Jul 29 05:20:07 PDT 2009


 patches/dev300/apply                                            |    1 
 patches/dev300/oox-pptx-export-animations-paragraph-target.diff |  156 ++++++++++
 2 files changed, 157 insertions(+)

New commits:
commit 9b4201ae03f2415ca947bf079e91f7baba0a3467
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Jul 29 14:13:09 2009 +0200

    export paragraph animation target
    
    * patches/dev300/apply: added new patch
    * patches/dev300/oox-pptx-export-animations-paragraph-target.diff: extract helper method from AnimationExport to get XShape target and get paragraph start/end indexes for paragraph target

diff --git a/patches/dev300/oox-pptx-export-animations-paragraph-target.diff b/patches/dev300/oox-pptx-export-animations-paragraph-target.diff
new file mode 100644
index 0000000..9bcc33f
--- /dev/null
+++ b/patches/dev300/oox-pptx-export-animations-paragraph-target.diff
@@ -0,0 +1,156 @@
+diff -rup sd/source/filter/pptx-orig/pptexanimations.hxx sd/source/filter/pptx/pptexanimations.hxx
+--- sd/source/filter/pptx-orig/pptexanimations.hxx	2009-07-28 16:28:23.000000000 +0200
++++ sd/source/filter/pptx/pptexanimations.hxx	2009-07-29 12:29:49.000000000 +0200
+@@ -144,6 +144,7 @@ public:
+         static sal_uInt32 GetValueTypeForAttributeName( const rtl::OUString& rAttributeName );
+ 
+     static const sal_Char* FindTransitionName( const sal_Int16 nType, const sal_Int16 nSubType, const sal_Bool bDirection );
++    static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTargetElementShape( const ::com::sun::star::uno::Any& rAny, sal_Int32& rBegin, sal_Int32& rEnd, sal_Bool& rParagraphTarget );
+ };
+ } // namespace ppt
+ 
+diff -rup sd/source/filter/pptx-orig/pptx-epptooxml.cxx sd/source/filter/pptx/pptx-epptooxml.cxx
+--- sd/source/filter/pptx-orig/pptx-epptooxml.cxx	2009-07-28 16:28:23.000000000 +0200
++++ sd/source/filter/pptx/pptx-epptooxml.cxx	2009-07-29 12:35:21.000000000 +0200
+@@ -633,13 +633,24 @@ void PowerPointExport::WriteAnimationAtt
+ 
+ void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget )
+ {
+-    Reference< XShape > rXShape( aTarget, UNO_QUERY );
++    sal_Int32 nBegin = -1, nEnd = -1;
++    sal_Bool bParagraphTarget;
++    Reference< XShape > rXShape = AnimationExporter::getTargetElementShape( aTarget, nBegin, nEnd, bParagraphTarget );
+ 
+     if( rXShape.is() ) {
+ 	pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
+-	pFS->singleElementNS( XML_p, XML_spTgt,
+-			      XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ),
+-			      FSEND );
++	pFS->startElementNS( XML_p, XML_spTgt,
++			     XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ),
++			     FSEND );
++	if( bParagraphTarget ) {
++	    pFS->startElementNS( XML_p, XML_txEl, FSEND );
++	    pFS->singleElementNS( XML_p, XML_pRg,
++				  XML_st, I32S( nBegin ),
++				  XML_end, I32S( nEnd ),
++				  FSEND );
++	    pFS->endElementNS( XML_p, XML_txEl );
++	}
++	pFS->endElementNS( XML_p, XML_spTgt );
+ 	pFS->endElementNS( XML_p, XML_tgtEl );
+     }
+ }
+diff -rup sd/source/filter/pptx-orig/pptx-pptexanimations.cxx sd/source/filter/pptx/pptx-pptexanimations.cxx
+--- sd/source/filter/pptx-orig/pptx-pptexanimations.cxx	2009-07-28 16:28:23.000000000 +0200
++++ sd/source/filter/pptx/pptx-pptexanimations.cxx	2009-07-29 12:31:04.000000000 +0200
+@@ -1761,54 +1761,69 @@ void AnimationExporter::exportAnimateTar
+ 	}
+ }
+ 
+-void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any aAny, const sal_Bool bCreate2b01Atom )
++Reference< XShape > AnimationExporter::getTargetElementShape( const Any& rAny, sal_Int32& rBegin, sal_Int32& rEnd, sal_Bool& rParagraphTarget )
+ {
+-	Reference< XShape > xShape;
+-	aAny >>= xShape;
+-	sal_uInt32 nRefMode = 0;	// nRefMode == 2 -> Paragraph
+-	sal_Int32 begin = -1;
+-	sal_Int32 end = -1;
++    Reference< XShape > xShape;
++    rAny >>= xShape;
+ 
+-	if( !xShape.is() )
++    rParagraphTarget = sal_False;
++
++    if( !xShape.is() )
++    {
++	ParagraphTarget aParaTarget;
++	if( rAny >>= aParaTarget )
++	    xShape = aParaTarget.Shape;
++	if ( xShape.is() )
+ 	{
+-		ParagraphTarget aParaTarget;
+-		if( aAny >>= aParaTarget )
+-			xShape = aParaTarget.Shape;
+-		if ( xShape.is() )
++	    // now calculating the character range for the paragraph
++	    sal_Int16 nParagraph = aParaTarget.Paragraph;
++	    Reference< XSimpleText > xText( xShape, UNO_QUERY );
++	    if ( xText.is() )
++	    {
++		rParagraphTarget = sal_True;
++		Reference< XEnumerationAccess > xTextParagraphEnumerationAccess( xText, UNO_QUERY );
++		if ( xTextParagraphEnumerationAccess.is() )
+ 		{
+-			// now calculating the character range for the paragraph
+-			sal_Int16 nParagraph = aParaTarget.Paragraph;
+-			Reference< XSimpleText > xText( xShape, UNO_QUERY );
+-			if ( xText.is() )
++		    Reference< XEnumeration > xTextParagraphEnumeration( xTextParagraphEnumerationAccess->createEnumeration() );
++		    if ( xTextParagraphEnumeration.is() )
++		    {
++			sal_Int16 nCurrentParagraph;
++			rBegin = rEnd = nCurrentParagraph = 0;
++			while ( xTextParagraphEnumeration->hasMoreElements() )
+ 			{
+-				nRefMode = 2;
+-				Reference< XEnumerationAccess > xTextParagraphEnumerationAccess( xText, UNO_QUERY );
+-				if ( xTextParagraphEnumerationAccess.is() )
+-				{
+-					Reference< XEnumeration > xTextParagraphEnumeration( xTextParagraphEnumerationAccess->createEnumeration() );
+-					if ( xTextParagraphEnumeration.is() )
+-					{
+-						sal_Int16 nCurrentParagraph;
+-						begin = end = nCurrentParagraph = 0;
+-						while ( xTextParagraphEnumeration->hasMoreElements() )
+-						{
+-							Reference< XTextRange > xTextRange( xTextParagraphEnumeration->nextElement(), UNO_QUERY );
+-							if ( xTextRange.is() )
+-							{
+-								rtl::OUString aParaText( xTextRange->getString() );
+-								sal_Int32 nLength = aParaText.getLength() + 1;
+-								end += nLength;
+-								if ( nCurrentParagraph == nParagraph )
+-									break;
+-								nCurrentParagraph++;
+-								begin += nLength;
+-							}
+-						}
+-					}
+-				}
++			    Reference< XTextRange > xTextRange( xTextParagraphEnumeration->nextElement(), UNO_QUERY );
++			    if ( xTextRange.is() )
++			    {
++				rtl::OUString aParaText( xTextRange->getString() );
++				sal_Int32 nLength = aParaText.getLength() + 1;
++				rEnd += nLength;
++				if ( nCurrentParagraph == nParagraph )
++				    break;
++				nCurrentParagraph++;
++				rBegin += nLength;
++			    }
+ 			}
++		    }
+ 		}
++	    }
+ 	}
++    }
++
++    return xShape;
++}
++
++void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any aAny, const sal_Bool bCreate2b01Atom )
++{
++	sal_uInt32 nRefMode = 0;	// nRefMode == 2 -> Paragraph
++	sal_Int32 begin = -1;
++	sal_Int32 end = -1;
++	sal_Bool bParagraphTarget;
++
++	Reference< XShape > xShape = getTargetElementShape( aAny, begin, end, bParagraphTarget );
++
++	if( bParagraphTarget )
++	    nRefMode = 2;
++
+ 	if ( xShape.is() || bCreate2b01Atom )
+ 	{
+ 		EscherExContainer aAnimateTargetElement( rStrm, DFF_msofbtAnimateTargetElement );
commit 57f39e8ea65993577de5194f72a374747ad3d0e5
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Jul 29 14:18:48 2009 +0200

    fixed merge conflict
    
    * patches/dev300/apply:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 03f6869..f126a42 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3298,6 +3298,7 @@ oox-pptx-export-fix-action-button-presets.diff, n#497570, rodo
 oox-drawingml-fix-shapes-map-crash.diff, rodo
 oox-pptx-export-animations-filter.diff, n#497570, rodo
 oox-calc-export-export-pivot-content.diff, n#505917, janneke
+oox-pptx-export-animations-paragraph-target.diff, n#497570, rodo
 
 [ CrossWin32Patches ]
 # Experimental patches to crosscompile OOo for Win32


More information about the ooo-build-commit mailing list