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>
This commit is contained in:
nd101
2019-07-08 09:10:29 +08:00
committed by Mike Kaganski
parent c283d46196
commit d064b51afc
5 changed files with 28 additions and 4 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;
}

Binary file not shown.

View File

@@ -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();