summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdocumentimpl.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-04-11 14:07:02 +0300
committerMichael Stahl <michael.stahl@cib.de>2020-04-15 11:18:49 +0200
commit7965bb9a1d8b29778c6eac279537952e6a9e9502 (patch)
tree12e7cf87c409676c0b6b5f7df9d2fd506bd5a730 /writerfilter/source/rtftok/rtfdocumentimpl.cxx
parent24e1563b5db3de5abac0d4fd0f737ec319e703e8 (diff)
Revert "NFC writerfilter: remove pointless asserts"
This reverts commit 708f95b87410c640f0e9e22892f4a71194631cd9. Stephan said I have it all backwards. Asserts are primarily "documentation", and there is no point in asserting something if you aren't going to accept it as true, at least not without any other qualifying remarks etc. So a simple "assert(p)" should never be followed by "if(p)". These asserts basically show that "yes, I'm using this pointer without checking on purpose, and not as an oversight." Change-Id: I7350b627a2acf027d1a6d5b33ea272050d23ce6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92059 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5429489304f6..3de574e75c12 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2113,6 +2113,7 @@ RTFReferenceTable::Entries_t RTFDocumentImpl::deduplicateStyleTable()
auto const pStyleType(
static_cast<RTFReferenceProperties&>(*pStyle).getAttributes().find(
NS_ooxml::LN_CT_Style_type));
+ assert(pStyleType);
int const nStyleType(pStyleType->getInt());
RTFSprms const sprms(
static_cast<RTFReferenceProperties&>(*pStyle).getSprms().cloneAndDeduplicate(