summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-07-07 16:22:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-11 17:44:32 +0200
commitd778119b867b67241b54fd7a9698c839e9bc00f5 (patch)
tree8bec557c3b826e9d5c892ccf3e061ea4f5d49a10 /sd
parentfcb7465df1fed433e795c1635e07f529897f2496 (diff)
tdf#108925: Too small bullet size confuses the user
Add a constraint for bullet relative size to avoid too small bullets which are hardly recognizable. Use the same 25% lower limit what MSO uses. Change-Id: Id956ecf3ec831c569188b944be58da03bf30a55e Reviewed-on: https://gerrit.libreoffice.org/39696 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 11652be4071ef6d1d89b2c397aa1a32476e03bf6) Reviewed-on: https://gerrit.libreoffice.org/39707 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sd')
-rwxr-xr-xsd/qa/unit/data/odp/tdf108925.odpbin0 -> 11219 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf108925.odp b/sd/qa/unit/data/odp/tdf108925.odp
new file mode 100755
index 000000000000..5b6dfc4ca4a2
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf108925.odp
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index da02f49c6946..fde285c39ef7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -160,6 +160,7 @@ public:
void testTdf105150PPT();
void testTdf100926();
void testTdf89064();
+ void testTdf108925();
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -228,6 +229,7 @@ public:
CPPUNIT_TEST(testTdf100926);
CPPUNIT_TEST(testPatternImport);
CPPUNIT_TEST(testTdf89064);
+ CPPUNIT_TEST(testTdf108925);
CPPUNIT_TEST_SUITE_END();
};
@@ -2196,6 +2198,23 @@ void SdImportTest::testTdf89064()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf108925()
+{
+ // Test document contains bulleting with too small bullet size (1%) which breaks the lower constraint
+ // So it should be converted to the lowest allowed value (25%).
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf108925.odp"), ODP);
+ 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 = dynamic_cast<const SvxNumBulletItem *>(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET));
+ CPPUNIT_ASSERT(pNumFmt);
+ CPPUNIT_ASSERT_EQUAL(pNumFmt->GetNumRule()->GetLevel(0).GetBulletRelSize(), sal_uInt16(25));
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();