I am not now in a position to do a proper review for the moment. However a couple of questions:<br><br>- what is it you are trying to do with these "other" paragraph styles?<br>- why inserting them is not done through the kotext's styleManager like the "standard" paragraph styles and directly into the model?<br>

- playing around with the model's returned data (from 2 different style lists) should be done with extreme care (inside beginInsert, beginMove,... and the like). You might get updating problems in the views otherwise<br>

<br>PierreSt<br><br><br><div class="gmail_quote">On Wed, May 23, 2012 at 2:35 PM, C. Boemann <span dir="ltr"><<a href="mailto:cbr@boemann.dk" target="_blank">cbr@boemann.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





 <div>
  <div style="font-family:Verdana,Arial,Helvetica,Sans-Serif"><div class="im">
   <table style="border:1px solid rgb(201,195,153)" bgcolor="#f9f3c9" cellpadding="8" width="100%">
    <tbody><tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/104962/" target="_blank">http://git.reviewboard.kde.org/r/104962/</a>
     </td>
    </tr>
   </tbody></table>
   <br>





 </div><pre style="white-space:pre-wrap;word-wrap:break-word">As I asked you submit midway through you work i know it's not done, so i'm not going to do a deep review.

However I've added some comments on what i think you should change</pre>
 <br>





<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64558#file64558line311" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StyleManager.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="4"><pre style="font-size:8pt;line-height:140%;margin:0pt">void StyleManager::buttonNewPressed()</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font>311</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">        <span>KoParagraphStyle</span> <span>*</span><span>newStyle</span> <span>=</span> <span>new</span> <span>KoParagraphStyle</span><span>();</span></pre>

</td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">you new lines are correct, just keep the setName and selectName) from above</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line109" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="4"><pre style="font-size:8pt;line-height:140%;margin:0pt">QVariant StylesModel::data(const QModelIndex &index, int role) const</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#f0f0f0"><font>109</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">            <span>}</span></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#f0f0f0"><font>109</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">            <span>}</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">please follow this by

if (!paragStyle && m_newStyleList.contains(styleId)) {
   paragStyle = m_newStyleList[styleId];
}</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line110" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="4"><pre style="font-size:8pt;line-height:140%;margin:0pt">QVariant StylesModel::data(const QModelIndex &index, int role) const</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font>110</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">            <span>if</span> <span>(</span><span>id</span> <span><</span> <span>0</span><span>)</span> <span>{</span></pre></td>


  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">not needed if you do the above</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line403" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="4"><pre style="font-size:8pt;line-height:140%;margin:0pt">void StylesModel::updateName(int styleId)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#e9eaa8"><font>400</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">            <span>if</span> <span>(</span><span>paragStyle</span><span>)</span> <span>{</span></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#e9eaa8"><font>403</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">            <span>if</span> <span>(</span><span>paragStyle</span><span> </span><span><span>||</span></span><span> </span><span><span>styleId</span></span><span> </span><span><span><</span></span><span> </span><span><span>0</span></span><span>)</span> <span>{</span></pre>

</td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">this change looks wrong. It could cause a crash. better to write in the line above

if (!paragStyle && m_newStyleList.contains(styleId)) {
   paragStyle = m_newStyleList[styleId];
}</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line413" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="4"><pre style="font-size:8pt;line-height:140%;margin:0pt">QModelIndex StylesModel::firstStyleIndex()</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#f0f0f0"><font>410</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">                    <span>// s should be found as the manager and the m_styleList should be in sync</span></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#f0f0f0"><font>413</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">                    <span>// s should be found as the manager and the m_styleList should be in sync</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">and again here you need to add something similar</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line478" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="2"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
   <td colspan="2"><pre style="font-size:8pt;line-height:140%;margin:0pt">void StylesModel::addNewParagraphStyle(KoParagraphStyle *style)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font>478</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">    <span>style</span><span>-></span><span>setName</span><span>(</span><span>i18n</span><span>(</span><span>"new Style moji"</span><span>));</span></pre>

</td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">giving it a name is not the responsibility of the stylemodel</pre>
</div>
<br>

<div>




<table bgcolor="white" border="0" width="100%">
 <thead>
  <tr>
   <th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#f0f0f0">
    <a href="http://git.reviewboard.kde.org/r/104962/diff/1-2/?file=64562#file64562line479" style="text-decoration:underline;font-weight:bold" target="_blank">plugins/textshape/dialogs/StylesModel.cpp</a>
    <span style="font-weight:normal">

     (Diff revisions 1 - 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color:rgb(228,217,203);padding:4px 8px;text-align:center">
  <tr>

   <td colspan="2"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
   <td colspan="2"><pre style="font-size:8pt;line-height:140%;margin:0pt">void StylesModel::addNewParagraphStyle(KoParagraphStyle *style)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt"></pre></td>
    <th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font>479</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0pt">    <span>style</span><span>-></span><span>setStyleId</span><span>(</span><span>-</span><span>100</span><span>);</span></pre>

</td>
  </tr>

 </tbody>

</table>

<pre style="margin-left:2em;white-space:pre-wrap;word-wrap:break-word">obviously you will need to assign different numbers, so we can insert more than one new style, before applying</pre>
</div>
<br>



<p>- C.</p><div class="im">


<br>
<p>On May 23rd, 2012, 12:12 p.m., mojtaba shahi wrote:</p>






</div><table style="background-image:url("");background-repeat:repeat-x;border:1px solid black" bgcolor="#fefadf" cellpadding="8" cellspacing="0" width="100%">
 <tbody><tr>
  <td><div class="im">

<div>Review request for Calligra.</div>
<div>By mojtaba shahi.</div>


<p style="color:grey"><i>Updated May 23, 2012, 12:12 p.m.</i></p>






</div><h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Description </h1><div class="im">
 <table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" cellspacing="0" width="100%">
 <tbody><tr>
  <td>
   <pre style="margin:0pt;padding:0pt;white-space:pre-wrap;word-wrap:break-word">a new review for adding new style and renamimg styles</pre>
  </td>
 </tr>
</tbody></table>





<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Diffs </h1>
</div><div class="im"><ul style="margin-left:3em;padding-left:0pt">

 <li>plugins/textshape/dialogs/CharacterGeneral.h <span style="color:grey">(eed6a02)</span></li>

 <li>plugins/textshape/dialogs/CharacterGeneral.cpp <span style="color:grey">(c951b27)</span></li>

 <li>plugins/textshape/dialogs/ParagraphGeneral.h <span style="color:grey">(3cf9824)</span></li>

 <li>plugins/textshape/dialogs/ParagraphGeneral.cpp <span style="color:grey">(2fdb272)</span></li>

 <li>plugins/textshape/dialogs/StyleManager.h <span style="color:grey">(44dff97)</span></li>

 <li>plugins/textshape/dialogs/StyleManager.cpp <span style="color:grey">(c318dd7)</span></li>

 <li>plugins/textshape/dialogs/StyleManagerDialog.h <span style="color:grey">(56e36b4)</span></li>

 <li>plugins/textshape/dialogs/StyleManagerDialog.cpp <span style="color:grey">(d423ae0)</span></li>

 <li>plugins/textshape/dialogs/StylesModel.h <span style="color:grey">(53c0225)</span></li>

 <li>plugins/textshape/dialogs/StylesModel.cpp <span style="color:grey">(3b03f1b)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104962/diff/" style="margin-left:3em" target="_blank">View Diff</a></p>




  </div></td>
 </tr>
</tbody></table>








  </div>
 </div>


<br>_______________________________________________<br>
calligra-devel mailing list<br>
<a href="mailto:calligra-devel@kde.org">calligra-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/calligra-devel" target="_blank">https://mail.kde.org/mailman/listinfo/calligra-devel</a><br>
<br></blockquote></div><br>