summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-27 18:10:02 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-27 19:29:54 +0200
commit58220942d65b81c8586f1c2984a0faf84ed9172c (patch)
treed7443b06f7baa6501f5bc2ea1527fb77e2b5b9b2 /sd/qa
parent65368d40bea28bd2d7abfae61056c68d3613c54c (diff)
CppunitTest_sd_export_tests-ooxml1: use clang-format
Do it before changing the inheritance Change-Id: I2346d7d6a7433134edf082d50d4782893b43013f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141937 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx795
1 files changed, 451 insertions, 344 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 624dcede7eb3..f9254ad6cfcc 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -200,25 +200,24 @@ public:
}
};
-namespace {
-
-template< typename ItemValue, typename ItemType >
-void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId)
+namespace
+{
+template <typename ItemValue, typename ItemType>
+void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId)
{
- CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
+ CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
const EditTextObject& aEdit = pObj->GetOutlinerParaObject()->GetTextObject();
std::vector<EECharAttrib> rLst;
aEdit.GetCharAttribs(0, rLst);
- for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
+ for (std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it)
{
- const ItemType* pAttrib = dynamic_cast<const ItemType *>((*it).pAttr);
+ const ItemType* pAttrib = dynamic_cast<const ItemType*>((*it).pAttr);
if (pAttrib && pAttrib->Which() == nId)
{
- CPPUNIT_ASSERT_EQUAL( nVal, static_cast<ItemValue>(pAttrib->GetValue()));
+ CPPUNIT_ASSERT_EQUAL(nVal, static_cast<ItemValue>(pAttrib->GetValue()));
}
}
}
-
}
void SdOOXMLExportTest1::testTdf149311()
@@ -244,10 +243,14 @@ void SdOOXMLExportTest1::testTdf149128()
xDocShRef->DoClose();
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id", "42");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "0");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id", "43");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", "2");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id",
+ "42");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx",
+ "0");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "id",
+ "43");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx",
+ "2");
}
void SdOOXMLExportTest1::testTdf66228()
@@ -260,7 +263,7 @@ void SdOOXMLExportTest1::testTdf66228()
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst",
- "bentConnector3");
+ "bentConnector3");
}
void SdOOXMLExportTest1::testTdf147919()
@@ -275,23 +278,29 @@ void SdOOXMLExportTest1::testTdf147919()
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst",
"bentConnector2");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom/a:avLst/a:gd", "name",
+ "adj1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:spPr/a:prstGeom", "prst",
"bentConnector3");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "flipH", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:xfrm", "rot", "16200000");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
+ "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
+ "name", "adj2");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[3]/p:spPr/a:prstGeom", "prst",
"bentConnector4");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipH", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "flipV", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:xfrm", "rot", "10800000");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[3]", "name", "adj3");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
+ "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
+ "name", "adj2");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom/a:avLst/a:gd[3]",
+ "name", "adj3");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[4]/p:spPr/a:prstGeom", "prst",
"bentConnector5");
@@ -302,23 +311,29 @@ void SdOOXMLExportTest1::testTdf147919()
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "flipH", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:xfrm", "rot", "16200000");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom/a:avLst/a:gd", "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom/a:avLst/a:gd", "name",
+ "adj1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[6]/p:spPr/a:prstGeom", "prst",
"curvedConnector3");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipH", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "flipV", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:xfrm", "rot", "10800000");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
+ "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
+ "name", "adj2");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[7]/p:spPr/a:prstGeom", "prst",
"curvedConnector4");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "flipV", "1");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:xfrm", "rot", "16200000");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[3]", "name", "adj3");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[1]",
+ "name", "adj1");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[2]",
+ "name", "adj2");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom/a:avLst/a:gd[3]",
+ "name", "adj3");
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[8]/p:spPr/a:prstGeom", "prst",
"curvedConnector5");
}
@@ -397,7 +412,8 @@ void SdOOXMLExportTest1::testTdf144914()
void SdOOXMLExportTest1::testTdf124232()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf141704.pptx"), PPTX);
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf141704.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -415,31 +431,32 @@ void SdOOXMLExportTest1::testTdf124232()
"ppaction://hlinkshowjump?jump=previousslide");
xmlDocUniquePtr pXmlDoc4 = parseExport(tempFile, "ppt/slides/slide4.xml");
- assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick",
- "id", "rId1");
+ assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "id",
+ "rId1");
xmlDocUniquePtr pRelsDoc4 = parseExport(tempFile, "ppt/slides/_rels/slide4.xml.rels");
assertXPath(pRelsDoc4, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
"http://www.example.com/");
xmlDocUniquePtr pXmlDoc5 = parseExport(tempFile, "ppt/slides/slide5.xml");
- assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick",
- "action", "ppaction://hlinksldjump");
+ assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
+ "ppaction://hlinksldjump");
xmlDocUniquePtr pRelsDoc5 = parseExport(tempFile, "ppt/slides/_rels/slide5.xml.rels");
assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
- "slide6.xml");
+ "slide6.xml");
xmlDocUniquePtr pXmlDoc6 = parseExport(tempFile, "ppt/slides/slide6.xml");
- assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick",
- "action", "ppaction://hlinkshowjump?jump=endshow");
+ assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
+ "ppaction://hlinkshowjump?jump=endshow");
xmlDocUniquePtr pXmlDoc7 = parseExport(tempFile, "ppt/slides/slide7.xml");
- assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick",
- "action", "ppaction://hlinkshowjump?jump=firstslide");
+ assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action",
+ "ppaction://hlinkshowjump?jump=firstslide");
}
void SdOOXMLExportTest1::testTdf143624()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143624.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143624.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -453,10 +470,12 @@ void SdOOXMLExportTest1::testTdf143624()
void SdOOXMLExportTest1::testTdf142648()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142648.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142648.pptx"), PPTX);
utl::TempFileNamed tempFile;
- uno::Reference<drawing::XDrawPagesSupplier> xDPS(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<drawing::XDrawPagesSupplier> xDPS(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
uno::Reference<drawing::XDrawPage> xDrawPage;
xDrawPages->getByIndex(0) >>= xDrawPage;
@@ -474,7 +493,8 @@ void SdOOXMLExportTest1::testTdf142648()
void SdOOXMLExportTest1::testTdf47365()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/loopNoPause.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/loopNoPause.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -488,7 +508,8 @@ void SdOOXMLExportTest1::testTdf47365()
void SdOOXMLExportTest1::testTdf125071()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125071.pptx"), PPTX);
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125071.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -501,7 +522,8 @@ void SdOOXMLExportTest1::testTdf125071()
void SdOOXMLExportTest1::testTdf54037()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf54037.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf54037.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -521,18 +543,20 @@ void SdOOXMLExportTest1::testTdf54037()
void SdOOXMLExportTest1::testTdf127237()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf127237.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf127237.pptx"), PPTX);
xDocShRef = saveAndReload(xDocShRef.get(), ODP);
const SdrPage* pPage = GetPage(1, xDocShRef);
CPPUNIT_ASSERT(pPage != nullptr);
- sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
CPPUNIT_ASSERT(pTableObj != nullptr);
- uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+ uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
Color nFillColor;
- uno::Reference< beans::XPropertySet > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 0),
+ uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillColor") >>= nFillColor;
CPPUNIT_ASSERT_EQUAL(Color(0x0070C0), nFillColor);
@@ -541,41 +565,43 @@ void SdOOXMLExportTest1::testTdf127237()
void SdOOXMLExportTest1::testBnc887230()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc887230.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc887230.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 0 ) );
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pPage->GetObj(0));
// Without the fix in place, this test would have failed with
//- Expected: 255
//- Actual : 13421823
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff), EE_CHAR_COLOR );
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testBnc870233_1()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc870233_1.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc870233_1.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
// The problem was all shapes had the same font (the last parsed font attributes overwrote all previous ones)
// First shape has red, bold font
{
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 0 ) );
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0xff0000), EE_CHAR_COLOR );
- checkFontAttributes<FontWeight, SvxWeightItem>( pObj, WEIGHT_BOLD, EE_CHAR_WEIGHT );
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pPage->GetObj(0));
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xff0000), EE_CHAR_COLOR);
+ checkFontAttributes<FontWeight, SvxWeightItem>(pObj, WEIGHT_BOLD, EE_CHAR_WEIGHT);
}
// Second shape has blue, italic font
{
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 1 ) );
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff), EE_CHAR_COLOR);
- checkFontAttributes<FontItalic, SvxPostureItem>( pObj, ITALIC_NORMAL, EE_CHAR_ITALIC);
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pPage->GetObj(1));
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
+ checkFontAttributes<FontItalic, SvxPostureItem>(pObj, ITALIC_NORMAL, EE_CHAR_ITALIC);
}
xDocShRef->DoClose();
@@ -583,34 +609,35 @@ void SdOOXMLExportTest1::testBnc870233_1()
void SdOOXMLExportTest1::testBnc870233_2()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc870233_2.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc870233_2.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
// The problem was in some SmartArts font color was wrong
// First smart art has blue font color (direct formatting)
{
- const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0));
+ const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObjGroup);
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(1));
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pObjGroup->GetSubList()->GetObj(1));
checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
}
// Second smart art has "dk2" font color (style)
{
- const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(1));
+ const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(1));
CPPUNIT_ASSERT(pObjGroup);
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(1));
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x1f497d), EE_CHAR_COLOR );
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pObjGroup->GetSubList()->GetObj(1));
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x1f497d), EE_CHAR_COLOR);
}
// Third smart art has white font color (style)
{
- const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(2));
+ const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(2));
CPPUNIT_ASSERT(pObjGroup);
- const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(1));
+ const SdrTextObj* pObj = dynamic_cast<SdrTextObj*>(pObjGroup->GetSubList()->GetObj(1));
checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xffffff), EE_CHAR_COLOR);
}
@@ -620,32 +647,38 @@ void SdOOXMLExportTest1::testBnc870233_2()
void SdOOXMLExportTest1::testN828390_4()
{
bool bPassed = false;
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/n828390_4.odp"), ODP );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/n828390_4.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
{
std::vector<EECharAttrib> rLst;
- SdrObject *pObj = pPage->GetObj(0);
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
- CPPUNIT_ASSERT( pTxtObj );
+ SdrObject* pObj = pPage->GetObj(0);
+ SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>(pObj);
+ CPPUNIT_ASSERT(pTxtObj);
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
aEdit.GetCharAttribs(0, rLst);
- for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
+ for (std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend();
+ ++it)
{
- const SvxFontHeightItem * pFontHeight = dynamic_cast<const SvxFontHeightItem *>((*it).pAttr);
- if( pFontHeight && (*it).nStart == 18 )
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", static_cast<sal_uInt32>(1129), pFontHeight->GetHeight() );
- const SvxFontItem *pFont = dynamic_cast<const SvxFontItem *>((*it).pAttr);
- if( pFont )
+ const SvxFontHeightItem* pFontHeight
+ = dynamic_cast<const SvxFontHeightItem*>((*it).pAttr);
+ if (pFontHeight && (*it).nStart == 18)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Font height is wrong", static_cast<sal_uInt32>(1129),
+ pFontHeight->GetHeight());
+ const SvxFontItem* pFont = dynamic_cast<const SvxFontItem*>((*it).pAttr);
+ if (pFont)
{
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font is wrong", OUString("Arial"), pFont->GetFamilyName() );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Font is wrong", OUString("Arial"),
+ pFont->GetFamilyName());
bPassed = true;
}
- const SvxWeightItem *pWeight = dynamic_cast<const SvxWeightItem *>((*it).pAttr);
- if( pWeight && (*it).nStart == 18 )
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font Weight is wrong", WEIGHT_BOLD, pWeight->GetWeight() );
+ const SvxWeightItem* pWeight = dynamic_cast<const SvxWeightItem*>((*it).pAttr);
+ if (pWeight && (*it).nStart == 18)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Font Weight is wrong", WEIGHT_BOLD,
+ pWeight->GetWeight());
}
}
CPPUNIT_ASSERT(bPassed);
@@ -655,18 +688,20 @@ void SdOOXMLExportTest1::testN828390_4()
void SdOOXMLExportTest1::testN828390_5()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/n828390_5.odp"), ODP );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/n828390_5.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
{
- SdrObject *pObj = pPage->GetObj(0);
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
- CPPUNIT_ASSERT( pTxtObj );
+ SdrObject* pObj = pPage->GetObj(0);
+ SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>(pObj);
+ CPPUNIT_ASSERT(pTxtObj);
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
const SvxNumBulletItem& rNumFmt = aEdit.GetParaAttribs(3).Get(EE_PARA_NUMBULLET);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's relative size is wrong!", sal_uInt16(75), rNumFmt.GetNumRule().GetLevel(1).GetBulletRelSize() ); // != 25
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's relative size is wrong!", sal_uInt16(75),
+ rNumFmt.GetNumRule().GetLevel(1).GetBulletRelSize()); // != 25
}
xDocShRef->DoClose();
@@ -674,10 +709,11 @@ void SdOOXMLExportTest1::testN828390_5()
void SdOOXMLExportTest1::testLostPlaceholders()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholder.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholder.odp"), ODP);
CPPUNIT_ASSERT(xDocShRef.is());
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
CPPUNIT_ASSERT(xDocShRef.is());
auto pDoc = xDocShRef->GetDoc();
@@ -686,16 +722,19 @@ void SdOOXMLExportTest1::testLostPlaceholders()
CPPUNIT_ASSERT(pPage);
auto pObj = pPage->GetObj(1);
CPPUNIT_ASSERT(pObj);
- uno::Reference<drawing::XShape> xShp (pObj->getUnoShape(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xShp(pObj->getUnoShape(), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShp);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!", OUString(u"com.sun.star.presentation.OutlinerShape"), xShp->getShapeType());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!",
+ OUString(u"com.sun.star.presentation.OutlinerShape"),
+ xShp->getShapeType());
uno::Reference<beans::XPropertySet> xShpProps(xShp, uno::UNO_QUERY);
// Without the fix in place there will be the following error:
// Expected: com.sun.star.presentation.OutlinerShape
// Actual: com.sun.star.drawing.CustomShape
- CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true, xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true,
+ xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
// Without the fix in place this will the following:
// Expected: true
// Actual: false
@@ -705,7 +744,8 @@ void SdOOXMLExportTest1::testLostPlaceholders()
void SdOOXMLExportTest1::testPlaceholderFillAndOutlineExport()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholderFill.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholderFill.odp"), ODP);
uno::Any aFillStyle;
uno::Any aFillColor;
@@ -726,9 +766,13 @@ void SdOOXMLExportTest1::testPlaceholderFillAndOutlineExport()
uno::Reference<drawing::XShape> xShp(pObj->getUnoShape(), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShp);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!", OUString(u"com.sun.star.presentation.OutlinerShape"), xShp->getShapeType());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!",
+ OUString(u"com.sun.star.presentation.OutlinerShape"),
+ xShp->getShapeType());
uno::Reference<beans::XPropertySet> xShpProps(xShp, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true, xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "It must be a placeholder!", true,
+ xShpProps->getPropertyValue("IsPresentationObject").get<bool>());
if (i == 1)
{
@@ -743,11 +787,15 @@ void SdOOXMLExportTest1::testPlaceholderFillAndOutlineExport()
}
else
{
- CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillstyle has not been exported!", aFillStyle, xShpProps->getPropertyValue("FillStyle"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillcolor has not been exported!", aFillColor, xShpProps->getPropertyValue("FillColor"));
-
- CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linestyle has not been exported!", aLineStyle, xShpProps->getPropertyValue("LineStyle"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linecolor has not been exported!", aLineColor, xShpProps->getPropertyValue("LineColor"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillstyle has not been exported!",
+ aFillStyle, xShpProps->getPropertyValue("FillStyle"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder fillcolor has not been exported!",
+ aFillColor, xShpProps->getPropertyValue("FillColor"));
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linestyle has not been exported!",
+ aLineStyle, xShpProps->getPropertyValue("LineStyle"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The Placeholder linecolor has not been exported!",
+ aLineColor, xShpProps->getPropertyValue("LineColor"));
break;
}
}
@@ -756,27 +804,31 @@ void SdOOXMLExportTest1::testPlaceholderFillAndOutlineExport()
void SdOOXMLExportTest1::testFdo71961()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo71961.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo71961.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ const SdrPage* pPage = GetPage(1, xDocShRef);
// Export to .pptx changes all text frames to custom shape objects, which obey TextWordWrap property
// (which is false for text frames otherwise and is ignored). Check that frames that should wrap still do.
- auto pTxtObj = pPage->GetObj( 1 );
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( OUString( "Text to be always wrapped" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
+ auto pTxtObj = pPage->GetObj(1);
+ CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString("Text to be always wrapped"),
+ pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
+ CPPUNIT_ASSERT_EQUAL(true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
- pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 2 ));
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape non-wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( false, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
+ pTxtObj = dynamic_cast<SdrObjCustomShape*>(pPage->GetObj(2));
+ CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString("Custom shape non-wrapped text"),
+ pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
+ CPPUNIT_ASSERT_EQUAL(false, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
- pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 3 ));
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
+ pTxtObj = dynamic_cast<SdrObjCustomShape*>(pPage->GetObj(3));
+ CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(OUString("Custom shape wrapped text"),
+ pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
+ CPPUNIT_ASSERT_EQUAL(true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
xDocShRef->DoClose();
}
@@ -784,24 +836,25 @@ void SdOOXMLExportTest1::testFdo71961()
void SdOOXMLExportTest1::testN828390()
{
bool bPassed = false;
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n828390.pptx"), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n828390.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
{
std::vector<EECharAttrib> rLst;
// Get the object
- SdrObject *pObj = pPage->GetObj(0);
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
- CPPUNIT_ASSERT( pTxtObj );
+ SdrObject* pObj = pPage->GetObj(0);
+ SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>(pObj);
+ CPPUNIT_ASSERT(pTxtObj);
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
aEdit.GetCharAttribs(0, rLst);
- bPassed = std::any_of(rLst.rbegin(), rLst.rend(),
- [](const EECharAttrib& rCharAttr) {
- const SvxEscapementItem *pFontEscapement = dynamic_cast<const SvxEscapementItem *>(rCharAttr.pAttr);
- return pFontEscapement && (pFontEscapement->GetEsc() == -25);
- });
+ bPassed = std::any_of(rLst.rbegin(), rLst.rend(), [](const EECharAttrib& rCharAttr) {
+ const SvxEscapementItem* pFontEscapement
+ = dynamic_cast<const SvxEscapementItem*>(rCharAttr.pAttr);
+ return pFontEscapement && (pFontEscapement->GetEsc() == -25);
+ });
}
CPPUNIT_ASSERT_MESSAGE("Subscript not exported properly", bPassed);
@@ -810,43 +863,49 @@ void SdOOXMLExportTest1::testN828390()
void SdOOXMLExportTest1::testBnc880763()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc880763.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc880763.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
// Check z-order of the two shapes, use background color to identify them
// First object in the background has blue background color
- const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0));
+ const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObjGroup);
- const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(1);
- CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( Color(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
+ const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1);
+ CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(
+ Color(0x0000ff),
+ (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
// Second object at the front has green background color
pObj = pPage->GetObj(1);
- CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( Color(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
+ CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(
+ Color(0x00ff00),
+ (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testBnc862510_5()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc862510_5.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc862510_5.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
// Same as testBnc870237, but here we check the horizontal spacing
- const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0));
+ const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObjGroup);
const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(2);
- CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST).GetValue());
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST).GetValue());
- CPPUNIT_ASSERT_EQUAL( sal_Int32(7510), pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST).GetValue());
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST).GetValue());
+ CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST).GetValue());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST).GetValue());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(7510), pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST).GetValue());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST).GetValue());
xDocShRef->DoClose();
}
@@ -856,8 +915,9 @@ void SdOOXMLExportTest1::testBnc862510_5()
// not written into the file.
void SdOOXMLExportTest1::testBnc822347_EmptyBullet()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/bnc822347_EmptyBullet.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX);
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/bnc822347_EmptyBullet.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
SdDrawDocument* pDoc = xDocShRef->GetDoc();
SdrOutliner* pOutliner = pDoc->GetInternalOutliner();
@@ -877,7 +937,8 @@ void SdOOXMLExportTest1::testBnc822347_EmptyBullet()
const sal_Int16 nDepth = pOutliner->GetDepth(0);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(-1), nDepth); // depth >= 0 means that the paragraph has bullets enabled
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(-1),
+ nDepth); // depth >= 0 means that the paragraph has bullets enabled
xDocShRef->DoClose();
}
@@ -885,12 +946,13 @@ void SdOOXMLExportTest1::testBnc822347_EmptyBullet()
//Bullets not having any text following them are not getting exported to pptx correctly.
void SdOOXMLExportTest1::testFdo90607()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo90607.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo90607.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(1) );
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+ SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>(pPage->GetObj(1));
+ CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr);
OutlinerParaObject* pOutlinerParagraphObject = pTxtObj->GetOutlinerParaObject();
const sal_Int16 nDepth = pOutlinerParagraphObject->GetDepth(0);
CPPUNIT_ASSERT_MESSAGE("not equal", nDepth != -1);
@@ -899,15 +961,19 @@ void SdOOXMLExportTest1::testFdo90607()
void SdOOXMLExportTest1::testFdo83751()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/fdo83751.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
-
- SdDrawDocument *pDoc = xDocShRef->GetDoc();
- CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/fdo83751.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( xDocShRef->GetModel(), uno::UNO_QUERY );
- uno::Reference<document::XDocumentProperties> xProps = xDocumentPropertiesSupplier->getDocumentProperties();
- uno::Reference<beans::XPropertySet> xUDProps( xProps->getUserDefinedProperties(), uno::UNO_QUERY );
+ SdDrawDocument* pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE("no document", pDoc != nullptr);
+
+ uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(
+ xDocShRef->GetModel(), uno::UNO_QUERY);
+ uno::Reference<document::XDocumentProperties> xProps
+ = xDocumentPropertiesSupplier->getDocumentProperties();
+ uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(),
+ uno::UNO_QUERY);
OUString propValue;
xUDProps->getPropertyValue("Testing") >>= propValue;
CPPUNIT_ASSERT_EQUAL(OUString("Document"), propValue);
@@ -916,27 +982,31 @@ void SdOOXMLExportTest1::testFdo83751()
void SdOOXMLExportTest1::testFdo79731()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo79731.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/fdo79731.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ SdDrawDocument* pDoc = xDocShRef->GetDoc();
CPPUNIT_ASSERT(pDoc);
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testTableCellFillProperties()
{
- std::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create());
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(
+ comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Cache::GraphicManager::TotalCacheSize::set(sal_Int32(1), batch);
batch->commit();
// Load the original file
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/Table_with_Cell_Fill.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/Table_with_Cell_Fill.odp"), ODP);
// Export the document and import again for a check
- uno::Reference< lang::XComponent > xComponent = xDocShRef->GetModel();
+ uno::Reference<lang::XComponent> xComponent = xDocShRef->GetModel();
uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
utl::MediaDescriptor aMediaDescriptor;
- aMediaDescriptor["FilterName"] <<= OStringToOUString(std::string_view(aFileFormats[PPTX].pFilterName), RTL_TEXTENCODING_UTF8);
+ aMediaDescriptor["FilterName"] <<= OStringToOUString(
+ std::string_view(aFileFormats[PPTX].pFilterName), RTL_TEXTENCODING_UTF8);
utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
@@ -945,12 +1015,12 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
xComponent->dispose();
xDocShRef = loadURL(aTempFile.GetURL(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT( pTableObj );
- uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
- uno::Reference< beans::XPropertySet > xCell;
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
+ uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xCell;
// Test Solid fill color
Color nColor;
@@ -959,7 +1029,7 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
CPPUNIT_ASSERT_EQUAL(Color(0x66ffff), nColor);
// Test Picture fill type for cell
- drawing::FillStyle aFillStyle( drawing::FillStyle_NONE );
+ drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("FillStyle") >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_BITMAP), static_cast<int>(aFillStyle));
@@ -974,70 +1044,77 @@ void SdOOXMLExportTest1::testTableCellFillProperties()
void SdOOXMLExportTest1::testBulletStartNumber()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n90255.pptx"), PPTX );
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/n90255.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
+ 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);
+ const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's start number is wrong!", sal_Int16(3), sal_Int16(pNumFmt->GetNumRule().GetLevel(0).GetStart()) );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's start number is wrong!", sal_Int16(3),
+ sal_Int16(pNumFmt->GetNumRule().GetLevel(0).GetStart()));
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testLineStyle()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/lineStyle.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/lineStyle.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
SdrObject const* pShape = pPage->GetObj(0);
CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr);
- const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>(
- pShape->GetMergedItem(XATTR_LINESTYLE));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", int(drawing::LineStyle_SOLID), static_cast<int>(rStyleItem.GetValue()));
+ const XLineStyleItem& rStyleItem
+ = dynamic_cast<const XLineStyleItem&>(pShape->GetMergedItem(XATTR_LINESTYLE));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", int(drawing::LineStyle_SOLID),
+ static_cast<int>(rStyleItem.GetValue()));
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testRightToLeftParaghraph()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
// Get first paragraph
- uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
- uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
+ uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
sal_Int16 nWritingMode = 0;
- xPropSet->getPropertyValue( "WritingMode" ) >>= nWritingMode;
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB, nWritingMode);
+ xPropSet->getPropertyValue("WritingMode") >>= nWritingMode;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB,
+ nWritingMode);
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testTextboxWithHyperlink()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/hyperlinktest.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/hyperlinktest.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
// Get first paragraph
- uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
// first chunk of text
- uno::Reference<text::XTextRange> xRun( getRunFromParagraph( 0, xParagraph ) );
- uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
+ uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
+ uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
uno::Reference<text::XTextField> xField;
xPropSet->getPropertyValue("TextField") >>= xField;
- CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
+ CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
xPropSet.set(xField, uno::UNO_QUERY);
OUString aURL;
@@ -1049,21 +1126,22 @@ void SdOOXMLExportTest1::testTextboxWithHyperlink()
void SdOOXMLExportTest1::testTdf136911()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/ppt/tdf136911.ppt"), PPT);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/ppt/tdf136911.ppt"), PPT);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
// Get second paragraph
- uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
// first chunk of text
- uno::Reference<text::XTextRange> xRun( getRunFromParagraph( 0, xParagraph ) );
- uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
+ uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
+ uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
uno::Reference<text::XTextField> xField;
xPropSet->getPropertyValue("TextField") >>= xField;
- CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
+ CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
xPropSet.set(xField, uno::UNO_QUERY);
OUString aURL;
@@ -1075,45 +1153,51 @@ void SdOOXMLExportTest1::testTdf136911()
void SdOOXMLExportTest1::testBulletColor()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bulletColor.pptx"), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bulletColor.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
+ 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);
+ const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", Color(0xff0000),pNumFmt->GetNumRule().GetLevel(0).GetBulletColor());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's color is wrong!", Color(0xff0000),
+ pNumFmt->GetNumRule().GetLevel(0).GetBulletColor());
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testBulletCharAndFont()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/bulletCharAndFont.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/bulletCharAndFont.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- 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<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::Reference<container::XIndexAccess> xLevels(xPropSet->getPropertyValue("NumberingRules"),
+ uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aProps;
xLevels->getByIndex(0) >>= aProps; // 1st level
- OUString sBulletChar(u'\xf06c');
- for (beans::PropertyValue const & rProp : std::as_const(aProps))
+ OUString sBulletChar(u'\xf06c');
+ for (beans::PropertyValue const& rProp : std::as_const(aProps))
{
if (rProp.Name == "BulletChar")
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "BulletChar incorrect.", sBulletChar ,rProp.Value.get<OUString>());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("BulletChar incorrect.", sBulletChar,
+ rProp.Value.get<OUString>());
if (rProp.Name == "BulletFont")
{
awt::FontDescriptor aFontDescriptor;
rProp.Value >>= aFontDescriptor;
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "BulletFont incorrect.", OUString("Wingdings"),aFontDescriptor.Name);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("BulletFont incorrect.", OUString("Wingdings"),
+ aFontDescriptor.Name);
}
}
xDocShRef->DoClose();
@@ -1121,41 +1205,46 @@ void SdOOXMLExportTest1::testBulletCharAndFont()
void SdOOXMLExportTest1::testBulletMarginAndIndentation()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bulletMarginAndIndent.pptx"), PPTX );
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bulletMarginAndIndent.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) );
- CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
+ 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);
+ const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's left margin is wrong!", sal_Int32(1000),pNumFmt->GetNumRule().GetLevel(0).GetAbsLSpace() ); // left margin is 0.79 cm
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's indentation is wrong!", sal_Int32(-1000),pNumFmt->GetNumRule().GetLevel(0). GetFirstLineOffset());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "Bullet's left margin is wrong!", sal_Int32(1000),
+ pNumFmt->GetNumRule().GetLevel(0).GetAbsLSpace()); // left margin is 0.79 cm
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's indentation is wrong!", sal_Int32(-1000),
+ pNumFmt->GetNumRule().GetLevel(0).GetFirstLineOffset());
xDocShRef->DoClose();
}
void SdOOXMLExportTest1::testParaMarginAndindentation()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/paraMarginAndIndentation.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/paraMarginAndIndentation.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
// Get first paragraph
- uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
- uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
+ uno::Reference<beans::XPropertySet> xPropSet(xParagraph, uno::UNO_QUERY_THROW);
sal_Int32 nParaLeftMargin = 0;
- xPropSet->getPropertyValue( "ParaLeftMargin" ) >>= nParaLeftMargin;
+ xPropSet->getPropertyValue("ParaLeftMargin") >>= nParaLeftMargin;
CPPUNIT_ASSERT_EQUAL(sal_uInt32(1000), sal_uInt32(nParaLeftMargin));
sal_Int32 nParaFirstLineIndent = 0;
- xPropSet->getPropertyValue( "ParaFirstLineIndent" ) >>= nParaFirstLineIndent;
+ xPropSet->getPropertyValue("ParaFirstLineIndent") >>= nParaFirstLineIndent;
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1270), nParaFirstLineIndent);
xDocShRef->DoClose();
@@ -1163,18 +1252,20 @@ void SdOOXMLExportTest1::testParaMarginAndindentation()
void SdOOXMLExportTest1::testCellLeftAndRightMargin()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/n90223.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/n90223.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
sal_Int32 nLeftMargin, nRightMargin;
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT( pTableObj );
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
- uno::Reference< css::table::XTable > xTable (pTableObj->getTable(), uno::UNO_SET_THROW);
- uno::Reference< css::table::XMergeableCell > xCell( xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xCellPropSet(xCell, uno::UNO_QUERY_THROW);
+ uno::Reference<css::table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
+ uno::Reference<css::table::XMergeableCell> xCell(xTable->getCellByPosition(0, 0),
+ uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xCellPropSet(xCell, uno::UNO_QUERY_THROW);
uno::Any aLeftMargin = xCellPropSet->getPropertyValue("TextLeftDistance");
CPPUNIT_ASSERT(aLeftMargin >>= nLeftMargin);
@@ -1183,8 +1274,8 @@ void SdOOXMLExportTest1::testCellLeftAndRightMargin()
CPPUNIT_ASSERT(aRightMargin >>= nRightMargin);
// Convert values to EMU
- nLeftMargin = oox::drawingml::convertHmmToEmu( nLeftMargin );
- nRightMargin = oox::drawingml::convertHmmToEmu( nRightMargin );
+ nLeftMargin = oox::drawingml::convertHmmToEmu(nLeftMargin);
+ nRightMargin = oox::drawingml::convertHmmToEmu(nRightMargin);
CPPUNIT_ASSERT_EQUAL(sal_Int32(45720), nLeftMargin);
CPPUNIT_ASSERT_EQUAL(sal_Int32(45720), nRightMargin);
@@ -1194,61 +1285,63 @@ void SdOOXMLExportTest1::testCellLeftAndRightMargin()
void SdOOXMLExportTest1::testMergedCells()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/cellspan.odp"), ODP);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/cellspan.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT( pTableObj );
- uno::Reference< table::XTable > xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
- uno::Reference< text::XTextRange > xText1(xTable->getCellByPosition(3, 0), uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL( OUString("0,3"), xText1->getString() );
+ CPPUNIT_ASSERT(pTableObj);
+ uno::Reference<table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
+ uno::Reference<text::XTextRange> xText1(xTable->getCellByPosition(3, 0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("0,3"), xText1->getString());
- uno::Reference< text::XTextRange > xText2(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL( OUString("2,3"), xText2->getString() );
+ uno::Reference<text::XTextRange> xText2(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("2,3"), xText2->getString());
}
void SdOOXMLExportTest1::testTableCellBorder()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/n90190.pptx"), PPTX);
- xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/n90190.pptx"), PPTX);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrPage* pPage = GetPage(1, xDocShRef);
- sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT( pTableObj );
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
table::BorderLine2 aBorderLine;
- uno::Reference< table::XTable > xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
- uno::Reference< css::table::XMergeableCell > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
- uno::Reference< beans::XPropertySet > xCellPropSet (xCell, uno::UNO_QUERY_THROW);
+ uno::Reference<table::XTable> xTable(pTableObj->getTable(), uno::UNO_SET_THROW);
+ uno::Reference<css::table::XMergeableCell> xCell(xTable->getCellByPosition(0, 0),
+ uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xCellPropSet(xCell, uno::UNO_QUERY_THROW);
xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine;
-// While importing the table cell border line width, it converts EMU->Hmm then divided result by 2.
-// To get original value of LineWidth need to multiple by 2.
+ // While importing the table cell border line width, it converts EMU->Hmm then divided result by 2.
+ // To get original value of LineWidth need to multiple by 2.
sal_Int32 nLeftBorder = aBorderLine.LineWidth * 2;
- nLeftBorder = oox::drawingml::convertHmmToEmu( nLeftBorder );
+ nLeftBorder = oox::drawingml::convertHmmToEmu(nLeftBorder);
CPPUNIT_ASSERT(nLeftBorder);
CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine;
sal_Int32 nRightBorder = aBorderLine.LineWidth * 2;
- nRightBorder = oox::drawingml::convertHmmToEmu( nRightBorder );
+ nRightBorder = oox::drawingml::convertHmmToEmu(nRightBorder);
CPPUNIT_ASSERT(nRightBorder);
CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, aBorderLine.Color));
xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine;
sal_Int32 nTopBorder = aBorderLine.LineWidth * 2;
- nTopBorder = oox::drawingml::convertHmmToEmu( nTopBorder );
+ nTopBorder = oox::drawingml::convertHmmToEmu(nTopBorder);
CPPUNIT_ASSERT(nTopBorder);
CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
-
xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
sal_Int32 nBottomBorder = aBorderLine.LineWidth * 2;
- nBottomBorder = oox::drawingml::convertHmmToEmu( nBottomBorder );
+ nBottomBorder = oox::drawingml::convertHmmToEmu(nBottomBorder);
CPPUNIT_ASSERT(nBottomBorder);
CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), Color(ColorTransparency, aBorderLine.Color));
@@ -1257,10 +1350,11 @@ void SdOOXMLExportTest1::testTableCellBorder()
void SdOOXMLExportTest1::testTdf111884()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf111884.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf111884.pptx"), PPTX);
xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
- const SdrPage *pPage = GetPage(1, xDocShRef);
+ const SdrPage* pPage = GetPage(1, xDocShRef);
SdrObject const* pShape = pPage->GetObj(2);
CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr);
@@ -1273,7 +1367,8 @@ void SdOOXMLExportTest1::testTdf111884()
void SdOOXMLExportTest1::testTdf112633()
{
// Load document and export it to a temporary file
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112633.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf112633.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1282,25 +1377,31 @@ void SdOOXMLExportTest1::testTdf112633()
xmlDocUniquePtr pRelsDoc = parseExport(tempFile, "ppt/slides/_rels/slide1.xml.rels");
// Check image with artistic effect exists in the slide
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/"
- "a14:imgLayer/a14:imgEffect/a14:artisticPencilGrayscale",
- "pencilSize", "80");
+ assertXPath(pXmlDoc,
+ "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/"
+ "a14:imgLayer/a14:imgEffect/a14:artisticPencilGrayscale",
+ "pencilSize", "80");
// Check there is a relation with the .wdp file that contains the backed up image
- OUString sEmbedId1 = getXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/"
- "a:ext/a14:imgProps/a14:imgLayer", "embed");
+ OUString sEmbedId1 = getXPath(pXmlDoc,
+ "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:extLst/"
+ "a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']";
- assertXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target", "../media/hdphoto1.wdp");
+ assertXPath(pRelsDoc, OUStringToOString(sXmlPath, RTL_TEXTENCODING_UTF8), "Target",
+ "../media/hdphoto1.wdp");
// Check the .wdp file exists
- uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(
- comphelper::getComponentContext(m_xSFactory), tempFile.GetURL());
+ uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
+ = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
+ tempFile.GetURL());
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("ppt/media/hdphoto1.wdp")));
}
void SdOOXMLExportTest1::testTdf128952()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128952.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf128952.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1315,7 +1416,8 @@ void SdOOXMLExportTest1::testTdf128952()
void SdOOXMLExportTest1::testTdf127090()
{
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf127090.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf127090.odp"), ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1328,7 +1430,8 @@ void SdOOXMLExportTest1::testTdf127090()
void SdOOXMLExportTest1::testCustomXml()
{
// Load document and export it to a temporary file
- ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/customxml.pptx"), PPTX);
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/customxml.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1340,7 +1443,8 @@ void SdOOXMLExportTest1::testCustomXml()
// Check there is a relation to itemProps1.xml.
assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship", 1);
- assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml");
+ assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
+ "itemProps1.xml");
std::unique_ptr<SvStream> pStream = parseExportStream(tempFile, "ddp/ddpfile.xen");
CPPUNIT_ASSERT(pStream);
@@ -1430,12 +1534,14 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles()
// Load odp document and read the LineDash values.
::sd::DrawDocShellRef xDocShRef
= loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/LineStylesOwn.odp"), ODP);
- uno::Reference<drawing::XDrawPagesSupplier> xDocodp(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPagesSupplier> xDocodp(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xDocodp.is());
- uno::Reference<drawing::XDrawPage> xPageodp(xDocodp->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xPageodp(xDocodp->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xPageodp.is());
drawing::LineDash aLineDashodp[10];
- for (sal_uInt16 i= 0; i < 10; i++)
+ for (sal_uInt16 i = 0; i < 10; i++)
{
uno::Reference<beans::XPropertySet> xShapeodp(getShape(i, xPageodp));
CPPUNIT_ASSERT(xShapeodp.is());
@@ -1445,9 +1551,11 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles()
// Save to pptx, reload and compare the LineDash values
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
- uno::Reference<drawing::XDrawPagesSupplier> xDocpptx(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPagesSupplier> xDocpptx(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xDocpptx.is());
- uno::Reference<drawing::XDrawPage> xPagepptx(xDocpptx->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xPagepptx(xDocpptx->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xPagepptx.is());
for (sal_uInt16 i = 0; i < 10; i++)
@@ -1475,31 +1583,23 @@ void SdOOXMLExportTest1::testRoundtripPrstDash()
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
- const OUString sOriginal[] = {
- "dash",
- "dashDot",
- "dot",
- "lgDash",
- "lgDashDot",
- "lgDashDotDot",
- "sysDash",
- "sysDashDot",
- "sysDashDotDot",
- "sysDot"
- };
+ const OUString sOriginal[]
+ = { "dash", "dashDot", "dot", "lgDash", "lgDashDot",
+ "lgDashDotDot", "sysDash", "sysDashDot", "sysDashDotDot", "sysDot" };
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
const OString sStart = "/p:sld/p:cSld/p:spTree/p:sp[";
const OString sEnd = "]/p:spPr/a:ln/a:prstDash";
for (sal_uInt16 i = 0; i < 10; i++)
{
- OString sXmlPath = sStart + OString::number(i+1) + sEnd;
+ OString sXmlPath = sStart + OString::number(i + 1) + sEnd;
OUString sResaved = getXPath(pXmlDoc, sXmlPath, "val");
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong prstDash", sOriginal[i], sResaved);
}
// tdf#126746: Make sure that dash-dot pattern starts with the longer dash, as defined in OOXML
// Make sure Style is drawing::DashStyle_RECTRELATIVE
- uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
CPPUNIT_ASSERT(xDoc.is());
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xPage.is());
@@ -1520,8 +1620,8 @@ void SdOOXMLExportTest1::testRoundtripPrstDash()
void SdOOXMLExportTest1::testDashOnHairline()
{
// load and save document, make sure the custDash has 11 child elements.
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf127267DashOnHairline.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf127267DashOnHairline.odp"), ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1576,12 +1676,10 @@ void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect()
assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "b");
}
-
-
void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp"), ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1596,8 +1694,9 @@ void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill()
void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp"),
+ ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1613,8 +1712,9 @@ void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow()
void SdOOXMLExportTest1::testTdf128345FullTransparentGradient()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_FullTransparentGradient.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_FullTransparentGradient.odp"),
+ ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1626,8 +1726,8 @@ void SdOOXMLExportTest1::testTdf128345FullTransparentGradient()
void SdOOXMLExportTest1::testTdf128345GradientLinear()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientLinear.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientLinear.odp"), ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1636,7 +1736,7 @@ void SdOOXMLExportTest1::testTdf128345GradientLinear()
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang", "3600000");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs",2);
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos", "25000");
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000");
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "20000");
@@ -1647,8 +1747,8 @@ void SdOOXMLExportTest1::testTdf128345GradientLinear()
void SdOOXMLExportTest1::testTdf128345GradientRadial()
{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientRadial.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientRadial.odp"), ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1657,7 +1757,7 @@ void SdOOXMLExportTest1::testTdf128345GradientRadial()
// 100000 for full opak, so only the full transparency with val 0 should be written.
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs",2);
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000");
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", 0);
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr", "val", "ffffff");
@@ -1668,8 +1768,8 @@ void SdOOXMLExportTest1::testTdf128345GradientAxial()
{
// Without the patch, symmetric linear gradient with full transparence outside and
// full opak in the middle were imported as full transparent.
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientAxial.odp"), ODP);
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf128345_GradientAxial.odp"), ODP);
xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
uno::Reference<beans::XPropertySet> xShapePropSet(getShapeFromPage(0, 0, xDocShRef));
@@ -1685,7 +1785,9 @@ void SdOOXMLExportTest1::testTdf128345GradientAxial()
void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient()
{
::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf134969_TransparencyOnColorGradient.odp"), ODP);
+ = loadURL(m_directories.getURLFromSrc(
+ u"sd/qa/unit/data/odp/tdf134969_TransparencyOnColorGradient.odp"),
+ ODP);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1693,7 +1795,7 @@ void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient()
// Make sure the shape has a transparency in gradient stops.
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs",2);
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2);
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000");
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "60000");
}
@@ -1731,7 +1833,8 @@ void SdOOXMLExportTest1::testNarrationMimeType()
// Check if the bitmap of the media shape is exported correctly.
xmlDocUniquePtr pSlideDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
- OUString aImageId = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip", "embed");
+ OUString aImageId
+ = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip", "embed");
xmlDocUniquePtr pRelsDoc = parseExport(aTempFile, "ppt/slides/_rels/slide1.xml.rels");
OUString aImagePath = "/rels:Relationships/rels:Relationship[@Id='" + aImageId + "']";
// Something like ../media/image2.png.
@@ -1781,8 +1884,8 @@ void SdOOXMLExportTest1::testNarrationMimeType()
void SdOOXMLExportTest1::testTdf140865Wordart3D()
{
- sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140865Wordart3D.pptx"), PPTX);
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140865Wordart3D.pptx"), PPTX);
utl::TempFileNamed aTempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &aTempFile);
xmlDocUniquePtr pXmlDoc = parseExport(aTempFile, "ppt/slides/slide1.xml");
@@ -1803,7 +1906,8 @@ void SdOOXMLExportTest1::testTdf140865Wordart3D()
void SdOOXMLExportTest1::testTdf124457()
{
- sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf124457.pptx"), PPTX );
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf124457.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1823,7 +1927,8 @@ void SdOOXMLExportTest1::testTdf124457()
void SdOOXMLExportTest1::testTdf143126()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143126.pptx"), PPTX);
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143126.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1831,13 +1936,14 @@ void SdOOXMLExportTest1::testTdf143126()
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
- assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2" );
- assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3" );
+ assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2");
+ assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3");
}
void SdOOXMLExportTest1::testTdf143129()
{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143129.pptx"), PPTX);
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143129.pptx"), PPTX);
utl::TempFileNamed tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xDocShRef->DoClose();
@@ -1845,7 +1951,7 @@ void SdOOXMLExportTest1::testTdf143129()
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
- assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0" );
+ assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0");
}
void SdOOXMLExportTest1::testTdf118045()
@@ -1870,7 +1976,8 @@ void SdOOXMLExportTest1::testTdf137675()
xDocShRef->DoClose();
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
- assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill", "none");
+ assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill",
+ "none");
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);