From feb1a67179b5d5b1d3771dae584f8388c18c0044 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 22 Dec 2011 12:46:22 +0100 Subject: Fix slideshow text animations - fdo#43837 String compare was not replaced equivalently, this needs matching against the XTEXT prefix, not exactly Removed VERBOSE_TEXTCOMMENTS exporter flag, that's now unused. Added some verbose-mode trace output --- slideshow/source/engine/shapes/drawshape.cxx | 52 ---------------------- slideshow/source/engine/shapes/drawshape.hxx | 1 - .../source/engine/shapes/drawshapesubsetting.cxx | 17 ++++++- slideshow/source/engine/shapes/gdimtftools.cxx | 28 ++++++------ slideshow/source/engine/shapes/gdimtftools.hxx | 3 -- 5 files changed, 28 insertions(+), 73 deletions(-) (limited to 'slideshow') diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index 0e3ed61bdd36..17ac98f6615f 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -270,39 +270,6 @@ namespace slideshow } } - void DrawShape::ensureVerboseMtfComments() const - { - // TODO(F1): Text effects don't currently work for drawing - // layer animations. - - // only touch mpCurrMtf, if we're not a DrawingLayer - // animation. - if( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) == 0 && - maAnimationFrames.empty() ) - { - ENSURE_OR_THROW( !maSubsetting.hasSubsetShapes(), - "DrawShape::ensureVerboseMtfComments(): reloading the metafile " - "with active child subsets will wreak havoc on the view!" ); - ENSURE_OR_THROW( maSubsetting.getSubsetNode().isEmpty(), - "DrawShape::ensureVerboseMtfComments(): reloading the metafile " - "for an ALREADY SUBSETTED shape is not possible!" ); - - // re-fetch metafile with comments - // note that, in case of shapes without text, the new - // metafile might still not provide any useful - // subsetting information! - mpCurrMtf.reset( new GDIMetaFile ); - mnCurrMtfLoadFlags |= MTF_LOAD_VERBOSE_COMMENTS; - local_getMetaFile_WithSpecialChartHandling( - uno::Reference(mxShape, uno::UNO_QUERY), - mxPage, *mpCurrMtf, mnCurrMtfLoadFlags, - mxComponentContext ); - - maSubsetting.reset( maSubsetting.getSubsetNode(), - mpCurrMtf ); - } - } - ViewShape::RenderArgs DrawShape::getViewRenderArgs() const { return ViewShape::RenderArgs( @@ -1326,17 +1293,12 @@ namespace slideshow DocTreeNode DrawShape::getSubsetNode() const { - ensureVerboseMtfComments(); - // forward to delegate return maSubsetting.getSubsetNode(); } AttributableShapeSharedPtr DrawShape::getSubset( const DocTreeNode& rTreeNode ) const { - ENSURE_OR_THROW( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0, - "DrawShape::getSubset(): subset query on shape with apparently no subsets" ); - // forward to delegate return maSubsetting.getSubsetShape( rTreeNode ); } @@ -1344,9 +1306,6 @@ namespace slideshow bool DrawShape::createSubset( AttributableShapeSharedPtr& o_rSubset, const DocTreeNode& rTreeNode ) { - ENSURE_OR_THROW( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0, - "DrawShape::createSubset(): subset query on shape with apparently no subsets" ); - // subset shape already created for this DocTreeNode? AttributableShapeSharedPtr pSubset( maSubsetting.getSubsetShape( rTreeNode ) ); @@ -1388,9 +1347,6 @@ namespace slideshow bool DrawShape::revokeSubset( const AttributableShapeSharedPtr& rShape ) { - ENSURE_OR_THROW( (mnCurrMtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0, - "DrawShape::createSubset(): subset query on shape with apparently no subsets" ); - // flush bounds cache maCurrentShapeUnitBounds.reset(); @@ -1436,16 +1392,12 @@ namespace slideshow sal_Int32 DrawShape::getNumberOfTreeNodes( DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException { - ensureVerboseMtfComments(); - return maSubsetting.getNumberOfTreeNodes( eNodeType ); } DocTreeNode DrawShape::getTreeNode( sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException { - ensureVerboseMtfComments(); - if ( hasHyperlinks()) { prepareHyperlinkIndices(); @@ -1457,8 +1409,6 @@ namespace slideshow sal_Int32 DrawShape::getNumberOfSubsetTreeNodes ( const DocTreeNode& rParentNode, DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException { - ensureVerboseMtfComments(); - return maSubsetting.getNumberOfSubsetTreeNodes( rParentNode, eNodeType ); } @@ -1466,8 +1416,6 @@ namespace slideshow sal_Int32 nNodeIndex, DocTreeNode::NodeType eNodeType ) const // throw ShapeLoadFailedException { - ensureVerboseMtfComments(); - return maSubsetting.getSubsetTreeNode( rParentNode, nNodeIndex, eNodeType ); } } diff --git a/slideshow/source/engine/shapes/drawshape.hxx b/slideshow/source/engine/shapes/drawshape.hxx index 1800ab3a5fe8..4fcb01c305ed 100644 --- a/slideshow/source/engine/shapes/drawshape.hxx +++ b/slideshow/source/engine/shapes/drawshape.hxx @@ -287,7 +287,6 @@ namespace slideshow ViewShape::RenderArgs getViewRenderArgs() const; ::basegfx::B2DRectangle getActualUnitShapeBounds() const; - void ensureVerboseMtfComments() const; bool hasIntrinsicAnimation() const; bool hasHyperlinks() const; void prepareHyperlinkIndices() const; diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index bb43fba67d21..1790aba40c4e 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -88,8 +88,10 @@ namespace slideshow { MetaCommentAction* pAct = static_cast(pCurrAct); - // skip comment if not a special XTEXT comment - if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT")) ) + // skip comment if not a special XTEXT... comment + if( pAct->GetComment().matchIgnoreAsciiCase( + rtl::OString(RTL_CONSTASCII_STRINGPARAM("XTEXT")), + 0) ) { // fill classification vector with NOOPs, // then insert corresponding classes at @@ -155,6 +157,8 @@ namespace slideshow maActionClassVector[ nActionIndex ] = CLASS_SHAPE_START; } } + VERBOSE_TRACE( "Shape text structure: %s at action #%d", + pAct->GetComment().getStr(), nActionIndex ); ++nActionIndex; break; } @@ -162,6 +166,15 @@ namespace slideshow case META_TEXTARRAY_ACTION: case META_STRETCHTEXT_ACTION: nLastTextActionIndex = nActionIndex; +#if OSL_DEBUG_LEVEL > 1 + { + MetaTextAction* pText = static_cast(pCurrAct); + VERBOSE_TRACE( "Shape text \"%s\" at action #%d", + ByteString(pText->GetText(), + RTL_TEXTENCODING_ISO_8859_1).GetBuffer(), + nActionIndex ); + } +#endif // fallthrough intended default: // comment action and all actions not diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index e58c1bb208e9..e1b4a475d800 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -224,21 +224,18 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource, aProps[1].Name = OUSTR("GraphicRenderer"); aProps[1].Value <<= xRenderer; - uno::Sequence< beans::PropertyValue > aFilterData(5); - aFilterData[0].Name = OUSTR("VerboseComments"); - aFilterData[0].Value <<= ((mtfLoadFlags & MTF_LOAD_VERBOSE_COMMENTS) != 0); + uno::Sequence< beans::PropertyValue > aFilterData(4); + aFilterData[0].Name = OUSTR("ScrollText"); + aFilterData[0].Value <<= ((mtfLoadFlags & MTF_LOAD_SCROLL_TEXT_MTF) != 0); - aFilterData[1].Name = OUSTR("ScrollText"); - aFilterData[1].Value <<= ((mtfLoadFlags & MTF_LOAD_SCROLL_TEXT_MTF) != 0); + aFilterData[1].Name = OUSTR("ExportOnlyBackground"); + aFilterData[1].Value <<= ((mtfLoadFlags & MTF_LOAD_BACKGROUND_ONLY) != 0); - aFilterData[2].Name = OUSTR("ExportOnlyBackground"); - aFilterData[2].Value <<= ((mtfLoadFlags & MTF_LOAD_BACKGROUND_ONLY) != 0); + aFilterData[2].Name = OUSTR("Version"); + aFilterData[2].Value <<= static_cast( SOFFICE_FILEFORMAT_50 ); - aFilterData[3].Name = OUSTR("Version"); - aFilterData[3].Value <<= static_cast( SOFFICE_FILEFORMAT_50 ); - - aFilterData[4].Name = OUSTR("CurrentPage"); - aFilterData[4].Value <<= uno::Reference< uno::XInterface >( xContainingPage, + aFilterData[3].Name = OUSTR("CurrentPage"); + aFilterData[3].Value <<= uno::Reference< uno::XInterface >( xContainingPage, uno::UNO_QUERY_THROW ); aProps[2].Name = OUSTR("FilterData"); @@ -478,9 +475,10 @@ bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect, { MetaCommentAction * pAct = static_cast(pCurrAct); - // skip comment if not a special XTEXT comment - if (pAct->GetComment().equalsIgnoreAsciiCaseL( - RTL_CONSTASCII_STRINGPARAM("XTEXT") )) + // skip comment if not a special XTEXT... comment + if( pAct->GetComment().matchIgnoreAsciiCase( + rtl::OString(RTL_CONSTASCII_STRINGPARAM("XTEXT")), + 0) ) { if (pAct->GetComment().equalsIgnoreAsciiCaseL( RTL_CONSTASCII_STRINGPARAM("XTEXT_SCROLLRECT") )) diff --git a/slideshow/source/engine/shapes/gdimtftools.hxx b/slideshow/source/engine/shapes/gdimtftools.hxx index 28a105589df2..2bcec05f7cb6 100644 --- a/slideshow/source/engine/shapes/gdimtftools.hxx +++ b/slideshow/source/engine/shapes/gdimtftools.hxx @@ -55,9 +55,6 @@ namespace slideshow enum mtf_load_flags { /// no flags MTF_LOAD_NONE = 0, - /// annotate text actions with verbose comments, - /// denoting logical and physical text entities. - MTF_LOAD_VERBOSE_COMMENTS = 1, /// the source of the metafile might be a foreign /// application. The metafile is checked against unsupported /// content, and, if necessary, returned as a pre-rendererd -- cgit