Kaydet (Commit) df9a436a authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Thorsten Behrens

Handled META_BMPSCALE_ACTION, supported hyperlinks, text selection support.

The implCreateObjectFromShape method of the SVGFilter class has been modified in order 
to handling bitmap meta actions of type META_BMPSCALE_ACTION for each bitmap 
embedded into a text shape.

The implCreateObjectFromShape method of the SVGFilter class has been modified in order 
to avoid to generate an id for empty text shapes.

The MetaSlide class has two new methods for collecting text shapes from the text shape 
exported index and hyperlinks. A new HyperlinkElement class has been designed for 
handling text portion with an attached URL. The routine handling mouse click has been 
modified in order to interacting with the EventMultiplexer instance belonging to the current 
slide even when no animations are exported. All that let us supporting both web links and 
local links to slide belonging to the current document.

The routine handling mouse click has been modified in order to avoid to start the next effect 
or switch to the next slide when there is a text fragment selected.

Now when the user selects text or performs a right click in order to copy the selected text no 
further action is executed by the presentation engine. When the left mouse button is clicked 
the previous selection is discarded but still no further action is performed by the presentation 
engine.

The implCreateObjectFromShape method of the SVGFilter class has been modified in order 
to avoid of adding to the group of embedded bitmaps those bitmap belonging to XShape 
object convertible to XText but that does not contain any text shape meta comment action. 
Now a meta bitmap action is handled by the SVGTextWriter class only if the action is between 
a meta comment action of type XTEXT_PAINTSHAPE_BEGIN and a meta comment action of 
type XTEXT_PAINTSHAPE_END.

The writeBitmapPlaceholder and implWriteEmbeddedBitmaps methods of the SVGTextWriter 
class have been modified in order to change the way the id of the <use> elements that 
reference a bitmap is created. That has been needed because when two <use> element 
referencing the same bitmap and embedded into two different text shapes but placed at the 
same position (e.g. for instance when they belong to different slide)  they got the same id. 
Now the id is built by prepending the meta bitmap action checksum with the text shape id 
followed by a dot.
üst dd188c47
This diff is collapsed.
...@@ -227,67 +227,22 @@ struct HashUChar ...@@ -227,67 +227,22 @@ struct HashUChar
}; };
// --------------------------- // ---------------------------
// - HashBmpExScale - // - HashBitmap -
// --------------------------- // ---------------------------
struct HashBmpExScale struct HashBitmap
{ {
size_t operator()( const ObjectRepresentation& rObjRep ) const size_t operator()( const ObjectRepresentation& rObjRep ) const;
{
const GDIMetaFile& aMtf = rObjRep.GetRepresentation();
if( aMtf.GetActionSize() == 1 )
{
const MetaBmpExScaleAction* pAction = (const MetaBmpExScaleAction*) aMtf.GetAction( 0 );
if( pAction )
{
return static_cast< size_t >( pAction->GetBitmapEx().GetChecksum() );
}
else
{
OSL_FAIL( "HashBmpExScale: metafile should have MetaBmpExScaleAction only." );
return 0;
}
}
else
{
OSL_FAIL( "HashBmpExScale: metafile should have a single action." );
return 0;
}
}
}; };
// --------------------------- // ---------------------------
// - EqualityBmpExScale - // - EqualityBitmap -
// --------------------------- // ---------------------------
struct EqualityBmpExScale struct EqualityBitmap
{ {
bool operator()( const ObjectRepresentation& rObjRep1, bool operator()( const ObjectRepresentation& rObjRep1,
const ObjectRepresentation& rObjRep2 ) const const ObjectRepresentation& rObjRep2 ) const;
{
const GDIMetaFile& aMtf1 = rObjRep1.GetRepresentation();
const GDIMetaFile& aMtf2 = rObjRep2.GetRepresentation();
if( aMtf1.GetActionSize() == 1 && aMtf2.GetActionSize() == 1 )
{
const MetaBmpExScaleAction* pA1 = (const MetaBmpExScaleAction*) aMtf1.GetAction( 0 );
const MetaBmpExScaleAction* pA2 = (const MetaBmpExScaleAction*) aMtf2.GetAction( 0 );
if( pA1 && pA2 )
{
return ( pA1->GetBitmapEx().GetChecksum() == pA2->GetBitmapEx().GetChecksum() );
}
else
{
OSL_FAIL( "EqualityBmpExScale: metafile should have MetaBmpExScaleAction only." );
return false;
}
}
else
{
OSL_FAIL( "EqualityBmpExScale: metafile should have a single action." );
return false;
}
}
}; };
...@@ -316,7 +271,7 @@ public: ...@@ -316,7 +271,7 @@ public:
typedef ::boost::unordered_map< Reference< XInterface >, ::rtl::OUString, HashReferenceXInterface > UOStringMap; typedef ::boost::unordered_map< Reference< XInterface >, ::rtl::OUString, HashReferenceXInterface > UOStringMap;
typedef ::boost::unordered_set< ObjectRepresentation, HashBmpExScale, EqualityBmpExScale > MetaBitmapActionSet; typedef ::boost::unordered_set< ObjectRepresentation, HashBitmap, EqualityBitmap > MetaBitmapActionSet;
private: private:
......
This diff is collapsed.
...@@ -204,7 +204,9 @@ class SVGTextWriter ...@@ -204,7 +204,9 @@ class SVGTextWriter
SVGFontExport& mrFontExport; SVGFontExport& mrFontExport;
SVGAttributeWriter* mpContext; SVGAttributeWriter* mpContext;
VirtualDevice* mpVDev; VirtualDevice* mpVDev;
sal_Bool mbIsTextShapeStarted;
Reference<XText> mrTextShape; Reference<XText> mrTextShape;
::rtl::OUString msShapeId;
Reference<XEnumeration> mrParagraphEnumeration; Reference<XEnumeration> mrParagraphEnumeration;
Reference<XTextContent> mrCurrentTextParagraph; Reference<XTextContent> mrCurrentTextParagraph;
Reference<XEnumeration> mrTextPortionEnumeration; Reference<XEnumeration> mrTextPortionEnumeration;
...@@ -244,6 +246,7 @@ class SVGTextWriter ...@@ -244,6 +246,7 @@ class SVGTextWriter
sal_Bool nextParagraph(); sal_Bool nextParagraph();
sal_Bool nextTextPortion(); sal_Bool nextTextPortion();
sal_Bool isTextShapeStarted() { return mbIsTextShapeStarted; }
void startTextShape(); void startTextShape();
void endTextShape(); void endTextShape();
void startTextParagraph(); void startTextParagraph();
...@@ -252,7 +255,8 @@ class SVGTextWriter ...@@ -252,7 +255,8 @@ class SVGTextWriter
void endTextPosition(); void endTextPosition();
void implExportHyperlinkIds(); void implExportHyperlinkIds();
void implWriteBulletChars(); void implWriteBulletChars();
void writeBitmapPlaceholder( const MetaBmpExScaleAction* pAction ); template< typename MetaBitmapActionType >
void writeBitmapPlaceholder( const MetaBitmapActionType* pAction );
void implWriteEmbeddedBitmaps(); void implWriteEmbeddedBitmaps();
void writeTextPortion( const Point& rPos, const String& rText, void writeTextPortion( const Point& rPos, const String& rText,
sal_Bool bApplyMapping = sal_True ); sal_Bool bApplyMapping = sal_True );
...@@ -295,8 +299,12 @@ class SVGTextWriter ...@@ -295,8 +299,12 @@ class SVGTextWriter
void implMap( const Point& rPt, Point& rDstPt ) const; void implMap( const Point& rPt, Point& rDstPt ) const;
void implSetCurrentFont(); void implSetCurrentFont();
void implSetFontFamily(); void implSetFontFamily();
template< typename SubType > template< typename SubType >
sal_Bool implGetTextPosition( const MetaAction* pAction, Point& raPos, sal_Bool& bEmpty ); sal_Bool implGetTextPosition( const MetaAction* pAction, Point& raPos, sal_Bool& bEmpty );
template< typename SubType >
sal_Bool implGetTextPositionFromBitmap( const MetaAction* pAction, Point& raPos, sal_Bool& rbEmpty );
void implRegisterInterface( const Reference< XInterface >& rxIf ); void implRegisterInterface( const Reference< XInterface >& rxIf );
const ::rtl::OUString & implGetValidIDFromInterface( const Reference< XInterface >& rxIf ); const ::rtl::OUString & implGetValidIDFromInterface( const Reference< XInterface >& rxIf );
...@@ -390,7 +398,7 @@ private: ...@@ -390,7 +398,7 @@ private:
public: public:
static ::rtl::OUString GetPathString( const PolyPolygon& rPolyPoly, sal_Bool bLine ); static ::rtl::OUString GetPathString( const PolyPolygon& rPolyPoly, sal_Bool bLine );
static sal_uLong GetChecksum( const MetaBmpExScaleAction* pAct ); static sal_uLong GetChecksum( const MetaAction* pAction );
public: public:
...@@ -404,7 +412,6 @@ public: ...@@ -404,7 +412,6 @@ public:
const ::rtl::OUString* pElementId = NULL, const ::rtl::OUString* pElementId = NULL,
const Reference< XShape >* pXShape = NULL, const Reference< XShape >* pXShape = NULL,
const GDIMetaFile* pTextEmbeddedBitmapMtf = NULL ); const GDIMetaFile* pTextEmbeddedBitmapMtf = NULL );
sal_Bool bIsTextShape;
}; };
#endif #endif
......
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