Kaydet (Commit) feb1a671 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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
üst fe1998c1
......@@ -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<lang::XComponent>(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 );
}
}
......
......@@ -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;
......
......@@ -88,8 +88,10 @@ namespace slideshow
{
MetaCommentAction* pAct = static_cast<MetaCommentAction*>(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<MetaTextAction*>(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
......
......@@ -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<sal_Int32>( SOFFICE_FILEFORMAT_50 );
aFilterData[3].Name = OUSTR("Version");
aFilterData[3].Value <<= static_cast<sal_Int32>( 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<MetaCommentAction *>(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") ))
......
......@@ -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
......
......@@ -120,7 +120,6 @@ namespace svx
sal_Int32 mnWidth;
sal_Int32 mnHeight;
sal_Bool mbExportOnlyBackground;
sal_Bool mbVerboseComments;
sal_Bool mbScrollText;
sal_Bool mbUseHighContrast;
sal_Bool mbTranslucent;
......@@ -137,7 +136,6 @@ namespace svx
: mnWidth( 0 )
, mnHeight( 0 )
, mbExportOnlyBackground( false )
, mbVerboseComments( false )
, mbScrollText( false )
, mbUseHighContrast( false )
, mbTranslucent( sal_False )
......@@ -538,11 +536,6 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
{
pDataValues->Value >>= mnPageNumber;
}
else if( pDataValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VerboseComments" ) ) )
{
// #110496# Read flag for verbose metafile comments
pDataValues->Value >>= rSettings.mbVerboseComments;
}
else if( pDataValues->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ScrollText" ) ) )
{
// #110496# Read flag solitary scroll text metafile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment