<table><tr><td style="">pino requested changes to this revision.<br />pino added a comment.<br />This revision now requires changes to proceed.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15690">View Revision</a></tr></table><br /><div><div><p>This patch does more things that "remove old style casts". Some of the other changes are OK, but please do split them in own changes, properly documenting them.</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84708">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:183</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"<tr></span><span style="color: #bb6622">\n</span><span style="color: #766510"><th colspan=</span><span style="color: #bb6622">\"</span><span style="color: #766510">2</span><span style="color: #bb6622">\"</span><span style="color: #766510">>"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211"><<</span> <span style="color: #766510">"</th></span><span style="color: #bb6622">\n</span><span style="color: #766510"></tr></span><span style="color: #bb6622">\n</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">you use dynamic_cast when you expect that the cast can fail; since in this case it is assumed it will work, then use static_cast directly instead</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84709">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:187</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"<tr></span><span style="color: #bb6622">\n</span><span style="color: #766510"><td class=</span><span style="color: #bb6622">\"</span><span style="color: #766510">property</span><span style="color: #bb6622">\"</span><span style="color: #766510">>"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span style="color: #766510">"</td></span><span style="color: #bb6622">\n</span><span style="color: #766510"><td class=</span><span style="color: #bb6622">\"</span><span style="color: #766510">value</span><span style="color: #bb6622">\"</span><span style="color: #766510">>"</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p>

