diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-06 15:26:28 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-08 13:40:11 +0000 |
commit | 6acc6c011d3afd6834efeee1b2efe43652a86f2e (patch) | |
tree | 78ec792c75ed8e23605982d68392f8a1cd22c6b5 /xmloff | |
parent | 204d1093d4954596cc7d7578e0630648f1f678f5 (diff) |
text:p is not allowed as child element of draw:frame
Regression from #i118485#.
Change-Id: Ib242ca1417f46b731d62d117132cbed6c02448fb
Reviewed-on: https://gerrit.libreoffice.org/15173
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTableContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTextListContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/XMLChangeInfoContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLStringBufferImportContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 18 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 3 |
9 files changed, 26 insertions, 17 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 6bd3aaee31fa..6902828681dd 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -1213,7 +1213,8 @@ SvXMLImportContext* SchXMLTitleContext::CreateChildContext( { SvXMLImportContext* pContext = 0; - if( nPrefix == XML_NAMESPACE_TEXT && + if( (nPrefix == XML_NAMESPACE_TEXT || + nPrefix == XML_NAMESPACE_LO_EXT) && IsXMLToken( rLocalName, XML_P ) ) { pContext = new SchXMLParagraphContext( GetImport(), rLocalName, mrTitle ); diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index a443522c0030..df2a6d726a1e 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -689,7 +689,8 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext( mbReadText = false;//don't apply text from <text:p> } // <text:p> element - read text (and range from text:id old version) - else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) ) + else if( (nPrefix == XML_NAMESPACE_TEXT || + nPrefix == XML_NAMESPACE_LO_EXT) && IsXMLToken( rLocalName, XML_P ) ) { pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId ); } diff --git a/xmloff/source/chart/SchXMLTextListContext.cxx b/xmloff/source/chart/SchXMLTextListContext.cxx index 871476fe8bb5..1fd4f5c5c732 100644 --- a/xmloff/source/chart/SchXMLTextListContext.cxx +++ b/xmloff/source/chart/SchXMLTextListContext.cxx @@ -72,7 +72,8 @@ SvXMLImportContext* SchXMLListItemContext::CreateChildContext( const uno::Reference< xml::sax::XAttributeList >& ) { SvXMLImportContext* pContext = 0; - if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) ) + if( (nPrefix == XML_NAMESPACE_TEXT || + nPrefix == XML_NAMESPACE_LO_EXT) && IsXMLToken( rLocalName, XML_P ) ) pContext = new SchXMLParagraphContext( GetImport(), rLocalName, m_rText ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 2d0506c6afc0..96dfd640fb20 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1492,14 +1492,14 @@ bool XMLShapeExport::ImpExportPresentationAttributes( const uno::Reference< bean return bIsEmpty; } -void XMLShapeExport::ImpExportText( const uno::Reference< drawing::XShape >& xShape ) +void XMLShapeExport::ImpExportText( const uno::Reference< drawing::XShape >& xShape, TextPNS eExtensionNS ) { uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY ); if( xText.is() ) { uno::Reference< container::XEnumerationAccess > xEnumAccess( xShape, uno::UNO_QUERY ); if( xEnumAccess.is() && xEnumAccess->hasElements() ) - mrExport.GetTextParagraphExport()->exportText( xText ); + mrExport.GetTextParagraphExport()->exportText( xText, false, true, eExtensionNS ); } } @@ -2804,7 +2804,7 @@ void XMLShapeExport::ImpExportOLE2Shape( { // #i118485# Add text export, the draw OLE shape allows text now // fdo#58571 chart objects don't allow text:p - ImpExportText( xShape ); + ImpExportText( xShape, TextPNS::EXTENSION ); } if(!bExportEmbedded) diff --git a/xmloff/source/text/XMLChangeInfoContext.cxx b/xmloff/source/text/XMLChangeInfoContext.cxx index 6a169b926703..4ec494314c0b 100644 --- a/xmloff/source/text/XMLChangeInfoContext.cxx +++ b/xmloff/source/text/XMLChangeInfoContext.cxx @@ -73,7 +73,8 @@ SvXMLImportContext* XMLChangeInfoContext::CreateChildContext( pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, sDateTimeBuffer); } - else if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + else if ( ( XML_NAMESPACE_TEXT == nPrefix || + XML_NAMESPACE_LO_EXT == nPrefix ) && IsXMLToken( rLocalName, XML_P ) ) { pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, diff --git a/xmloff/source/text/XMLStringBufferImportContext.cxx b/xmloff/source/text/XMLStringBufferImportContext.cxx index dbbfc41634d7..a74724537a90 100644 --- a/xmloff/source/text/XMLStringBufferImportContext.cxx +++ b/xmloff/source/text/XMLStringBufferImportContext.cxx @@ -62,7 +62,8 @@ void XMLStringBufferImportContext::Characters( void XMLStringBufferImportContext::EndElement() { // add return for paragraph elements - if ( (XML_NAMESPACE_TEXT == GetPrefix()) && + if ( (XML_NAMESPACE_TEXT == GetPrefix() || + XML_NAMESPACE_LO_EXT == GetPrefix()) && (IsXMLToken(GetLocalName(), XML_P)) ) { rTextBuffer.append(sal_Unicode(0x0a)); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 3eeec35f4643..e1b39832d38b 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -80,6 +80,7 @@ using namespace ::com::sun::star::ucb; static const SvXMLTokenMapEntry aTextElemTokenMap[] = { { XML_NAMESPACE_TEXT, XML_P, XML_TOK_TEXT_P }, + { XML_NAMESPACE_LO_EXT, XML_P, XML_TOK_TEXT_P }, { XML_NAMESPACE_TEXT, XML_H, XML_TOK_TEXT_H }, { XML_NAMESPACE_TEXT, XML_LIST, XML_TOK_TEXT_LIST }, { XML_NAMESPACE_DRAW, XML_FRAME, XML_TOK_TEXT_FRAME_PAGE }, diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index a3be7157c52d..3b1ab768e507 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1651,7 +1651,8 @@ void XMLTextParagraphExport::exportText( const Reference < XText > & rText, bool bAutoStyles, bool bIsProgress, - bool bExportParagraph ) + bool bExportParagraph, + TextPNS eExtensionNS) { if( bAutoStyles ) GetExport().GetShapeExport(); // make sure the graphics styles family @@ -1702,7 +1703,7 @@ void XMLTextParagraphExport::exportText( if( !bAutoStyles && (pRedlineExport != NULL) ) pRedlineExport->ExportStartOrEndRedline( xPropertySet, true ); exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection, - bIsProgress, bExportParagraph, 0, bExportLevels ); + bIsProgress, bExportParagraph, 0, bExportLevels, eExtensionNS ); if( !bAutoStyles && (pRedlineExport != NULL) ) pRedlineExport->ExportStartOrEndRedline( xPropertySet, false ); } @@ -1712,7 +1713,8 @@ void XMLTextParagraphExport::exportText( const Reference < XTextSection > & rBaseSection, bool bAutoStyles, bool bIsProgress, - bool bExportParagraph ) + bool bExportParagraph, + TextPNS /*eExtensionNS*/) { if( bAutoStyles ) GetExport().GetShapeExport(); // make sure the graphics styles family @@ -1745,7 +1747,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration( bool bIsProgress, bool bExportParagraph, const Reference < XPropertySet > *pRangePropSet, - bool bExportLevels ) + bool bExportLevels, TextPNS eExtensionNS ) { DBG_ASSERT( rContEnum.is(), "No enumeration to export!" ); bool bHasMoreElements = rContEnum->hasMoreElements(); @@ -1829,7 +1831,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration( } else exportParagraph( xTxtCntnt, bAutoStyles, bIsProgress, - bExportParagraph, aPropSetHelper ); + bExportParagraph, aPropSetHelper, eExtensionNS ); bHasContent = true; } else if( xServiceInfo->supportsService( sTableService ) ) @@ -1907,7 +1909,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration( void XMLTextParagraphExport::exportParagraph( const Reference < XTextContent > & rTextContent, bool bAutoStyles, bool bIsProgress, bool bExportParagraph, - MultiPropertySetHelper& rPropSetHelper) + MultiPropertySetHelper& rPropSetHelper, TextPNS eExtensionNS) { sal_Int16 nOutlineLevel = -1; @@ -2153,7 +2155,7 @@ void XMLTextParagraphExport::exportParagraph( bool bPrevCharIsSpace = true; enum XMLTokenEnum eElem = 0 < nOutlineLevel ? XML_H : XML_P; - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem, + SvXMLElementExport aElem( GetExport(), eExtensionNS == TextPNS::EXTENSION ? XML_NAMESPACE_LO_EXT : XML_NAMESPACE_TEXT, eElem, true, false ); if( bHasContentEnum ) bPrevCharIsSpace = !exportTextContentEnumeration( @@ -3401,7 +3403,7 @@ void XMLTextParagraphExport::exportTextRange( } void XMLTextParagraphExport::exportText( const OUString& rText, - bool& rPrevCharIsSpace ) + bool& rPrevCharIsSpace, TextPNS /*eExtensionNS*/ ) { sal_Int32 nExpStartPos = 0; sal_Int32 nEndPos = rText.getLength(); diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index b65135f0b5df..6a324b71a7ee 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -2346,7 +2346,8 @@ SvXMLImportContext *XMLNumberedParaContext::CreateChildContext( { SvXMLImportContext *pContext( 0 ); - if ( XML_NAMESPACE_TEXT == i_nPrefix ) + if ( XML_NAMESPACE_TEXT == i_nPrefix || + XML_NAMESPACE_LO_EXT == i_nPrefix ) { bool bIsHeader( IsXMLToken( i_rLocalName, XML_H ) ); if ( bIsHeader || IsXMLToken( i_rLocalName, XML_P ) ) |