diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-22 16:39:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-04 06:38:03 +0000 |
commit | 5676ced82539d9e40bde6196d2aa3b2e4c7b3fdb (patch) | |
tree | db860b2365f8cb0e2fab4772e80e4e38d4d89b37 /desktop | |
parent | 1a1d1a86e9129ec3885610b641179b30f9bf5e79 (diff) |
make UNO enums scoped for internal LO code
this modifies codemaker so that, for an UNO enum, we generate code
that effectively looks like:
#ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR
enum class XXX {
ONE = 1
};
constexpr auto ONE = XXX_ONE;
#else
...the old normal way..
#endif
which means that for LO internal code, the enums are scoped.
The "constexpr auto" trick acts like an alias so we don't have to
use scoped naming everywhere.
Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4
Reviewed-on: https://gerrit.libreoffice.org/34546
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 9 | ||||
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.cxx | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 2b767a7c2b47..d895fa4952bd 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -37,12 +37,21 @@ #include <comphelper/string.hxx> #include <comphelper/scopeguard.hxx> #include <cairo.h> +#include <ostream> #include <lib/init.hxx> using namespace com::sun::star; using namespace desktop; +namespace com { namespace sun { namespace star { namespace text { +std::ostream& operator<<(std::ostream& os, css::text::TextContentAnchorType const & n) +{ + os << (sal_Int32)n; + return os; +} +} } } }; + class DesktopLOKTest : public UnoApiTest { public: diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index a491cb8457b4..012a5aa3ec60 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -147,7 +147,7 @@ bool LOKInteractionHandler::handleIOException(const css::uno::Sequence<css::uno: if (!(rRequest >>= aIoException)) return false; - static ErrCode const aErrorCode[ucb::IOErrorCode_WRONG_VERSION + 1] = + static ErrCode const aErrorCode[(int)ucb::IOErrorCode_WRONG_VERSION + 1] = { ERRCODE_IO_ABORT, ERRCODE_IO_ACCESSDENIED, @@ -187,7 +187,7 @@ bool LOKInteractionHandler::handleIOException(const css::uno::Sequence<css::uno: ERRCODE_IO_WRONGVERSION, }; - postError(aIoException.Classification, "io", aErrorCode[aIoException.Code], ""); + postError(aIoException.Classification, "io", aErrorCode[(int)aIoException.Code], ""); selectApproved(rContinuations); return true; |