Kaydet (Commit) 36189096 authored tarafından PriyankaGaikwad's avatar PriyankaGaikwad Kaydeden (comit) David Tardon

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/15028Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 593515e5
......@@ -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
......
......@@ -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()
......
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