[Libreoffice-commits] core.git: oox/source sd/qa

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Mon Apr 13 01:18:48 PDT 2015


 oox/source/export/drawingml.cxx  |    6 ++++++
 sd/qa/unit/data/pptx/n90255.pptx |binary
 sd/qa/unit/export-tests.cxx      |   26 ++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)

New commits:
commit 3618909684a892d912482844b81606bca4e0c29c
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Fri Mar 27 16:18:28 2015 +0530

    tdf#90255 FILESAVE:PPTX 'startAt' tag for bullet numbering is not exported
    
    Problem Description :
    XML Difference
    Original :
    <a:buAutoNum type="arabicPeriod" startAt="3"/>
    
    Roundtrip :
    <a:buAutoNum type="arabicPeriod"/>
    
    Solution :
    Added export support for 'startAt' tag of <a:buAutoNum> for pptx.
    
    Change-Id: If86bce98e222795d851d4a5b3cbb65da5cee85fc
    Reviewed-on: https://gerrit.libreoffice.org/15028
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 57bb0b0..f4e36a9 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1611,6 +1611,7 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa
     bool bHasFontDesc = false;
     OUString aGraphicURL;
     sal_Int16 nBulletRelSize = 0;
+    sal_Int16 nStartWith = 1;
 
     for ( sal_Int32 i = 0; i < nPropertyCount; i++ )
     {
@@ -1656,6 +1657,10 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa
             {
                 nBulletRelSize = *static_cast<sal_Int16 const *>(pValue);
             }
+            else if ( aPropName == "StartWith" )
+            {
+                nStartWith = *( (sal_Int16*)pValue );
+            }
             else if ( aPropName == "GraphicURL" )
             {
                 aGraphicURL = *static_cast<OUString const *>(pValue);
@@ -1704,6 +1709,7 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa
         {
             mpFS->singleElementNS(XML_a, XML_buAutoNum,
                                   XML_type, OUStringToOString(pAutoNumType, RTL_TEXTENCODING_UTF8).getStr(),
+                                  XML_startAt, nStartWith > 1 ? IS(nStartWith) : NULL,
                                   FSEND);
         }
         else
diff --git a/sd/qa/unit/data/pptx/n90255.pptx b/sd/qa/unit/data/pptx/n90255.pptx
new file mode 100644
index 0000000..2263d89
Binary files /dev/null and b/sd/qa/unit/data/pptx/n90255.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index d6645dd..e0878a7 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -84,6 +84,7 @@ public:
     void testLinkedGraphicRT();
     void testImageWithSpecialID();
     void testTableCellFillProperties();
+    void testBulletStartNumber();
 #if !defined WNT
     void testBnc822341();
 #endif
@@ -107,6 +108,7 @@ public:
     CPPUNIT_TEST(testLinkedGraphicRT);
     CPPUNIT_TEST(testImageWithSpecialID);
     CPPUNIT_TEST(testTableCellFillProperties);
+    CPPUNIT_TEST(testBulletStartNumber);
 #if !defined WNT
     CPPUNIT_TEST(testBnc822341);
 #endif
@@ -781,6 +783,30 @@ void SdExportTest::testTableCellFillProperties()
     xDocShRef->DoClose();
 }
 
+void SdExportTest::testBulletStartNumber()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/n90255.pptx"), PPTX );
+    xDocShRef = saveAndReload( xDocShRef, PPTX );
+
+    uno::Reference< drawing::XDrawPagesSupplier > xDoc(
+        xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
+
+    uno::Reference< drawing::XDrawPage > xPage(
+        xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
+    SdDrawDocument *pDoc = xDocShRef->GetDoc();
+    CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+
+    const SdrPage *pPage = pDoc->GetPage(1);
+    CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+    SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
+    CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
+    const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
+    const SvxNumBulletItem *pNumFmt = dynamic_cast<const SvxNumBulletItem *>(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET));
+    CPPUNIT_ASSERT(pNumFmt);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's start number is wrong!", sal_Int16(pNumFmt->GetNumRule()->GetLevel(0).GetStart()), sal_Int16(3) );
+    xDocShRef->DoClose();
+}
+
 #if !defined WNT
 
 void SdExportTest::testBnc822341()


More information about the Libreoffice-commits mailing list