oox/source/drawingml/table/predefined-table-styles.cxx | 23 +++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
New commits: commit db7676137ad91a1e9e0449afffc639ce73b40f4a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Oct 15 09:03:42 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Oct 15 11:38:27 2021 +0200 Value stored to 'accent_val' during its initialization is never read Change-Id: I780ffee680e52c240a1bd212f34c9c019c8b5e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123625 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx b/oox/source/drawingml/table/predefined-table-styles.cxx index ea68911112a0..75435eb40303 100644 --- a/oox/source/drawingml/table/predefined-table-styles.cxx +++ b/oox/source/drawingml/table/predefined-table-styles.cxx @@ -462,13 +462,12 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) OUString style_name = mStyleIdMap[styleId].first; OUString accent_name = mStyleIdMap[styleId].second; - sal_Int32 accent_val = tokens[mStyleIdMap[styleId].second]; if (style_name == "Themed-Style-1") { if (!accent_name.isEmpty()) { - accent_val = tokens[mStyleIdMap[styleId].second]; + sal_Int32 accent_val = tokens[mStyleIdMap[styleId].second]; wholeTblTextColor.setSchemeClr(XML_dk1); firstRowTextColor.setSchemeClr(XML_lt1); @@ -516,6 +515,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) } else if (style_name == "Themed-Style-2") { + sal_Int32 accent_val; + if (!accent_name.isEmpty()) { wholeTblTextColor.setSchemeClr(XML_lt1); @@ -555,6 +556,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) { wholeTblTextColor.setSchemeClr(XML_tx1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -578,6 +581,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) wholeTblTextColor.setSchemeClr(XML_tx1); firstRowTextColor.setSchemeClr(XML_bg1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -604,6 +609,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) { wholeTblTextColor.setSchemeClr(XML_tx1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -632,6 +639,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1); pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -669,6 +678,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -702,6 +713,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -720,6 +733,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); pLastRowFillProperties->maFillColor.setSchemeClr(XML_dk1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else @@ -755,6 +770,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1); pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) { accent_val = tokens[mStyleIdMap[styleId].second]; @@ -795,6 +812,8 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) else if (accent_name == "Accent5") pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent6); + sal_Int32 accent_val; + if (!accent_name.isEmpty()) accent_val = tokens[mStyleIdMap[styleId].second]; else