summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2010-01-28 19:03:55 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2010-01-28 19:03:55 +0000
commit04b74d9eadff586cab293db3cd473108ca1d5827 (patch)
tree5f81a44eeb200306c4b261e9312ae48426e1b3b4 /xmloff
parentedcc547422e9d869bf1d7982a49430b6c398533a (diff)
parentd1886d07b439e7197f731c9d98c0b2ec31c62faa (diff)
koheidatapilot03: merge with DEV300_m57
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmloff/txtparae.hxx14
-rw-r--r--xmloff/inc/xmloff/xmlimppr.hxx1
-rw-r--r--xmloff/inc/xmloff/xmlmetai.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx1
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx5
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx11
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx68
-rw-r--r--xmloff/source/chart/SchXMLTools.hxx5
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx2
-rw-r--r--xmloff/source/core/xmltoken.cxx1
-rw-r--r--xmloff/source/meta/xmlmetai.cxx15
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx141
-rw-r--r--xmloff/source/text/XMLTextFrameContext.hxx3
-rw-r--r--xmloff/source/text/txtimp.cxx290
-rw-r--r--xmloff/source/text/txtimppr.cxx13
-rw-r--r--xmloff/source/text/txtparae.cxx44
-rw-r--r--xmloff/source/text/txtstyli.cxx24
17 files changed, 417 insertions, 226 deletions
diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx
index 1ea068911236..a7c7df50ee64 100644
--- a/xmloff/inc/xmloff/txtparae.hxx
+++ b/xmloff/inc/xmloff/txtparae.hxx
@@ -123,7 +123,11 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
protected:
const ::rtl::OUString sActualSize;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sAnchorCharStyleName;
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sAnchorType;
@@ -605,8 +609,12 @@ public:
virtual void exportTextAutoStyles();
void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
- void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
- const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+// void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+// const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // <--
// This method exports the given XText
void exportText(
diff --git a/xmloff/inc/xmloff/xmlimppr.hxx b/xmloff/inc/xmloff/xmlimppr.hxx
index ff6d167e737c..4bf1a9865c85 100644
--- a/xmloff/inc/xmloff/xmlimppr.hxx
+++ b/xmloff/inc/xmloff/xmlimppr.hxx
@@ -80,6 +80,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public UniRefBase
protected:
UniReference< XMLPropertySetMapper > maPropMapper;
+ SvXMLImport& GetImport() const { return rImport;}
public:
diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx
index 9423b7424b73..7cc1c6b054ec 100644
--- a/xmloff/inc/xmloff/xmlmetai.hxx
+++ b/xmloff/inc/xmloff/xmlmetai.hxx
@@ -35,6 +35,7 @@
#include "xmloff/dllapi.h"
#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -76,6 +77,10 @@ protected:
void initDocumentProperties();
// set the BuildId property at the importer
void setBuildId(const ::rtl::OUString & i_rBuildId);
+
+public:
+ static void setBuildId(const ::rtl::OUString & rGenerator,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo );
};
#endif // _XMLOFF_XMLMETAI_HXX
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index b42791ca1d0b..4b92f050e94f 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3075,6 +3075,7 @@ namespace xmloff { namespace token {
XML_AT_LABELS,
XML_AT_AXIS,
XML_AT_LABELS_AND_AXIS,
+ XML_FILLED_RADAR,
// MathML only
XML_MATHVARIANT,
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 831c15fb624e..dd955e6d69d5 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -35,6 +35,8 @@
#include "SchXMLChartContext.hxx"
#include "contexts.hxx"
#include "XMLChartPropertySetMapper.hxx"
+#include "SchXMLTools.hxx"
+
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
// header for class ByteString
@@ -872,6 +874,9 @@ SvXMLImportContext* SchXMLImport::CreateStylesContext(
const OUString& rLocalName,
const Reference<xml::sax::XAttributeList>& xAttrList )
{
+ //#i103287# make sure that the version information is set before importing all the properties (especially stroke-opacity!)
+ SchXMLTools::setBuildIDAtImportInfo( GetModel(), getImportInfo() );
+
SvXMLStylesContext* pStylesCtxt =
new SvXMLStylesContext( *(this), XML_NAMESPACE_OFFICE, rLocalName, xAttrList );
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 4eb17d289d73..a1c021171a92 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -936,7 +936,15 @@ void SchXMLTableHelper::applyTableSimple(
sal_Int32 nColumnCount = 0;
sal_Int32 nCol = 0, nRow = 0;
if( nRowCount )
+ {
nColumnCount = rTable.aData[ 0 ].size();
+ ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
+ while( iRow != rTable.aData.end() )
+ {
+ nColumnCount = ::std::max( nColumnCount, static_cast<sal_Int32>(iRow->size()) );
+ iRow++;
+ }
+ }
// #i27909# avoid illegal index access for empty tables
if( nColumnCount == 0 || nRowCount == 0 )
@@ -950,7 +958,8 @@ void SchXMLTableHelper::applyTableSimple(
// set labels
::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- for( nCol = 1; nCol < nColumnCount; nCol++ )
+ sal_Int32 nColumnCountOnFirstRow = iRow->size();
+ for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ )
{
aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
}
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 57ba65868140..a1700c65d316 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -53,6 +53,7 @@
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexp.hxx>
#include "xmlnmspe.hxx"
+#include <xmloff/xmlmetai.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -103,9 +104,19 @@ rtl::OUString lcl_getGeneratorFromModel( const uno::Reference< frame::XModel >&
uno::Reference< document::XDocumentProperties > xChartDocumentProperties(
xChartDocumentPropertiesSupplier->getDocumentProperties());
if( xChartDocumentProperties.is() )
- {
aGenerator = xChartDocumentProperties->getGenerator();
- }
+ }
+ return aGenerator;
+}
+
+rtl::OUString lcl_getGeneratorFromModelOrItsParent( const uno::Reference< frame::XModel >& xChartModel )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModel(xChartModel) );
+ if( !aGenerator.getLength() ) //try to get the missing info from the parent document
+ {
+ uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
+ if( xChild.is() )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
}
return aGenerator;
}
@@ -158,6 +169,7 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] =
{ XML_RING, XML_CHART_CLASS_RING },
{ XML_SCATTER, XML_CHART_CLASS_SCATTER },
{ XML_RADAR, XML_CHART_CLASS_RADAR },
+ { XML_FILLED_RADAR, XML_CHART_CLASS_FILLED_RADAR },
{ XML_BAR, XML_CHART_CLASS_BAR },
{ XML_STOCK, XML_CHART_CLASS_STOCK },
{ XML_BUBBLE, XML_CHART_CLASS_BUBBLE },
@@ -202,6 +214,9 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.NetDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.NetChartType" ) )
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart.FilledNetDiagram" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart2.FilledNetChartType" ) )
+
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" ) )
@@ -269,6 +284,8 @@ OUString GetChartTypeByClassName(
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Bubble"));
else if( IsXMLToken( rClassName, XML_RADAR ))
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Net"));
+ else if( IsXMLToken( rClassName, XML_FILLED_RADAR ))
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("FilledNet"));
else if( IsXMLToken( rClassName, XML_STOCK ))
{
if( bUseOldNames )
@@ -336,6 +353,8 @@ XMLTokenEnum getTokenByChartType(
eResult = XML_BUBBLE;
else if( aServiceName.equalsAscii("Net"))
eResult = XML_RADAR;
+ else if( aServiceName.equalsAscii("FilledNet"))
+ eResult = XML_FILLED_RADAR;
else if( (bUseOldNames && aServiceName.equalsAscii("Stock")) ||
(!bUseOldNames && aServiceName.equalsAscii("CandleStick")))
eResult = XML_STOCK;
@@ -673,6 +692,13 @@ bool switchBackToDataProviderFromParent( const Reference< chart2::XChartDocument
return true;
}
+void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference< beans::XPropertySet > xImportInfo )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xModel) );
+ if( aGenerator.getLength() )
+ SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo );
+}
+
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const uno::Reference< frame::XModel >& xChartModel )
{
bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan2_3( xChartModel );
@@ -706,31 +732,41 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const uno::Reference< frame:
//if there is a meta stream at the chart object it was not written with an older OpenOffice version < 2.3
if( !aGenerator.getLength() )
{
- //if there is no meta stream at the chart object we need to check the version from the parent document
- //and we need to check whether the document was created with OpenOffice.org at all
+ //if there is no meta stream at the chart object we need to check whether the parent document is OpenOffice at all
uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
if( xChild.is() )
{
- ::rtl::OUString aParentGenerator( lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) ) );
- if( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
{
- sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( aParentGenerator );
- if( nBuilId<=9161 ) //9161 is build id of OpenOffice.org 2.2.1
- bResult= true;
+ //the chart application has not created files without a meta stream since OOo 2.3 (OOo 2.3 has written a metastream already)
+ //only the report builder extension has created some files with OOo 3.1 that do not have a meta stream
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/31") ) ) != -1 )
+ bResult = false;//#i100102# probably generated with OOo 3.1 by the report designer
+ else
+ bResult= true; //in this case the OLE chart was created by an older version, as OLE objects are sometimes stream copied the version can differ from the parents version, so the parents version is not a reliable indicator
}
- else if(
- ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
- )
+ else if( isDocumentGeneratedWithOpenOfficeOlderThan2_0(xChartModel) )
bResult= true;
}
}
return bResult;
}
+bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel)
+{
+ bool bResult = false;
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xChartModel) );
+ if( ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
+ )
+ bResult= true;
+ return bResult;
+}
+
Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Reference< chart2::XChartDocument >& xChartDoc )
{
Reference< chart2::data::XDataProvider > xRet;
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index 916fffc382aa..89d17fc440d9 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -53,10 +53,14 @@ class SvXMLExport;
namespace SchXMLTools
{
+ bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
+ void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel
+ , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo );
+
enum SchXMLChartTypeEnum
{
XML_CHART_CLASS_LINE,
@@ -65,6 +69,7 @@ namespace SchXMLTools
XML_CHART_CLASS_RING,
XML_CHART_CLASS_SCATTER,
XML_CHART_CLASS_RADAR,
+ XML_CHART_CLASS_FILLED_RADAR,
XML_CHART_CLASS_BAR,
XML_CHART_CLASS_STOCK,
XML_CHART_CLASS_BUBBLE,
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 077ef6133fc4..abd33ec80625 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -157,7 +157,7 @@ RDFaExportHelper::AddRDFa(
.makeStringAndClear()
);
- const ::comphelper::StlUnoSequence<rdf::Statement>::iterator iter
+ rdf::Statement* const iter
( ::std::partition( ::comphelper::stl_begin(stmts),
::comphelper::stl_end(stmts),
::boost::bind(&::rtl::OUString::equals, m_RDFsLabel,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 8655a367db52..937d3c64d3a1 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3077,6 +3077,7 @@ namespace xmloff { namespace token {
TOKEN( "at-labels", XML_AT_LABELS ),
TOKEN( "at-axis", XML_AT_AXIS ),
TOKEN( "at-labels-and-axis", XML_AT_LABELS_AND_AXIS ),
+ TOKEN( "filled-radar", XML_FILLED_RADAR ),
TOKEN( "mathvariant", XML_MATHVARIANT ),
TOKEN( "mathsize", XML_MATHSIZE ),
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 4eda35e38a23..c903cf2dc1ba 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -209,7 +209,13 @@ void SvXMLMetaDocumentContext::initDocumentProperties()
}
}
-void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
+void SvXMLMetaDocumentContext::setBuildId(const ::rtl::OUString & i_rBuildId)
+{
+ SvXMLMetaDocumentContext::setBuildId( i_rBuildId, GetImport().getImportInfo() );
+}
+
+//static
+void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, const uno::Reference<beans::XPropertySet>& xImportInfo )
{
OUString sBuildId;
// skip to second product
@@ -258,14 +264,13 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
if ( sBuildId.getLength() ) try
{
- uno::Reference<beans::XPropertySet> xSet(GetImport().getImportInfo());
- if( xSet.is() )
+ if( xImportInfo.is() )
{
const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
uno::Reference< beans::XPropertySetInfo > xSetInfo(
- xSet->getPropertySetInfo());
+ xImportInfo->getPropertySetInfo());
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
- xSet->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
+ xImportInfo->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
}
}
catch( uno::Exception& )
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c53885e73187..c3ff9abebd90 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -124,44 +124,45 @@ inline XMLTextFrameContextHyperlink_Impl::XMLTextFrameContextHyperlink_Impl(
{
}
-class XMLTextFrameDescContext_Impl : public SvXMLImportContext
+// --> OD 2009-07-22 #i73249#
+class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext
{
- OUString& rDesc;
+ OUString& mrTitleOrDesc;
public:
TYPEINFO();
- XMLTextFrameDescContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- OUString& rD );
- virtual ~XMLTextFrameDescContext_Impl();
+ XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ OUString& rTitleOrDesc );
+ virtual ~XMLTextFrameTitleOrDescContext_Impl();
virtual void Characters( const OUString& rText );
};
-TYPEINIT1( XMLTextFrameDescContext_Impl, SvXMLImportContext );
+TYPEINIT1( XMLTextFrameTitleOrDescContext_Impl, SvXMLImportContext );
-XMLTextFrameDescContext_Impl::XMLTextFrameDescContext_Impl(
+XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl(
SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > &,
- OUString& rD ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rDesc( rD )
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ OUString& rTitleOrDesc )
+ : SvXMLImportContext( rImport, nPrfx, rLName )
+ , mrTitleOrDesc( rTitleOrDesc )
{
}
-XMLTextFrameDescContext_Impl::~XMLTextFrameDescContext_Impl()
+XMLTextFrameTitleOrDescContext_Impl::~XMLTextFrameTitleOrDescContext_Impl()
{
}
-void XMLTextFrameDescContext_Impl::Characters( const OUString& rText )
+void XMLTextFrameTitleOrDescContext_Impl::Characters( const OUString& rText )
{
- rDesc += rText;
+ mrTitleOrDesc += rText;
}
+// <--
// ------------------------------------------------------------------------
@@ -385,7 +386,11 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sGraphicURL;
const ::rtl::OUString sGraphicFilter;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sFrameStyleName;
const ::rtl::OUString sGraphicRotation;
const ::rtl::OUString sTextBoxServiceName;
@@ -461,6 +466,9 @@ public:
const ::rtl::OUString& rName,
const ::rtl::OUString& rTargetFrameName,
sal_Bool bMap );
+ // --> OD 2009-07-22 #i73249#
+ void SetTitle( const ::rtl::OUString& rTitle );
+ // <--
void SetDesc( const ::rtl::OUString& rDesc );
::com::sun::star::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; }
@@ -829,7 +837,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
, sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo"))
, sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))
, sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter"))
-, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+// --> OD 2009-07-22 #i73249#
+//, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
+, sDescription(RTL_CONSTASCII_USTRINGPARAM("Description"))
+// <--
, sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName"))
, sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation"))
, sTextBoxServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame"))
@@ -1135,12 +1147,15 @@ SvXMLImportContext *XMLTextFrameContext_Impl::CreateChildContext(
}
}
}
+ // --> OD 2009-08-17 #i100480#
+ // correction of condition which also avoids warnings.
if( !pContext &&
- ( XML_TEXT_FRAME_OBJECT == nType &&
- (XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT )) ||
- (XML_NAMESPACE_MATH == nPrefix &&
- IsXMLToken(rLocalName, XML_MATH) ) ) )
+ ( XML_TEXT_FRAME_OBJECT == nType &&
+ ( ( XML_NAMESPACE_OFFICE == nPrefix &&
+ IsXMLToken( rLocalName, XML_DOCUMENT ) ) ||
+ ( XML_NAMESPACE_MATH == nPrefix &&
+ IsXMLToken( rLocalName, XML_MATH ) ) ) ) )
+ // <--
{
if( !xPropSet.is() && !bCreateFailed )
{
@@ -1262,18 +1277,31 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
}
}
+// --> OD 2009-07-22 #i73249#
+void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle )
+{
+ if ( xPropSet.is() )
+ {
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sTitle ) )
+ {
+ xPropSet->setPropertyValue( sTitle, makeAny( rTitle ) );
+ }
+ }
+}
+
void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc )
{
if ( xPropSet.is() )
{
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sDescription ) )
{
- xPropSet->setPropertyValue( sAlternativeText, makeAny( rDesc ) );
+ xPropSet->setPropertyValue( sDescription, makeAny( rDesc ) );
}
}
}
+// <--
//-----------------------------------------------------------------------------------------------------
@@ -1312,6 +1340,10 @@ XMLTextFrameContext::XMLTextFrameContext(
: SvXMLImportContext( rImport, nPrfx, rLName )
, m_xAttrList( new SvXMLAttributeList( xAttrList ) )
, m_pHyperlink( 0 )
+// --> OD 2009-07-22 #i73249#
+, m_sTitle()
+, m_sDesc()
+// <--
, m_eDefaultAnchorType( eATyp )
// --> OD 2006-03-10 #i51726#
, m_HasAutomaticStyleWithoutParentStyle( sal_False )
@@ -1374,9 +1406,20 @@ void XMLTextFrameContext::EndElement()
{
pImpl->CreateIfNotThere();
- // alternative text
+ // --> OD 2009-07-22 #i73249#
+// // alternative text
+// if( m_sDesc.getLength() )
+// pImpl->SetDesc( m_sDesc );
+ // svg:title
+ if( m_sTitle.getLength() )
+ {
+ pImpl->SetTitle( m_sTitle );
+ }
if( m_sDesc.getLength() )
+ {
pImpl->SetDesc( m_sDesc );
+ }
+ // <--
if( m_pHyperlink )
{
@@ -1494,10 +1537,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
// the child is a writer frame
if( XML_NAMESPACE_SVG == p_nPrefix )
{
- bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
- if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
- pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
- xAttrList, m_sDesc );
+ // --> OD 2009-07-22 #i73249#
+// bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+// if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
+// pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
+// xAttrList, m_sDesc );
+ const bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+ if ( bOld )
+ {
+ if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ }
+ else
+ {
+ if( IsXMLToken( rLocalName, XML_TITLE ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ else if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sDesc );
+ }
+ }
+ // <--
}
else if( XML_NAMESPACE_DRAW == p_nPrefix )
{
diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx
index 9b620a993590..51e41d45367c 100644
--- a/xmloff/source/text/XMLTextFrameContext.hxx
+++ b/xmloff/source/text/XMLTextFrameContext.hxx
@@ -53,6 +53,9 @@ class XMLTextFrameContext : public SvXMLImportContext
SvXMLAttributeList *m_pAttrList;
XMLTextFrameContextHyperlink_Impl *m_pHyperlink;
+ // --> OD 2009-07-22 #i73249#
+ ::rtl::OUString m_sTitle;
+ // <--
::rtl::OUString m_sDesc;
::com::sun::star::text::TextContentAnchorType m_eDefaultAnchorType;
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index e47c3aae262b..add97d20efda 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -931,6 +931,134 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
return bConverted ? sChars.makeStringAndClear() : rChars;
}
+// --> OD 2006-10-12 #i69629#
+// helper method to determine, if a paragraph style has a list style (inclusive
+// an empty one) inherits a list style (inclusive an empty one) from one of its parents
+// --> OD 2007-01-29 #i73973#
+// apply special case, that found list style equals the chapter numbering, also
+// to the found list styles of the parent styles.
+sal_Bool lcl_HasListStyle( OUString sStyleName,
+ const Reference < XNameContainer >& xParaStyles,
+ SvXMLImport& rImport,
+ const OUString& sNumberingStyleName,
+ const OUString& sOutlineStyleName )
+{
+ sal_Bool bRet( sal_False );
+
+ if ( !xParaStyles->hasByName( sStyleName ) )
+ {
+ // error case
+ return sal_True;
+ }
+
+ Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_False;
+ }
+
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // special case: the set list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ }
+ }
+ else
+ {
+ // --> OD 2007-12-07 #i77708#
+ sal_Int32 nUPD( 0 );
+ sal_Int32 nBuild( 0 );
+ // --> OD 2008-03-19 #i86058#
+// rImport.getBuildIds( nUPD, nBuild );
+ const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
+ // <--
+ // <--
+ // search list style at parent
+ Reference<XStyle> xStyle( xPropState, UNO_QUERY );
+ while ( xStyle.is() )
+ {
+ OUString aParentStyle( xStyle->getParentStyle() );
+ if ( aParentStyle.getLength() > 0 )
+ {
+ aParentStyle =
+ rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
+ aParentStyle );
+ }
+ if ( aParentStyle.getLength() == 0 ||
+ !xParaStyles->hasByName( aParentStyle ) )
+ {
+ // no list style found
+ break;
+ }
+ else
+ {
+ xPropState = Reference< XPropertyState >(
+ xParaStyles->getByName( aParentStyle ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_True;
+ }
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // --> OD 2007-01-29 #i73973#
+ // special case: the found list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ // --> OD 2007-12-07 #i77708#
+ // special handling for text documents from OOo version prior OOo 2.4
+ // --> OD 2008-03-19 #i86058#
+ // check explicitly on certain versions and on import of
+ // text documents in OpenOffice.org file format
+ else if ( sListStyle.getLength() == 0 &&
+ ( rImport.IsTextDocInOOoFileFormat() ||
+ ( bBuildIdFound &&
+ ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
+ ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
+ {
+ bRet = sal_False;
+ }
+ // <--
+ }
+ // <--
+ break;
+ }
+ else
+ {
+ // search list style at parent
+ xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+// <--
OUString XMLTextImportHelper::SetStyleAndAttrs(
SvXMLImport& rImport,
const Reference < XTextCursor >& rCursor,
@@ -1241,14 +1369,20 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// Some minor rework and adjust access to paragraph styles
if ( bPara )
{
+ // --> OD 2009-08-18 #i103817#
+ sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
+ const bool bHasOutlineLevelProp( xPropSetInfo->hasPropertyByName( sOutlineLevel ) );
+ if ( bHasOutlineLevelProp )
+ {
+ xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
+ }
+ // <--
//if ( bPara && nOutlineLevel != -1 ) //#outline level,removed by zhaojianwei
if ( nOutlineLevel > 0 ) //add by zhaojianwei
{
//#outline level,removed by zhaojianwei
- if ( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ if ( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
// In case that the value equals the value of its paragraph style
// attribute outline level, the paragraph attribute value is left unset
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
@@ -1327,15 +1461,33 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
AddOutlineStyleCandidate( nOutlineLevel, sStyleName );
}
+ // --> OD 2009-08-18 #i103817#
+ // Assure that heading applies the outline style
+ if ( ( !pStyle || !pStyle->IsListStyleSet() ) &&
+ !bOutlineStyleCandidate &&
+ xChapterNumbering.is() )
+ {
+ OUString sEmptyStr;
+ if ( !lcl_HasListStyle( sStyleName,
+ xParaStyles, GetXMLImport(),
+ sNumberingStyleName,
+ sEmptyStr ) )
+ {
+ // heading not in a list --> apply outline style
+ xPropSet->setPropertyValue( sNumberingRules,
+ makeAny(xChapterNumbering) );
+ xPropSet->setPropertyValue( sNumberingLevel,
+ makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
+ }
+ }
+ // <--
}
// <--
}
//-> #outlinelevel added by zhaojianwei
//handle for text:p,if the paragraphstyle outlinelevel is set to[1~10]
- else if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ else if( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
{
sal_Int16 nZero = 0;
@@ -1428,132 +1580,6 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
// <--
// --> OD 2006-10-12 #i69629#
-// helper method to determine, if a paragraph style has a list style (inclusive
-// an empty one) inherits a list style (inclusive an empty one) from one of its parents
-// --> OD 2007-01-29 #i73973#
-// apply special case, that found list style equals the chapter numbering, also
-// to the found list styles of the parent styles.
-sal_Bool lcl_HasListStyle( OUString sStyleName,
- const Reference < XNameContainer >& xParaStyles,
- SvXMLImport& rImport,
- const OUString& sNumberingStyleName,
- const OUString& sOutlineStyleName )
-{
- sal_Bool bRet( sal_False );
-
- if ( !xParaStyles->hasByName( sStyleName ) )
- {
- // error case
- return sal_True;
- }
-
- Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_False;
- }
-
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // special case: the set list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- }
- }
- else
- {
- // --> OD 2007-12-07 #i77708#
- sal_Int32 nUPD( 0 );
- sal_Int32 nBuild( 0 );
- // --> OD 2008-03-19 #i86058#
-// rImport.getBuildIds( nUPD, nBuild );
- const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
- // <--
- // <--
- // search list style at parent
- Reference<XStyle> xStyle( xPropState, UNO_QUERY );
- while ( xStyle.is() )
- {
- OUString aParentStyle( xStyle->getParentStyle() );
- if ( aParentStyle.getLength() > 0 )
- {
- aParentStyle =
- rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
- aParentStyle );
- }
- if ( aParentStyle.getLength() == 0 ||
- !xParaStyles->hasByName( aParentStyle ) )
- {
- // no list style found
- break;
- }
- else
- {
- xPropState = Reference< XPropertyState >(
- xParaStyles->getByName( aParentStyle ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_True;
- }
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // --> OD 2007-01-29 #i73973#
- // special case: the found list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- // --> OD 2007-12-07 #i77708#
- // special handling for text documents from OOo version prior OOo 2.4
- // --> OD 2008-03-19 #i86058#
- // check explicitly on certain versions and on import of
- // text documents in OpenOffice.org file format
- else if ( sListStyle.getLength() == 0 &&
- ( rImport.IsTextDocInOOoFileFormat() ||
- ( bBuildIdFound &&
- ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
- ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
- {
- bRet = sal_False;
- }
- // <--
- }
- // <--
- break;
- }
- else
- {
- // search list style at parent
- xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
- }
- }
- }
- }
-
- return bRet;
-}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index 875d78b6bfe7..9feacd0ad3d9 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -39,6 +39,7 @@
#include <tools/string.hxx>
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/txtprmap.hxx>
+#include <xmloff/xmlimp.hxx>
#include "txtimppr.hxx"
#define XML_LINE_LEFT 0
@@ -120,11 +121,21 @@ sal_Bool XMLTextImportPropertyMapper::handleSpecialItem(
case CTF_FONTFAMILYNAME:
case CTF_FONTFAMILYNAME_CJK:
case CTF_FONTFAMILYNAME_CTL:
- case CTF_TEXT_DISPLAY:
bRet = getPropertySetMapper()->importXML( rValue, rProperty,
rUnitConverter );
break;
+ case CTF_TEXT_DISPLAY:
+ bRet = getPropertySetMapper()->importXML( rValue, rProperty,
+ rUnitConverter );
+ if( SvXMLImport::OOo_2x == GetImport().getGeneratorVersion() )
+ {
+ sal_Bool bHidden;
+ rProperty.maValue >>= bHidden;
+ bHidden = !bHidden;
+ rProperty.maValue <<= bHidden;
+ }
+ break;
default:
bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty,
rProperties, rValue, rUnitConverter, rNamespaceMap );
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index a96fe0ffd1a2..6a3b66ec58ee 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1128,7 +1128,11 @@ XMLTextParagraphExport::XMLTextParagraphExport(
// <--
sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ // --> OD 2009-07-22 #i73249#
+// sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
+ sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
+ // <--
sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")),
sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
@@ -2782,6 +2786,10 @@ void XMLTextParagraphExport::_exportTextFrame(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
}
void XMLTextParagraphExport::exportContour(
@@ -2973,8 +2981,10 @@ void XMLTextParagraphExport::_exportTextGraphic(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
- // svg:desc
- exportAlternativeText( rPropSet, rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
// draw:contour
exportContour( rPropSet, rPropSetInfo );
@@ -3003,23 +3013,39 @@ void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rP
if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap))
GetExport().GetImageMapExport().Export( rPropSet );
}
-void XMLTextParagraphExport::exportAlternativeText(
+
+// --> OD 2009-07-22 #i73249#
+void XMLTextParagraphExport::exportTitleAndDescription(
const Reference < XPropertySet > & rPropSet,
const Reference < XPropertySetInfo > & rPropSetInfo )
{
// svg:title
- if( rPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ if( rPropSetInfo->hasPropertyByName( sTitle ) )
{
- OUString sAltText;
- rPropSet->getPropertyValue( sAlternativeText ) >>= sAltText;
- if( sAltText.getLength() )
+ OUString sObjTitle;
+ rPropSet->getPropertyValue( sTitle ) >>= sObjTitle;
+ if( sObjTitle.getLength() )
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
XML_TITLE, sal_True, sal_False );
- GetExport().Characters( sAltText );
+ GetExport().Characters( sObjTitle );
+ }
+ }
+
+ // svg:description
+ if( rPropSetInfo->hasPropertyByName( sDescription ) )
+ {
+ OUString sObjDesc;
+ rPropSet->getPropertyValue( sDescription ) >>= sObjDesc;
+ if( sObjDesc.getLength() )
+ {
+ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
+ XML_DESC, sal_True, sal_False );
+ GetExport().Characters( sObjDesc );
}
}
}
+// <--
void XMLTextParagraphExport::setTextEmbeddedGraphicURL(
const Reference < XPropertySet >&,
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index b5eb0a7bdfcb..c41d54bb00ed 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -547,30 +547,6 @@ void XMLTextStyleContext::FillPropertySet(
struct XMLPropertyState& rState = GetProperties()[nIndex];
Any rAny = rState.maValue;
sal_Int32 nMapperIndex = rState.mnIndex;
- if( i == 3 )
- {
- if( SvXMLImport::OOo_2x != GetImport().getGeneratorVersion() )
- continue;
- sal_Bool bHidden;
- rAny >>= bHidden;
- bHidden = !bHidden;
- Any aAny( rAny );
- aAny <<= bHidden;
- // get property set mapper
- UniReference<XMLPropertySetMapper> rPropMapper =
- xImpPrMap->getPropertySetMapper();
-
- // set property
- OUString rPropertyName(
- rPropMapper->GetEntryAPIName(nMapperIndex) );
- if( !xInfo.is() )
- xInfo = rPropSet->getPropertySetInfo();
- if ( xInfo->hasPropertyByName( rPropertyName ) )
- {
- rPropSet->setPropertyValue( rPropertyName, aAny );
- }
- continue;
- }
// Now check for font name in rState and set corrected value,
// if necessary.