[Libreoffice-commits] core.git: filter/source sd/qa
Mark Hung
marklh9 at gmail.com
Fri Apr 6 10:38:13 UTC 2018
filter/source/msfilter/svdfppt.cxx | 6 ++++++
sd/qa/unit/data/ppt/tdf77747.ppt |binary
sd/qa/unit/import-tests.cxx | 17 +++++++++++++++++
3 files changed, 23 insertions(+)
New commits:
commit 3b17a8ebad5251d7908cf1d992c8b76b88557578
Author: Mark Hung <marklh9 at gmail.com>
Date: Sun Apr 1 21:32:07 2018 +0800
tdf#77747 handle Hebrew numbering in ppt.
Change-Id: I4af60a701e4dc2c3bae1c223ec56e03c16210996
Reviewed-on: https://gerrit.libreoffice.org/52225
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mark Hung <marklh9 at gmail.com>
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 9817e93e4b22..22d21cb1a74e 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3592,6 +3592,12 @@ bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport const &
rNumberFormat.SetSuffix( "." );
}
break;
+ case 25: // Bidi Hebrew 2 with ANSI minus symbol.
+ {
+ rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_HEBREW );
+ rNumberFormat.SetSuffix( "-" );
+ }
+ break;
case 26: // Japanese/Korean.
{
rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_LOWER_ZH );
diff --git a/sd/qa/unit/data/ppt/tdf77747.ppt b/sd/qa/unit/data/ppt/tdf77747.ppt
new file mode 100755
index 000000000000..e011be717a7d
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf77747.ppt differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 8e4cc6798b54..33c2e47e49f7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -180,6 +180,7 @@ public:
void testTdf115394PPT();
void testTdf51340();
void testTdf115639();
+ void testTdf77747();
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -261,6 +262,7 @@ public:
CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testTdf51340);
CPPUNIT_TEST(testTdf115639);
+ CPPUNIT_TEST(testTdf77747);
CPPUNIT_TEST_SUITE_END();
};
@@ -2516,6 +2518,21 @@ void SdImportTest::testTdf115639()
}
}
+void SdImportTest::testTdf77747()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf77747.ppt"), PPT);
+ CPPUNIT_ASSERT(xDocShRef.is());
+ SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>(GetPage(1, xDocShRef)->GetObj(0));
+ CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
+ const SvxNumBulletItem *pNumFmt = pTxtObj->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
+ CPPUNIT_ASSERT(pNumFmt);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", pNumFmt->GetNumRule()->GetLevel(0).GetSuffix(), OUString("-") );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's numbering type is wrong!", pNumFmt->GetNumRule()->GetLevel(0).GetNumberingType(),
+ SVX_NUM_NUMBER_HEBREW);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
More information about the Libreoffice-commits
mailing list