diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-01 00:11:21 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-02-09 16:02:10 +0000 |
commit | 5b48d5e25c8e7918f4669195144afb1fae049d41 (patch) | |
tree | 17b9336ec5f4c26fb00509eb0adc53190ac03101 /writerfilter | |
parent | 0bc37cf20044fe8fee0cc7dd5af3ee58304a3a0f (diff) |
Related: tdf#88583 writerfilter: import paragraph color as fill attributes
In theory this is to be in sync with the ODF import. In practice the old
UNO property seems not to have a proper fallback to populate the doc
model with the fillattributes, so without this even if the import result
is visible, it would be lost on ODF export.
Additionally, this detected a bug in SwUnoCursorHelper::makeRedline(),
where paragraph format redline tried to use the map of a text portion
instead of a paragraph.
(cherry picked from commit 24077b2d52ab3d0fd0db5afb25d8b94b62386e3e)
Change-Id: I026e38e1990ed2a460624a8d967a16ae3fb6c512
Reviewed-on: https://gerrit.libreoffice.org/14353
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/CellColorHandler.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index 632bc0764498..dc2bda909e7d 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -21,6 +21,7 @@ #include <ConversionHelper.hxx> #include <TDefTableHandler.hxx> #include <ooxml/resourceids.hxx> +#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/ShadingPattern.hpp> #include <sal/macros.h> #include <filter/msfilter/util.hxx> @@ -268,9 +269,14 @@ TablePropertyMapPtr CellColorHandler::getProperties() pPropertyMap->Insert(PROP_CHAR_SHADING_VALUE, uno::makeAny( nShadingPattern )); } - pPropertyMap->Insert( m_OutputFormat == Form ? PROP_BACK_COLOR - : m_OutputFormat == Paragraph ? PROP_PARA_BACK_COLOR - : PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor )); + if (m_OutputFormat == Paragraph) + { + pPropertyMap->Insert(PROP_FILL_STYLE, uno::makeAny(drawing::FillStyle_SOLID)); + pPropertyMap->Insert(PROP_FILL_COLOR, uno::makeAny(nApplyColor)); + } + else + pPropertyMap->Insert( m_OutputFormat == Form ? PROP_BACK_COLOR + : PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor )); createGrabBag("originalColor", uno::makeAny(OUString::fromUtf8(msfilter::util::ConvertColor(nApplyColor, true)))); diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 8d21989ea085..f380c457c8a0 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -401,6 +401,8 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_ROW_CNF_STYLE: sName = "RowCnfStyle"; break; case PROP_CELL_HIDE_MARK: sName = "CellHideMark"; break; case PROP_FOLLOW_TEXT_FLOW: sName = "IsFollowingTextFlow"; break; + case PROP_FILL_STYLE: sName = "FillStyle"; break; + case PROP_FILL_COLOR: sName = "FillColor"; break; } ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 4e0950838f65..cd52d488fbbc 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -373,6 +373,8 @@ enum PropertyIds ,PROP_ROW_CNF_STYLE ,PROP_CELL_HIDE_MARK ,PROP_FOLLOW_TEXT_FLOW + ,PROP_FILL_STYLE + ,PROP_FILL_COLOR }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier |