summaryrefslogtreecommitdiffstats
path: root/sc/source/filter/excel/xestyle.cxx
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-12-30 15:32:37 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-01-11 09:39:05 +0100
commitd4c9f299145635cb1cba3365dfe5533ba3636572 (patch)
treeeffd1144c1503c9548516d49847a51533fee6647 /sc/source/filter/excel/xestyle.cxx
parentonly use X509Data (diff)
downloadcore-d4c9f299145635cb1cba3365dfe5533ba3636572.tar.gz
core-d4c9f299145635cb1cba3365dfe5533ba3636572.zip
tdf#145059: sc: always write dxf node for color filter for XLSX
If there is no dxf reference to color filter (for example if selected color is not in range of available colors for current range) Excel is not able to show color filter correctly: it is not marked as used filter, no ability to reset, etc. Change-Id: I65378ddd6f8f8233cda147ff9dcd28f455a58225 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127745 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128249 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sc/source/filter/excel/xestyle.cxx')
-rw-r--r--sc/source/filter/excel/xestyle.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 77a73ee19f57..bedf7d7f77d1 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3159,22 +3159,30 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
}
}
-sal_Int32 XclExpDxfs::GetDxfId( const OUString& rStyleName )
+sal_Int32 XclExpDxfs::GetDxfId( const OUString& rStyleName ) const
{
- std::map<OUString, sal_Int32>::iterator itr = maStyleNameToDxfId.find(rStyleName);
+ std::map<OUString, sal_Int32>::const_iterator itr = maStyleNameToDxfId.find(rStyleName);
if(itr!= maStyleNameToDxfId.end())
return itr->second;
return -1;
}
-sal_Int32 XclExpDxfs::GetDxfByColor(Color& aColor)
+sal_Int32 XclExpDxfs::GetDxfByColor(const Color& aColor) const
{
- std::map<Color, sal_Int32>::iterator itr = maColorToDxfId.find(aColor);
+ std::map<Color, sal_Int32>::const_iterator itr = maColorToDxfId.find(aColor);
if (itr != maColorToDxfId.end())
return itr->second;
return -1;
}
+void XclExpDxfs::AddColor(Color aColor)
+{
+ maColorToDxfId.emplace(aColor, maDxf.size());
+
+ std::unique_ptr<XclExpCellArea> pExpCellArea(new XclExpCellArea(aColor, 0));
+ maDxf.push_back(std::make_unique<XclExpDxf>(GetRoot(), std::move(pExpCellArea)));
+}
+
void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm )
{
if(maDxf.empty())