Kaydet (Commit) 16e8ffbd authored tarafından Heena Gupta's avatar Heena Gupta Kaydeden (comit) Miklos Vajna

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
üst b4a224d1
......@@ -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 ,
......
......@@ -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() )
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment