I was looking as this piece of code in KoTextEditor.cpp<br><br><br>void KoTextEditor::newLine()<br>{<br> d->updateState(KoTextEditor::Private::Custom, i18n("Line Break"));<br> if (d->caret.hasSelection())<br>
d->deleteInlineObjects();<br> KoTextDocument koDocument(d->document);<br> KoStyleManager *styleManager = koDocument.styleManager();<br> KoParagraphStyle *nextStyle = 0;<br> KoParagraphStyle *currentStyle = 0;<br>
if (styleManager) {<br> <span style="color: rgb(255, 0, 0);"> <span style="color: rgb(0, 153, 0);"> int id = d->caret.blockFormat().intProperty(KoParagraphStyle::StyleId);</span></span><br style="color: rgb(0, 153, 0);">
<span style="color: rgb(0, 153, 0);"> currentStyle = styleManager->paragraphStyle(id);</span><br> if (currentStyle == 0) // not a style based parag. Lets make the next one correct.<br> nextStyle = styleManager->defaultParagraphStyle();<br>
else<br> nextStyle = styleManager->paragraphStyle(currentStyle->nextStyle());<br> Q_ASSERT(nextStyle);<br> if (currentStyle == nextStyle)<br> nextStyle = 0;<br> }<br>.<br>
.<br>.<br><br>}<br><br><br>Here the parameter passed to styleManager->paragraphStyle(id) is a integer whereas its signature shows that it is a const QString....Is this the right way to call or am I missing something?<br>
<br>//snippet from KoStyleManager.cpp<br>KoParagraphStyle *KoStyleManager::paragraphStyle(const QString &name) const<br>{<br> foreach(KoParagraphStyle *style, d->paragStyles) {<br> qDebug()<<Q_FUNC_INFO<<" name "<<name<<"style->name "<<style->name();<br>
if (style->name() == name)<br> return style;<br> }<br> return 0;<br>}<br><br>-- <br>My blog <a href="http://gkbhat.blogspot.com">http://gkbhat.blogspot.com</a><br><br>