[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: Fix Multi-Table Charts
From:       "Inge Wallin" <inge () lysator ! liu ! se>
Date:       2010-09-17 12:52:33
Message-ID: 20100917125233.8462.86215 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5373/#review7654
-----------------------------------------------------------


In general: a nice generalization of the previous concepts.

However: I don't understand the details of this patch at all.  The main rea=
son for that is probably that there is no documentation on how all these mo=
dels fit together.  You did describe a little in Essen about it, but there =
were many important details glossed over. I would like to see a clear descr=
iption of:
 - The role of every model.  Where does it fit in the big picture?
 - Who creates and owns them?

I also don't like the general idea that the TableSource is connected to int=
erals of KSpread (unless I have misunderstood that).  I think we should mak=
e the chart shape a general chart mechanism that can be used in other place=
s as well.  Things like (what I think is the purpose of) TableSource should=
 be kept inside KSpread itself.  I think that the data model presented to t=
he chart shape should be as simple as possible, preferrably just one model.=
  I would love to discuss this over IRC or skype some time soon.

All this said, a general redesign of the chart interface is not something w=
e should do this late in the development cycle. If this patch fixes importa=
nt bugs, I think it should go in now, but I will wait to press ship it unti=
l we have discussed it a little.


trunk/koffice/interfaces/KoChartInterface.h
<http://svn.reviewboard.kde.org/r/5373/#comment7794>

    Hmm, as I said above, I don't like this specialization to spreadsheets.=
  I think that the chart shape should work with any external data sources a=
nd any embedding application, of which spreadsheets are only one (albeight =
very important). This should be incorporated into our design as well as our=
 naming and comments.



trunk/koffice/plugins/chartshape/ChartConfigWidget.cpp
<http://svn.reviewboard.kde.org/r/5373/#comment7795>

    This is not the same test as before. Is that intentional?
    =

     A chart shape can be embedded with an external data source or an inter=
nal data source. I guess it's difficult to find a non-embedded chart with a=
n external datasource, though.


- Inge


On 2010-09-17 09:17:31, Johannes Simon wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5373/
> -----------------------------------------------------------
> =

> (Updated 2010-09-17 09:17:31)
> =

> =

> Review request for KOffice and bjbreitm.
> =

> =

> Summary
> -------
> =

> I'm putting this up on reviewboard because this is a rather large and tha=
t touches (a minor part of) KSpread as well.
> This is partly in reply to http://reviewboard.kde.org/r/4866/diff/ .
> =

> This patch:
> - fixes charts with more than one table as data source
> - fixes charts with a sheet as data source that's not the sheet the chart=
 is in (in KSpread)
> - handles sheet renames
> - allows a chart to reference both an internal table and an external tabl=
e (e.g. sheet in KSpread), needed for OOXML bubble charts
> =

> Take, for instance, a workbook in KSpread with multiple tables. Right now=
 a chart can take data only and exclusively from the sheet it was created i=
n. Also it is limited to the very name the sheet had when the chart was cre=
ated. If you take data (e.g. Table2.A2:B3) from another sheet, the chart pr=
etends it's data from the current sheet (e.g. Table1). If you change the sh=
eet name, the chart will use the old name when saved to ODF. All that is fi=
xed in this patch.
> =

> The patch does the following:
> - Introduce a TableSource that is connected to KSpread's SheetAccessModel=
 to provide name/model pairs for all tables
> - Bind a CellRegion to a Table* pointer ("handed out" by TableSource) ins=
tead of just a (fixed) table name
> - changes a lot of the CellRegion(QRect) constructor calls to CellRegion(=
Table*,QRect)
> - makes sure CellRegion instances are used instead of their string repres=
entations so that sheet renames are trivially handled (CellRegion::table()-=
>name() changes automatically)
> - adds lots of test cases
> =

> I admit that I started this work while we weren't in feature freeze yet s=
o it originally was a bit bigger and included also a refactoring of two cla=
sses, but I removed the irrelevant bits there much as possible to restrain =
this patch to fix the original issues only. With that and the new test case=
s I think this patch should be compatible with us being in bug-fix mode.
> =

> =

> Diffs
> -----
> =

>   trunk/koffice/interfaces/KoChartInterface.h 1175800 =

>   trunk/koffice/kspread/BindingModel.h 1175800 =

>   trunk/koffice/kspread/chart/ChartDatabaseSelector.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/Axis.h 1175800 =

>   trunk/koffice/plugins/chartshape/Axis.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/CMakeLists.txt 1175800 =

>   trunk/koffice/plugins/chartshape/CellRegion.h 1175800 =

>   trunk/koffice/plugins/chartshape/CellRegion.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartConfigWidget.h 1175800 =

>   trunk/koffice/plugins/chartshape/ChartConfigWidget.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartProxyModel.h 1175800 =

>   trunk/koffice/plugins/chartshape/ChartProxyModel.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartShape.h 1175800 =

>   trunk/koffice/plugins/chartshape/ChartShape.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartShapeFactory.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartTableModel.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/ChartTool.h 1175800 =

>   trunk/koffice/plugins/chartshape/ChartTool.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/DataSet.h 1175800 =

>   trunk/koffice/plugins/chartshape/DataSet.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/OdfLoadingHelper.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/PlotArea.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/TableSource.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/TableSource.cpp PRE-CREATION =

>   trunk/koffice/plugins/chartshape/dialogs/TableEditorDialog.h 1175800 =

>   trunk/koffice/plugins/chartshape/dialogs/TableEditorDialog.cpp 1175800 =

>   trunk/koffice/plugins/chartshape/kchart_global.h 1175800 =

>   trunk/koffice/plugins/chartshape/tests/CMakeLists.txt PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/ModelObserver.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/ModelObserver.cpp PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestCellRegion.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestCellRegion.cpp PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestDataSet.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestDataSet.cpp PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestKDChartModel.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestKDChartModel.cpp PRE-CREATIO=
N =

>   trunk/koffice/plugins/chartshape/tests/TestProxyModel.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestProxyModel.cpp PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestTableSource.h PRE-CREATION =

>   trunk/koffice/plugins/chartshape/tests/TestTableSource.cpp PRE-CREATION =

> =

> Diff: http://svn.reviewboard.kde.org/r/5373/diff
> =

> =

> Testing
> -------
> =

> 5 sets of test cases for classes relevant in these changes (CellRegion, C=
hartProxyModel, TableSource, KDChartModel, DataSet) are added or adapted fr=
om /kchart/tests. TestDataSet demonstrates a simple test case that can only=
 pass after the change. =

> =

> =

> Thanks,
> =

> Johannes
> =

>


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/5373/">http://svn.reviewboard.kde.org/r/5373/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">In general: a nice \
generalization of the previous concepts.

However: I don&#39;t understand the details of this patch at all.  The main reason \
for that is probably that there is no documentation on how all these models fit \
together.  You did describe a little in Essen about it, but there were many important \
                details glossed over. I would like to see a clear description of:
 - The role of every model.  Where does it fit in the big picture?
 - Who creates and owns them?

I also don&#39;t like the general idea that the TableSource is connected to interals \
of KSpread (unless I have misunderstood that).  I think we should make the chart \
shape a general chart mechanism that can be used in other places as well.  Things \
like (what I think is the purpose of) TableSource should be kept inside KSpread \
itself.  I think that the data model presented to the chart shape should be as simple \
as possible, preferrably just one model.  I would love to discuss this over IRC or \
skype some time soon.

All this said, a general redesign of the chart interface is not something we should \
do this late in the development cycle. If this patch fixes important bugs, I think it \
should go in now, but I will wait to press ship it until we have discussed it a \
little.</pre>  <br />





<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="/r/5373/diff/2/?file=36258#file36258line37" style="color: black; font-weight: \
bold; text-decoration: underline;">trunk/koffice/interfaces/KoChartInterface.h</a>  \
<span style="font-weight: normal;">

     (Diff revision 2)

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

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">37</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm"> * Interface for ChartShape to embed it into a \
spreadsheet.</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmm, as I \
said above, I don&#39;t like this specialization to spreadsheets.  I think that the \
chart shape should work with any external data sources and any embedding application, \
of which spreadsheets are only one (albeight very important). This should be \
incorporated into our design as well as our naming and comments.</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="/r/5373/diff/2/?file=36267#file36267line446" style="color: black; font-weight: \
bold; text-decoration: \
underline;">trunk/koffice/plugins/chartshape/ChartConfigWidget.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 2)

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

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
ChartConfigWidget::open( KoShape* shape )</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">441</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> \
<span class="p">(</span> <span class="n">d</span><span class="o">-&gt;</span><span \
class="n">isExternalDataSource</span> <span class="p">)</span> <span \
class="p">{</span></pre></td>  <th bgcolor="#e9eaa8" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">446</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span \
class="p">(</span> <span class="n">d</span><span class="o">-&gt;</span><span \
class="n">shape</span><span class="o">-&gt;</span><span \
class="n">isEmbedded</span><span class="p">()</span> <span class="p">)</span> <span \
class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This is not \
the same test as before. Is that intentional?

 A chart shape can be embedded with an external data source or an internal data \
