diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-01 00:11:21 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-01 01:48:38 +0100 |
commit | 24077b2d52ab3d0fd0db5afb25d8b94b62386e3e (patch) | |
tree | fef53926c540c9194f8e893a69690ebbd5fed7be /writerfilter/source | |
parent | eaf1c5f85bcf33fbb7e0ad0d6de4b33ae07445ae (diff) |
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.
Change-Id: I026e38e1990ed2a460624a8d967a16ae3fb6c512
Diffstat (limited to 'writerfilter/source')
-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 3c8b5060a229..63e7ed4a2e50 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 |