Skip to content

Lec -07 google Docs #24

Description

@Sakshamvijay-078

Issue: renderedDocument is cached after the first render. If new elements are added later, renderDocument() still returns the old cached value because renderedDocument is no longer empty.

string renderDocument() {
    if (renderedDocument.empty()) {
        renderedDocument = document->render();
    }
    return renderedDocument;
}

Fix: Clear the cache (or mark it dirty) whenever the document is modified so the next call re-renders the updated document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions