~ubuntu-branches/ubuntu/lucid/kde4libs/lucid-updates

« back to all changes in this revision

Viewing changes to kate/document/katedocument.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2010-02-04 14:24:15 UTC
  • mfrom: (1.1.44 upstream)
  • Revision ID: james.westby@ubuntu.com-20100204142415-m9s99idmc0685wei
Tags: 4:4.4.0-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5520
5520
 
5521
5521
KTextEditor::Attribute::Ptr KateDocument::defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
5522
5522
{
5523
 
  ///TODO: should this maybe be put into the View until the glory day the renderer does not require a View?
 
5523
  ///TODO: move attributes to document, they are not view-dependant
5524
5524
  KateView* view = activeKateView();
5525
 
  Q_ASSERT(view);
 
5525
  if ( !view ) {
 
5526
    kWarning() << "ATTENTION: cannot access defaultStyle() without any View (will be fixed eventually)";
 
5527
    return KTextEditor::Attribute::Ptr(0);
 
5528
  }
5526
5529
 
5527
5530
  KateAttributeList list;
5528
5531
  return highlight()->attributes(view->renderer()->config()->schema()).at(ds);
5530
5533
 
5531
5534
QList< KTextEditor::HighlightInterface::AttributeBlock > KateDocument::lineAttributes(const unsigned int line)
5532
5535
{
5533
 
  ///TODO: should this maybe be put into the View until the glory day the renderer does not require a View?
 
5536
  ///TODO: move attributes to document, they are not view-dependant
5534
5537
 
5535
5538
  QList< KTextEditor::HighlightInterface::AttributeBlock > attribs;
5536
5539
 
5537
5540
  KateView* view = activeKateView();
5538
 
  Q_ASSERT(view);
 
5541
  if ( !view ) {
 
5542
    kWarning() << "ATTENTION: cannot access lineAttributes() without any View (will be fixed eventually)";
 
5543
    return attribs;
 
5544
  }
5539
5545
 
5540
5546
  KateTextLine::Ptr kateLine = kateTextLine(line);
5541
5547
 
5558
5564
  return attribs;
5559
5565
}
5560
5566
 
5561
 
QStringList KateDocument::embeddedModes() const
 
5567
QStringList KateDocument::embeddedHighlightingModes() const
5562
5568
{
5563
5569
  return highlight()->getEmbeddedModes();
5564
5570
}
5565
5571
 
5566
 
QString KateDocument::modeAt(const KTextEditor::Cursor& position)
 
5572
QString KateDocument::highlightingModeAt(const KTextEditor::Cursor& position)
5567
5573
{
5568
5574
  KateTextLine::Ptr kateLine = kateTextLine(position.line());
5569
5575