summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-14 11:13:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-12-15 13:50:31 +0000
commitcfb770dc619fc33796b98ca900eb3fd7f714139e (patch)
treef43eb9d06015ddc4feff3c9057a31353768a1bd0 /writerfilter
parent1b9bcc2e7f31e880e71c8d2a2aaf1b2839d4d32a (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. (cherry picked from commit 4568d1d298bf4fc98dcd86384743a04587a2fe6f) Conflicts: writerfilter/source/dmapper/GraphicImport.cxx Change-Id: Iffee41066d42822b699c478821645b9742df3f58 Reviewed-on: https://gerrit.libreoffice.org/13470 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 f53f7f30d068..e36f1b5e8380 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>
@@ -1123,7 +1124,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
if( m_pImpl->eGraphicImportType == IMPORT_AS_GRAPHIC || !nBorder )
{
GraphicBorderLine& rBorderLine = m_pImpl->aBorders[m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE ? BORDER_TOP : static_cast<BorderPosition>(nBorder)];
- 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 acbe6a2b7b5e..1a5aeac05134 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -137,6 +137,8 @@ void RTFSdrImport::resolveFLine(uno::Reference<beans::XPropertySet> xPropertySet
{
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> xShape, const OUString& aKey, const OUString& aValue)