<p style="padding: 0; margin: 8px;">also, <tt style="background: #ebebeb; font-size: 13px;">property</tt> is casted more than once within this foreach loop, so factorize it</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84710">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:190-191</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span class="n">KalziumUtils</span><span style="color: #aa2211">::</span><span class="n">prettyUnit</span><span class="p">(</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="p">(<span class="bright">(</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="p">(<span class="bright">(</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span style="color: #766510">"</td></span><span style="color: #bb6622">\n</span><span style="color: #766510"></tr></span><span style="color: #bb6622">\n</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84711">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:203</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"  <element name=</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">></span><span style="color: #bb6622">\n</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84712">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:207</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"    <property name=</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">>"</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto (dynamic_cast + factorize)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84713">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:210-211</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span class="n">KalziumUtils</span><span style="color: #aa2211">::</span><span class="n">prettyUnit</span><span class="p">(</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">               <span class="bright"> </span><span class="p"><span class="bright">((</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">               <span class="bright"> </span><span class="p"><span class="bright">((</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">               <span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">               <span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span style="color: #766510">"</property></span><span style="color: #bb6622">\n</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84714">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:224</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">", </span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">text</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84715">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:230</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211">*</span><span class="n">m_outputStream</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright">(</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa2211"><<</span> <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span style="color: #aa2211">-></span><span class="n">dataAsString</span><span class="p">(</span><span class="n">ChemicalDataObject</span><span style="color: #aa2211">::</span><span class="n">name</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto (dynamic_cast + factorize)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84716">View Inline</a><span style="color: #4b4d51; font-weight: bold;">exportdialog.cpp:235-236</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span class="n">KalziumUtils</span><span style="color: #aa2211">::</span><span class="n">prettyUnit</span><span class="p">(</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="p">(<span class="bright">(</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">element</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="p">(<span class="bright">(</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">property</span><span class="p">)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">ElementListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">element<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_element</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">dynamic_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="n">PropertyListEntry</span><span style="color: #aa2211">*<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">property<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span><span style="color: #aa2211">-></span><span class="n">m_type</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa2211"><<</span> <span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84717">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kdeeduglossary.cpp:236-237</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #aa4000">const</span> <span class="n">uint</span> <span class="n">num</span> <span style="color: #aa2211">=</span> <span class="n">itemList</span><span class="p">.</span><span class="n">count</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">const</span> <span class="n">uint</span> <span class="n">num</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="bright"></span><span class="n"><span class="bright">uint</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">></span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">itemList</span><span class="p">.</span><span class="n">count</span><span class="p">(<span class="bright">)</span>);</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #aa4000">for</span> <span class="p">(</span><span class="n">uint</span> <span class="n">i</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span> <span class="n">i</span> <span style="color: #aa2211"><</span> <span class="n">num</span><span class="p">;</span> <span style="color: #aa2211">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span class="n">reflist</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">or, simpler, turn both <tt style="background: #ebebeb; font-size: 13px;">num</tt> and <tt style="background: #ebebeb; font-size: 13px;">i</tt> to int, since the only usage of <tt style="background: #ebebeb; font-size: 13px;">i</tt> is with <tt style="background: #ebebeb; font-size: 13px;">QDomNodeList::item(int)</tt></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84718">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kdeeduglossary.cpp:241</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">itemElement</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="p"><span class="bright">(</span></span><span style="color: #aa4000">const</span> <span class="n">QDomElement</span><span style="color: #aa2211">&<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">itemList</span><span class="p">.</span><span class="n">item</span><span class="p">(</span><span class="n">i</span><span class="p">).</span><span class="n">toElement</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">itemElement</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span style="color: #aa4000">const</span> <span class="n">QDomElement</span><span style="color: #aa2211">&<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">itemList</span><span class="p">.</span><span class="n">item</span><span class="p">(</span><span class="n">i</span><span class="p">).</span><span class="n">toElement</span><span class="p">(<span class="bright">)</span>);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">QDomNode::toElement()</tt> already returns a QDomElement, so this cast can go away altogether</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84719">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kdeeduglossary.cpp:247</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        <span class="n">QString</span> <span class="n">picName</span> <span style="color: #aa2211">=</span> <span class="n">itemElement</span><span class="p">.</span><span class="n">namedItem</span><span class="p">(</span><span style="color: #766510">"picture"</span><span class="p">).</span><span class="n">toElement</span><span class="p">().</span><span class="n">text</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">QDomElement</span> <span class="n">refNode</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="p"><span class="bright">(</span></span><span style="color: #aa4000">const</span> <span class="n">QDomElement</span><span style="color: #aa2211">&<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="n">itemElement</span><span class="p">.</span><span class="n">namedItem</span><span class="p">(</span><span style="color: #766510">"references"</span><span class="p">).</span><span class="n">toElement</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">QDomElement</span> <span class="n">refNode</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span style="color: #aa4000">const</span> <span class="n">QDomElement</span><span style="color: #aa2211">&<span class="bright">></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="n">itemElement</span><span class="p">.</span><span class="n">namedItem</span><span class="p">(</span><span style="color: #766510">"references"</span><span class="p">).</span><span class="n">toElement</span><span class="p">(<span class="bright">)</span>);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84720">View Inline</a><span style="color: #4b4d51; font-weight: bold;">molcalcwidget.cpp:101</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">                <span class="n">fullForm</span> <span style="color: #aa2211">=</span> <span class="n">fullList</span><span class="p">.</span><span class="n">takeFirst</span> <span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="n">ui</span><span class="p">.</span><span class="n">user_defined</span><span style="color: #aa2211">-></span><span class="n">setItem</span><span class="p">(<span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span class="n"><span class="bright">i</span></span><span class="p">,</span> <span style="color: #601200">0</span><span class="p">,</span> <span style="color: #aa4000">new</span> <span class="n">QTableWidgetItem</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">ui</span><span class="p">.</span><span class="n">user_defined</span><span style="color: #aa2211">-></span><span class="n">setItem</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">></span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">i</span></span><span class="bright"></span><span class="p"><span class="bright">)</span>,</span> <span style="color: #601200">0</span><span class="p">,</span> <span style="color: #aa4000">new</span> <span class="n">QTableWidgetItem</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">                    <span class="p">(</span><span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"%1"</span><span class="p">,</span><span class="n">shortForm</span> <span style="color: #aa2211">+</span> <span style="color: #766510">" : "</span> <span style="color: #aa2211">+</span> <span class="n">fullForm</span><span class="p">)));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">i</tt> is already int, so this cast can go altogether</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84721">View Inline</a><span style="color: #4b4d51; font-weight: bold;">molcalcwidget.cpp:137</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">                <span class="n">fullForm</span> <span style="color: #aa2211">=</span> <span class="n">fullList</span><span class="p">.</span><span class="n">takeFirst</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="n">ui</span><span class="p">.</span><span class="n">pre_defined</span><span style="color: #aa2211">-></span><span class="n">setItem</span><span class="p">(<span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span class="n"><span class="bright">i</span></span><span class="p">,</span> <span style="color: #601200">0</span><span class="p">,</span> <span style="color: #aa4000">new</span> <span class="n">QTableWidgetItem</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">ui</span><span class="p">.</span><span class="n">pre_defined</span><span style="color: #aa2211">-></span><span class="n">setItem</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright"><</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">></span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">i</span></span><span class="bright"></span><span class="p"><span class="bright">)</span>,</span> <span style="color: #601200">0</span><span class="p">,</span> <span style="color: #aa4000">new</span> <span class="n">QTableWidgetItem</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">                    <span class="p">(</span><span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"%1"</span><span class="p">,</span><span class="n">shortForm</span> <span style="color: #aa2211">+</span> <span style="color: #766510">" : "</span> <span style="color: #aa2211">+</span> <span class="n">fullForm</span><span class="p">)));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">ditto</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15690#inline-84722">View Inline</a><span style="color: #4b4d51; font-weight: bold;">spectrumviewimpl.cpp:75</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">                          <span style="color: #aa2211"><<</span> <span class="n">QString</span><span style="color: #aa2211">::</span><span class="n">number</span><span class="p">(</span><span class="n">peak</span><span style="color: #aa2211">-></span><span class="n">intensity</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">items</span><span class="p">.</span><span class="n">append</span><span class="p">(</span><span style="color: #aa4000">new</span> <span class="n">QTreeWidgetItem</span><span class="p">((</span><span class="n">QTreeWidget</span><span style="color: #aa2211">*</span><span class="p">)</span><span style="color: #601200">0</span><span class="p">,</span> <span class="n">row</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright">        </span><span class="n"><span class="bright">items</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">append</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">new</span></span><span class="bright"> </span><span class="n"><span class="bright">QTreeWidgetItem</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">static_cast</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright"><</span></span><span class="bright"></span><span class="n"><span class="bright">QTreeWidget</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">*></span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">nullptr</span></span><span class="bright"></span><span class="p"><span class="bright">),</span></span><span class="bright"> </span><span class="n"><span class="bright">row</span></span><span class="bright"></span><span class="p"><span class="bright">));</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">as mentioned this goes to another patch... hoever you do not need to cast nullptr to anything...</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R326 Kalzium</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15690">https://phabricator.kde.org/D15690</a></div></div><br /><div><strong>To: </strong>carlos_hdc, tcanabrava, pino<br /><strong>Cc: </strong>pino, kde-edu, narvaez, apol<br /></div>