summaryrefslogtreecommitdiff
path: root/xmloff/source/text/txtparae.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
commit0a266bd33b8786869cdeab8325f8f1b1900533ad (patch)
tree137ba378aaae9e8f0765fabbbf5035131f250781 /xmloff/source/text/txtparae.cxx
parent6a1e797fa4b432841708545272e13e8f6ab4bd39 (diff)
parentab33e14647ada2a32624fa39ec0ddbbbdc694df5 (diff)
merge commit
Diffstat (limited to 'xmloff/source/text/txtparae.cxx')
-rw-r--r--xmloff/source/text/txtparae.cxx57
1 files changed, 37 insertions, 20 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index d9b66ffa3653..bf48c5337283 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();