diff options
author | Heena Gupta <heena.h.gupta@ericsson.com> | 2015-05-29 16:42:34 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-25 15:33:35 +0200 |
commit | 16e8ffbd5ec1fe7b81835ea6584547669d55d751 (patch) | |
tree | 14689a881ae377d957e20656975d61c69021afa0 | |
parent | b4a224d1a91232a16b70be4531a3e6fd2d9bc9ae (diff) |
tdf#91378-Empty Custom Properties are lost while saving in .pptx format
Conflicts:
sd/qa/unit/export-tests.cxx
Reviewed on:
https://gerrit.libreoffice.org/15966
Change-Id: Ibc24ab9633b51fe41ad483121646cc391319fe6f
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 6 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf91378.pptx | bin | 0 -> 33866 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 22 |
4 files changed, 24 insertions, 10 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 4ef16d0c6bce..f1c80df9a97f 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -539,8 +539,6 @@ OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputSt static void writeElement( FSHelperPtr pDoc, sal_Int32 nXmlElement, const OUString& sValue ) { - if( sValue.isEmpty() ) - return; pDoc->startElement( nXmlElement, FSEND ); pDoc->writeEscaped( sValue ); pDoc->endElement( nXmlElement ); @@ -745,10 +743,6 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP { if ( !aprop[n].Name.isEmpty() ) { - // Ignore empty string property as well. - if (aprop[n].Value.has<OUString>() && aprop[n].Value.get<OUString>().isEmpty()) - continue; - OString aName = OUStringToOString( aprop[n].Name, RTL_TEXTENCODING_ASCII_US ); // pid starts from 2 not from 1 as MS supports pid from 2 pAppProps->startElement( XML_property , diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index f118a5d13e9b..79ab8991af78 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1037,8 +1037,7 @@ void FastSaxParserImpl::parse() void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xmlChar* prefix, const xmlChar* URI, int numNamespaces, const xmlChar** namespaces, int numAttributes, int /*defaultedAttributes*/, const xmlChar **attributes) { - if( !pendingCharacters.isEmpty()) - sendPendingCharacters(); + sendPendingCharacters(); Entity& rEntity = getEntity(); if( rEntity.maNamespaceCount.empty() ) { @@ -1145,8 +1144,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm void FastSaxParserImpl::callbackEndElement( const xmlChar*, const xmlChar*, const xmlChar* ) { - if( !pendingCharacters.isEmpty()) - sendPendingCharacters(); + sendPendingCharacters(); Entity& rEntity = getEntity(); SAL_WARN_IF(rEntity.maNamespaceCount.empty(), "sax", "Empty NamespaceCount"); if( !rEntity.maNamespaceCount.empty() ) diff --git a/sd/qa/unit/data/pptx/tdf91378.pptx b/sd/qa/unit/data/pptx/tdf91378.pptx Binary files differnew file mode 100644 index 000000000000..361be2c9a555 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf91378.pptx diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index d8cd85f68bdd..3c72207e499f 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -122,6 +122,7 @@ public: void testTransparentBackground(); void testFdo90607(); + void testTdf91378(); #if !defined WNT void testBnc822341(); #endif @@ -155,6 +156,7 @@ public: CPPUNIT_TEST(testBulletMarginAndIndentation); CPPUNIT_TEST(testParaMarginAndindentation); CPPUNIT_TEST(testTransparentBackground); + CPPUNIT_TEST(testTdf91378); #if !defined WNT CPPUNIT_TEST(testBnc822341); @@ -951,6 +953,26 @@ void SdExportTest::testBulletColor() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor()); } +void SdExportTest::testTdf91378() +{ + + //Check For Import and Export Both + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf91378.pptx"), PPTX); + for( sal_uInt32 i=0;i<2;i++) + { + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( xDocShRef->GetModel(), uno::UNO_QUERY ); + uno::Reference<document::XDocumentProperties> xProps( xDocumentPropertiesSupplier->getDocumentProperties(), uno::UNO_QUERY ); + uno::Reference<beans::XPropertySet> xUDProps( xProps->getUserDefinedProperties(), uno::UNO_QUERY ); + OUString propValue; + xUDProps->getPropertyValue(OUString("Testing")) >>= propValue; + CPPUNIT_ASSERT(propValue.isEmpty()); + xDocShRef = saveAndReload( xDocShRef, PPTX ); + } + xDocShRef->DoClose(); +} + #if !defined WNT void SdExportTest::testBnc822341() |