cui/uiconfig/ui/bulletandposition.ui | 2 +- cui/uiconfig/ui/numberingoptionspage.ui | 2 +- editeng/source/uno/unonrule.cxx | 6 ++++-- sd/qa/unit/data/pptx/tdf126234.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx | 22 ++++++++++++++++++++++ 5 files changed, 28 insertions(+), 4 deletions(-)
New commits: commit d064b51afc84af92f877dc33c683c9521a6cd937 Author: nd101 <f...@nd.com.cn> AuthorDate: Mon Jul 8 09:10:29 2019 +0800 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Jul 11 06:58:28 2019 +0200 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.kagan...@collabora.com> diff --git a/cui/uiconfig/ui/bulletandposition.ui b/cui/uiconfig/ui/bulletandposition.ui index 0b35873974bc..1ac89c4d966f 100644 --- a/cui/uiconfig/ui/bulletandposition.ui +++ b/cui/uiconfig/ui/bulletandposition.ui @@ -20,7 +20,7 @@ </object> <object class="GtkAdjustment" id="adjustment4"> <property name="lower">1</property> - <property name="upper">250</property> + <property name="upper">400</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> diff --git a/cui/uiconfig/ui/numberingoptionspage.ui b/cui/uiconfig/ui/numberingoptionspage.ui index 5e123bdaf55f..dc575cc267c6 100644 --- a/cui/uiconfig/ui/numberingoptionspage.ui +++ b/cui/uiconfig/ui/numberingoptionspage.ui @@ -22,7 +22,7 @@ </object> <object class="GtkAdjustment" id="adjustment4"> <property name="lower">1</property> - <property name="upper">250</property> + <property name="upper">400</property> <property name="value">100</property> <property name="step_increment">1</property> <property name="page_increment">10</property> diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index a046910b1068..e469d63f9ac4 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -440,8 +440,10 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex(const Sequence<beans::Propert sal_Int16 nSize = sal_Int16(); if( aVal >>= nSize ) { - // [Bug 120650] the slide content corrupt when open in Aoo - if ((nSize>250)||(nSize<=0)) + // [AOO Bug 120650] the slide content corrupt when open in Aoo + // [TDF# 126234] when MS Office document being imported, the value of the relative size + // of the bullet could be as high as 400% + if ((nSize>400)||(nSize<=0)) { nSize = 100; } diff --git a/sd/qa/unit/data/pptx/tdf126234.pptx b/sd/qa/unit/data/pptx/tdf126234.pptx new file mode 100644 index 000000000000..7db54f822538 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf126234.pptx differ 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits