oox/source/core/xmlfilterbase.cxx    |    6 ------
 sax/source/fastparser/fastparser.cxx |    6 ++----
 sd/qa/unit/data/pptx/tdf91378.pptx   |binary
 sd/qa/unit/export-tests.cxx          |   22 ++++++++++++++++++++++
 4 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 16e8ffbd5ec1fe7b81835ea6584547669d55d751
Author: Heena Gupta <heena.h.gu...@ericsson.com>
Date:   Fri May 29 16:42:34 2015 +0530

    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

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 4ef16d0..f1c80df 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 f118a5d..79ab899 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
new file mode 100644
index 0000000..361be2c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf91378.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index d8cd85f..3c72207 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()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to