summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-14 11:13:17 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-14 11:30:18 +0100
commit4568d1d298bf4fc98dcd86384743a04587a2fe6f (patch)
treebd6245c95ce8201742f1c633a6e2564bb5fccb74 /writerfilter
parentb605c244772e82edd500748af8e07c4a9e349467 (diff)
fdo#86761 RTF import: positive border width and fLine=0 means no border
Regression from 01a32b7d074511bed24044dc94e1159aea62722b (fdo#85179 RTF filter: import image border, 2014-10-23), there were a number of problems here: - CppunitTest_sw_htmlexport: revert back to the old behavior, where in case there is no border, we don't set the color of it. - The testcase of the above commit omitted fLine=1 shape property, which is present in the original bugdoc, and only with that should we put a border around the shape. - Let fLine=1 explicitly change the line style from NONE. - dmapper: if line style is NONE, then don't bother setting the border color and width. Change-Id: Iffee41066d42822b699c478821645b9742df3f58
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx3
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index bcd78f4c4754..de999affa584 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/drawing/ColorMode.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
@@ -1165,7 +1166,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
//shapes have only one border
table::BorderLine2 aBorderLine;
GraphicBorderLine& rBorderLine = m_pImpl->aBorders[0];
- if (rBorderLine.isEmpty() && xShapeProps.is())
+ if (rBorderLine.isEmpty() && xShapeProps.is() && xShapeProps->getPropertyValue("LineStyle").get<drawing::LineStyle>() != drawing::LineStyle_NONE)
{
// In case we got no border tokens and we have the
// original shape, then use its line properties as the
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 8df4a6aa47c6..3f3969004d1a 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -128,6 +128,8 @@ void RTFSdrImport::resolveFLine(uno::Reference<beans::XPropertySet> const& xProp
{
if (nFLine == 0)
xPropertySet->setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_NONE));
+ else
+ xPropertySet->setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_SOLID));
}
void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape, const OUString& aKey, const OUString& aValue)