<table><tr><td style="">anthonyfieroni added inline comments.
</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/D19327">View Revision</a></tr></table><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/D19327#inline-109659">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonView.cpp:429-433</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(151, 234, 151, .6);"><span class="bright">    </span><span style="color: #74777d"><span class="bright">// TODO: It is not obvious how this is best implemented when importing multipage docs</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #74777d">// Append pages?</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #74777d">// Append layers to existing pages?</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #74777d">// Add shapes to active page?</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #74777d">// etc?</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Can we append layers?</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/D19327#inline-109662">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonView.cpp:462-465</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="bright">        </span><span class="n"><span class="bright">KarbonDocumentMergeCommand</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">cmd</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">new</span></span><span class="bright"> </span><span class="n"><span class="bright">KarbonDocumentMergeCommand</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">part</span></span><span class="bright"></span><span class="p"><span class="bright">(),</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">importDocument</span></span><span class="bright"></span><span class="p"><span class="bright">);</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">d</span><span style="color: #aa2211">-></span><span class="n">canvas</span><span style="color: #aa2211">-></span><span class="n">addCommand</span><span class="p">(</span><span class="n">cmd</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(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">/*</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d">        foreach(KoShape * shape, importedShapes) {</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d">            d->canvas->shapeManager()->selection()->select(shape, false);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d">        }<span class="bright">*/</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Remove</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/D19327#inline-109663">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonView.cpp:483</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(151, 234, 151, .6);">    <span style="color: #aa4000">for</span> <span class="p">(</span><span style="color: #aa4000">int</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">kopaDocument</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">pages</span><span class="p">().</span><span class="n">count</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; background: rgba(151, 234, 151, .6);">        <span class="n">KoShapeLayer</span> <span style="color: #aa2211">*</span><span class="n">l</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">dynamic_cast</span><span style="color: #aa2211"><</span><span class="n">KoShapeLayer</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">kopaDocument</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">pages</span><span class="p">().</span><span class="n">at</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">shapes</span> <span style="color: #aa2211">+=</span> <span class="n">l</span><span style="color: #aa2211">-></span><span class="n">shapes</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Use static_cast when we don't check against nullptr, dynamic_cast is waste of time.</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/D19327#inline-109664">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonView.cpp:878-879</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="bright"></span><span class="n"><span class="bright">d</span></span><span style="color: #aa2211">-></span><span class="n">canvasController</span><span style="color: #aa2211">-></span><span class="n">zoomTo</span><span class="p">(</span><span class="n">viewRect</span><span class="p">.</span><span class="n">translated</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">d</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">c</span>anvas</span><span style="color: #aa2211">-></span><span class="n">documentOrigin</span><span class="p">()));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="n">QPointF</span> <span class="n">newCenter</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="n"><span class="bright">d</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">c</span>anvas</span><span style="color: #aa2211">-></span><span class="n">documentOrigin</span><span class="p">()</span> <span style="color: #aa2211">+</span> <span class="n">zoomHandler</span><span style="color: #aa2211">-></span><span class="n">documentToView</span><span class="p">(</span><span class="n">bbox</span><span class="p">.</span><span class="n">center</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="n"><span class="bright">d</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">c</span>anvas<span class="bright">Controller</span></span><span style="color: #aa2211">-></span><span class="n">setPreferredCenter</span><span class="p">(</span><span class="n">newCenter</span><span class="p">.</span><span class="n">toPoint</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">kopaCanvas</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span style="color: #aa2211">-></span><span class="n">canvasController<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">zoomTo</span><span class="p">(</span><span class="n">viewRect</span><span class="p">.</span><span class="n">translated</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">kopaC</span>anvas<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">documentOrigin</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 style="color: #74777d"><span class="bright">// </span>    QPointF newCenter = <span class="bright">kopaC</span>anvas<span class="bright">()</span>->documentOrigin() + zoomHandler->documentToView(bbox.center());</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>    <span class="bright">kopaC</span>anvas<span class="bright">()</span>->setPreferredCenter(newCenter.toPoint());</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;">If we don't need this - remove.</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/D19327#inline-109665">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonConfigInterfacePage.cpp:85-87</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="bright">    </span><span class="n"><span class="bright">m_canvasColor</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">new</span></span><span class="bright"> </span><span class="n"><span class="bright">KColorButton</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">m_oldCanvasColor</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span><span class="bright"> </span><span class="n"><span class="bright">tmpQGroupBox</span></span><span class="bright"></span><span class="p"><span class="bright">);</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="bright"></span><span class="n"><span class="bright">interfaceLayout</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">addRow</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">i18n</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"</span>Canvas<span class="bright"> c</span>olor<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">m_canvasColor</span></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 style="color: #74777d"><span class="bright">// TODO or move or remove?</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>    <span class="bright">m_canvasColor = new KColorButton(m_old</span>Canvas<span class="bright">C</span>olor<span class="bright">, tmpQGroupBox</span>);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d">//     interfaceLayout->addRow(i18n("Canvas color:"), m_canvasColor);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">We can keep canvas color, after all</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/D19327#inline-109666">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KarbonConfigInterfacePage.cpp:122-126</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">QColor</span> <span class="n">canvasColor</span> <span style="color: #aa2211">=</span> <span class="n">m_canvasColor</span><span style="color: #aa2211">-></span><span class="n">color</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">canvasColor</span> <span style="color: #aa2211">!=</span> <span class="n">m_oldCanvasColor</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">interfaceGroup</span><span class="p">.</span><span class="n">writeEntry</span><span class="p">(</span><span style="color: #766510">"CanvasColor"</span><span class="p">,</span> <span class="n">canvasColor</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">refreshGUI</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">true</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>    QColor canvasColor = m_canvasColor->color();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>    if (canvasColor != m_oldCanvasColor) {</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>        interfaceGroup.writeEntry("CanvasColor", canvasColor);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>        refreshGUI = true;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright"></span><span style="color: #74777d"><span class="bright">// </span>    }</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Also we can keep.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R8 Calligra</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19327">https://phabricator.kde.org/D19327</a></div></div><br /><div><strong>To: </strong>danders, anthonyfieroni<br /><strong>Cc: </strong>Calligra-Devel-list, dcaliste, cochise, vandenoever<br /></div>