source. I guess it&#39;s difficult to find a non-embedded chart with an external \
datasource, though.</pre> </div>
<br />



<p>- Inge</p>


<br />
<p>On September 17th, 2010, 9:17 a.m., Johannes Simon wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KOffice and bjbreitm.</div>
<div>By Johannes Simon.</div>


<p style="color: grey;"><i>Updated 2010-09-17 09:17:31</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I&#39;m putting this up on reviewboard because this is a rather large \
and that touches (a minor part of) KSpread as well. This is partly in reply to \
http://reviewboard.kde.org/r/4866/diff/ .

This patch:
- fixes charts with more than one table as data source
- fixes charts with a sheet as data source that&#39;s not the sheet the chart is in \
                (in KSpread)
- handles sheet renames
- allows a chart to reference both an internal table and an external table (e.g. \
sheet in KSpread), needed for OOXML bubble charts

Take, for instance, a workbook in KSpread with multiple tables. Right now a chart can \
take data only and exclusively from the sheet it was created in. Also it is limited \
to the very name the sheet had when the chart was created. If you take data (e.g. \
Table2.A2:B3) from another sheet, the chart pretends it&#39;s data from the current \
sheet (e.g. Table1). If you change the sheet name, the chart will use the old name \
when saved to ODF. All that is fixed in this patch.

