[go: up one dir, main page]

Add tracking of "Object type's current style" and clean up style get/apply code

Add tracking of "Object type's current style" to some tools. Use this option as the default.

  • Addresses inbox#717 (closed)
  • Paths (pencil, pen, calligraphic, paintbucket), 3dbox, text, rect, arc, star, spiral

Improve 3DBox "current style" tracking:

  • Distingush between "last used style" (apply one style to all faces) and "object type's last used style" (track six faces separately)
  • Take style from selected object now captures styles for all six faces
  • Attempts to address inbox#1565 and inbox#3626
  • 3dbox faces now use a single usecurrent pref for all six faces: tools/shapes/3dbox/usecurrent
  • Make string_from_axes(axis) return static strings instead of dynamically-constructed strings

Unified the code that retrieves desktop, tool-current or tool's-own styles

  • Everything now goes through SPDesktop::getCurrentOrToolStyle
  • Removed sp_desktop_get_style, sp_desktop_apply_style_tool
  • Always applies the Tool's own style, and overrides properties with one of the current styles if needed (Avoids a scenario where applying a current property (e.g., stroke) causes a different property (e.g., tool's own fill) to be unset)
  • Filtering of attributes is also unified: Always uses SPStyle::sp_css_attr_unset_blacklist/sp_css_attr_unset_uris/sp_css_attr_unset_text

sp_desktop_get_*_tool: If it can get the requested property from the tool, don't require desktop->current to be set.

Also possibly fixes #5175 (closed) , because the default mode is no longer "Last used style".

Edited by Henry Wong

Merge request reports

Loading