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,6 +169,7 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star
}
Sequence < OUString > elementNames = xName->getElementNames();
if(xstyleLoader.is()){
Sequence<com::sun::star::beans::PropertyValue> pValue=xstyleLoader->getStyleLoaderOptions();
//Load the Styles from the Template URL Supplied in the TypeDetection file
......@@ -183,6 +184,7 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star
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;
......
......@@ -9,7 +9,7 @@
$RCSfile: body.xsl,v $
$Revision: 1.3 $
$Revision: 1.3.14.1 $
This file is part of OpenOffice.org.
......@@ -96,8 +96,16 @@
<!-- ID / NAME of text-box -->
<xsl:template match="@draw:name">
<xsl:attribute name="id">
<!-- a simplified string to ID conversion -->
<xsl:value-of select="translate(., '.,;: %()[]/\+', '_____________')"/>
<xsl:choose>
<xsl:when test="number(substring(.,1,1))">
<!-- Heuristic: If the first character is a number a 'a_' will be set
as prefix, as id have to be of type NMTOKEN -->
<xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
......@@ -140,13 +148,17 @@
<xsl:element namespace="{$namespace}" name="a">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
<xsl:value-of select="translate(@text:ref-name, '.,;: %()[]/\+', '_____________')"/>
</xsl:attribute>
<xsl:if test="@text:name">
<xsl:attribute name="title">
<xsl:value-of select="@text:name"/>
<xsl:choose>
<xsl:when test="number(substring(@text:ref-name,1,1))">
<!-- Heuristic: If the first character is a number a 'a_' will be set
as prefix, as id have to be of type NMTOKEN -->
<xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@* | node()">
<xsl:with-param name="globalData" select="$globalData"/>
......@@ -154,13 +166,37 @@
</xsl:element>
</xsl:template>
<xsl:template match="@text:name">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="number(substring(.,1,1))">
<!-- Heuristic: If the first character is a number a 'a_' will be set
as prefix, as id have to be of type NMTOKEN -->
<xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="text:sequence">
<xsl:param name="globalData"/>
<xsl:element namespace="{$namespace}" name="a">
<xsl:apply-templates select="@*" />
<xsl:attribute name="name">
<xsl:value-of select="translate(@text:ref-name, '.,;: %()[]/\+', '_____________')"/>
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="number(substring(@text:ref-name,1,1))">
<!-- Heuristic: If the first character is a number a 'a_' will be set
as prefix, as id have to be of type NMTOKEN -->
<xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
......@@ -174,8 +210,17 @@
<xsl:element namespace="{$namespace}" name="a">
<xsl:apply-templates select="@*" />
<xsl:attribute name="name">
<xsl:value-of select="translate(@text:name, '.,;: %()[]/\+', '_____________')"/>
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="number(substring(@text:name,1,1))">
<!-- Heuristic: If the first character is a number a 'a_' will be set
as prefix, as id have to be of type NMTOKEN -->
<xsl:value-of select="concat('a_',translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
......@@ -205,9 +250,6 @@
<!-- @text:title exist only in text:bibliography-mark -->
<xsl:template match="@text:title">
<xsl:attribute name="name">
<xsl:value-of select="translate(., '.,;: %()[]/\+', '_____________')"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="."/>
</xsl:attribute>
......@@ -224,6 +266,60 @@
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="office:annotation">
<xsl:element name="span">
<xsl:attribute name="title">annotation</xsl:attribute>
<xsl:attribute name="class">annotation_style_by_filter</xsl:attribute>
<xsl:apply-templates select="@*" />
<br/>
<xsl:text>[ANNOTATION:</xsl:text>
<br/>
<xsl:apply-templates select="*" mode="annotation"/>
<xsl:text>]</xsl:text>
</xsl:element>
</xsl:template>
<xsl:template match="text:p" mode="annotation">
<br/>
<xsl:element name="span">
<xsl:text>NOTE: '</xsl:text>
<xsl:apply-templates />
<xsl:text>'</xsl:text>
</xsl:element>
</xsl:template>
<xsl:template match="dc:creator" mode="annotation">
<br/>
<xsl:element name="span">
<xsl:attribute name="title">dc:creator</xsl:attribute>
<xsl:text>BY '</xsl:text>
<xsl:apply-templates />
<xsl:text>'</xsl:text>
</xsl:element>
</xsl:template>
<xsl:template match="dc:date" mode="annotation">
<br/>
<xsl:element name="span">
<xsl:attribute name="title">dc:date</xsl:attribute>
<xsl:text>ON '</xsl:text>
<xsl:apply-templates />
<xsl:text>'</xsl:text>
</xsl:element>
</xsl:template>
<xsl:template match="meta:date-string" mode="annotation">
<br/>
<xsl:element name="span">
<xsl:attribute name="title">meta-date-string</xsl:attribute>
<xsl:text>META DATE '</xsl:text>
<xsl:apply-templates />
<xsl:text>'</xsl:text>
</xsl:element>
</xsl:template>
<!-- *************** -->
<!-- *** HELPER *** -->
<!-- *************** -->
......@@ -243,7 +339,7 @@
<xsl:apply-templates mode="concatenate"/>
</xsl:variable>
<xsl:value-of select="translate($title, '.,;: %()[]/\+', '_____________')"/>
<xsl:value-of select="concat('a_', translate(normalize-space($title), '.,;: %()[]/\+', '_____________'))"/>
</xsl:when>
<xsl:when test="self::draw:image[office:binary-data]">
<xsl:text>data:image/*;base64,</xsl:text><xsl:value-of select="office:binary-data"/>
......@@ -299,7 +395,7 @@
<!-- ******************** -->
<!-- ignore / neglect the following elements -->
<xsl:template match="office:forms | text:alphabetical-index-mark | text:alphabetical-index-mark-end | text:alphabetical-index-mark-start | text:bibliography-source | text:reference-mark-end | text:sequence-decls | text:soft-page-break | text:table-of-content-source | text:tracked-changes | text:user-field-decls"/>
<xsl:template match="draw:custom-shape | draw:g | office:forms | text:alphabetical-index-mark | text:alphabetical-index-mark-end | text:alphabetical-index-mark-start | text:bibliography-source | text:number | text:reference-mark-end | text:sequence-decls | text:soft-page-break | text:table-of-content-source | text:tracked-changes | text:user-field-decls"/>
<!-- default template used by purpose-->
<xsl:template match="text:bibliography | text:change-end | text:change-start">
......
......@@ -9,7 +9,7 @@
$RCSfile: style_mapping_css.xsl,v $
$Revision: 1.3 $
$Revision: 1.3.14.3 $
This file is part of OpenOffice.org.
......@@ -98,7 +98,7 @@
<!-- Maps fo:margin as well fo:margin-top, fo:margin-bottom, fo:padding-left, fo:margin-right -->
<!-- Maps fo:padding as well fo:padding-top, fo:padding-bottom, fo:padding-left, fo:padding-right -->
<xsl:template match="@fo:line-height | @fo:width |@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right | @fo:padding | @fo:padding-top | @fo:padding-bottom | @fo:padding-left | @fo:padding-right">
<xsl:template match="@fo:letter-spacing | @fo:line-height | @fo:width |@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right | @fo:padding | @fo:padding-top | @fo:padding-bottom | @fo:padding-left | @fo:padding-right">
<xsl:value-of select="substring-after(name(), ':')"/>
<xsl:text>:</xsl:text>
<!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
......@@ -118,10 +118,24 @@
Otherwise a table cell style-class would always be outnumbered by the run-time alignment value -->
<xsl:choose>
<xsl:when test="contains(., 'start')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:right ! important; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:left ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(., 'end')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:left ! important;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:right ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:</xsl:text>
......@@ -281,8 +295,12 @@
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="@style:writing-mode">
<xsl:text>writing-mode:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
</xsl:template>
<!-- *** Properties with a no 'fo:' or 'style:' prefix *** -->
<xsl:template match="@table:align">
<xsl:choose>
<xsl:when test=".='left'">
......
......@@ -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="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(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
<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: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 -->
<!-- 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: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 *** -->
<!-- ******************** -->
......@@ -538,4 +547,12 @@ Scenarios unmatched:
</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>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,7 +9,7 @@
$RCSfile: header.xsl,v $
$Revision: 1.3 $
$Revision: 1.3.14.2 $
This file is part of OpenOffice.org.
......@@ -112,11 +112,16 @@
</xsl:text>
<xsl:text>li { list-style: none; margin:0; padding:0;}
</xsl:text>
<xsl:text>li span.odfLiEnd { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
<xsl:comment> "li span.odfLiEnd" - IE 7 issue</xsl:comment>
<xsl:text>
</xsl:text>
<xsl:text>li span. { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
</xsl:text>
<xsl:text>span.footnodeNumber { padding-right:1em; }
</xsl:text>
<xsl:text>* { margin:0; }
<xsl:text>span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
</xsl:text>
<xsl:text>* { margin:0;}
</xsl:text>
<xsl:call-template name="write-mapped-CSS-styles">
<xsl:with-param name="globalData" select="$globalData" />
......@@ -169,13 +174,37 @@
<xsl:template name='create-page-layout'>
<xsl:param name="globalData" />
<!-- approximation to find the correct master page style (with page dimensions) -->
<xsl:variable name="masterPageNames">
<!-- set context to styles.xml -->
<xsl:for-each select="$globalData/all-doc-styles/style">
<!-- Loop over every style:style containing a @style:master-page-name attribute -->
<xsl:for-each select="key('masterPage','count')">
<!-- set context to styles.xml -->
<xsl:for-each select="/*/office:body">
<!-- Check if this style is being used in the body -->
<xsl:if test="key('elementUsingStyle', ../@style:name)">
<!-- Check every master-page-name if it is not emtpy and return as ';' separated list -->
<xsl:if test="string-length(../@style:master-page-name) &gt; 0"><xsl:value-of select="../@style:master-page-name"/>;</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
<xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
<!-- Find the according style:page-layout and store the properties in a variable -->
<xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
<xsl:text>@page { </xsl:text>
<xsl:call-template name="page-size">
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="pageProperties" select="$pageProperties" />
</xsl:call-template>
<xsl:call-template name="page-margin">
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="pageProperties" select="$pageProperties" />
</xsl:call-template>
<xsl:text> }
......@@ -186,9 +215,7 @@
<xsl:template name="page-size">
<xsl:param name="globalData" />
<!-- approximation as attribute belongs to a page style, which won't work in XHTML -->
<xsl:variable name="pageProperties" select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
<xsl:param name="pageProperties" />
<xsl:variable name="printOrientation" select="$pageProperties/@style:print-orientation" />
<xsl:variable name="pageWidth" select="$pageProperties/@fo:page-width" />
......@@ -213,9 +240,7 @@
<xsl:template name="page-margin">
<xsl:param name="globalData" />
<!-- approximation as attribute belongs to a page style, which won't work in XHTML -->
<xsl:variable name="pageProperties" select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
<xsl:param name="pageProperties" />
<xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" />
<xsl:if test="$marginTop">
......@@ -293,7 +318,7 @@
<!-- explicit output content-type for low-tech browser (e.g. IE6) -->
<xsl:element name="meta">
<xsl:attribute name="http-equiv">Content-Type</xsl:attribute>
<xsl:attribute name="content">text/html; charset=utf-8</xsl:attribute>
<xsl:attribute name="content">application/xhtml+xml; charset=utf-8</xsl:attribute>
</xsl:element>
<!-- title of document for browser frame title -->
......
......@@ -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 ) )
#define US(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ))
#define I32S(x) OString::valueOf( (sal_Int32) x ).getStr()
#define I64S(x) OString::valueOf( (sal_Int64) x ).getStr()
#define H32S(x) OString::valueOf( (sal_Int32) x, 16 ).getStr()
#define H64S(x) OString::valueOf( (sal_Int64) x, 16 ).getStr()
#define IS(x) OString::valueOf( x ).getStr()
#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
#define ST(x) ByteString( x, RTL_TEXTENCODING_UTF8 ).GetBuffer()
#ifndef DBG
# if OSL_DEBUG_LEVEL > 0
# define DBG(x) x
# else
# define DBG(x)
# endif
#endif
// ---------------------------------------------------------------------------------------------
static inline sal_Int64 PPTtoEMU( INT32 nPPT )
{
return (sal_Int64)( (double)nPPT * 1587.5 );
}
// ---------------------------------------------------------------------------------------------
static inline sal_Int64 MM100toEMU( INT32 nMM100 )
{
return (sal_Int64)nMM100 * 360;
}
// ---------------------------------------------------------------------------------------------
static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
{
return sal_Int64( nTwips ) * 635;
}
#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.
*
************************************************************************/
#include <oox/dllapi.h>
#include <sax/fshelper.hxx>
#include <svx/escherex.hxx>
namespace rtl {
class OString;
class OStringBuffer;
}
namespace oox {
namespace vml {
class OOX_DLLPUBLIC VMLExport : public EscherEx
{
/// Fast serializer to output the data
::sax_fastparser::FSHelperPtr m_pSerializer;
/// Fill the shape attributes as they come.
::sax_fastparser::FastAttributeList *m_pShapeAttrList;
/// Remember the shape type.
sal_uInt32 m_nShapeType;
/// Remember the shape flags.
sal_uInt32 m_nShapeFlags;
/// Remember style, the most important shape attribute ;-)
rtl::OStringBuffer *m_pShapeStyle;
/// Remember which shape types we had already written.
bool *m_pShapeTypeWritten;
public:
VMLExport( ::sax_fastparser::FSHelperPtr pSerializer );
virtual ~VMLExport();
::sax_fastparser::FSHelperPtr
GetFS() { return m_pSerializer; }
/// Export the sdr object as VML.
///
/// Call this when you need to export the object as VML.
using EscherEx::AddSdrObject;
protected:
/// Add an attribute to the generated <v:shape/> element.
///
/// This should be called from within StartShape() to ensure that the
/// added attribute is preserved.
void AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& sValue );
/// Start the shape for which we just collected the information.
///
/// Returns the element's tag number, -1 means we wrote nothing.
virtual sal_Int32 StartShape();
/// End the shape.
///
/// The parameter is just what we got from StartShape().
virtual void EndShape( sal_Int32 nShapeElement );
virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
private:
virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
virtual void CloseContainer();
virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
virtual void LeaveGroup();
virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 );
private:
/// Create an OString representing the id from a numerical id.
static rtl::OString ShapeIdString( sal_uInt32 nId );
/// Add starting and ending point of a line to the m_pShapeAttrList.
void AddLineDimensions( const Rectangle& rRectangle );
/// Add position and size to the OStringBuffer.
void AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle );
};
} // namespace vml
} // namespace oox
/*************************************************************************
*
* 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_PPT_HEADERFOOTER
#define OOX_PPT_HEADERFOOTER
#include <sal/types.h>
namespace oox { namespace ppt {
struct HeaderFooter
{
sal_Bool mbSlideNumber;
sal_Bool mbHeader;
sal_Bool mbFooter;
sal_Bool mbDateTime;
HeaderFooter()
: mbSlideNumber( sal_True )
, mbHeader( sal_True )
, mbFooter( sal_True )
, mbDateTime( sal_True ) {};
};
} }
#endif
......@@ -38,6 +38,7 @@
#include "oox/drawingml/clrscheme.hxx"
#include "oox/drawingml/textliststyle.hxx"
#include "oox/drawingml/textparagraphproperties.hxx"
#include <oox/ppt/headerfooter.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/animations/XAnimationNode.hpp>
......@@ -109,6 +110,7 @@ public:
oox::drawingml::ShapePtr getShapes() { return maShapesPtr; }
::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
......@@ -134,6 +136,7 @@ private:
oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
oox::ppt::HeaderFooter maHeaderFooter;
sal_Int32 mnLayoutValueToken;
sal_Bool mbMaster;
sal_Bool mbNotes;
......
oox oox : vos cppu cppuhelper comphelper sal offapi sax basegfx tools BOOST:boost NULL
oox oox : vos cppu cppuhelper comphelper sal offapi sax basegfx tools vcl BOOST:boost NULL
oox oox usr1 - all oox_mkout NULL
oox oox\prj get - all oox_prj NULL
oox oox\source\token nmake - all oox_token NULL
......
......@@ -75,6 +75,7 @@ const sal_Char SERVICE_CHART2_CANDLE[] = "com.sun.star.chart2.CandleStickChartT
const sal_Char SERVICE_CHART2_COLUMN[] = "com.sun.star.chart2.ColumnChartType";
const sal_Char SERVICE_CHART2_LINE[] = "com.sun.star.chart2.LineChartType";
const sal_Char SERVICE_CHART2_NET[] = "com.sun.star.chart2.NetChartType";
const sal_Char SERVICE_CHART2_FILLEDNET[] = "com.sun.star.chart2.FilledNetChartType";
const sal_Char SERVICE_CHART2_PIE[] = "com.sun.star.chart2.PieChartType";
const sal_Char SERVICE_CHART2_SCATTER[] = "com.sun.star.chart2.ScatterChartType";
const sal_Char SERVICE_CHART2_BUBBLE[] = "com.sun.star.chart2.BubbleChartType";
......@@ -91,7 +92,7 @@ static const TypeGroupInfo spTypeInfos[] =
{ TYPEID_AREA, TYPECATEGORY_LINE, SERVICE_CHART2_AREA, VARPOINTMODE_NONE, csscd::CENTER, true, true, false, true, false, true, false, true, true, false, false },
{ TYPEID_STOCK, TYPECATEGORY_LINE, SERVICE_CHART2_CANDLE, VARPOINTMODE_NONE, csscd::RIGHT, true, false, false, false, false, true, false, true, false, true, false },
{ TYPEID_RADARLINE, TYPECATEGORY_RADAR, SERVICE_CHART2_NET, VARPOINTMODE_SINGLE, csscd::TOP, false, false, true, false, false, true, false, false, false, false, false },
{ TYPEID_RADARAREA, TYPECATEGORY_RADAR, SERVICE_CHART2_NET, VARPOINTMODE_NONE, csscd::TOP, false, false, true, true, false, true, false, false, false, false, false },
{ TYPEID_RADARAREA, TYPECATEGORY_RADAR, SERVICE_CHART2_FILLEDNET, VARPOINTMODE_NONE, csscd::TOP, false, false, true, true, false, true, false, false, true, false, false },
{ TYPEID_PIE, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, true, false, false, false, false, false },
{ TYPEID_DOUGHNUT, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, false, true, false, false, false, false, false },
{ TYPEID_OFPIE, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, true, false, false, false, false, false },
......@@ -485,7 +486,7 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym
void TypeGroupConverter::convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const
{
if( !isSeriesFrameFormat() )
if( !isSeriesFrameFormat() && (maTypeInfo.meTypeCategory != TYPECATEGORY_RADAR) )
{
namespace cssc = ::com::sun::star::chart2;
cssc::CurveStyle eCurveStyle = bOoxSmooth ? cssc::CurveStyle_CUBIC_SPLINES : cssc::CurveStyle_LINES;
......
......@@ -55,33 +55,106 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
: ContextHandler( rParent )
, maProperties(aProperties)
{
OUString sURL, sHref;
OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id );
if ( aRelId.getLength() )
{
OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer);
const OUString& sHref = getRelations().getExternalTargetFromRelId( aRelId );
sHref = getRelations().getExternalTargetFromRelId( aRelId );
if( sHref.getLength() > 0 )
{
OSL_TRACE("OOX: URI href %s", ::rtl::OUStringToOString (sHref, RTL_TEXTENCODING_UTF8).pData->buffer);
maProperties[ PROP_URL ] <<= getFilter().getAbsoluteUrl( sHref );
sURL = getFilter().getAbsoluteUrl( sHref );
}
}
OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip );
if ( sTooltip.getLength() )
maProperties[ PROP_Representation ] <<= sTooltip;
OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame );
if( sFrame.getLength() )
maProperties[ PROP_TargetFrame ] <<= sFrame;
OUString aAction = xAttributes->getOptionalValue( XML_action );
if ( aAction.getLength() )
{
// reserved values of the unrestricted string aAction:
// ppaction://customshow?id=SHOW_ID // custom presentation
// ppaction://hlinkfile // external file via r:id
// ppaction://hlinkpres?slideindex=SLIDE_NUM // external presentation via r:id
// ppaction://hlinkshowjump?jump=endshow
// ppaction://hlinkshowjump?jump=firstslide
// ppaction://hlinkshowjump?jump=lastslide
// ppaction://hlinkshowjump?jump=lastslideviewed
// ppaction://hlinkshowjump?jump=nextslide
// ppaction://hlinkshowjump?jump=previousslide
// ppaction://hlinksldjump
// ppaction://macro?name=MACRO_NAME
// ppaction://program
// sValue = OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) );
// const rtl::OUString sUnvisitedCharStyleName( CREATE_OUSTRING( "UnvisitedCharStyleName" ) );
// maProperties[ sUnvisitedCharStyleName ] <<= sValue;
// const rtl::OUString sVisitedCharStyleName( CREATE_OUSTRING( "VisitedCharStyleName" ) );
// maProperties[ sVisitedCharStyleName ] <<= sValue;
const OUString sPPAction( CREATE_OUSTRING( "ppaction://" ) );
if ( aAction.matchIgnoreAsciiCase( sPPAction, 0 ) )
{
OUString aPPAct( aAction.copy( sPPAction.getLength() ) );
sal_Int32 nIndex = aPPAct.indexOf( '?', 0 );
OUString aPPAction( nIndex > 0 ? aPPAct.copy( 0, nIndex ) : aPPAct );
const OUString sHlinkshowjump( CREATE_OUSTRING( "hlinkshowjump" ) );
const OUString sHlinksldjump( CREATE_OUSTRING( "hlinksldjump" ) );
if ( aPPAction.match( sHlinkshowjump ) )
{
const OUString sJump( CREATE_OUSTRING( "jump=" ) );
if ( aPPAct.match( sJump, nIndex + 1 ) )
{
OUString aDestination( aPPAct.copy( nIndex + 1 + sJump.getLength() ) );
sURL = sURL.concat( CREATE_OUSTRING( "#action?jump=" ) );
sURL = sURL.concat( aDestination );
}
}
else if ( aPPAction.match( sHlinksldjump ) )
{
sURL = OUString();
sal_Int32 nIndex2 = 0;
while ( nIndex2 < sHref.getLength() )
{
sal_Unicode nChar = sHref[ nIndex2 ];
if ( ( nChar >= '0' ) && ( nChar <= '9' ) )
break;
nIndex2++;
}
if ( nIndex2 && ( nIndex2 != sHref.getLength() ) )
{
sal_Int32 nLength = 1;
while( ( nIndex2 + nLength ) < sHref.getLength() )
{
sal_Unicode nChar = sHref[ nIndex2 + nLength ];
if ( ( nChar < '0' ) || ( nChar > '9' ) )
break;
nLength++;
}
sal_Int32 nPageNumber = sHref.copy( nIndex2, nLength ).toInt32();
if ( nPageNumber )
{
const OUString sSlide( CREATE_OUSTRING( "slide" ) );
const OUString sNotesSlide( CREATE_OUSTRING( "notesSlide" ) );
const OUString aSlideType( sHref.copy( 0, nIndex2 ) );
if ( aSlideType.match( sSlide ) )
sURL = CREATE_OUSTRING( "#Slide " ).concat( rtl::OUString::valueOf( nPageNumber ) );
else if ( aSlideType.match( sNotesSlide ) )
sURL = CREATE_OUSTRING( "#Notes " ).concat( rtl::OUString::valueOf( nPageNumber ) );
// else: todo for other types such as notesMaster or slideMaster as they can't be referenced easily
}
}
}
}
}
if ( sURL.getLength() )
maProperties[ PROP_URL ] <<= sURL;
// TODO unhandled
// XML_invalidUrl
// XML_history
// XML_highlightClick
// XML_endSnd
// XML_action
}
HyperLinkContext::~HyperLinkContext()
......
......@@ -148,7 +148,7 @@ void Shape::addShape(
rtl::OUString sServiceName( msServiceName );
if( sServiceName.getLength() )
{
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect ) );
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, sal_False ) );
if( pShapeMap && msId.getLength() )
{
......@@ -247,7 +247,8 @@ Reference< XShape > Shape::createAndInsert(
const rtl::OUString& rServiceName,
const ThemePtr& rxTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const awt::Rectangle* pShapeRect )
const awt::Rectangle* pShapeRect,
sal_Bool bClearText )
{
awt::Size aSize( pShapeRect ? awt::Size( pShapeRect->Width, pShapeRect->Height ) : maSize );
awt::Point aPosition( pShapeRect ? awt::Point( pShapeRect->X, pShapeRect->Y ) : maPosition );
......@@ -367,6 +368,17 @@ Reference< XShape > Shape::createAndInsert(
}
rxShapes->add( mxShape );
// sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape
if ( bClearText )
{
uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
if ( xText.is() )
{
OUString aEmpty;
xText->setString( aEmpty );
}
}
LineProperties aLineProperties;
aLineProperties.maLineFill.moFillType = XML_noFill;
sal_Int32 nLinePhClr = -1;
......
......@@ -91,12 +91,21 @@ void TextRun::insertAt(
Reference< XTextField > xField( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.text.TextField.URL" ) ), UNO_QUERY );
if( xField.is() )
{
Reference< XTextCursor > xTextFieldCursor = xText->createTextCursor();
xTextFieldCursor->gotoEnd( sal_False );
PropertySet aFieldProps( xField );
aFieldProps.setProperties( maTextCharacterProperties.maHyperlinkPropertyMap );
aFieldProps.setProperty( PROP_Representation, getText() );
Reference< XTextContent > xContent( xField, UNO_QUERY);
xText->insertTextContent( xStart, xContent, sal_False );
xTextFieldCursor->gotoEnd( sal_True );
oox::core::TextField aTextField;
aTextField.xText = xText;
aTextField.xTextCursor = xTextFieldCursor;
aTextField.xTextField = xField;
rFilterBase.getTextFieldStack().push_back( aTextField );
}
else
{
......
presetTextWarpDefinitions.xml and presetShapeDefinitions.xml come from the
OOXML documentation (TC45).
This diff is collapsed.
PRJ=..$/..
PRJNAME=oox
TARGET=export
AUTOSEG=true
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE: $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
$(SLO)$/drawingml.obj \
$(SLO)$/shapes.obj \
$(SLO)$/vmlexport.obj \
$(SLO)$/vmlexport-shape-types.obj
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
$(MISC)$/vmlexport-shape-types.cxx : preset-definitions-to-shape-types.pl presetShapeDefinitions.xml presetTextWarpDefinitions.xml
$(PERL) $< > $@.in_progress 2> $(MISC)$/vmlexport-shape-types.log && mv $@.in_progress $@
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*************************************************************************
*
* 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.
*
************************************************************************/
#include "headerfootercontext.hxx"
#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
namespace oox { namespace ppt {
HeaderFooterContext::HeaderFooterContext( ContextHandler& rParent,
const Reference< XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter )
: ContextHandler( rParent )
{
AttributeList aAttribs( xAttribs );
if ( xAttribs->hasAttribute( XML_sldNum ) )
{
rHeaderFooter.mbSlideNumber = aAttribs.getBool( XML_sldNum, sal_True );
}
if ( xAttribs->hasAttribute( XML_hdr ) )
{
rHeaderFooter.mbHeader = aAttribs.getBool( XML_hdr, sal_True );
}
if ( xAttribs->hasAttribute( XML_ftr ) )
{
rHeaderFooter.mbFooter = aAttribs.getBool( XML_ftr, sal_True );
}
if ( xAttribs->hasAttribute( XML_dt ) )
{
rHeaderFooter.mbDateTime = aAttribs.getBool( XML_dt, sal_True );
}
}
HeaderFooterContext::~HeaderFooterContext( )
{
}
} }
/*************************************************************************
*
* 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_PPT_HEADERFOOTERCONTEXT
#define OOX_PPT_HEADERFOOTERCONTEXT
#include "oox/ppt/headerfooter.hxx"
#include "oox/core/contexthandler.hxx"
namespace oox { namespace ppt {
/** CT_HeaderFooter */
class HeaderFooterContext : public ::oox::core::ContextHandler
{
public:
HeaderFooterContext( ::oox::core::ContextHandler& rParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter );
~HeaderFooterContext( );
};
} }
#endif
......@@ -34,6 +34,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include "headerfootercontext.hxx"
#include "oox/ppt/layoutfragmenthandler.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/core/namespaces.hxx"
......@@ -72,6 +73,9 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext(
case NMSP_PPT|XML_sldLayout: // CT_SlideLayout
mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType
break;
case NMSP_PPT|XML_hf: // CT_HeaderFooter
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
default:
xRet.set( SlideFragmentHandler::createFastChildContext( aElementToken, xAttribs ) );
}
......
......@@ -54,6 +54,7 @@ SLOFILES = \
$(SLO)$/commontimenodecontext.obj \
$(SLO)$/conditioncontext.obj \
$(SLO)$/customshowlistcontext.obj \
$(SLO)$/headerfootercontext.obj \
$(SLO)$/layoutfragmenthandler.obj\
$(SLO)$/pptfilterhelpers.obj\
$(SLO)$/pptimport.obj\
......
......@@ -82,6 +82,7 @@ void PPTShape::addShape(
{
oox::drawingml::TextListStylePtr aMasterTextListStyle;
Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
sal_Bool bClearText = sal_False;
if ( sServiceName != OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) )
{
......@@ -122,24 +123,28 @@ void PPTShape::addShape(
{
const rtl::OUString sDateTimeShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.DateTimeShape" ) );
sServiceName = sDateTimeShapeService;
bClearText = sal_True;
}
break;
case XML_hdr :
{
const rtl::OUString sHeaderShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.HeaderShape" ) );
sServiceName = sHeaderShapeService;
bClearText = sal_True;
}
break;
case XML_ftr :
{
const rtl::OUString sFooterShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.FooterShape" ) );
sServiceName = sFooterShapeService;
bClearText = sal_True;
}
break;
case XML_sldNum :
{
const rtl::OUString sSlideNumberShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.SlideNumberShape" ) );
sServiceName = sSlideNumberShapeService;
bClearText = sal_True;
}
break;
case XML_sldImg :
......@@ -157,8 +162,24 @@ void PPTShape::addShape(
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
setMasterTextListStyle( aMasterTextListStyle );
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect ) );
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, bClearText ) );
if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) )
{
try
{
rtl::OUString aTitleText;
Reference< XTextRange > xText( xShape, UNO_QUERY_THROW );
aTitleText = xText->getString();
if ( aTitleText.getLength() && ( aTitleText.getLength() < 64 ) ) // just a magic value, but we don't want to set slide names which are too long
{
Reference< container::XNamed > xName( rSlidePersist.getPage(), UNO_QUERY_THROW );
xName->setName( aTitleText );
}
}
catch( uno::Exception& )
{
}
}
if( pShapeMap && msId.getLength() )
{
(*pShapeMap)[ msId ] = shared_from_this();
......
......@@ -46,6 +46,7 @@
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "tokens.hxx"
#include "properties.hxx"
using rtl::OUString;
using namespace oox::core;
......@@ -189,6 +190,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
case NMSP_PPT|XML_txBody:
{
oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True );
mpShapePtr->setTextBody( xTextBody );
xRet = new oox::drawingml::TextBodyContext( *this, *xTextBody );
break;
......
......@@ -68,6 +68,14 @@ PresentationFragmentHandler::PresentationFragmentHandler( XmlFilterBase& rFilter
: FragmentHandler( rFilter, rFragmentPath )
, mpTextListStyle( new TextListStyle )
{
TextParagraphPropertiesVector& rParagraphDefaulsVector( mpTextListStyle->getListStyle() );
TextParagraphPropertiesVector::iterator aParagraphDefaultIter( rParagraphDefaulsVector.begin() );
while( aParagraphDefaultIter != rParagraphDefaulsVector.end() )
{
// ppt is having zero bottom margin per default, whereas OOo is 0,5cm,
// so this attribute needs to be set always
(*aParagraphDefaultIter++)->getParaBottomMargin() = TextSpacing( 0 );
}
}
PresentationFragmentHandler::~PresentationFragmentHandler() throw()
......@@ -78,6 +86,66 @@ void PresentationFragmentHandler::startDocument() throw (SAXException, RuntimeEx
{
}
void ResolveTextFields( XmlFilterBase& rFilter )
{
const oox::core::TextFieldStack& rTextFields = rFilter.getTextFieldStack();
if ( rTextFields.size() )
{
Reference< frame::XModel > xModel( rFilter.getModel() );
oox::core::TextFieldStack::const_iterator aIter( rTextFields.begin() );
while( aIter != rTextFields.end() )
{
const OUString sURL = CREATE_OUSTRING( "URL" );
Reference< drawing::XDrawPagesSupplier > xDPS( xModel, uno::UNO_QUERY_THROW );
Reference< drawing::XDrawPages > xDrawPages( xDPS->getDrawPages(), uno::UNO_QUERY_THROW );
const oox::core::TextField& rTextField( *aIter++ );
Reference< XPropertySet > xPropSet( rTextField.xTextField, UNO_QUERY );
Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
if ( xPropSetInfo->hasPropertyByName( sURL ) )
{
rtl::OUString aURL;
if ( xPropSet->getPropertyValue( sURL ) >>= aURL )
{
const OUString sSlide = CREATE_OUSTRING( "#Slide " );
const OUString sNotes = CREATE_OUSTRING( "#Notes " );
sal_Bool bNotes = sal_False;
sal_Int32 nPageNumber = 0;
if ( aURL.match( sSlide ) )
nPageNumber = aURL.copy( sSlide.getLength() ).toInt32();
else if ( aURL.match( sNotes ) )
{
nPageNumber = aURL.copy( sNotes.getLength() ).toInt32();
bNotes = sal_True;
}
if ( nPageNumber )
{
try
{
Reference< XDrawPage > xDrawPage;
xDrawPages->getByIndex( nPageNumber - 1 ) >>= xDrawPage;
if ( bNotes )
{
Reference< ::com::sun::star::presentation::XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
xDrawPage = xPresentationPage->getNotesPage();
}
Reference< container::XNamed > xNamed( xDrawPage, UNO_QUERY_THROW );
aURL = CREATE_OUSTRING( "#" ).concat( xNamed->getName() );
xPropSet->setPropertyValue( sURL, Any( aURL ) );
Reference< text::XTextContent > xContent( rTextField.xTextField, UNO_QUERY);
Reference< text::XTextRange > xTextRange( rTextField.xTextCursor, UNO_QUERY );
rTextField.xText->insertTextContent( xTextRange, xContent, sal_True );
}
catch( uno::Exception& )
{
}
}
}
}
}
}
}
void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeException)
{
// todo: localized progress bar text
......@@ -216,6 +284,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
}
}
}
ResolveTextFields( rFilter );
}
catch( uno::Exception& )
{
......@@ -297,6 +366,26 @@ bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlide
awt::Size& rPageSize( pSlidePersistPtr->isNotesPage() ? maNotesSize : maSlideSize );
xPropertySet->setPropertyValue( sWidth, Any( rPageSize.Width ) );
xPropertySet->setPropertyValue( sHeight, Any( rPageSize.Height ) );
oox::ppt::HeaderFooter aHeaderFooter( pSlidePersistPtr->getHeaderFooter() );
if ( !pSlidePersistPtr->isMasterPage() )
aHeaderFooter.mbSlideNumber = aHeaderFooter.mbHeader = aHeaderFooter.mbFooter = aHeaderFooter.mbDateTime = sal_False;
try
{
static const OUString sIsHeaderVisible = CREATE_OUSTRING( "IsHeaderVisible" );
static const OUString sIsFooterVisible = CREATE_OUSTRING( "IsFooterVisible" );
static const OUString sIsDateTimeVisible = CREATE_OUSTRING( "IsDateTimeVisible" );
static const OUString sIsPageNumberVisible = CREATE_OUSTRING( "IsPageNumberVisible" );
if ( pSlidePersistPtr->isNotesPage() )
xPropertySet->setPropertyValue( sIsHeaderVisible, Any( aHeaderFooter.mbHeader ) );
xPropertySet->setPropertyValue( sIsFooterVisible, Any( aHeaderFooter.mbFooter ) );
xPropertySet->setPropertyValue( sIsDateTimeVisible, Any( aHeaderFooter.mbDateTime ) );
xPropertySet->setPropertyValue( sIsPageNumberVisible, Any( aHeaderFooter.mbSlideNumber ) );
}
catch( uno::Exception& )
{
}
}
pSlidePersistPtr->setPath( rxSlideFragmentHandler->getFragmentPath() );
return getFilter().importFragment( rxSlideFragmentHandler );
......
......@@ -38,6 +38,7 @@
#include "oox/helper/propertyset.hxx"
#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "headerfootercontext.hxx"
#include "oox/ppt/backgroundproperties.hxx"
#include "oox/ppt/slidefragmenthandler.hxx"
#include "oox/ppt/slidetimingcontext.hxx"
......@@ -122,6 +123,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
case NMSP_PPT|XML_transition: // CT_SlideTransition
xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) );
break;
case NMSP_PPT|XML_hf:
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
// BackgroundGroup
case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties
......
AbsoluteName
Action
ActiveSplitRange
ActiveTable
Adjust
......@@ -135,6 +136,7 @@ FirstPageNumber
FocusOnClick
FontCharset
FontHeight
FontIndependentLineSpacing
FontName
FontSlant
FontStrikeout
......
......@@ -1501,6 +1501,9 @@ cyan
cycle
cylinder
d
dc
dcmitype
dcterms
dLbl
dLblPos
dLbls
......@@ -5467,7 +5470,9 @@ vol
volType
volTypes
vstream
vt
w
w10
wAfter
wArH
wBefore
......@@ -5545,6 +5550,7 @@ workbookView
workbookViewId
worksheet
worksheetSource
wp
wpJustification
wpSpaceWidth
wrap
......@@ -5568,6 +5574,7 @@ xMode
xSplit
xVal
xWindow
xdr
xf
xfDxf
xfId
......@@ -5586,6 +5593,7 @@ xmlns
xpath
xrange
xscale
xsi
xy
y
yAlign
......
......@@ -39,7 +39,7 @@
#include "node.hxx"
#include <libxml/tree.h>
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
......@@ -42,7 +42,7 @@
#include "element.hxx"
#include "attr.hxx"
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
......@@ -30,6 +30,8 @@
#include "cdatasection.hxx"
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
namespace DOM
{
CCDATASection::CCDATASection(const xmlNodePtr aNodePtr)
......
......@@ -37,7 +37,7 @@
#include "text.hxx"
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
......@@ -42,7 +42,7 @@
#include <libxml/tree.h>
#include "node.hxx"
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
......@@ -41,7 +41,7 @@
#include "node.hxx"
#include "libxml/tree.h"
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
......@@ -30,6 +30,8 @@
#include "comment.hxx"
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
namespace DOM
{
CComment::CComment(const xmlNodePtr aNodePtr)
......
......@@ -36,7 +36,7 @@
#include <com/sun/star/xml/dom/XComment.hpp>
#include "characterdata.hxx"
using namespace rtl;
using ::rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::dom;
......
This diff is collapsed.
......@@ -34,7 +34,7 @@
#include <list>
#include <set>
#include <sal/types.h>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase6.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/beans/StringPair.hpp>
......@@ -45,7 +45,9 @@
#include <com/sun/star/xml/dom/events/XDocumentEvent.hpp>
#include <com/sun/star/xml/dom/events/XEvent.hpp>
#include <com/sun/star/xml/sax/XSAXSerializable.hpp>
#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/XActiveDataControl.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
......@@ -68,9 +70,9 @@ using namespace com::sun::star::xml::dom::events;
namespace DOM
{
class CDocument : public cppu::ImplInheritanceHelper5<
class CDocument : public cppu::ImplInheritanceHelper6<
CNode, XDocument, XDocumentEvent,
XActiveDataControl, XActiveDataSource, XSAXSerializable>
XActiveDataControl, XActiveDataSource, XSAXSerializable, XFastSAXSerializable>
{
friend class CNode;
typedef std::list< Reference< XNode >* > nodereflist_t;
......@@ -97,6 +99,8 @@ namespace DOM
virtual void SAL_CALL saxify(
const Reference< XDocumentHandler >& i_xHandler);
virtual void SAL_CALL fastSaxify( Context& rContext );
/**
Creates an Attr of the given name.
*/
......@@ -347,12 +351,18 @@ namespace DOM
return CNode::setPrefix(prefix);
}
// ::com::sun::star::xml::sax::XSAXSerializable
virtual void SAL_CALL serialize(
const Reference< XDocumentHandler >& i_xHandler,
const Sequence< beans::StringPair >& i_rNamespaces)
throw (RuntimeException, SAXException);
// ::com::sun::star::xml::sax::XFastSAXSerializable
virtual void SAL_CALL fastSerialize( const Reference< XFastDocumentHandler >& handler,
const Reference< XFastTokenHandler >& tokenHandler,
const Sequence< beans::StringPair >& i_rNamespaces,
const Sequence< beans::Pair< rtl::OUString, sal_Int32 > >& namespaces )
throw (SAXException, RuntimeException);
};
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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