diff options
author | nd101 <Fong@nd.com.cn> | 2019-07-08 09:10:29 +0800 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-07-11 06:58:28 +0200 |
commit | d064b51afc84af92f877dc33c683c9521a6cd937 (patch) | |
tree | f54aa9c4ab6feb1cb4868c619caf0ca6308a1582 /sd/qa | |
parent | c283d46196c148733619ac0f59f07878ff95c7f1 (diff) |
tdf#126234 up relative bullet size limit to 400%
The legitimate value for MS Office document bullet relative size is between 0% and 400%
But for ODF the value is normally between 0% and 250%.
Per ODF 1.2 spec "19.761 text:bullet-relative-size" there is no limit placed on the
relative size of the bullet. This change is to make the upper limit match MS Office
to address the import issue.
UI also changed to reflect the raise
Change-Id: Ic4bbef47e86a04b9a6f9f6188326c8b66e034807
Reviewed-on: https://gerrit.libreoffice.org/75189
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf126234.pptx | bin | 0 -> 34091 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf126234.pptx b/sd/qa/unit/data/pptx/tdf126234.pptx Binary files differnew file mode 100644 index 000000000000..7db54f822538 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf126234.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 22761ecd2d8c..ea41ec84a47a 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -12,6 +12,7 @@ #include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> #include <svl/stritem.hxx> +#include <editeng/eeitem.hxx> #include <editeng/editobj.hxx> #include <editeng/outlobj.hxx> #include <editeng/ulspitem.hxx> @@ -212,6 +213,7 @@ public: void testTdf125360_1(); void testTdf125360_2(); void testTdf125551(); + void testTdf126234(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -302,6 +304,7 @@ public: CPPUNIT_TEST(testTdf125360_1); CPPUNIT_TEST(testTdf125360_2); CPPUNIT_TEST(testTdf125551); + CPPUNIT_TEST(testTdf126234); CPPUNIT_TEST_SUITE_END(); @@ -2429,6 +2432,25 @@ void SdOOXMLExportTest2::testTdf1225573_FontWorkScaleX() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf126234() +{ + sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126234.pptx"), PPTX ); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + // check relative size of the bullet, 400% is a legitimate value for MS Office document + // Without a fix, it will fail to set the size correctly + const SdrPage *pPage = GetPage( 1, xDocShRef ); + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) ); + CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); + CPPUNIT_ASSERT(pNumFmt); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(400), pNumFmt->GetNumRule()->GetLevel(0).GetBulletRelSize()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |