diff options
author | sb <sb@openoffice.org> | 2009-09-16 17:08:52 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2009-09-16 17:08:52 +0200 |
commit | 11418032c587bcee688fcb4f76739c0e2520193b (patch) | |
tree | fd69455f64f6f2940f9eab860e45b06e8abaf748 /xmloff/source/text/txtparae.cxx | |
parent | ca107138e1786b636b8f81ebbcc9994ac7dd393f (diff) | |
parent | a11aa70b384e3ca0df953b53cff6b4d7f9699147 (diff) |
merged in DEV300_m59
Diffstat (limited to 'xmloff/source/text/txtparae.cxx')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 6a3b66ec58ee..2c160eabd334 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1461,8 +1461,8 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres { Any aAny = xTextFieldsEnum->nextElement(); Reference< XTextField > xTextField = *(Reference<XTextField>*)aAny.getValue(); - exportTextField( xTextField->getAnchor(), bAutoStyles, - bIsProgress ); + exportTextField( xTextField, bAutoStyles, bIsProgress, + !xAutoStylesSupp.is() ); try { Reference < XPropertySet > xSet( xTextField, UNO_QUERY ); @@ -1470,8 +1470,11 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres Any a = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("TextRange") ); a >>= xText; if ( xText.is() ) + { exportText( xText, sal_True, bIsProgress, bExportContent ); - GetExport().GetTextParagraphExport()->collectTextAutoStyles( xText ); + GetExport().GetTextParagraphExport() + ->collectTextAutoStyles( xText ); + } } catch (Exception&) { @@ -2145,7 +2148,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bPrvChrIsSpc ) { - static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("Meta")); // FIXME + static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("InContentMetadata")); sal_Bool bPrevCharIsSpace = bPrvChrIsSpc; while( rTextEnum->hasMoreElements() ) @@ -2305,7 +2308,8 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } } - DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" ); +// now that there are nested enumerations for meta(-field), this may be valid! +// DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" ); } void XMLTextParagraphExport::exportTable( @@ -2326,21 +2330,29 @@ void XMLTextParagraphExport::exportTextField( DBG_ASSERT( xTxtFld.is(), "text field missing" ); if( xTxtFld.is() ) { - if( bAutoStyles ) - { - pFieldExport->ExportFieldAutoStyle( xTxtFld, bIsProgress ); - } - else - { - pFieldExport->ExportField( xTxtFld, bIsProgress ); - } + exportTextField(xTxtFld, bAutoStyles, bIsProgress, sal_True); } else { // write only characters GetExport().Characters(rTextRange->getString()); } + } +} +void XMLTextParagraphExport::exportTextField( + const Reference < XTextField > & xTextField, + const sal_Bool bAutoStyles, const sal_Bool bIsProgress, + const sal_Bool bRecursive ) +{ + if ( bAutoStyles ) + { + pFieldExport->ExportFieldAutoStyle( xTextField, bIsProgress, + bRecursive ); + } + else + { + pFieldExport->ExportField( xTextField, bIsProgress ); } } @@ -2385,9 +2397,12 @@ void XMLTextParagraphExport::exportTextMark( nElement = *(sal_Bool *)rPropSet->getPropertyValue(sIsStart).getValue() ? 1 : 2; } - // bookmark, bookmark-start: xml:id for RDF metadata + // bookmark, bookmark-start: xml:id and RDFa for RDF metadata if( nElement < 2 ) { GetExport().AddAttributeXmlId(xName); + const uno::Reference<text::XTextContent> xTextContent( + xName, uno::UNO_QUERY_THROW); + GetExport().AddAttributesRDFa(xTextContent); } // export element @@ -3664,11 +3679,12 @@ void XMLTextParagraphExport::exportRuby( } } -// FIXME: this is untested void XMLTextParagraphExport::exportMeta( - const Reference<XPropertySet> & i_xMeta, + const Reference<XPropertySet> & i_xPortion, sal_Bool i_bAutoStyles, sal_Bool i_isProgress) { + static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("InContentMetadata")); + bool doExport(!i_bAutoStyles); // do not export element if autostyles // check version >= 1.2 switch (GetExport().getDefaultVersion()) { @@ -3677,13 +3693,14 @@ void XMLTextParagraphExport::exportMeta( default: break; } - const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW ); - const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() ); + const Reference< XTextContent > xTextContent( + i_xPortion->getPropertyValue(sMeta), UNO_QUERY_THROW); + const Reference< XEnumerationAccess > xEA( xTextContent, UNO_QUERY_THROW ); + const Reference< XEnumeration > xTextEnum( xEA->createEnumeration() ); if (doExport) { - const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW ); - const Reference<XTextContent> xTextContent( i_xMeta, UNO_QUERY_THROW ); + const Reference<rdf::XMetadatable> xMeta(xTextContent, UNO_QUERY_THROW); // text:meta with neither xml:id nor RDFa is invalid xMeta->ensureMetadataReference(); |