Skip to content
Snippets Groups Projects

Copy page margins, setup, print options when copying worksheet

Merged Bitbucket Importer requested to merge bitbucket/merged-pr-330 into branch/2.6

Created originally on Bitbucket by johnwoltman (John Woltman)

Was already merged in Bitbucket before import, marked as merged by the import user

WorksheetCopy class now copies the PageMargins, PrintPageSetup, and PrintOptions. Fixes #1244.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: CharlieC

    Thanks. It’s probably worth checking that the any child objects of the copied objects are also copies. I can’t remember offhand of the base class handles this case.

  • Created by: johnwoltman

    Will do; thanks for the feedback.

  • Created by: johnwoltman

    I looked into it, and found that:

    • PageMargins, PrintPageSetup, and PrintOptions are subclasses of Serialisable.
    • Serialisable implements __copy__() by turning the object into its XML representation and then converting back into a Python object.
    • The child classes, which are subclasses of Descriptor and Set, appear to be handled by Serialisable's __copy__ and are part of the Python-to-XML-to-Python cycle.

    If you’d like me to do anything further with this, let me know. (I haven’t contributed much to any open source project before, so any help or tips are appreciated).

  • Created by: CharlieC

    Thanks for checking, I wasn’t sure if I’d done something in that respect; it’s a copy Python gotcha when copying objects that child objects might be shared.

    You might want to add yourself to the list of contributors.

Please register or sign in to reply
Loading