tdf#136949: Revert "tdf#115753 fix table border missing when there are merged cells"
This reverts commit 2b19cd84f1
.
Change-Id: I5f3f51e0e816416c364155ab67bc37bb8c6fe545
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103187
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
@@ -35,7 +35,7 @@ public:
|
|||||||
/// Return xmlDocPtr representation of the XML stream read from pStream.
|
/// Return xmlDocPtr representation of the XML stream read from pStream.
|
||||||
static xmlDocUniquePtr parseXmlStream(SvStream* pStream);
|
static xmlDocUniquePtr parseXmlStream(SvStream* pStream);
|
||||||
|
|
||||||
static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const GDIMetaFile& rGDIMetaFile, const OUString& rStreamName = OUString());
|
static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const GDIMetaFile& rGDIMetaFile);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
XmlTestTools();
|
XmlTestTools();
|
||||||
|
Binary file not shown.
@@ -18,16 +18,13 @@
|
|||||||
#include <svx/svdograf.hxx>
|
#include <svx/svdograf.hxx>
|
||||||
#include <svx/svdomedia.hxx>
|
#include <svx/svdomedia.hxx>
|
||||||
#include <unotools/mediadescriptor.hxx>
|
#include <unotools/mediadescriptor.hxx>
|
||||||
#include <unotools/streamwrap.hxx>
|
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <comphelper/propertysequence.hxx>
|
|
||||||
|
|
||||||
#include <vcl/opengl/OpenGLWrapper.hxx>
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
#include <vcl/skia/SkiaHelper.hxx>
|
#include <vcl/skia/SkiaHelper.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/drawing/XDrawPage.hpp>
|
#include <com/sun/star/drawing/XDrawPage.hpp>
|
||||||
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
|
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
|
||||||
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
|
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/awt/XBitmap.hpp>
|
#include <com/sun/star/awt/XBitmap.hpp>
|
||||||
#include <com/sun/star/graphic/XGraphic.hpp>
|
#include <com/sun/star/graphic/XGraphic.hpp>
|
||||||
@@ -80,7 +77,6 @@ public:
|
|||||||
void testGlow();
|
void testGlow();
|
||||||
void testSoftEdges();
|
void testSoftEdges();
|
||||||
void testShadowBlur();
|
void testShadowBlur();
|
||||||
void testTdf115753();
|
|
||||||
void testRhbz1870501();
|
void testRhbz1870501();
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(SdExportTest);
|
CPPUNIT_TEST_SUITE(SdExportTest);
|
||||||
@@ -119,7 +115,6 @@ public:
|
|||||||
CPPUNIT_TEST(testGlow);
|
CPPUNIT_TEST(testGlow);
|
||||||
CPPUNIT_TEST(testSoftEdges);
|
CPPUNIT_TEST(testSoftEdges);
|
||||||
CPPUNIT_TEST(testShadowBlur);
|
CPPUNIT_TEST(testShadowBlur);
|
||||||
CPPUNIT_TEST(testTdf115753);
|
|
||||||
CPPUNIT_TEST(testRhbz1870501);
|
CPPUNIT_TEST(testRhbz1870501);
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
@@ -556,46 +551,6 @@ void SdExportTest::testBnc480256()
|
|||||||
xDocShRef->DoClose();
|
xDocShRef->DoClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SdExportTest::testTdf115753()
|
|
||||||
{
|
|
||||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115753.pptx"), PPTX);
|
|
||||||
xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
|
|
||||||
uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
// Save the first shape to a metafile.
|
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter = drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
|
|
||||||
uno::Reference<lang::XComponent> xSourceDoc(xShape, uno::UNO_QUERY);
|
|
||||||
xGraphicExporter->setSourceDocument(xSourceDoc);
|
|
||||||
|
|
||||||
SvMemoryStream aStream;
|
|
||||||
uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aStream));
|
|
||||||
uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({
|
|
||||||
{ "OutputStream", uno::Any(xOutputStream) },
|
|
||||||
{ "FilterName", uno::Any(OUString("SVM")) }
|
|
||||||
}));
|
|
||||||
xGraphicExporter->filter(aDescriptor);
|
|
||||||
aStream.Seek(STREAM_SEEK_TO_BEGIN);
|
|
||||||
|
|
||||||
// Read it back and dump it as an XML file.
|
|
||||||
Graphic aGraphic;
|
|
||||||
ReadGraphic(aStream, aGraphic);
|
|
||||||
const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile();
|
|
||||||
MetafileXmlDump dumper;
|
|
||||||
|
|
||||||
xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, rMetaFile);
|
|
||||||
CPPUNIT_ASSERT(pXmlDoc);
|
|
||||||
// Without the fix in place, it will print:
|
|
||||||
// - Expected: 21180
|
|
||||||
// - Actual : 12714
|
|
||||||
// because without the fix, one of the border lines is missing,
|
|
||||||
// and the value, which is where the line ends, will be shorter
|
|
||||||
// than it should be.
|
|
||||||
assertXPath(pXmlDoc, "/metafile/push[6]/polyline/point[2]", "x", "21180");
|
|
||||||
xDocShRef->DoClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SdExportTest::testUnknownAttributes()
|
void SdExportTest::testUnknownAttributes()
|
||||||
{
|
{
|
||||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), FODP);
|
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), FODP);
|
||||||
|
@@ -254,6 +254,20 @@ namespace sdr::contact
|
|||||||
aArray.SetCellStyleRight(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
|
aArray.SetCellStyleRight(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
|
||||||
aArray.SetCellStyleTop(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, true, nColCount, nRowCount, bIsRTL));
|
aArray.SetCellStyleTop(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, true, nColCount, nRowCount, bIsRTL));
|
||||||
aArray.SetCellStyleBottom(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow + 1, true, nColCount, nRowCount, bIsRTL));
|
aArray.SetCellStyleBottom(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow + 1, true, nColCount, nRowCount, bIsRTL));
|
||||||
|
|
||||||
|
// ignore merged cells (all except the top-left of a merged cell)
|
||||||
|
if(!xCurrentCell->isMerged())
|
||||||
|
{
|
||||||
|
// check if we are the top-left of a merged cell
|
||||||
|
const sal_Int32 nXSpan(xCurrentCell->getColumnSpan());
|
||||||
|
const sal_Int32 nYSpan(xCurrentCell->getRowSpan());
|
||||||
|
|
||||||
|
if(nXSpan > 1 || nYSpan > 1)
|
||||||
|
{
|
||||||
|
// if merged, set so at CellBorderArray for primitive creation
|
||||||
|
aArray.SetMergedRange(aCellPos.mnCol, aCellPos.mnRow, aCellPos.mnCol + nXSpan - 1, aCellPos.mnRow + nYSpan - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xCurrentCell.is() && !xCurrentCell->isMerged())
|
if(xCurrentCell.is() && !xCurrentCell->isMerged())
|
||||||
|
@@ -59,16 +59,8 @@ xmlDocUniquePtr XmlTestTools::parseXmlStream(SvStream* pStream)
|
|||||||
return xmlDocUniquePtr(xmlParseDoc(pCharBuffer));
|
return xmlDocUniquePtr(xmlParseDoc(pCharBuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlDocUniquePtr XmlTestTools::dumpAndParse(MetafileXmlDump& rDumper, const GDIMetaFile& rGDIMetaFile, const OUString& rStreamName)
|
xmlDocUniquePtr XmlTestTools::dumpAndParse(MetafileXmlDump& rDumper, const GDIMetaFile& rGDIMetaFile)
|
||||||
{
|
{
|
||||||
if (!rStreamName.isEmpty())
|
|
||||||
{
|
|
||||||
SvStream *pStream = new SvFileStream(rStreamName, StreamMode::STD_READWRITE | StreamMode::TRUNC);
|
|
||||||
rDumper.dump(rGDIMetaFile, *pStream);
|
|
||||||
pStream->Seek(STREAM_SEEK_TO_BEGIN);
|
|
||||||
return XmlTestTools::parseXmlStream(pStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
SvMemoryStream aStream;
|
SvMemoryStream aStream;
|
||||||
rDumper.dump(rGDIMetaFile, aStream);
|
rDumper.dump(rGDIMetaFile, aStream);
|
||||||
aStream.Seek(STREAM_SEEK_TO_BEGIN);
|
aStream.Seek(STREAM_SEEK_TO_BEGIN);
|
||||||
|
Reference in New Issue
Block a user