Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/text/qtextdocument.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6262#include "qtextcontrol_p.h"
    6363#include "private/qtextedit_p.h"
     64#include "private/qdataurl_p.h"
    6465
    6566#include "qtextdocument_p.h"
     
    126127                    tag += text[i];
    127128                else if (!tag.isEmpty() && text[i].isSpace())
     129                    break;
     130                else if (!tag.isEmpty() && text[i] == QLatin1Char('/') && i + 1 == close)
    128131                    break;
    129132                else if (!text[i].isSpace() && (!tag.isEmpty() || text[i] != QLatin1Char('!')))
     
    289292    provides contentsChanged(), undoAvailable(), and redoAvailable() signals
    290293    that inform connected editor widgets about the state of the undo/redo
    291     system.
     294    system. The following are the undo/redo operations of a QTextDocument:
     295
     296    \list
     297        \o Insertion or removal of characters. A sequence of insertions or removals
     298           within the same text block are regarded as a single undo/redo operation.
     299        \o Insertion or removal of text blocks. Sequences of insertion or removals
     300           in a single operation (e.g., by selecting and then deleting text) are
     301           regarded as a single undo/redo operation.
     302        \o Text character format changes.
     303        \o Text block format changes.
     304        \o Text block group format changes.
     305    \endlist
    292306
    293307    \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example}
     
    435449}
    436450
     451/*! \enum QTextDocument::Stacks
     452 
     453  \value UndoStack              The undo stack.
     454  \value RedoStack              The redo stack.
     455  \value UndoAndRedoStacks      Both the undo and redo stacks.
     456*/
     457       
     458/*!
     459    \since 4.7
     460    Clears the stacks specified by \a stacksToClear.
     461
     462    This method clears any commands on the undo stack, the redo stack,
     463    or both (the default). If commands are cleared, the appropriate
     464    signals are emitted, QTextDocument::undoAvailable() or
     465    QTextDocument::redoAvailable().
     466
     467    \sa QTextDocument::undoAvailable() QTextDocument::redoAvailable()
     468*/
     469void QTextDocument::clearUndoRedoStacks(Stacks stacksToClear)
     470{
     471    Q_D(QTextDocument);
     472    d->clearUndoRedoStacks(stacksToClear, true);
     473}
     474
    437475/*!
    438476    \overload
     
    557595{
    558596    Q_D(QTextDocument);
    559     if (!d->inContentsChange)
    560         d->beginEditBlock();
    561597    d->documentChange(from, length);
    562     if (!d->inContentsChange)
    563         d->endEditBlock();
     598    if (!d->inContentsChange) {
     599        if (d->lout) {
     600            d->lout->documentChanged(d->docChangeFrom, d->docChangeOldLength, d->docChangeLength);
     601            d->docChangeFrom = -1;
     602        }
     603    }
    564604}
    565605
     
    17501790    if (printer->collateCopies() == true){
    17511791        docCopies = 1;
    1752         pageCopies = printer->numCopies();
     1792        pageCopies = printer->supportsMultipleCopies() ? 1 : printer->copyCount();
    17531793    } else {
    1754         docCopies = printer->numCopies();
     1794        docCopies = printer->supportsMultipleCopies() ? 1 : printer->copyCount();
    17551795        pageCopies = 1;
    17561796    }
     
    19211961    }
    19221962#endif
     1963
     1964    // handle data: URLs
     1965    if (r.isNull() && name.scheme().compare(QLatin1String("data"), Qt::CaseInsensitive) == 0)
     1966        r = qDecodeDataUrl(name).second;
    19231967
    19241968    // if resource was not loaded try to load it here
     
    24682512    emitAlignment(format.alignment());
    24692513
    2470     Qt::LayoutDirection dir = format.layoutDirection();
    2471     if (dir == Qt::LeftToRight) {
    2472         // assume default to not bloat the html too much
    2473         // html += QLatin1String(" dir='ltr'");
    2474     } else {
     2514    // assume default to not bloat the html too much
     2515    // html += QLatin1String(" dir='ltr'");
     2516    if (block.textDirection() == Qt::RightToLeft)
    24752517        html += QLatin1String(" dir='rtl'");
    2476     }
    24772518
    24782519    QLatin1String style(" style=\"");
Note: See TracChangeset for help on using the changeset viewer.