summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-04-01 21:32:07 +0800
committerMark Hung <marklh9@gmail.com>2018-04-06 12:37:52 +0200
commit3b17a8ebad5251d7908cf1d992c8b76b88557578 (patch)
tree721014732d86c3b6a353b3f4bbce26eddf8143cc
parent1d9703945e7b62761cc7f60c9644f80293174522 (diff)
tdf#77747 handle Hebrew numbering in ppt.
Change-Id: I4af60a701e4dc2c3bae1c223ec56e03c16210996 Reviewed-on: https://gerrit.libreoffice.org/52225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r--filter/source/msfilter/svdfppt.cxx6
-rwxr-xr-xsd/qa/unit/data/ppt/tdf77747.pptbin0 -> 147968 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx17
3 files changed, 23 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/ppt/tdf77747.ppt
Binary files 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();