summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'sd/qa/unit')
-rw-r--r--sd/qa/unit/data/pptx/smartart-font-size.pptxbin0 -> 63915 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx33
2 files changed, 33 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-font-size.pptx b/sd/qa/unit/data/pptx/smartart-font-size.pptx
new file mode 100644
index 000000000000..253cd4c73b65
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-font-size.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 1e726a5d1339..f07cca532e1b 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -11,6 +11,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -75,6 +76,7 @@ public:
void testBackground();
void testBackgroundDrawingmlFallback();
void testCenterCycle();
+ void testFontSize();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -112,6 +114,7 @@ public:
CPPUNIT_TEST(testBackground);
CPPUNIT_TEST(testBackgroundDrawingmlFallback);
CPPUNIT_TEST(testCenterCycle);
+ CPPUNIT_TEST(testFontSize);
CPPUNIT_TEST_SUITE_END();
};
@@ -1166,6 +1169,36 @@ void SdImportTestSmartArt::testCenterCycle()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testFontSize()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-font-size.pptx"), PPTX);
+
+ uno::Reference<drawing::XShapes> xGroup1(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape1(xGroup1->getByIndex(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xParagraph1(getParagraphFromShape(0, xShape1));
+ uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
+ uno::Reference<beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY);
+ double fFontSize1 = xPropSet1->getPropertyValue("CharHeight").get<double>();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, fFontSize1, 0.01);
+
+ uno::Reference<drawing::XShapes> xGroup2(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape2(xGroup2->getByIndex(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xParagraph2(getParagraphFromShape(0, xShape2));
+ uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
+ uno::Reference<beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY);
+ double fFontSize2 = xPropSet2->getPropertyValue("CharHeight").get<double>();
+ CPPUNIT_ASSERT_EQUAL(32.0, fFontSize2);
+
+ uno::Reference<drawing::XShapes> xGroup3(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape3(xGroup3->getByIndex(1), uno::UNO_QUERY);
+ drawing::TextFitToSizeType eTextFitToSize = drawing::TextFitToSizeType_NONE;
+ xShape3->getPropertyValue("TextFitToSize") >>= eTextFitToSize;
+ CPPUNIT_ASSERT_EQUAL(drawing::TextFitToSizeType_AUTOFIT, eTextFitToSize);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();