Kaydet (Commit) 711c2e49 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

tdf#116272 use correct property name when exporting to PPT

Change-Id: Ic1f5fb0e00531f9e36f05cbdf68b4c2fa7e98989
Reviewed-on: https://gerrit.libreoffice.org/53987Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst f4e7d521
......@@ -132,7 +132,6 @@ public:
void testFontScale();
void testTdf115394();
void testTdf115394Zero();
void testBulletsAsImage();
void testTdf115005();
int testTdf115005_FallBack_Images(bool bAddReplacementImages);
void testTdf115005_FallBack_Images_On();
......@@ -200,7 +199,6 @@ public:
CPPUNIT_TEST(testFontScale);
CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST(testTdf115394Zero);
CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST(testTdf115005);
CPPUNIT_TEST(testTdf115005_FallBack_Images_On);
CPPUNIT_TEST(testTdf115005_FallBack_Images_Off);
......@@ -1505,32 +1503,6 @@ void SdOOXMLExportTest2::testTdf115394Zero()
xDocShRef->DoClose();
}
void SdOOXMLExportTest2::testBulletsAsImage()
{
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/BulletsAsImage.odp"), ODP);
utl::TempFile tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
uno::Reference<container::XIndexAccess> xLevels(xPropSet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aProperties;
xLevels->getByIndex(0) >>= aProperties; // 1st level
uno::Reference<awt::XBitmap> xBitmap;
for (const beans::PropertyValue& rProperty : aProperties)
{
if (rProperty.Name == "GraphicBitmap")
{
xBitmap = rProperty.Value.get<uno::Reference<awt::XBitmap>>();
}
}
CPPUNIT_ASSERT_MESSAGE("No bitmap for the bullets", xBitmap.is());
xDocShRef->DoClose();
}
void SdOOXMLExportTest2::testTdf115005()
{
sd::DrawDocShellRef xDocShRefOriginal = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf115005.odp"), ODP);
......
......@@ -95,6 +95,7 @@ public:
void testPageWithTransparentBackground();
void testTextRotation();
void testTdf115394PPT();
void testBulletsAsImage();
CPPUNIT_TEST_SUITE(SdExportTest);
......@@ -117,6 +118,7 @@ public:
CPPUNIT_TEST(testPageWithTransparentBackground);
CPPUNIT_TEST(testTextRotation);
CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST_SUITE_END();
......@@ -915,6 +917,46 @@ void SdExportTest::testTdf115394PPT()
xDocShRef->DoClose();
}
void SdExportTest::testBulletsAsImage()
{
for (sal_Int32 nExportFormat : {ODP, PPTX, PPT})
{
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/BulletsAsImage.odp"), ODP);
const OString sFailedMessageBase = OString("Failed on filter '") + OString(aFileFormats[nExportFormat].pFilterName) + OString("': ");
uno::Reference< lang::XComponent > xComponent(xDocShRef->GetModel(), uno::UNO_QUERY);
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
utl::MediaDescriptor aMediaDescriptor;
aMediaDescriptor["FilterName"] <<= OStringToOUString(OString(aFileFormats[nExportFormat].pFilterName), RTL_TEXTENCODING_UTF8);
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
xComponent.set(xStorable, uno::UNO_QUERY);
xComponent->dispose();
xDocShRef = loadURL(aTempFile.GetURL(), nExportFormat);
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
uno::Reference<container::XIndexAccess> xLevels(xPropSet->getPropertyValue("NumberingRules"), uno::UNO_QUERY_THROW);
uno::Sequence<beans::PropertyValue> aProperties;
xLevels->getByIndex(0) >>= aProperties; // 1st level
uno::Reference<awt::XBitmap> xBitmap;
for (const beans::PropertyValue& rProperty : aProperties)
{
if (rProperty.Name == "GraphicBitmap")
xBitmap = rProperty.Value.get<uno::Reference<awt::XBitmap>>();
}
const OString sFailed = sFailedMessageBase + "No bitmap for the bullets";
CPPUNIT_ASSERT_MESSAGE(sFailed.getStr(), xBitmap.is());
xDocShRef->DoClose();
}
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -845,7 +845,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
}
else if ( aPropName == "Graphic" )
else if ( aPropName == "GraphicBitmap" )
xGraphic = pPropValue[i].Value.get<uno::Reference<graphic::XGraphic>>();
else if ( aPropName == "GraphicSize" )
{
......@@ -882,7 +882,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
#ifdef DBG_UTIL
else if ( ! (
( aPropName == "SymbolTextDistance" )
|| ( aPropName == "Graphic" ) ) )
|| ( aPropName == "GraphicBitmap" ) ) )
{
OSL_FAIL( "Unknown Property" );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment