summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/export/shapes.cxx5
-rw-r--r--sd/qa/unit/export-tests.cxx56
-rw-r--r--sd/qa/unit/import-tests.cxx56
3 files changed, 60 insertions, 57 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 6e4442502b5d..95cc968f76ff 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1758,7 +1758,10 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
if ( nBorderWidth > 0 )
{
mpFS->startElementNS( XML_a, XML_line, XML_w, I32S(nBorderWidth), FSEND );
- DrawingML::WriteSolidFill( ::Color(rBorderLine.Color) );
+ if ( rBorderLine.Color == sal_Int32( COL_AUTO ) )
+ mpFS->singleElementNS( XML_a, XML_noFill, FSEND );
+ else
+ DrawingML::WriteSolidFill( ::Color(rBorderLine.Color) );
mpFS->endElementNS( XML_a, XML_line );
}
}
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 165d212fd956..b75e4aad24cf 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -82,6 +82,7 @@ public:
void testTdf97630();
void testSwappedOutImageExport();
void testOOoXMLAnimations();
+ void testBnc480256();
void testUnknownAttributes();
void testTdf80020();
void testLinkedGraphicRT();
@@ -105,6 +106,7 @@ public:
CPPUNIT_TEST(testTdf97630);
CPPUNIT_TEST(testSwappedOutImageExport);
CPPUNIT_TEST(testOOoXMLAnimations);
+ CPPUNIT_TEST(testBnc480256);
CPPUNIT_TEST(testUnknownAttributes);
CPPUNIT_TEST(testTdf80020);
CPPUNIT_TEST(testLinkedGraphicRT);
@@ -517,6 +519,60 @@ void SdExportTest::testOOoXMLAnimations()
assertXPath(pXmlDoc, "//anim:par", 223);
}
+void SdExportTest::testBnc480256()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
+ // In the document, there are two tables with table background properties.
+ // Make sure colors are set properly for individual cells.
+
+ // TODO: If you are working on improving table background support, expect
+ // this unit test to fail. In that case, feel free to change the numbers.
+
+ const SdrPage *pPage = GetPage( 1, xDocShRef );
+
+ sdr::table::SdrTableObj *pTableObj;
+ uno::Reference< table::XCellRange > xTable;
+ uno::Reference< beans::XPropertySet > xCell;
+ sal_Int32 nColor;
+ table::BorderLine2 aBorderLine;
+
+ pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT( pTableObj );
+ xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+
+ xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
+ xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+ CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
+
+ xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
+ xCell->getPropertyValue("TopBorder") >>= aBorderLine;
+ CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
+
+ pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
+ CPPUNIT_ASSERT( pTableObj );
+ xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+
+ xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
+ xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+ CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
+
+ xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("FillColor") >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
+
+ xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
+ xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
+ CPPUNIT_ASSERT_EQUAL(util::Color(COL_AUTO), aBorderLine.Color);
+
+ xDocShRef->DoClose();
+}
+
void SdExportTest::testUnknownAttributes()
{
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), FODP);
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 242bddfd2c3a..b9d7b21db3aa 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -127,7 +127,6 @@ public:
void testN862510_4();
void testBnc870237();
void testBnc887225();
- void testBnc480256();
void testBnc591147();
void testCreationDate();
void testBnc584721_1();
@@ -211,7 +210,6 @@ public:
CPPUNIT_TEST(testN862510_4);
CPPUNIT_TEST(testBnc870237);
CPPUNIT_TEST(testBnc887225);
- CPPUNIT_TEST(testBnc480256);
CPPUNIT_TEST(testBnc591147);
CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST(testBnc584721_1);
@@ -890,60 +888,6 @@ void SdImportTest::testBnc887225()
xDocShRef->DoClose();
}
-void SdImportTest::testBnc480256()
-{
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
- // In the document, there are two tables with table background properties.
- // Make sure colors are set properly for individual cells.
-
- // TODO: If you are working on improving table background support, expect
- // this unit test to fail. In that case, feel free to change the numbers.
-
- const SdrPage *pPage = GetPage( 1, xDocShRef );
-
- sdr::table::SdrTableObj *pTableObj;
- uno::Reference< table::XCellRange > xTable;
- uno::Reference< beans::XPropertySet > xCell;
- sal_Int32 nColor;
- table::BorderLine2 aBorderLine;
-
- pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT( pTableObj );
- xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
-
- xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
- xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
- xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
- CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
-
- xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
- xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
- xCell->getPropertyValue("TopBorder") >>= aBorderLine;
- CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
-
- pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
- CPPUNIT_ASSERT( pTableObj );
- xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
-
- xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
- xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
- xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
- CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
-
- xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
- xCell->getPropertyValue("FillColor") >>= nColor;
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
-
- xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
- xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
- CPPUNIT_ASSERT_EQUAL(util::Color(COL_AUTO), aBorderLine.Color);
-
- xDocShRef->DoClose();
-}
-
void SdImportTest::testBnc584721_1()
{
// Title text shape on the master page contained wrong text.