> OUString RectanglePointToOUString(const css::drawing::RectanglePoint& rp){ > if(rp == css::drawing::RectanglePoint::LEFT_TOP) > return OUString::createFromAscii("LEFT_TOP"); > ... > SAL_WARN("sd","Unknown RectanglePoint Value"); > return OUString::createFromAscii(""); > } > > The existing practice is to use a switch statement, not a sequence of if statements. Also, as css::drawing::RectanglePoint is a new-style so-called scoped enum (enum class, not plain enum), you should introduce a stream output operator<< directly, no need for a ToString function just for SAL_INFO etc usage. If you have an operator<< for it, you can use values of that css::drawing::RectanglePoint type directly in SAL_INFO etc.
See for instance include/sfx2/event.hxx, this: template< typename charT, typename traits > inline std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, const SvMacroItemId& id ) { switch(id) { ... That is my code, and my style, and it is I who (as far as I have noticed) have been adding such debug output operators when I have had the need. Nobody has opposed, so that is the existing style you should follow. If somebody now opposes, they are free to introduce another style, *if* they change there existing ones to be of that style, too. Just my opinion, of course. Note that instead of a SAL_WARN as you have, I output the undefined value as a number. That is more useful. --tml
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice