Kaydet (Commit) e765abbb authored tarafından sb's avatar sb

merged in DEV300_m57

üst 483dcdaf
......@@ -52,5 +52,9 @@
#define HID_FILTER_XSLT_START (HID_FILTER_START + 0) // see source/xsltdialog/xmlfilterhelpids.hrc for range
#define HID_FILTER_XSLT_END (HID_FILTER_START + 99)
#define HID_FILTER_PDF_OPTIONS (HID_FILTER_START + 100)
#define HID_FILTER_PDF_INITIAL_VIEW (HID_FILTER_START + 101)
#define HID_FILTER_PDF_USER_INTERFACE (HID_FILTER_START + 102)
#define HID_FILTER_PDF_SECURITY (HID_FILTER_START + 103)
#define HID_FILTER_PDF_LINKS (HID_FILTER_START + 104)
#endif
......@@ -2,7 +2,7 @@
<prop oor:name="Flags"><value>IMPORT EXPORT ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>emp</value></prop>
<prop oor:name="UserData"><value>sdfilt</value></prop>
<prop oor:name="UIName">
<value xml:lang="x-default">Microsoft PowerPoint 97/2000/XP</value>
</prop>
......
......@@ -2,7 +2,7 @@
<prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>emp</value></prop>
<prop oor:name="UserData"><value>sdfilt</value></prop>
<prop oor:name="FileFormatVersion"><value>0</value></prop>
<prop oor:name="Type"><value>impress_MS_PowerPoint_97_Vorlage</value></prop>
<prop oor:name="TemplateName"/>
......
......@@ -3,7 +3,7 @@
<prop oor:name="Type"><value>XHTML_File</value></prop>
<prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="UserData"><value oor:separator=",">com.sun.star.documentconversion.XSLTFilter,,com.sun.star.comp.Writer.XMLOasisImporter,com.sun.star.comp.Writer.XMLOasisExporter,,../share/xslt/export/xhtml/opendoc2xhtml.xsl</value></prop>
<prop oor:name="UserData"><value oor:separator=",">com.sun.star.documentconversion.XSLTFilter,,com.sun.star.comp.Writer.XMLOasisImporter,com.sun.star.comp.Writer.XMLOasisExporter,,../share/xslt/export/xhtml/opendoc2xhtml.xsl,,true</value></prop>
<prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIName">
......
......@@ -231,7 +231,7 @@ TabPage RID_PDF_TAB_GENER
//tab page for PDF Export, opening features
TabPage RID_PDF_TAB_OPNFTR
{
HelpId = 0 ;
HelpId = HID_FILTER_PDF_INITIAL_VIEW ;
Text[ en-US ] = "Initial View" ;
TAB_PDF_SIZE;
Hide = TRUE;
......@@ -374,7 +374,7 @@ TabPage RID_PDF_TAB_OPNFTR
//tab page for PDF Export, viewer preferences
TabPage RID_PDF_TAB_VPREFER
{
HelpId = 0 ;
HelpId = HID_FILTER_PDF_USER_INTERFACE ;
Text[ en-US ] = "User Interface" ;
TAB_PDF_SIZE;
Hide = TRUE;
......@@ -492,7 +492,7 @@ TabPage RID_PDF_TAB_VPREFER
//tab page for PDF Export, security
TabPage RID_PDF_TAB_SECURITY
{
HelpId = 0 ;
HelpId = HID_FILTER_PDF_SECURITY ;
Text [ en-US ] = "Security";
TAB_PDF_SIZE;
Hide = TRUE;
......@@ -654,7 +654,7 @@ TabPage RID_PDF_TAB_SECURITY
//tab page for PDF Export, links management
TabPage RID_PDF_TAB_LINKS
{
HelpId = 0 ;
HelpId = HID_FILTER_PDF_LINKS;
Text [ en-US ] = "---";
TAB_PDF_SIZE;
Hide = TRUE;
......
......@@ -56,7 +56,7 @@ SLOFILES+= $(SLO)$/svgimport.obj
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS=\
$(SVXLIB) \
$(SVXCORELIB) \
$(XMLOFFLIB) \
$(GOODIESLIB) \
$(VCLLIB) \
......
......@@ -169,19 +169,21 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star
}
Sequence < OUString > elementNames = xName->getElementNames();
Sequence<com::sun::star::beans::PropertyValue> pValue=xstyleLoader->getStyleLoaderOptions();
//Load the Styles from the Template URL Supplied in the TypeDetection file
if(msTemplateName.indexOf(OUString::createFromAscii("file:"))==-1)
{
Reference< XConfigManager >xCfgMgr ( mxMSF->createInstance(
OUString::createFromAscii("com.sun.star.config.SpecialConfigManager") ), UNO_QUERY );
OUString PathString=xCfgMgr->substituteVariables(OUString::createFromAscii("$(progurl)"));
PathString=PathString.concat(OUString::createFromAscii("/"));
msTemplateName=PathString.concat(msTemplateName);
if(xstyleLoader.is()){
Sequence<com::sun::star::beans::PropertyValue> pValue=xstyleLoader->getStyleLoaderOptions();
//Load the Styles from the Template URL Supplied in the TypeDetection file
if(msTemplateName.indexOf(OUString::createFromAscii("file:"))==-1)
{
Reference< XConfigManager >xCfgMgr ( mxMSF->createInstance(
OUString::createFromAscii("com.sun.star.config.SpecialConfigManager") ), UNO_QUERY );
OUString PathString=xCfgMgr->substituteVariables(OUString::createFromAscii("$(progurl)"));
PathString=PathString.concat(OUString::createFromAscii("/"));
msTemplateName=PathString.concat(msTemplateName);
}
xstyleLoader->loadStylesFromURL(msTemplateName,pValue);
}
xstyleLoader->loadStylesFromURL(msTemplateName,pValue);
}
// sal_Bool xconv_ret = sal_True;
......@@ -265,6 +267,14 @@ sal_Bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< ::com::sun::star
sal_Bool bPrettyPrint =
(msUserData.getLength() > 6 && msUserData[6].equalsIgnoreAsciiCaseAscii("true"));
// --> OD 2008-11-25 #b6761284#
// export of <text:number> element for <text:list-item> elements are
// needed for certain filters.
sal_Bool bExportTextNumberElementForListItems =
( msUserData.getLength() > 7 &&
msUserData[7].equalsIgnoreAsciiCaseAscii("true") );
// <--
// get the base URI, so we can use relative links
OUString aBaseURI;
if (aMediaMap.find(OUString::createFromAscii("URL"))->second >>= aBaseURI)
......@@ -279,6 +289,9 @@ sal_Bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< ::com::sun::star
PropertyMapEntry aImportInfoMap[] =
{
{ MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((const sal_Bool*)0), PropertyAttribute::MAYBEVOID, 0},
// --> OD 2008-11-25 #b6761284#
{ MAP_LEN( "ExportTextNumberElement" ), 0, &::getCppuType((const sal_Bool*)0), PropertyAttribute::MAYBEVOID, 0},
// <--
{ MAP_LEN( "BaseURI" ), 0, &::getCppuType((const OUString*)0), PropertyAttribute::MAYBEVOID, 0},
{ NULL, 0, 0, NULL, 0, 0 }
};
......@@ -287,6 +300,11 @@ sal_Bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< ::com::sun::star
GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) );
xInfoSet->setPropertyValue(
OUString::createFromAscii( "UsePrettyPrinting" ), makeAny( bPrettyPrint ));
// --> OD 2008-11-25 #b6761284#
xInfoSet->setPropertyValue(
OUString::createFromAscii( "ExportTextNumberElement" ),
makeAny( bExportTextNumberElementForListItems ));
// <--
xInfoSet->setPropertyValue(
OUString::createFromAscii( "BaseURI" ), makeAny( aBaseURI ));
aAnys[1] <<= xInfoSet;
......
......@@ -54,7 +54,7 @@
<xsl:param name="globalData"/>
<xsl:choose>
<xsl:when test="*/text:tab">
<xsl:when test="*/text:tab[1] or */*/text:tab[1]">
<xsl:call-template name="createIndexBodyTable">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:call-template>
......@@ -97,15 +97,18 @@
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">0</xsl:attribute>
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/@table:style-name]/*/@style:rel-width"/>
<xsl:if test="$value">
<xsl:attribute name="width">
<xsl:value-of select="$value"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
</xsl:attribute>
<xsl:if test="parent::*/@text:style-name">
<!-- parent as index:body has no style -->
<xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/@style:rel-width"/>
<xsl:if test="$value">
<xsl:attribute name="width">
<xsl:value-of select="$value"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="translate(parent::*/@text:style-name, '.,;: %()[]/\+', '_____________')"/>
</xsl:attribute>
</xsl:if>
<xsl:element namespace="{$namespace}" name="colgroup">
<xsl:choose>
......@@ -440,7 +443,7 @@ Scenarios unmatched:
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="nodesOfNextColumn" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]][position() > $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]"/>
<xsl:variable name="nodesOfNextColumn" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]][position() &gt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]"/>
<xsl:choose>
<xsl:when test="$nodesOfNextColumn != ''">
<xsl:apply-templates mode="content-table" select="$nodesOfNextColumn">
......@@ -495,20 +498,27 @@ Scenarios unmatched:
<xsl:template match="text:a" mode="content-table">
<xsl:param name="globalData"/>
<xsl:choose>
<!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text, furthermore that a tab will separate the to be neglected page number -->
<xsl:when test="text:tab">
<xsl:element namespace="{$namespace}" name="a">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
<xsl:value-of select="translate(text()[1], '.,;: %()[]/\+', '_____________')"/>
</xsl:attribute>
<xsl:value-of select="text()[1]"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="text">
<xsl:choose>
<!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text,
furthermore that a tab will separate the to be neglected page number -->
<xsl:when test="text:tab">
<xsl:value-of select="text()[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- REFERENCE HANDLING - HREF -->
<xsl:element namespace="{$namespace}" name="a">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
<xsl:value-of select='concat("a_", translate(normalize-space($text), "&#xA;&amp;&lt;&gt;.,;: %()[]/\+", "_______________________________"))'/>
</xsl:attribute>
<xsl:value-of select="$text"/>
</xsl:element>
</xsl:template>
<xsl:template match="text:s" mode="content-table">
......@@ -517,7 +527,6 @@ Scenarios unmatched:
</xsl:call-template>
</xsl:template>
<!-- ******************** -->
<!-- *** Common Rules *** -->
<!-- ******************** -->
......@@ -537,5 +546,13 @@ Scenarios unmatched:
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="content-table">
<!-- Heuristic to remove page numbers (useless in HTML) in the content table
usually after a tab -->
<xsl:if test="name(preceding-sibling::*[1]) != 'text:tab' and not(number() &gt; -1)">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
......@@ -38,9 +38,13 @@
#include "oox/core/filterbase.hxx"
#include "oox/core/relations.hxx"
#include <oox/dllapi.h>
#include <com/sun/star/text/XTextField.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/XText.hpp>
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
namespace document { class XDocumentProperties; }
namespace xml { namespace sax { class XLocator; } }
namespace xml { namespace sax { class XFastDocumentHandler; } }
} } }
......@@ -60,6 +64,13 @@ namespace core {
class FragmentHandler;
struct TextField {
com::sun::star::uno::Reference< com::sun::star::text::XText > xText;
com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > xTextCursor;
com::sun::star::uno::Reference< com::sun::star::text::XTextField > xTextField;
};
typedef std::vector< TextField > TextFieldStack;
// ============================================================================
struct XmlFilterBaseImpl;
......@@ -135,8 +146,10 @@ public:
*/
::rtl::OUString addRelation( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutputStream, const ::rtl::OUString& rType, const ::rtl::OUString& rTarget, bool bExternal = false );
/** Opens and returns the specified output stream from the base storage
with specified media type.
/** Returns a stack of used textfields, used by the pptx importer to replace links to slidepages with rhe real page name */
TextFieldStack& getTextFieldStack() const;
/** Opens and returns the specified output stream from the base storage with specified media type.
@param rStreamName
The name of the embedded storage stream. The name may contain
......@@ -183,6 +196,14 @@ public:
inline ::rtl::OString GetUniqueIdOString() { return ::rtl::OString::valueOf( mnMaxDocId++ ); }
inline ::rtl::OUString GetUniqueIdOUString() { return ::rtl::OUString::valueOf( mnMaxDocId++ ); }
/** Write the document properties into into the current OPC package.
@param xProperties The document properties to export.
@return *this
*/
XmlFilterBase& exportDocumentProperties( ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > xProperties );
private:
virtual StorageRef implCreateStorage(
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
......
......@@ -166,7 +166,8 @@ protected:
const ::rtl::OUString& rServiceName,
const ThemePtr& rxTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect );
const ::com::sun::star::awt::Rectangle* pShapeRect,
sal_Bool bClearText );
void addChildren(
const ::oox::core::XmlFilterBase& rFilterBase,
......
......@@ -51,6 +51,7 @@ namespace oox { namespace drawingml {
: nUnit( POINTS ), nValue( 0 ), bHasValue( sal_False )
{
}
TextSpacing( sal_Int32 nPoints ) : nUnit( POINTS ), nValue( nPoints ), bHasValue( sal_True ){};
::com::sun::star::style::LineSpacing toLineSpacing() const
{
::com::sun::star::style::LineSpacing aSpacing;
......
#ifndef _OOX_EXPORT_DRAWINGML_HXX_
#define _OOX_EXPORT_DRAWINGML_HXX_
#include <oox/dllapi.h>
#include <sax/fshelper.hxx>
#include <rtl/strbuf.hxx>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/uno/XReference.hpp>
#include <tools/poly.hxx>
#include <svx/escherex.hxx>
class Graphic;
class String;
namespace com { namespace sun { namespace star {
namespace beans {
class XPropertySet;
class XPropertyState;
}
namespace drawing {
class XShape;
}
namespace text {
class XTextContent;
class XTextRange;
}
}}}
namespace oox {
namespace core {
class XmlFilterBase;
}
namespace drawingml {
class OOX_DLLPUBLIC DrawingML {
public:
enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
private:
::sax_fastparser::FSHelperPtr mpFS;
::oox::core::XmlFilterBase* mpFB;
static int mnImageCounter;
/// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
DocumentType meDocumentType;
protected:
::com::sun::star::uno::Any mAny;
bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String aName );
bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState,
String aName, ::com::sun::star::beans::PropertyState& eState );
const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
rtl::OUString WriteImage( const rtl::OUString& rURL );
public:
DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : mpFS( pFS ), mpFB( pFB ), meDocumentType( eDocumentType ) {}
void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; }
::sax_fastparser::FSHelperPtr GetFS() { return mpFS; }
::oox::core::XmlFilterBase* GetFB() { return mpFB; }
rtl::OUString WriteImage( const Graphic &rGraphic );
void WriteColor( sal_uInt32 nColor );
void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor );
void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart );
void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID );
void WriteSolidFill( sal_uInt32 nColor );
void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String sURLPropName, sal_Int32 nXmlNamespace );
void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String sURLPropName );
void WriteOutline( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteStretch();
::rtl::OUString WriteBlip( ::rtl::OUString& rURL );
void WriteBlipMode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteShapeTransformation( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape,
sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 );
void WriteTransformation( const Rectangle& rRectangle,
sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 );
void WriteText( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape );
void WriteParagraph( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
void WriteParagraphProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
void WriteParagraphNumbering( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
sal_Int16 nLevel );
void WriteRun( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
void WriteRunProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
void WritePresetShape( const char* pShape );
void WritePresetShape( const char* pShape, MSO_SPT eShapeType, sal_Bool bPredefinedHandlesUsed, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, const ::com::sun::star::beans::PropertyValue& rProp );
void WritePolyPolygon( const PolyPolygon& rPolyPolygon );
static void ResetCounters();
void GetUUID( ::rtl::OStringBuffer& rBuffer );
static sal_Unicode SubstituteBullet( sal_Unicode cBulletId, ::com::sun::star::awt::FontDescriptor& rFontDesc );
sal_uInt32 ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity );
static const char* GetAlignment( sal_Int32 nAlignment );
};
}
}
#endif
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile$
* $Revision$
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _OOX_EXPORT_SHAPES_HXX_
#define _OOX_EXPORT_SHAPES_HXX_
#include <oox/dllapi.h>
#include <com/sun/star/uno/XReference.hpp>
#include <oox/export/drawingml.hxx>
#include <sax/fshelper.hxx>
#include <vcl/mapmod.hxx>
#include <hash_map>
namespace com { namespace sun { namespace star {
namespace beans {
class XPropertySet;
}
namespace drawing {
class XShape;
class XShapes;
}
}}}
namespace oox { namespace drawingml {
class OOX_DLLPUBLIC ShapeExport : public DrawingML {
private:
sal_Int32 mnXmlNamespace;
sal_Int32 mnShapeIdMax, mnPictureIdMax;
Fraction maFraction;
MapMode maMapModeSrc, maMapModeDest;
::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
struct ShapeCheck
{
bool operator()( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s1, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s2 ) const
{
return s1 == s2;
}
};
struct ShapeHash
{
std::hash<const char*> maHashFunction;
size_t operator()( const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > ) const;
};
typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
ShapeHashMap maShapeMap;
public:
ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
virtual ~ShapeExport() {}
sal_Int32 GetXmlNamespace() const;
ShapeExport& SetXmlNamespace( sal_Int32 nXmlNamespace );
static sal_Bool NonEmptyText( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, sal_Bool bClosed );
virtual ShapeExport&
WriteClosedBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteConnectorShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteCustomShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteEllipseShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet );
virtual ShapeExport&
WriteGraphicObjectShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteLineShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteNonVisualDrawingProperties( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, const char* sName );
virtual ShapeExport&
WriteNonVisualProperties( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteOpenBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteRectangleShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
/**
* Write the DrawingML for a particular shape.
*
* <p>This is the member function you want. It performs the type lookup and
* invokes the appropriate corresponding Write*() method for the specific
* type.</p>
*
* <p>To write an XShape, XShape::getShapeType() is called to determine
* the shape type, and the corresponding method in this table is
* invoked:</p>
*
* <table>
* <tr><th>Shape Type</th><th>Method</th></tr>
* <tr><td><tt>com.sun.star.drawing.ClosedBezierShape</tt></td> <td>ShapeExport::WriteClosedBezierShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.CustomShape</tt></td> <td>ShapeExport::WriteCustomShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.EllipseShape</tt></td> <td>ShapeExport::WriteEllipseShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.GraphicObjectShape</tt></td> <td>ShapeExport::WriteGraphicObjectShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.LineShape</tt></td> <td>ShapeExport::WriteLineShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.OpenBezierShape</tt></td> <td>ShapeExport::WriteOpenBezierShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.RectangleShape</tt></td> <td>ShapeExport::WriteRectangleShape</td></tr>
* <tr><td><tt>com.sun.star.drawing.TextShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.DateTimeShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.FooterShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.HeaderShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.NotesShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.OutlinerShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.SlideNumberShape</tt></td><td>ShapeExport::WriteTextShape</td></tr>
* <tr><td><tt>com.sun.star.presentation.TitleTextShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
* </table>
*
* <p>If the shape type is not recognized, then
* <tt>ShapeExport::WriteUnknownShape</tt> is called.</p>
*
* @param xShape The shape to export as DrawingML.
* @return <tt>*this</tt>
*/
virtual ShapeExport&
WriteShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteTextBox( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteTextShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
virtual ShapeExport&
WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
};
}}
#endif /* ndef _OOX_EXPORT_SHAPES_HXX_ */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile$
* $Revision$
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _OOX_EXPORT_UTILS_HXX_
#define _OOX_EXPORT_UTILS_HXX_
#define S(x) String( RTL_CONSTASCII_USTRINGPARAM( x ) )