summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-06 15:26:28 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-08 13:40:11 +0000
commit6acc6c011d3afd6834efeee1b2efe43652a86f2e (patch)
tree78ec792c75ed8e23605982d68392f8a1cd22c6b5
parent204d1093d4954596cc7d7578e0630648f1f678f5 (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>
-rw-r--r--include/xmloff/shapeexport.hxx3
-rw-r--r--include/xmloff/txtparae.hxx30
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLTextListContext.cxx3
-rw-r--r--xmloff/source/draw/shapeexport.cxx6
-rw-r--r--xmloff/source/text/XMLChangeInfoContext.cxx3
-rw-r--r--xmloff/source/text/XMLStringBufferImportContext.cxx3
-rw-r--r--xmloff/source/text/txtimp.cxx1
-rw-r--r--xmloff/source/text/txtparae.cxx18
-rw-r--r--xmloff/source/text/txtparai.cxx3
11 files changed, 49 insertions, 27 deletions
diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx
index 64538e2a6fba..b957022d5e0e 100644
--- a/include/xmloff/shapeexport.hxx
+++ b/include/xmloff/shapeexport.hxx
@@ -38,6 +38,7 @@
#include <xmloff/xmlexppr.hxx>
#include <xmloff/animexp.hxx>
#include <xmloff/families.hxx>
+#include <xmloff/txtparae.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <xmloff/table/XMLTableExport.hxx>
@@ -216,7 +217,7 @@ private:
SAL_DLLPRIVATE void ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix& rMat, ::basegfx::B2DTuple& rTRScale, double& fTRShear, double& fTRRotate, ::basegfx::B2DTuple& rTRTranslate, com::sun::star::awt::Point* pRefPoint);
SAL_DLLPRIVATE void ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTRScale, double fTRShear, double fTRRotate, ::basegfx::B2DTuple& rTRTranslate, const XMLShapeExportFlags nFeatures);
SAL_DLLPRIVATE bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const OUString& rClass );
- SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+ SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, TextPNS eExtensionNS = TextPNS::ODF );
SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
SAL_DLLPRIVATE void ImpExportDescription( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); // #i68101#
SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index ca0c3b43f3b7..00dc25e386be 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -61,8 +61,15 @@ namespace xmloff
{
class OFormLayerXMLExport;
class BoundFrameSets;
+
}
+enum class TextPNS
+{
+ ODF,
+ EXTENSION
+};
+
class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
{
struct Impl;
@@ -282,14 +289,14 @@ protected:
void exportText(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XText > & rText,
- bool bAutoStyles, bool bProgress, bool bExportParagraph );
+ bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS eExtensionNS = TextPNS::ODF );
void exportText(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XText > & rText,
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextSection > & rBaseSection,
- bool bAutoStyles, bool bProgress, bool bExportParagraph );
+ bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS eExtensionNS = TextPNS::ODF );
bool exportTextContentEnumeration(
const ::com::sun::star::uno::Reference <
@@ -301,13 +308,16 @@ protected:
bool bExportParagraph = true,
const ::com::sun::star::uno::Reference <
::com::sun::star::beans::XPropertySet > *pRangePropSet = 0,
- bool bExportLevels = true );
+ bool bExportLevels = true,
+ TextPNS eExtensionNS = TextPNS::ODF);
void exportParagraph(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextContent > & rTextContent,
bool bAutoStyles, bool bProgress,
bool bExportParagraph,
- MultiPropertySetHelper& rPropSetHelper);
+ MultiPropertySetHelper& rPropSetHelper,
+ TextPNS eExtensionNS = TextPNS::ODF);
+
virtual void exportTable(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextContent > & rTextContent,
@@ -568,7 +578,8 @@ public:
// This method exports the given OUString
void exportText(
const OUString& rText,
- bool& rPrevCharWasSpace );
+ bool& rPrevCharWasSpace,
+ TextPNS eExtensionNS = TextPNS::ODF);
// This method collects all automatic styles for the given XText
void collectTextAutoStyles(
@@ -610,9 +621,9 @@ public:
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XText > & rText,
bool bIsProgress = false,
- bool bExportParagraph = true)
+ bool bExportParagraph = true, TextPNS eExtensionNS = TextPNS::ODF)
{
- exportText( rText, false, bIsProgress, bExportParagraph );
+ exportText( rText, false, bIsProgress, bExportParagraph, eExtensionNS );
}
void exportText(
@@ -621,9 +632,10 @@ public:
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextSection > & rBaseSection,
bool bIsProgress = false,
- bool bExportParagraph = true)
+ bool bExportParagraph = true,
+ TextPNS eExtensionNS = TextPNS::ODF)
{
- exportText( rText, rBaseSection, false, bIsProgress, bExportParagraph );
+ exportText( rText, rBaseSection, false, bIsProgress, bExportParagraph, eExtensionNS );
}
void exportFramesBoundToPage( bool bIsProgress = false )
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 ) )