[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Review Request: Support for hyperlinks in kpresenter presentation
From: "Thomas Zander" <zander () kde ! org>
Date: 2010-10-19 11:46:23
Message-ID: 20101019114623.29388.56862 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On 2010-10-16 14:48:49, Thomas Zander wrote:
> > trunk/koffice/plugins/textshape/TextEventAction.cpp, line 87
> > <http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line87>
> >
> > does this work when you have more than one shape?
>
> Matus Hanzes wrote:
> When more text shapes are on one slide in kpresenter, the code works. If you see \
> some problems please tell me.
I meant more than one text shape for a text-document. Like multiple pages in kword.
This concept is possible in any KOffice application, and I think the above code will \
only work for the first shape in a series.
> On 2010-10-16 14:48:49, Thomas Zander wrote:
> > trunk/koffice/plugins/textshape/TextEventAction.cpp, line 110
> > <http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line110>
> >
> > this text sounds familiar, does it come from another place in KDE/KOffice ?
> >
> > If so;
> > * why is that not reflected in the copyright?
> > * what is the reason for not reusing the functionality?
>
> Matus Hanzes wrote:
> The same text string is in TextTool.cpp. I can to move this string to place where \
> both TextTool and TextEventAction can access it.
Its important that whenever you copy code or text, you copy all copyright holders \
from that file too. I caught this one by surprise, I want to stress its important to \
follow this rule always.
And I do object to copy pasting code between classes. Please avoid duplicating \
functionality.
- Thomas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5633/#review8184
-----------------------------------------------------------
On 2010-10-15 14:40:48, Matus Hanzes wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5633/
> -----------------------------------------------------------
>
> (Updated 2010-10-15 14:40:48)
>
>
> Review request for KOffice, Thorsten Zachmann and Thomas Zander.
>
>
> Summary
> -------
>
> Support for hyperlinks in presentation mode consist of two problems
> 1. Change the cursor from ArrowCursor to PointingHandCursur, when the cursor is \
> over the hyperlink. 2. Run the hyperlink, when the hyperlink is clicked.
>
> I have used KoShape EventAction framework for accessing the data inside TextShape.
> To work with hyperlinks in TextEvenAction I have used code from TextTool.
>
> I will do unit tests after this solution is approved.
>
>
> Diffs
> -----
>
> trunk/koffice/kpresenter/part/KPrPresentationTool.cpp 1186176
> trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.h 1186176
> trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.cpp 1186176 \
> trunk/koffice/libs/flake/KoEventAction.h 1186176
> trunk/koffice/plugins/textshape/CMakeLists.txt 1186176
> trunk/koffice/plugins/textshape/TextEventAction.h PRE-CREATION
> trunk/koffice/plugins/textshape/TextEventAction.cpp PRE-CREATION
> trunk/koffice/plugins/textshape/TextShape.h 1186176
> trunk/koffice/plugins/textshape/TextShape.cpp 1186176
> trunk/koffice/plugins/textshape/tests/CMakeLists.txt 1186176
> trunk/koffice/plugins/videoshape/VideoEventAction.h 1186176
> trunk/koffice/plugins/videoshape/VideoEventAction.cpp 1186176
>
> Diff: http://svn.reviewboard.kde.org/r/5633/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Matus
>
>
[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/5633/">http://svn.reviewboard.kde.org/r/5633/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On October 16th, 2010, 2:48 p.m., <b>Thomas \
Zander</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<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="http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line87" \
style="color: black; font-weight: bold; text-decoration: \
underline;">trunk/koffice/plugins/textshape/TextEventAction.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td> <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">bool TextEventAction::getHyperlink(const QPointF &position, QString \
&href)</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">87</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="kt">int</span> <span class="n">caretPos</span> <span class="o">=</span> <span \
class="n">m_textShape</span><span class="o">-></span><span \
class="n">textShapeData</span><span class="p">()</span><span \
class="o">-></span><span class="n">document</span><span class="p">()</span><span \
class="o">-></span><span class="n">documentLayout</span><span \
class="p">()</span><span class="o">-></span><span class="n">hitTest</span><span \
class="p">(</span><span class="n">p</span><span class="p">,</span> <span \
class="n">Qt</span><span class="o">::</span><span class="n">FuzzyHit</span><span \
class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">does this work when you \
have more than one shape?</pre> </blockquote>
<p>On October 18th, 2010, 12:26 p.m., <b>Matus Hanzes</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">When more text shapes \
are on one slide in kpresenter, the code works. If you see some problems please tell \
me.</pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I meant \
more than one text shape for a text-document. Like multiple pages in kword. This \
concept is possible in any KOffice application, and I think the above code will only \
work for the first shape in a series.</pre> <br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On October 16th, 2010, 2:48 p.m., <b>Thomas \
Zander</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<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="http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line110" \
style="color: black; font-weight: bold; text-decoration: \
underline;">trunk/koffice/plugins/textshape/TextEventAction.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td> <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">bool TextEventAction::getHyperlink(const QPointF &position, QString \
&href)</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">110</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">QString</span> <span class="n">question</span> <span class="o">=</span> \
<span class="n">i18n</span><span class="p">(</span><span class="s">"This link \
points to the program or script '%1'.</span><span class="se">\n</span><span \
class="s">"</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this text sounds \
familiar, does it come from another place in KDE/KOffice ?
If so;
* why is that not reflected in the copyright?
* what is the reason for not reusing the functionality?</pre>
</blockquote>
<p>On October 18th, 2010, 12:26 p.m., <b>Matus Hanzes</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The same text string is \
in TextTool.cpp. I can to move this string to place where both TextTool and \
TextEventAction can access it. </pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Its \
important that whenever you copy code or text, you copy all copyright holders from \
that file too. I caught this one by surprise, I want to stress its important to \
follow this rule always.
And I do object to copy pasting code between classes. Please avoid duplicating \
functionality.</pre> <br />
<p>- Thomas</p>
<br />
<p>On October 15th, 2010, 2:40 p.m., Matus Hanzes 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, Thorsten Zachmann and Thomas Zander.</div>
<div>By Matus Hanzes.</div>
<p style="color: grey;"><i>Updated 2010-10-15 14:40:48</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;">Support for hyperlinks in presentation mode consist of two problems \
1. Change the cursor from ArrowCursor to PointingHandCursur, when the cursor is over \
the hyperlink. 2. Run the hyperlink, when the hyperlink is clicked.
I have used KoShape EventAction framework for accessing the data inside TextShape.
To work with hyperlinks in TextEvenAction I have used code from TextTool.
I will do unit tests after this solution is approved.</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/kpresenter/part/KPrPresentationTool.cpp <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.h <span \
style="color: grey">(1186176)</span></li>
<li>trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.cpp \
<span style="color: grey">(1186176)</span></li>
<li>trunk/koffice/libs/flake/KoEventAction.h <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/textshape/CMakeLists.txt <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/textshape/TextEventAction.h <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>trunk/koffice/plugins/textshape/TextEventAction.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>trunk/koffice/plugins/textshape/TextShape.h <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/textshape/TextShape.cpp <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/textshape/tests/CMakeLists.txt <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/videoshape/VideoEventAction.h <span style="color: \
grey">(1186176)</span></li>
<li>trunk/koffice/plugins/videoshape/VideoEventAction.cpp <span style="color: \
grey">(1186176)</span></li>
</ul>
<p><a href="http://svn.reviewboard.kde.org/r/5633/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