From aeeabc36fd0a4a71238c8c3df2e80ea324f9bac0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 31 Oct 2016 10:29:25 +0200 Subject: loplugin:oncevar in unoxml..toolkit Change-Id: I3b97665908be0a44d24192433bdc9c2bd9008736 Reviewed-on: https://gerrit.libreoffice.org/30431 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- unoxml/source/rdf/librdf_repository.cxx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 8dedfd37f341..1cb823070b70 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1491,12 +1491,6 @@ void SAL_CALL librdf_Repository::setStatementRDFa( throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException, std::exception) { - static const char s_cell[] = "com.sun.star.table.Cell"; - static const char s_cellprops[] = "com.sun.star.text.CellProperties"; // for writer - static const char s_paragraph[] = "com.sun.star.text.Paragraph"; - static const char s_bookmark[] = "com.sun.star.text.Bookmark"; - static const char s_meta[] = "com.sun.star.text.InContentMetadata"; - if (!i_xSubject.is()) { throw lang::IllegalArgumentException( "librdf_Repository::setStatementRDFa: Subject is null", *this, 0); @@ -1520,14 +1514,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference xService(i_xObject, uno::UNO_QUERY_THROW); uno::Reference xTextRange; - if (xService->supportsService(s_cell) || - xService->supportsService(s_cellprops) || - xService->supportsService(s_paragraph)) + if (xService->supportsService("com.sun.star.table.Cell") || + xService->supportsService("com.sun.star.text.CellProperties") || // for writer + xService->supportsService("com.sun.star.text.Paragraph")) { xTextRange.set(i_xObject, uno::UNO_QUERY_THROW); } - else if (xService->supportsService(s_bookmark) || - xService->supportsService(s_meta)) + else if (xService->supportsService("com.sun.star.text.Bookmark") || + xService->supportsService("com.sun.star.text.InContentMetadata")) { const uno::Reference xTextContent(i_xObject, uno::UNO_QUERY_THROW); -- cgit