Example #1
0
shared_ptr< xc::DOMDocument > PerformHTMLUpdates::operator()()
{
    UpdateXMLReferences();

    if (!m_CSSUpdates.isEmpty()) {
        m_Document = XhtmlDoc::LoadTextIntoDocument(
                         PerformCSSUpdates(XhtmlDoc::GetDomDocumentAsString(*m_Document), m_CSSUpdates)());
    }

    return m_Document;
}
void UniversalUpdates::LoadAndUpdateOneCSSFile(CSSResource *css_resource,
        const QHash<QString, QString> &css_updates)
{
    if (!css_resource) {
        return;
    }

    const QString &source = Utility::ReadUnicodeTextFile(css_resource->GetFullPath());
    css_resource->SetText(PerformCSSUpdates(source, css_updates)());
    css_resource->SaveToDisk();
}
Example #3
0
QString PerformHTMLUpdates::operator()()
{
    QString newsource = m_source;
    GumboInterface gi = GumboInterface(newsource);
    gi.parse();
    newsource = gi.perform_source_updates(m_HTMLUpdates, m_CurrentPath);
    if (!m_CSSUpdates.isEmpty()) {
        newsource = PerformCSSUpdates(newsource, m_CSSUpdates)();
    }
    return CleanSource::CharToEntity(newsource);
}
void UniversalUpdates::UpdateOneCSSFile(CSSResource *css_resource,
                                        const QHash<QString, QString> &css_updates)
{
    if (!css_resource) {
        return;
    }

    QWriteLocker locker(&css_resource->GetLock());
    const QString &source = css_resource->GetText();
    css_resource->SetText(PerformCSSUpdates(source, css_updates)());
}