The patch does the following:
- Introduce a TableSource that is connected to KSpread&#39;s SheetAccessModel to \
                provide name/model pairs for all tables
- Bind a CellRegion to a Table* pointer (&quot;handed out&quot; by TableSource) \
                instead of just a (fixed) table name
- changes a lot of the CellRegion(QRect) constructor calls to \
                CellRegion(Table*,QRect)
- makes sure CellRegion instances are used instead of their string representations so \
that sheet renames are trivially handled (CellRegion::table()-&gt;name() changes \
                automatically)
- adds lots of test cases

I admit that I started this work while we weren&#39;t in feature freeze yet so it \
originally was a bit bigger and included also a refactoring of two classes, but I \
removed the irrelevant bits there much as possible to restrain this patch to fix the \
original issues only. With that and the new test cases I think this patch should be \
compatible with us being in bug-fix mode.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">5 sets of test cases for classes relevant in these changes (CellRegion, \
ChartProxyModel, TableSource, KDChartModel, DataSet) are added or adapted from \
/kchart/tests. TestDataSet demonstrates a simple test case that can only pass after \
the change. </pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>trunk/koffice/interfaces/KoChartInterface.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/kspread/BindingModel.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/kspread/chart/ChartDatabaseSelector.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/Axis.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/Axis.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/CMakeLists.txt <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/CellRegion.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/CellRegion.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartConfigWidget.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartConfigWidget.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartProxyModel.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartProxyModel.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartShape.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartShape.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartShapeFactory.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartTableModel.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartTool.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/ChartTool.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/DataSet.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/DataSet.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/OdfLoadingHelper.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/PlotArea.cpp <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/TableSource.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/TableSource.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/dialogs/TableEditorDialog.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/dialogs/TableEditorDialog.cpp <span \
style="color: grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/kchart_global.h <span style="color: \
grey">(1175800)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/ModelObserver.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/ModelObserver.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestCellRegion.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestCellRegion.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestDataSet.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestDataSet.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestKDChartModel.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestKDChartModel.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestProxyModel.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestProxyModel.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestTableSource.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/chartshape/tests/TestTableSource.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/5373/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic