conditional_format_impl.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <cstddef>
  3. #include <xlnt/styles/conditional_format.hpp>
  4. #include <xlnt/utils/optional.hpp>
  5. #include <xlnt/worksheet/range_reference.hpp>
  6. namespace xlnt {
  7. class border;
  8. class fill;
  9. class font;
  10. namespace detail {
  11. struct stylesheet;
  12. struct worksheet_impl;
  13. struct conditional_format_impl
  14. {
  15. stylesheet *parent;
  16. worksheet_impl *target_sheet;
  17. bool operator==(const conditional_format_impl& rhs) const
  18. {
  19. // not comparing parent or target sheet
  20. return target_range == rhs.target_range
  21. && priority == rhs.priority
  22. && differential_format_id == rhs.differential_format_id
  23. && when == rhs.when
  24. && border_id == rhs.border_id
  25. && fill_id == rhs.fill_id
  26. && font_id == rhs.font_id;
  27. }
  28. range_reference target_range;
  29. std::size_t priority;
  30. std::size_t differential_format_id;
  31. condition when;
  32. optional<std::size_t> border_id;
  33. optional<std::size_t> fill_id;
  34. optional<std::size_t> font_id;
  35. };
  36. } // namespace detail
  37. } // namespace xlnt