diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-14 09:10:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-14 11:47:53 +0200 |
commit | 008f4273ae201b5bebfd728a3b59958de49279bf (patch) | |
tree | 01bbd1f8b86ae9adc034b3273dbf5e6f6ff70df1 /test | |
parent | b56ca52cef77d4d1f99bc3edd89b2557e5cb2cfb (diff) |
loplugin:ostr in test
Change-Id: Ie261167fc3e1ed9073210e0f8b179455da340c83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167620
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'test')
82 files changed, 660 insertions, 655 deletions
diff --git a/test/qa/cppunit/test_xpath.cxx b/test/qa/cppunit/test_xpath.cxx index 8d105dd4eae6..18d815a2420b 100644 --- a/test/qa/cppunit/test_xpath.cxx +++ b/test/qa/cppunit/test_xpath.cxx @@ -33,7 +33,7 @@ CPPUNIT_TEST_FIXTURE(TestXPath, test_getXPath) // Must fail when requested non-empty attribute doesn't exist CPPUNIT_ASSERT_ASSERTION_FAIL(getXPath(pTable, "/xml/item"_ostr, "no_attrib"_ostr)); // Must properly return attribute content - CPPUNIT_ASSERT_EQUAL(OUString("val"), getXPath(pTable, "/xml/item"_ostr, "attrib"_ostr)); + CPPUNIT_ASSERT_EQUAL(u"val"_ustr, getXPath(pTable, "/xml/item"_ostr, "attrib"_ostr)); // Trying to get position of missing child of a node must fail assertion CPPUNIT_ASSERT_ASSERTION_FAIL(getXPathPosition(pTable, "/xml/item"_ostr, "absent")); // Asserting that an attribute is absent diff --git a/test/source/a11y/AccessibilityTools.cxx b/test/source/a11y/AccessibilityTools.cxx index f0a28d4cdad2..4c01d1674b6a 100644 --- a/test/source/a11y/AccessibilityTools.cxx +++ b/test/source/a11y/AccessibilityTools.cxx @@ -217,181 +217,181 @@ OUString AccessibilityTools::getRoleName(const sal_Int16 role) switch (role) { case accessibility::AccessibleRole::UNKNOWN: - return "UNKNOWN"; + return u"UNKNOWN"_ustr; case accessibility::AccessibleRole::ALERT: - return "ALERT"; + return u"ALERT"_ustr; case accessibility::AccessibleRole::BLOCK_QUOTE: - return "BLOCK_QUOTE"; + return u"BLOCK_QUOTE"_ustr; case accessibility::AccessibleRole::BUTTON_DROPDOWN: - return "BUTTON_DROPDOWN"; + return u"BUTTON_DROPDOWN"_ustr; case accessibility::AccessibleRole::BUTTON_MENU: - return "BUTTON_MENU"; + return u"BUTTON_MENU"_ustr; case accessibility::AccessibleRole::CANVAS: - return "CANVAS"; + return u"CANVAS"_ustr; case accessibility::AccessibleRole::CAPTION: - return "CAPTION"; + return u"CAPTION"_ustr; case accessibility::AccessibleRole::CHART: - return "CHART"; + return u"CHART"_ustr; case accessibility::AccessibleRole::CHECK_BOX: - return "CHECK_BOX"; + return u"CHECK_BOX"_ustr; case accessibility::AccessibleRole::CHECK_MENU_ITEM: - return "CHECK_MENU_ITEM"; + return u"CHECK_MENU_ITEM"_ustr; case accessibility::AccessibleRole::COLOR_CHOOSER: - return "COLOR_CHOOSER"; + return u"COLOR_CHOOSER"_ustr; case accessibility::AccessibleRole::COLUMN_HEADER: - return "COLUMN_HEADER"; + return u"COLUMN_HEADER"_ustr; case accessibility::AccessibleRole::COMBO_BOX: - return "COMBO_BOX"; + return u"COMBO_BOX"_ustr; case accessibility::AccessibleRole::COMMENT: - return "COMMENT"; + return u"COMMENT"_ustr; case accessibility::AccessibleRole::COMMENT_END: - return "COMMENT_END"; + return u"COMMENT_END"_ustr; case accessibility::AccessibleRole::DATE_EDITOR: - return "DATE_EDITOR"; + return u"DATE_EDITOR"_ustr; case accessibility::AccessibleRole::DESKTOP_ICON: - return "DESKTOP_ICON"; + return u"DESKTOP_ICON"_ustr; case accessibility::AccessibleRole::DESKTOP_PANE: - return "DESKTOP_PANE"; + return u"DESKTOP_PANE"_ustr; case accessibility::AccessibleRole::DIALOG: - return "DIALOG"; + return u"DIALOG"_ustr; case accessibility::AccessibleRole::DIRECTORY_PANE: - return "DIRECTORY_PANE"; + return u"DIRECTORY_PANE"_ustr; case accessibility::AccessibleRole::DOCUMENT: - return "DOCUMENT"; + return u"DOCUMENT"_ustr; case accessibility::AccessibleRole::DOCUMENT_PRESENTATION: - return "DOCUMENT_PRESENTATION"; + return u"DOCUMENT_PRESENTATION"_ustr; case accessibility::AccessibleRole::DOCUMENT_SPREADSHEET: - return "DOCUMENT_SPREADSHEET"; + return u"DOCUMENT_SPREADSHEET"_ustr; case accessibility::AccessibleRole::DOCUMENT_TEXT: - return "DOCUMENT_TEXT"; + return u"DOCUMENT_TEXT"_ustr; case accessibility::AccessibleRole::EDIT_BAR: - return "EDIT_BAR"; + return u"EDIT_BAR"_ustr; case accessibility::AccessibleRole::EMBEDDED_OBJECT: - return "EMBEDDED_OBJECT"; + return u"EMBEDDED_OBJECT"_ustr; case accessibility::AccessibleRole::END_NOTE: - return "END_NOTE"; + return u"END_NOTE"_ustr; case accessibility::AccessibleRole::FILE_CHOOSER: - return "FILE_CHOOSER"; + return u"FILE_CHOOSER"_ustr; case accessibility::AccessibleRole::FILLER: - return "FILLER"; + return u"FILLER"_ustr; case accessibility::AccessibleRole::FONT_CHOOSER: - return "FONT_CHOOSER"; + return u"FONT_CHOOSER"_ustr; case accessibility::AccessibleRole::FOOTER: - return "FOOTER"; + return u"FOOTER"_ustr; case accessibility::AccessibleRole::FOOTNOTE: - return "FOOTNOTE"; + return u"FOOTNOTE"_ustr; case accessibility::AccessibleRole::FORM: - return "FORM"; + return u"FORM"_ustr; case accessibility::AccessibleRole::FRAME: - return "FRAME"; + return u"FRAME"_ustr; case accessibility::AccessibleRole::GLASS_PANE: - return "GLASS_PANE"; + return u"GLASS_PANE"_ustr; case accessibility::AccessibleRole::GRAPHIC: - return "GRAPHIC"; + return u"GRAPHIC"_ustr; case accessibility::AccessibleRole::GROUP_BOX: - return "GROUP_BOX"; + return u"GROUP_BOX"_ustr; case accessibility::AccessibleRole::HEADER: - return "HEADER"; + return u"HEADER"_ustr; case accessibility::AccessibleRole::HEADING: - return "HEADING"; + return u"HEADING"_ustr; case accessibility::AccessibleRole::HYPER_LINK: - return "HYPER_LINK"; + return u"HYPER_LINK"_ustr; case accessibility::AccessibleRole::ICON: - return "ICON"; + return u"ICON"_ustr; case accessibility::AccessibleRole::IMAGE_MAP: - return "IMAGE_MAP"; + return u"IMAGE_MAP"_ustr; case accessibility::AccessibleRole::INTERNAL_FRAME: - return "INTERNAL_FRAME"; + return u"INTERNAL_FRAME"_ustr; case accessibility::AccessibleRole::LABEL: - return "LABEL"; + return u"LABEL"_ustr; case accessibility::AccessibleRole::LAYERED_PANE: - return "LAYERED_PANE"; + return u"LAYERED_PANE"_ustr; case accessibility::AccessibleRole::LIST: - return "LIST"; + return u"LIST"_ustr; case accessibility::AccessibleRole::LIST_ITEM: - return "LIST_ITEM"; + return u"LIST_ITEM"_ustr; case accessibility::AccessibleRole::MENU: - return "MENU"; + return u"MENU"_ustr; case accessibility::AccessibleRole::MENU_BAR: - return "MENU_BAR"; + return u"MENU_BAR"_ustr; case accessibility::AccessibleRole::MENU_ITEM: - return "MENU_ITEM"; + return u"MENU_ITEM"_ustr; case accessibility::AccessibleRole::NOTE: - return "NOTE"; + return u"NOTE"_ustr; case accessibility::AccessibleRole::OPTION_PANE: - return "OPTION_PANE"; + return u"OPTION_PANE"_ustr; case accessibility::AccessibleRole::PAGE: - return "PAGE"; + return u"PAGE"_ustr; case accessibility::AccessibleRole::PAGE_TAB: - return "PAGE_TAB"; + return u"PAGE_TAB"_ustr; case accessibility::AccessibleRole::PAGE_TAB_LIST: - return "PAGE_TAB_LIST"; + return u"PAGE_TAB_LIST"_ustr; case accessibility::AccessibleRole::PANEL: - return "PANEL"; + return u"PANEL"_ustr; case accessibility::AccessibleRole::PARAGRAPH: - return "PARAGRAPH"; + return u"PARAGRAPH"_ustr; case accessibility::AccessibleRole::PASSWORD_TEXT: - return "PASSWORD_TEXT"; + return u"PASSWORD_TEXT"_ustr; case accessibility::AccessibleRole::POPUP_MENU: - return "POPUP_MENU"; + return u"POPUP_MENU"_ustr; case accessibility::AccessibleRole::PROGRESS_BAR: - return "PROGRESS_BAR"; + return u"PROGRESS_BAR"_ustr; case accessibility::AccessibleRole::PUSH_BUTTON: - return "PUSH_BUTTON"; + return u"PUSH_BUTTON"_ustr; case accessibility::AccessibleRole::RADIO_BUTTON: - return "RADIO_BUTTON"; + return u"RADIO_BUTTON"_ustr; case accessibility::AccessibleRole::RADIO_MENU_ITEM: - return "RADIO_MENU_ITEM"; + return u"RADIO_MENU_ITEM"_ustr; case accessibility::AccessibleRole::ROOT_PANE: - return "ROOT_PANE"; + return u"ROOT_PANE"_ustr; case accessibility::AccessibleRole::ROW_HEADER: - return "ROW_HEADER"; + return u"ROW_HEADER"_ustr; case accessibility::AccessibleRole::RULER: - return "RULER"; + return u"RULER"_ustr; case accessibility::AccessibleRole::SCROLL_BAR: - return "SCROLL_BAR"; + return u"SCROLL_BAR"_ustr; case accessibility::AccessibleRole::SCROLL_PANE: - return "SCROLL_PANE"; + return u"SCROLL_PANE"_ustr; case accessibility::AccessibleRole::SECTION: - return "SECTION"; + return u"SECTION"_ustr; case accessibility::AccessibleRole::SEPARATOR: - return "SEPARATOR"; + return u"SEPARATOR"_ustr; case accessibility::AccessibleRole::SHAPE: - return "SHAPE"; + return u"SHAPE"_ustr; case accessibility::AccessibleRole::SLIDER: - return "SLIDER"; + return u"SLIDER"_ustr; case accessibility::AccessibleRole::SPIN_BOX: - return "SPIN_BOX"; + return u"SPIN_BOX"_ustr; case accessibility::AccessibleRole::SPLIT_PANE: - return "SPLIT_PANE"; + return u"SPLIT_PANE"_ustr; case accessibility::AccessibleRole::STATIC: - return "STATIC"; + return u"STATIC"_ustr; case accessibility::AccessibleRole::STATUS_BAR: - return "STATUS_BAR"; + return u"STATUS_BAR"_ustr; case accessibility::AccessibleRole::TABLE: - return "TABLE"; + return u"TABLE"_ustr; case accessibility::AccessibleRole::TABLE_CELL: - return "TABLE_CELL"; + return u"TABLE_CELL"_ustr; case accessibility::AccessibleRole::TEXT: - return "TEXT"; + return u"TEXT"_ustr; case accessibility::AccessibleRole::TEXT_FRAME: - return "TEXT_FRAME"; + return u"TEXT_FRAME"_ustr; case accessibility::AccessibleRole::TOGGLE_BUTTON: - return "TOGGLE_BUTTON"; + return u"TOGGLE_BUTTON"_ustr; case accessibility::AccessibleRole::TOOL_BAR: - return "TOOL_BAR"; + return u"TOOL_BAR"_ustr; case accessibility::AccessibleRole::TOOL_TIP: - return "TOOL_TIP"; + return u"TOOL_TIP"_ustr; case accessibility::AccessibleRole::TREE: - return "TREE"; + return u"TREE"_ustr; case accessibility::AccessibleRole::TREE_ITEM: - return "TREE_ITEM"; + return u"TREE_ITEM"_ustr; case accessibility::AccessibleRole::TREE_TABLE: - return "TREE_TABLE"; + return u"TREE_TABLE"_ustr; case accessibility::AccessibleRole::VIEW_PORT: - return "VIEW_PORT"; + return u"VIEW_PORT"_ustr; case accessibility::AccessibleRole::WINDOW: - return "WINDOW"; + return u"WINDOW"_ustr; }; return unknownName(role); } @@ -526,7 +526,7 @@ OUString AccessibilityTools::debugAccessibleStateSet(const sal_Int64 nCombinedSt } if (combinedName.isEmpty()) - return "unknown"; + return u"unknown"_ustr; return combinedName; } @@ -535,87 +535,87 @@ OUString AccessibilityTools::getEventIdName(const sal_Int16 event_id) switch (event_id) { case accessibility::AccessibleEventId::ACTION_CHANGED: - return "ACTION_CHANGED"; + return u"ACTION_CHANGED"_ustr; case accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED: - return "ACTIVE_DESCENDANT_CHANGED"; + return u"ACTIVE_DESCENDANT_CHANGED"_ustr; case accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS: - return "ACTIVE_DESCENDANT_CHANGED_NOFOCUS"; + return u"ACTIVE_DESCENDANT_CHANGED_NOFOCUS"_ustr; case accessibility::AccessibleEventId::BOUNDRECT_CHANGED: - return "BOUNDRECT_CHANGED"; + return u"BOUNDRECT_CHANGED"_ustr; case accessibility::AccessibleEventId::CARET_CHANGED: - return "CARET_CHANGED"; + return u"CARET_CHANGED"_ustr; case accessibility::AccessibleEventId::CHILD: - return "CHILD"; + return u"CHILD"_ustr; case accessibility::AccessibleEventId::COLUMN_CHANGED: - return "COLUMN_CHANGED"; + return u"COLUMN_CHANGED"_ustr; case accessibility::AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED: - return "CONTENT_FLOWS_FROM_RELATION_CHANGED"; + return u"CONTENT_FLOWS_FROM_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED: - return "CONTENT_FLOWS_TO_RELATION_CHANGED"; + return u"CONTENT_FLOWS_TO_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED: - return "CONTROLLED_BY_RELATION_CHANGED"; + return u"CONTROLLED_BY_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED: - return "CONTROLLER_FOR_RELATION_CHANGED"; + return u"CONTROLLER_FOR_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::DESCRIPTION_CHANGED: - return "DESCRIPTION_CHANGED"; + return u"DESCRIPTION_CHANGED"_ustr; case accessibility::AccessibleEventId::HYPERTEXT_CHANGED: - return "HYPERTEXT_CHANGED"; + return u"HYPERTEXT_CHANGED"_ustr; case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN: - return "INVALIDATE_ALL_CHILDREN"; + return u"INVALIDATE_ALL_CHILDREN"_ustr; case accessibility::AccessibleEventId::LABELED_BY_RELATION_CHANGED: - return "LABELED_BY_RELATION_CHANGED"; + return u"LABELED_BY_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::LABEL_FOR_RELATION_CHANGED: - return "LABEL_FOR_RELATION_CHANGED"; + return u"LABEL_FOR_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::LISTBOX_ENTRY_COLLAPSED: - return "LISTBOX_ENTRY_COLLAPSED"; + return u"LISTBOX_ENTRY_COLLAPSED"_ustr; case accessibility::AccessibleEventId::LISTBOX_ENTRY_EXPANDED: - return "LISTBOX_ENTRY_EXPANDED"; + return u"LISTBOX_ENTRY_EXPANDED"_ustr; case accessibility::AccessibleEventId::MEMBER_OF_RELATION_CHANGED: - return "MEMBER_OF_RELATION_CHANGED"; + return u"MEMBER_OF_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::NAME_CHANGED: - return "NAME_CHANGED"; + return u"NAME_CHANGED"_ustr; case accessibility::AccessibleEventId::PAGE_CHANGED: - return "PAGE_CHANGED"; + return u"PAGE_CHANGED"_ustr; case accessibility::AccessibleEventId::ROLE_CHANGED: - return "ROLE_CHANGED"; + return u"ROLE_CHANGED"_ustr; case accessibility::AccessibleEventId::SECTION_CHANGED: - return "SECTION_CHANGED"; + return u"SECTION_CHANGED"_ustr; case accessibility::AccessibleEventId::SELECTION_CHANGED: - return "SELECTION_CHANGED"; + return u"SELECTION_CHANGED"_ustr; case accessibility::AccessibleEventId::SELECTION_CHANGED_ADD: - return "SELECTION_CHANGED_ADD"; + return u"SELECTION_CHANGED_ADD"_ustr; case accessibility::AccessibleEventId::SELECTION_CHANGED_REMOVE: - return "SELECTION_CHANGED_REMOVE"; + return u"SELECTION_CHANGED_REMOVE"_ustr; case accessibility::AccessibleEventId::SELECTION_CHANGED_WITHIN: - return "SELECTION_CHANGED_WITHIN"; + return u"SELECTION_CHANGED_WITHIN"_ustr; case accessibility::AccessibleEventId::STATE_CHANGED: - return "STATE_CHANGED"; + return u"STATE_CHANGED"_ustr; case accessibility::AccessibleEventId::SUB_WINDOW_OF_RELATION_CHANGED: - return "SUB_WINDOW_OF_RELATION_CHANGED"; + return u"SUB_WINDOW_OF_RELATION_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_CAPTION_CHANGED: - return "TABLE_CAPTION_CHANGED"; + return u"TABLE_CAPTION_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED: - return "TABLE_COLUMN_DESCRIPTION_CHANGED"; + return u"TABLE_COLUMN_DESCRIPTION_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED: - return "TABLE_COLUMN_HEADER_CHANGED"; + return u"TABLE_COLUMN_HEADER_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_MODEL_CHANGED: - return "TABLE_MODEL_CHANGED"; + return u"TABLE_MODEL_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED: - return "TABLE_ROW_DESCRIPTION_CHANGED"; + return u"TABLE_ROW_DESCRIPTION_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_ROW_HEADER_CHANGED: - return "TABLE_ROW_HEADER_CHANGED"; + return u"TABLE_ROW_HEADER_CHANGED"_ustr; case accessibility::AccessibleEventId::TABLE_SUMMARY_CHANGED: - return "TABLE_SUMMARY_CHANGED"; + return u"TABLE_SUMMARY_CHANGED"_ustr; case accessibility::AccessibleEventId::TEXT_ATTRIBUTE_CHANGED: - return "TEXT_ATTRIBUTE_CHANGED"; + return u"TEXT_ATTRIBUTE_CHANGED"_ustr; case accessibility::AccessibleEventId::TEXT_CHANGED: - return "TEXT_CHANGED"; + return u"TEXT_CHANGED"_ustr; case accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED: - return "TEXT_SELECTION_CHANGED"; + return u"TEXT_SELECTION_CHANGED"_ustr; case accessibility::AccessibleEventId::VALUE_CHANGED: - return "VALUE_CHANGED"; + return u"VALUE_CHANGED"_ustr; case accessibility::AccessibleEventId::VISIBLE_DATA_CHANGED: - return "VISIBLE_DATA_CHANGED"; + return u"VISIBLE_DATA_CHANGED"_ustr; } return unknownName(event_id); } @@ -625,27 +625,27 @@ OUString AccessibilityTools::getRelationTypeName(const sal_Int16 rel_type) switch (rel_type) { case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM: - return "CONTENT_FLOWS_FROM"; + return u"CONTENT_FLOWS_FROM"_ustr; case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO: - return "CONTENT_FLOWS_TO"; + return u"CONTENT_FLOWS_TO"_ustr; case accessibility::AccessibleRelationType::CONTROLLED_BY: - return "CONTROLLED_BY"; + return u"CONTROLLED_BY"_ustr; case accessibility::AccessibleRelationType::CONTROLLER_FOR: - return "CONTROLLER_FOR"; + return u"CONTROLLER_FOR"_ustr; case accessibility::AccessibleRelationType::DESCRIBED_BY: - return "DESCRIBED_BY"; + return u"DESCRIBED_BY"_ustr; case accessibility::AccessibleRelationType::INVALID: - return "INVALID"; + return u"INVALID"_ustr; case accessibility::AccessibleRelationType::LABELED_BY: - return "LABELED_BY"; + return u"LABELED_BY"_ustr; case accessibility::AccessibleRelationType::LABEL_FOR: - return "LABEL_FOR"; + return u"LABEL_FOR"_ustr; case accessibility::AccessibleRelationType::MEMBER_OF: - return "MEMBER_OF"; + return u"MEMBER_OF"_ustr; case accessibility::AccessibleRelationType::NODE_CHILD_OF: - return "NODE_CHILD_OF"; + return u"NODE_CHILD_OF"_ustr; case accessibility::AccessibleRelationType::SUB_WINDOW_OF: - return "SUB_WINDOW_OF"; + return u"SUB_WINDOW_OF"_ustr; } return unknownName(rel_type); } diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index 00aac5ea9900..62b8043917df 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -62,7 +62,8 @@ void test::AccessibleTestBase::load(const rtl::OUString& sURL) { // make sure there is no open document in case it is called more than once close(); - mxDocument = mxDesktop->loadComponentFromURL(sURL, "_blank", frame::FrameSearchFlag::AUTO, {}); + mxDocument + = mxDesktop->loadComponentFromURL(sURL, u"_blank"_ustr, frame::FrameSearchFlag::AUTO, {}); uno::Reference<frame::XModel> xModel(mxDocument, uno::UNO_QUERY_THROW); mxWindow.set(xModel->getCurrentController()->getFrame()->getContainerWindow()); @@ -461,7 +462,7 @@ test::AccessibleTestBase::awaitDialog(const std::u16string_view name, // This is not very nice, but it should help fail earlier if we never catch the dialog // yet we're in a sub-loop and waitEndDialog() didn't have a chance to run yet. - throw new css::uno::RuntimeException("Timeout waiting for dialog"); + throw new css::uno::RuntimeException(u"Timeout waiting for dialog"_ustr); } class MyTopWindowListener : public ::cppu::WeakImplHelper<awt::XTopWindowListener> diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx index 038b1e5733b6..1956a6def624 100644 --- a/test/source/beans/xpropertyset.cxx +++ b/test/source/beans/xpropertyset.cxx @@ -288,9 +288,9 @@ void XPropertySet::fillPropsToTest(const uno::Reference<beans::XPropertySetInfo> // TODO: Maybe we should mark these properties read-only, instead of // giving them a special treatment here? std::set<OUString> aSkip; - aSkip.insert("PrinterName"); - aSkip.insert("CharRelief"); - aSkip.insert("IsLayerMode"); + aSkip.insert(u"PrinterName"_ustr); + aSkip.insert(u"CharRelief"_ustr); + aSkip.insert(u"IsLayerMode"_ustr); for (const beans::Property& aProp : aProps) { diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index f1db0bf66637..273109496012 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -73,13 +73,13 @@ static void test_init_impl(bool bAssertOnDialog, bool bNeedUCB, if (bNeedUCB) { // initialise unconfigured UCB: - uno::Reference<ucb::XUniversalContentBroker> xUcb(pSFactory->createInstance("com.sun.star.ucb.UniversalContentBroker"), uno::UNO_QUERY_THROW); - uno::Reference<ucb::XContentProvider> xFileProvider(pSFactory->createInstance("com.sun.star.ucb.FileContentProvider"), uno::UNO_QUERY_THROW); - xUcb->registerContentProvider(xFileProvider, "file", true); - uno::Reference<ucb::XContentProvider> xTdocProvider(pSFactory->createInstance("com.sun.star.ucb.TransientDocumentsContentProvider"), uno::UNO_QUERY); + uno::Reference<ucb::XUniversalContentBroker> xUcb(pSFactory->createInstance(u"com.sun.star.ucb.UniversalContentBroker"_ustr), uno::UNO_QUERY_THROW); + uno::Reference<ucb::XContentProvider> xFileProvider(pSFactory->createInstance(u"com.sun.star.ucb.FileContentProvider"_ustr), uno::UNO_QUERY_THROW); + xUcb->registerContentProvider(xFileProvider, u"file"_ustr, true); + uno::Reference<ucb::XContentProvider> xTdocProvider(pSFactory->createInstance(u"com.sun.star.ucb.TransientDocumentsContentProvider"_ustr), uno::UNO_QUERY); if (xTdocProvider.is()) { - xUcb->registerContentProvider(xTdocProvider, "vnd.sun.star.tdoc", true); + xUcb->registerContentProvider(xTdocProvider, u"vnd.sun.star.tdoc"_ustr, true); } } } diff --git a/test/source/container/xnamecontainer.cxx b/test/source/container/xnamecontainer.cxx index 5df1e76b3e3c..60ad5f58bbb7 100644 --- a/test/source/container/xnamecontainer.cxx +++ b/test/source/container/xnamecontainer.cxx @@ -37,7 +37,8 @@ void XNameContainer::testInsertByNameEmptyName() uno::Reference<container::XNameContainer> xNameContainer(init(), uno::UNO_QUERY_THROW); uno::Any aAny; - CPPUNIT_ASSERT_THROW(xNameContainer->insertByName("", aAny), lang::IllegalArgumentException); + CPPUNIT_ASSERT_THROW(xNameContainer->insertByName(u""_ustr, aAny), + lang::IllegalArgumentException); } void XNameContainer::testInsertByNameInvalidElement() @@ -85,14 +86,14 @@ void XNameContainer::testRemoveByNameEmptyName() { uno::Reference<container::XNameContainer> xNameContainer(init(), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_THROW(xNameContainer->removeByName(""), lang::IllegalArgumentException); + CPPUNIT_ASSERT_THROW(xNameContainer->removeByName(u""_ustr), lang::IllegalArgumentException); } void XNameContainer::testRemoveByNameNoneExistingElement() { uno::Reference<container::XNameContainer> xNameContainer(init(), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_THROW(xNameContainer->removeByName("UnitTest"), + CPPUNIT_ASSERT_THROW(xNameContainer->removeByName(u"UnitTest"_ustr), container::NoSuchElementException); } diff --git a/test/source/container/xnamed.cxx b/test/source/container/xnamed.cxx index 000a9f62e094..6e946f4cb7bf 100644 --- a/test/source/container/xnamed.cxx +++ b/test/source/container/xnamed.cxx @@ -31,7 +31,7 @@ void XNamed::testGetName() void XNamed::testSetName() { uno::Reference<container::XNamed> xNamed(init(), UNO_QUERY_THROW); - OUString aTestName("NewName"); + OUString aTestName(u"NewName"_ustr); xNamed->setName(aTestName); CPPUNIT_ASSERT_EQUAL(aTestName, xNamed->getName()); @@ -58,7 +58,7 @@ void XNamed::testSetNameThrowsException() { uno::Reference<container::XNamed> xNamed(init(), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_THROW(xNamed->setName("NewName"), uno::RuntimeException); + CPPUNIT_ASSERT_THROW(xNamed->setName(u"NewName"_ustr), uno::RuntimeException); } } diff --git a/test/source/helper/form.cxx b/test/source/helper/form.cxx index 5727909a603a..7238ecda9f88 100644 --- a/test/source/helper/form.cxx +++ b/test/source/helper/form.cxx @@ -39,14 +39,14 @@ uno::Reference<drawing::XControlShape> OOO_DLLPUBLIC_TEST createControlShape( uno::Reference<lang::XMultiServiceFactory> xMSF(r_xComponent, uno::UNO_QUERY_THROW); uno::Reference<drawing::XControlShape> xControlShape( - xMSF->createInstance("com.sun.star.drawing.ControlShape"), uno::UNO_QUERY_THROW); + xMSF->createInstance(u"com.sun.star.drawing.ControlShape"_ustr), uno::UNO_QUERY_THROW); uno::Reference<uno::XInterface> aComponent( xMSF->createInstance(OUString::Concat("com.sun.star.form.component.") + r_aKind), uno::UNO_SET_THROW); uno::Reference<beans::XPropertySet> xPropertySet(aComponent, uno::UNO_QUERY_THROW); xPropertySet->setPropertyValue( - "DefaultControl", uno::Any(OUString::Concat("com.sun.star.form.control.") + r_aKind)); + u"DefaultControl"_ustr, uno::Any(OUString::Concat("com.sun.star.form.control.") + r_aKind)); uno::Reference<awt::XControlModel> xControlModel(aComponent, uno::UNO_QUERY_THROW); xControlShape->setSize(awt::Size(nHeight, nWidth)); diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 9b85338303a0..3baad8b24b7a 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -51,7 +51,7 @@ using namespace css::uno; constexpr OUString g_aScreenshotDirectory(u"screenshots"_ustr); ScreenshotTest::ScreenshotTest() - : maParent(nullptr, "vcl/ui/screenshotparent.ui", "ScreenShot") + : maParent(nullptr, u"vcl/ui/screenshotparent.ui"_ustr, u"ScreenShot"_ustr) , mxParentWidget(maParent.getDialog()->weld_content_area()) { if (auto const env = getenv("LO_TEST_LOCALE")) { @@ -172,7 +172,7 @@ void ScreenshotTest::dumpDialogToPath(weld::Builder& rBuilder) { std::unique_ptr<weld::Window> xDialog(rBuilder.create_screenshot_window()); - auto xTabCtrl = rBuilder.weld_notebook("tabcontrol"); + auto xTabCtrl = rBuilder.weld_notebook(u"tabcontrol"_ustr); int nPages = xTabCtrl ? xTabCtrl->get_n_pages() : 0; if (nPages) diff --git a/test/source/sheet/cellarealink.cxx b/test/source/sheet/cellarealink.cxx index 93319542cb9b..75604173af2b 100644 --- a/test/source/sheet/cellarealink.cxx +++ b/test/source/sheet/cellarealink.cxx @@ -29,10 +29,10 @@ void CellAreaLink::testUrl() CPPUNIT_ASSERT_EQUAL_MESSAGE("Default Url already changed", m_aFileURL, aUrl); uno::Any aNewUrl; - aNewUrl <<= OUString("file:///tmp"); + aNewUrl <<= u"file:///tmp"_ustr; xCellAreaLink->setPropertyValue(propName, aNewUrl); CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aUrl); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of Url wasn't changed", OUString("file:///tmp"), aUrl); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of Url wasn't changed", u"file:///tmp"_ustr, aUrl); } void CellAreaLink::testFilter() @@ -43,13 +43,13 @@ void CellAreaLink::testFilter() OUString aFilter; CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilter); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Default Filter already changed", OUString("calc8"), aFilter); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default Filter already changed", u"calc8"_ustr, aFilter); uno::Any aNewFilter; - aNewFilter <<= OUString("UnitTest"); + aNewFilter <<= u"UnitTest"_ustr; xCellAreaLink->setPropertyValue(propName, aNewFilter); CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilter); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of Filter wasn't changed", OUString("UnitTest"), aFilter); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of Filter wasn't changed", u"UnitTest"_ustr, aFilter); } void CellAreaLink::testFilterOptions() @@ -60,14 +60,13 @@ void CellAreaLink::testFilterOptions() OUString aFilterOptions; CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilterOptions); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Default FilterOptions already changed", OUString(""), - aFilterOptions); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default FilterOptions already changed", u""_ustr, aFilterOptions); uno::Any aNewFilterOptions; - aNewFilterOptions <<= OUString("UnitTest"); + aNewFilterOptions <<= u"UnitTest"_ustr; xCellAreaLink->setPropertyValue(propName, aNewFilterOptions); CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilterOptions); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of FilterOptions wasn't changed", OUString("UnitTest"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Value of FilterOptions wasn't changed", u"UnitTest"_ustr, aFilterOptions); } diff --git a/test/source/sheet/cellproperties.cxx b/test/source/sheet/cellproperties.cxx index 3d7908be78b2..7ff7120736af 100644 --- a/test/source/sheet/cellproperties.cxx +++ b/test/source/sheet/cellproperties.cxx @@ -22,7 +22,7 @@ namespace apitest void CellProperties::testVertJustify() { uno::Reference<beans::XPropertySet> xCellRangeBase(init(), UNO_QUERY_THROW); - OUString aVertJustify("VertJustify"); + OUString aVertJustify(u"VertJustify"_ustr); uno::Any aOldVertJustify = xCellRangeBase->getPropertyValue(aVertJustify); sal_Int32 aValue = 0; CPPUNIT_ASSERT(aOldVertJustify >>= aValue); @@ -40,7 +40,7 @@ void CellProperties::testVertJustify() void CellProperties::testRotateReference() { uno::Reference<beans::XPropertySet> xCellRangeBase(init(), UNO_QUERY_THROW); - OUString aRotateReference("RotateReference"); + OUString aRotateReference(u"RotateReference"_ustr); uno::Any aOldRotateReference = xCellRangeBase->getPropertyValue(aRotateReference); sal_Int32 aValue = 0; CPPUNIT_ASSERT(aOldRotateReference >>= aValue); diff --git a/test/source/sheet/databaseimportdescriptor.cxx b/test/source/sheet/databaseimportdescriptor.cxx index 132f88817f8d..ffcae42567a6 100644 --- a/test/source/sheet/databaseimportdescriptor.cxx +++ b/test/source/sheet/databaseimportdescriptor.cxx @@ -42,16 +42,16 @@ void DatabaseImportDescriptor::testDatabaseImportDescriptorProperties() aOldValue >>= aValue; OString aMsgGet = "Unable to get PropertyValue " + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgGet.getStr(), OUString(""), aValue); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgGet.getStr(), u""_ustr, aValue); - aNewValue <<= OUString("New"); + aNewValue <<= u"New"_ustr; rPropValue.Value = aNewValue; aOldValue = rPropValue.Value; aOldValue >>= aValue; OString aMsgSet = "Unable to set PropertyValue " + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgSet.getStr(), OUString("New"), aValue); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgSet.getStr(), u"New"_ustr, aValue); } else if (rPropValue.Name == "IsNative") { diff --git a/test/source/sheet/databaserange.cxx b/test/source/sheet/databaserange.cxx index 5bae62ce434e..ac7d6a38a5a8 100644 --- a/test/source/sheet/databaserange.cxx +++ b/test/source/sheet/databaserange.cxx @@ -24,7 +24,7 @@ namespace apitest { void DatabaseRange::testMoveCells() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"MoveCells"_ustr); @@ -41,7 +41,7 @@ void DatabaseRange::testMoveCells() void DatabaseRange::testKeepFormats() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"KeepFormats"_ustr); @@ -58,7 +58,7 @@ void DatabaseRange::testKeepFormats() void DatabaseRange::testStripData() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"StripData"_ustr); @@ -75,7 +75,7 @@ void DatabaseRange::testStripData() void DatabaseRange::testAutoFilter() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"AutoFilter"_ustr); @@ -92,7 +92,7 @@ void DatabaseRange::testAutoFilter() void DatabaseRange::testUseFilterCriteriaSource() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"UseFilterCriteriaSource"_ustr); @@ -111,7 +111,7 @@ void DatabaseRange::testUseFilterCriteriaSource() void DatabaseRange::testFilterCriteriaSource() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"FilterCriteriaSource"_ustr); @@ -130,7 +130,7 @@ void DatabaseRange::testFilterCriteriaSource() void DatabaseRange::testRefreshPeriod() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"RefreshPeriod"_ustr); @@ -149,7 +149,7 @@ void DatabaseRange::testRefreshPeriod() void DatabaseRange::testFromSelection() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"FromSelection"_ustr); @@ -166,7 +166,7 @@ void DatabaseRange::testFromSelection() void DatabaseRange::testTokenIndex() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"TokenIndex"_ustr); @@ -183,7 +183,7 @@ void DatabaseRange::testTokenIndex() void DatabaseRange::testTotalsRow() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"TotalsRow"_ustr); @@ -200,7 +200,7 @@ void DatabaseRange::testTotalsRow() void DatabaseRange::testContainsHeader() { - uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDatabaseRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); static constexpr OUString propName(u"ContainsHeader"_ustr); diff --git a/test/source/sheet/datapilotfield.cxx b/test/source/sheet/datapilotfield.cxx index 020f33680d3c..56e333a1385f 100644 --- a/test/source/sheet/datapilotfield.cxx +++ b/test/source/sheet/datapilotfield.cxx @@ -30,7 +30,7 @@ void DataPilotField::testSortInfo() { uno::Reference< beans::XPropertySet> xPropSet(init(),UNO_QUERY_THROW); sheet::DataPilotFieldSortInfo aSortInfoValue; - OUString aSortInfo("SortInfo"); + OUString aSortInfo(u"SortInfo"_ustr); aSortInfoValue.Field = "Col1"; aSortInfoValue.IsAscending = false; aSortInfoValue.Mode = sheet::DataPilotFieldSortMode::MANUAL; @@ -47,7 +47,7 @@ void DataPilotField::testSortInfo() //setting HasSortInfo only makes sense for false, for true the uno implementation does nothing bool bHasSortInfo(false); - OUString aHasSortInfo("HasSortInfo"); + OUString aHasSortInfo(u"HasSortInfo"_ustr); aValue = xPropSet->getPropertyValue(aHasSortInfo); CPPUNIT_ASSERT( aValue >>= bHasSortInfo ); CPPUNIT_ASSERT_MESSAGE("should have sort info", bHasSortInfo); @@ -65,7 +65,7 @@ void DataPilotField::testLayoutInfo() { uno::Reference< beans::XPropertySet > xPropSet(init(),UNO_QUERY_THROW); sheet::DataPilotFieldLayoutInfo aLayoutInfoValue; - OUString aLayoutInfo("LayoutInfo"); + OUString aLayoutInfo(u"LayoutInfo"_ustr); aLayoutInfoValue.AddEmptyLines = false; aLayoutInfoValue.LayoutMode = sheet::DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM; uno::Any aValue; @@ -80,7 +80,7 @@ void DataPilotField::testLayoutInfo() //setting HasLayoutInfo only makes sense for false, tor true the uno implementation does nothing bool bHasLayoutInfo(false); - OUString aHasLayoutInfo("HasLayoutInfo"); + OUString aHasLayoutInfo(u"HasLayoutInfo"_ustr); aValue = xPropSet->getPropertyValue(aHasLayoutInfo); CPPUNIT_ASSERT( aValue >>= bHasLayoutInfo ); CPPUNIT_ASSERT_MESSAGE("should have layout information", bHasLayoutInfo); @@ -100,7 +100,7 @@ void DataPilotField::testAutoShowInfo() sheet::DataPilotFieldAutoShowInfo aAutoShowInfoValue; aAutoShowInfoValue.DataField = "Col1"; aAutoShowInfoValue.IsEnabled = true; - OUString aAutoShowInfo("AutoShowInfo"); + OUString aAutoShowInfo(u"AutoShowInfo"_ustr); uno::Any aValue; aValue <<= aAutoShowInfoValue; xPropSet->setPropertyValue(aAutoShowInfo, aValue); @@ -113,7 +113,7 @@ void DataPilotField::testAutoShowInfo() //setting HasLayoutInfo only makes sense for false, tor true the uno implementation does nothing bool bHasAutoShowInfo(false); - OUString aHasAutoShowInfo("HasAutoShowInfo"); + OUString aHasAutoShowInfo(u"HasAutoShowInfo"_ustr); aValue = xPropSet->getPropertyValue(aHasAutoShowInfo); CPPUNIT_ASSERT( aValue >>= bHasAutoShowInfo ); CPPUNIT_ASSERT_MESSAGE("should have AutoShow information", bHasAutoShowInfo); @@ -133,7 +133,7 @@ void DataPilotField::testReference() sheet::DataPilotFieldReference aReferenceValue; aReferenceValue.ReferenceField = "Col1"; aReferenceValue.ReferenceItemType = sheet::DataPilotFieldReferenceItemType::NAMED; - OUString aReference("Reference"); + OUString aReference(u"Reference"_ustr); uno::Any aValue; aValue <<= aReferenceValue; xPropSet->setPropertyValue(aReference, aValue); @@ -146,7 +146,7 @@ void DataPilotField::testReference() //setting HasReference only makes sense for false, tor true the uno implementation does nothing bool bHasReference(false); - OUString aHasReference("HasReference"); + OUString aHasReference(u"HasReference"_ustr); aValue = xPropSet->getPropertyValue(aHasReference); CPPUNIT_ASSERT( aValue >>= bHasReference ); CPPUNIT_ASSERT_MESSAGE("should have Reference information", bHasReference); @@ -164,7 +164,7 @@ void DataPilotField::testIsGroupField() { uno::Reference< beans::XPropertySet > xPropSet(init(),UNO_QUERY_THROW); uno::Any aValue; - OUString aIsGroupField("IsGroupField"); + OUString aIsGroupField(u"IsGroupField"_ustr); bool bIsGroupField(false); aValue = xPropSet->getPropertyValue(aIsGroupField); diff --git a/test/source/sheet/datapilotitem.cxx b/test/source/sheet/datapilotitem.cxx index 7433097035d7..42e8f811021a 100644 --- a/test/source/sheet/datapilotitem.cxx +++ b/test/source/sheet/datapilotitem.cxx @@ -49,7 +49,7 @@ void DataPilotItem::testProperties() CPPUNIT_ASSERT_MESSAGE("Value of ShowDetail wasn't changed", bShowDetail); sal_Int32 nPosition = 42; - CPPUNIT_ASSERT(xItem->getPropertyValue("Position") >>= nPosition); + CPPUNIT_ASSERT(xItem->getPropertyValue(u"Position"_ustr) >>= nPosition); CPPUNIT_ASSERT_EQUAL_MESSAGE("Default Position already changed", sal_Int32(0), nPosition); // FIXME: This throws somehow a com.sun.star.lang.IllegalArgumentException diff --git a/test/source/sheet/globalsheetsettings.cxx b/test/source/sheet/globalsheetsettings.cxx index 40d01fe45d42..977329cfde7d 100644 --- a/test/source/sheet/globalsheetsettings.cxx +++ b/test/source/sheet/globalsheetsettings.cxx @@ -38,14 +38,14 @@ void GlobalSheetSettings::testGlobalSheetSettingsProperties() css::uno::Any aOrigValue(origValue), aNewValue(newValue); css::uno::Sequence<css::uno::Any> args{ css::uno::Any( - css::beans::NamedValue("nodepath", css::uno::Any(regNodeName))) }; + css::beans::NamedValue(u"nodepath"_ustr, css::uno::Any(regNodeName))) }; css::uno::Reference<beans::XPropertySet> xRegNodeRO( configProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", args), + u"com.sun.star.configuration.ConfigurationAccess"_ustr, args), css::uno::UNO_QUERY_THROW); css::uno::Reference<beans::XPropertySet> xRegNodeRW( configProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationUpdateAccess", args), + u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr, args), css::uno::UNO_QUERY_THROW); css::uno::Reference<css::util::XChangesBatch> xBatch(xRegNodeRW, css::uno::UNO_QUERY_THROW); @@ -71,29 +71,31 @@ void GlobalSheetSettings::testGlobalSheetSettingsProperties() xGlobalSheetSettings->getPropertyValue(propName)); }; - OUString node = "/org.openoffice.Office.Calc/Input"; - DoCheck("MoveSelection", true, false, node, "MoveSelection"); - DoCheck("MoveDirection", sal_Int16(0), sal_Int16(1), node, "MoveSelectionDirection"); - DoCheck("EnterEdit", false, true, node, "SwitchToEditMode"); - DoCheck("ExtendFormat", false, true, node, "ExpandFormatting"); - DoCheck("RangeFinder", true, false, node, "ShowReference"); - DoCheck("ExpandReferences", false, true, node, "ExpandReference"); - DoCheck("MarkHeader", true, false, node, "HighlightSelection"); - DoCheck("UseTabCol", false, true, node, "UseTabCol"); - DoCheck("ReplaceCellsWarning", true, false, node, "ReplaceCellsWarning"); + OUString node = u"/org.openoffice.Office.Calc/Input"_ustr; + DoCheck(u"MoveSelection"_ustr, true, false, node, u"MoveSelection"_ustr); + DoCheck(u"MoveDirection"_ustr, sal_Int16(0), sal_Int16(1), node, + u"MoveSelectionDirection"_ustr); + DoCheck(u"EnterEdit"_ustr, false, true, node, u"SwitchToEditMode"_ustr); + DoCheck(u"ExtendFormat"_ustr, false, true, node, u"ExpandFormatting"_ustr); + DoCheck(u"RangeFinder"_ustr, true, false, node, u"ShowReference"_ustr); + DoCheck(u"ExpandReferences"_ustr, false, true, node, u"ExpandReference"_ustr); + DoCheck(u"MarkHeader"_ustr, true, false, node, u"HighlightSelection"_ustr); + DoCheck(u"UseTabCol"_ustr, false, true, node, u"UseTabCol"_ustr); + DoCheck(u"ReplaceCellsWarning"_ustr, true, false, node, u"ReplaceCellsWarning"_ustr); node = "/org.openoffice.Office.Calc/Layout/Other/MeasureUnit"; - DoCheck("Metric", sal_Int16(8), sal_Int16(1), node, "NonMetric"); // Test uses en-US locale + DoCheck(u"Metric"_ustr, sal_Int16(8), sal_Int16(1), node, + u"NonMetric"_ustr); // Test uses en-US locale node = "/org.openoffice.Office.Calc/Input"; - DoCheck("DoAutoComplete", true, false, node, "AutoInput"); + DoCheck(u"DoAutoComplete"_ustr, true, false, node, u"AutoInput"_ustr); node = "/org.openoffice.Office.Calc/Content/Update"; - DoCheck("LinkUpdateMode", sal_Int16(2), sal_Int16(1), node, "Link"); + DoCheck(u"LinkUpdateMode"_ustr, sal_Int16(2), sal_Int16(1), node, u"Link"_ustr); node = "/org.openoffice.Office.Calc/Print/"; - DoCheck("PrintAllSheets", false, true, node + "Other", "AllSheets"); - DoCheck("PrintEmptyPages", false, true, node + "Page", "EmptyPages"); + DoCheck(u"PrintAllSheets"_ustr, false, true, node + "Other", u"AllSheets"_ustr); + DoCheck(u"PrintEmptyPages"_ustr, false, true, node + "Page", u"EmptyPages"_ustr); OUString propName; uno::Any aNewValue; @@ -122,12 +124,12 @@ void GlobalSheetSettings::testGlobalSheetSettingsProperties() propName = "UserLists"; uno::Sequence<OUString> aSeq{ - "Sun,Mon,Tue,Wed,Thu,Fri,Sat", - "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday", - "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", - "January,February,March,April,May,June,July,August,September,October,November,December", - "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Shabbat", - "Nissan,Iyar,Sivan,Tammuz,Av,Elul,Tishri,Heshvan,Kislev,Tevet,Shevat,Adar,Adar B" + u"Sun,Mon,Tue,Wed,Thu,Fri,Sat"_ustr, + u"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"_ustr, + u"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"_ustr, + u"January,February,March,April,May,June,July,August,September,October,November,December"_ustr, + u"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Shabbat"_ustr, + u"Nissan,Iyar,Sivan,Tammuz,Av,Elul,Tishri,Heshvan,Kislev,Tevet,Shevat,Adar,Adar B"_ustr }; uno::Sequence<OUString> aUserLists; diff --git a/test/source/sheet/shape.cxx b/test/source/sheet/shape.cxx index ab2abec6e8e2..a14d2b84d425 100644 --- a/test/source/sheet/shape.cxx +++ b/test/source/sheet/shape.cxx @@ -39,44 +39,44 @@ void Shape::testShapePropertiesAnchor() // Shape should be anchored to sheet by default uno::Reference<sheet::XSpreadsheet> xSheetGet; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Anchor (XSpreadsheet)", - xShape->getPropertyValue("Anchor") >>= xSheetGet); + xShape->getPropertyValue(u"Anchor"_ustr) >>= xSheetGet); // Anchor the shape to a cell aNewValue <<= xCell; - xShape->setPropertyValue("Anchor", aNewValue); + xShape->setPropertyValue(u"Anchor"_ustr, aNewValue); uno::Reference<table::XCell> xCellGet; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Anchor (XCell)", - xShape->getPropertyValue("Anchor") >>= xCellGet); + xShape->getPropertyValue(u"Anchor"_ustr) >>= xCellGet); // Shape should not resize with cell by default bool bIsResizeWithCell = {}; - CPPUNIT_ASSERT(xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ResizeWithCell"_ustr) >>= bIsResizeWithCell); CPPUNIT_ASSERT_MESSAGE("Shape should not resize with the cell", !bIsResizeWithCell); - xShape->setPropertyValue("ResizeWithCell", uno::Any(true)); - CPPUNIT_ASSERT(xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell); + xShape->setPropertyValue(u"ResizeWithCell"_ustr, uno::Any(true)); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ResizeWithCell"_ustr) >>= bIsResizeWithCell); CPPUNIT_ASSERT_MESSAGE("Shape should resize with the cell", bIsResizeWithCell); // Anchoring to a different cell should keep the "ResizeWithCell" attribute uno::Reference<table::XCell> xCell2(xSheet->getCellByPosition(1, 2), UNO_SET_THROW); aNewValue <<= xCell2; - xShape->setPropertyValue("Anchor", aNewValue); - CPPUNIT_ASSERT(xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell); + xShape->setPropertyValue(u"Anchor"_ustr, aNewValue); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ResizeWithCell"_ustr) >>= bIsResizeWithCell); CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should still be set", bIsResizeWithCell); // Now anchor to sheet again aNewValue <<= xSheet; - xShape->setPropertyValue("Anchor", aNewValue); - CPPUNIT_ASSERT(xShape->getPropertyValue("Anchor") >>= xSheetGet); + xShape->setPropertyValue(u"Anchor"_ustr, aNewValue); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"Anchor"_ustr) >>= xSheetGet); CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Anchor (XSpreadsheet)", - xShape->getPropertyValue("Anchor") >>= xSheetGet); + xShape->getPropertyValue(u"Anchor"_ustr) >>= xSheetGet); // Setting ResizeWithCell while anchored to page should not have any effect - CPPUNIT_ASSERT(xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ResizeWithCell"_ustr) >>= bIsResizeWithCell); CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should be false for sheet anchored shapes", !bIsResizeWithCell); - xShape->setPropertyValue("ResizeWithCell", uno::Any(true)); - CPPUNIT_ASSERT(xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell); + xShape->setPropertyValue(u"ResizeWithCell"_ustr, uno::Any(true)); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ResizeWithCell"_ustr) >>= bIsResizeWithCell); CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should be unchangeable for sheet anchored shapes", !bIsResizeWithCell); } @@ -89,24 +89,24 @@ void Shape::testShapePropertiesPosition() sal_Int32 nHoriOrientPositionGet = 0; sal_Int32 nHoriOrientPositionSet = 0; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue HoriOrientPosition", - xShape->getPropertyValue("HoriOrientPosition") + xShape->getPropertyValue(u"HoriOrientPosition"_ustr) >>= nHoriOrientPositionGet); aNewValue <<= nHoriOrientPositionGet + 42; - xShape->setPropertyValue("HoriOrientPosition", aNewValue); - CPPUNIT_ASSERT(xShape->getPropertyValue("HoriOrientPosition") >>= nHoriOrientPositionSet); + xShape->setPropertyValue(u"HoriOrientPosition"_ustr, aNewValue); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"HoriOrientPosition"_ustr) >>= nHoriOrientPositionSet); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue HoriOrientPosition", nHoriOrientPositionGet + 42, nHoriOrientPositionSet); sal_Int32 nVertOrientPositionGet = 0; sal_Int32 nVertOrientPositionSet = 0; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue VertOrientPosition", - xShape->getPropertyValue("VertOrientPosition") + xShape->getPropertyValue(u"VertOrientPosition"_ustr) >>= nVertOrientPositionGet); aNewValue <<= nVertOrientPositionGet + 42; - xShape->setPropertyValue("VertOrientPosition", aNewValue); - CPPUNIT_ASSERT(xShape->getPropertyValue("VertOrientPosition") >>= nVertOrientPositionSet); + xShape->setPropertyValue(u"VertOrientPosition"_ustr, aNewValue); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"VertOrientPosition"_ustr) >>= nVertOrientPositionSet); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue VertOrientPosition", nVertOrientPositionGet + 42, nVertOrientPositionSet); } diff --git a/test/source/sheet/sheetcell.cxx b/test/source/sheet/sheetcell.cxx index d0a2c6c032bd..ef2f2b2aca90 100644 --- a/test/source/sheet/sheetcell.cxx +++ b/test/source/sheet/sheetcell.cxx @@ -58,15 +58,15 @@ void SheetCell::testSheetCellProperties() CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue Size", aSizeGet, aSizeSet); propName = "FormulaLocal"; - OUString aFormulaLocal = ""; + OUString aFormulaLocal = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FormulaLocal", xSheetCell->getPropertyValue(propName) >>= aFormulaLocal); - aNewValue <<= OUString("FormulaLocal"); + aNewValue <<= u"FormulaLocal"_ustr; xSheetCell->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aFormulaLocal); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FormulaLocal", - OUString("FormulaLocal"), aFormulaLocal); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FormulaLocal", u"FormulaLocal"_ustr, + aFormulaLocal); propName = "CellContentType"; table::CellContentType aCellContentTypeGet; @@ -106,7 +106,7 @@ void SheetCell::testSheetCellProperties() aFormulaResultType2Get, aFormulaResultType2Set); uno::Sequence<beans::PropertyValue> aPropValue{ comphelper::makePropertyValue( - "StyleName", OUString("Result2")) }; + u"StyleName"_ustr, u"Result2"_ustr) }; propName = "ConditionalFormat"; uno::Reference<sheet::XSheetConditionalEntries> aConditionalFormatGet; @@ -170,13 +170,13 @@ void SheetCell::testSheetCellProperties() uno::Reference<beans::XPropertySet> aValidationNew(aValidationGet, UNO_SET_THROW); uno::Any aValidationType; aValidationType <<= sheet::ValidationType_WHOLE; - aValidationNew->setPropertyValue("Type", aValidationType); + aValidationNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationNew; xSheetCell->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aValidationSet); sheet::ValidationType aType; - aValidationSet->getPropertyValue("Type") >>= aType; + aValidationSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Validation", sheet::ValidationType_WHOLE, aType); @@ -189,21 +189,21 @@ void SheetCell::testSheetCellProperties() uno::Reference<beans::XPropertySet> aValidationLocalNew(aValidationLocalGet, UNO_SET_THROW); aValidationType <<= sheet::ValidationType_WHOLE; - aValidationLocalNew->setPropertyValue("Type", aValidationType); + aValidationLocalNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationLocalNew; xSheetCell->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aValidationLocalSet); - aValidationLocalSet->getPropertyValue("Type") >>= aType; + aValidationLocalSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue ValidationLocal", sheet::ValidationType_WHOLE, aType); propName = "AbsoluteName"; - OUString aAbsoluteNameGet = ""; + OUString aAbsoluteNameGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue AbsoluteName", xSheetCell->getPropertyValue(propName) >>= aAbsoluteNameGet); - OUString aAbsoluteNameSet = "$Sheet1.$C$3"; + OUString aAbsoluteNameSet = u"$Sheet1.$C$3"_ustr; aNewValue <<= aAbsoluteNameSet; xSheetCell->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aAbsoluteNameSet); diff --git a/test/source/sheet/sheetcellrange.cxx b/test/source/sheet/sheetcellrange.cxx index bf56849360c0..36ca172c5dce 100644 --- a/test/source/sheet/sheetcellrange.cxx +++ b/test/source/sheet/sheetcellrange.cxx @@ -57,7 +57,7 @@ void SheetCellRange::testSheetCellRangeProperties() CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue Size", aSizeGet, aSizeSet); uno::Sequence<beans::PropertyValue> aPropValue{ comphelper::makePropertyValue( - "StyleName", OUString("Result2")) }; + u"StyleName"_ustr, u"Result2"_ustr) }; propName = "ConditionalFormat"; uno::Reference<sheet::XSheetConditionalEntries> aConditionalFormatGet; @@ -122,13 +122,13 @@ void SheetCellRange::testSheetCellRangeProperties() uno::Reference<beans::XPropertySet> aValidationNew(aValidationGet, UNO_SET_THROW); uno::Any aValidationType; aValidationType <<= sheet::ValidationType_WHOLE; - aValidationNew->setPropertyValue("Type", aValidationType); + aValidationNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationNew; xSheetCellRange->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRange->getPropertyValue(propName) >>= aValidationSet); sheet::ValidationType aType; - aValidationSet->getPropertyValue("Type") >>= aType; + aValidationSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Validation", sheet::ValidationType_WHOLE, aType); @@ -141,21 +141,21 @@ void SheetCellRange::testSheetCellRangeProperties() uno::Reference<beans::XPropertySet> aValidationLocalNew(aValidationLocalGet, UNO_SET_THROW); aValidationType <<= sheet::ValidationType_WHOLE; - aValidationLocalNew->setPropertyValue("Type", aValidationType); + aValidationLocalNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationLocalNew; xSheetCellRange->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRange->getPropertyValue(propName) >>= aValidationLocalSet); - aValidationLocalSet->getPropertyValue("Type") >>= aType; + aValidationLocalSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue ValidationLocal", sheet::ValidationType_WHOLE, aType); propName = "AbsoluteName"; - OUString aAbsoluteNameGet = ""; + OUString aAbsoluteNameGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue AbsoluteName", xSheetCellRange->getPropertyValue(propName) >>= aAbsoluteNameGet); - OUString aAbsoluteNameSet = "$Sheet1.$C$3"; + OUString aAbsoluteNameSet = u"$Sheet1.$C$3"_ustr; aNewValue <<= aAbsoluteNameSet; xSheetCellRange->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRange->getPropertyValue(propName) >>= aAbsoluteNameSet); diff --git a/test/source/sheet/sheetcellranges.cxx b/test/source/sheet/sheetcellranges.cxx index 9611a33bd5a3..223eee7ac700 100644 --- a/test/source/sheet/sheetcellranges.cxx +++ b/test/source/sheet/sheetcellranges.cxx @@ -32,7 +32,7 @@ void SheetCellRanges::testSheetCellRangesProperties() uno::Any aNewValue; uno::Sequence<beans::PropertyValue> aPropValue{ comphelper::makePropertyValue( - "StyleName", OUString("Result2")) }; + u"StyleName"_ustr, u"Result2"_ustr) }; propName = "ConditionalFormat"; uno::Reference<sheet::XSheetConditionalEntries> aConditionalFormatGet; @@ -97,13 +97,13 @@ void SheetCellRanges::testSheetCellRangesProperties() uno::Reference<beans::XPropertySet> aValidationNew(aValidationGet, UNO_SET_THROW); uno::Any aValidationType; aValidationType <<= sheet::ValidationType_WHOLE; - aValidationNew->setPropertyValue("Type", aValidationType); + aValidationNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationNew; xSheetCellRanges->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRanges->getPropertyValue(propName) >>= aValidationSet); sheet::ValidationType aType; - aValidationSet->getPropertyValue("Type") >>= aType; + aValidationSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Validation", sheet::ValidationType_WHOLE, aType); @@ -116,21 +116,21 @@ void SheetCellRanges::testSheetCellRangesProperties() uno::Reference<beans::XPropertySet> aValidationLocalNew(aValidationLocalGet, UNO_SET_THROW); aValidationType <<= sheet::ValidationType_WHOLE; - aValidationLocalNew->setPropertyValue("Type", aValidationType); + aValidationLocalNew->setPropertyValue(u"Type"_ustr, aValidationType); aNewValue <<= aValidationLocalNew; xSheetCellRanges->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRanges->getPropertyValue(propName) >>= aValidationLocalSet); - aValidationLocalSet->getPropertyValue("Type") >>= aType; + aValidationLocalSet->getPropertyValue(u"Type"_ustr) >>= aType; CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue ValidationLocal", sheet::ValidationType_WHOLE, aType); propName = "AbsoluteName"; - OUString aAbsoluteNameGet = ""; + OUString aAbsoluteNameGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue AbsoluteName", xSheetCellRanges->getPropertyValue(propName) >>= aAbsoluteNameGet); - OUString aAbsoluteNameSet = "$Sheet1.$C$3"; + OUString aAbsoluteNameSet = u"$Sheet1.$C$3"_ustr; aNewValue <<= aAbsoluteNameSet; xSheetCellRanges->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetCellRanges->getPropertyValue(propName) >>= aAbsoluteNameSet); diff --git a/test/source/sheet/sheetlink.cxx b/test/source/sheet/sheetlink.cxx index de6a2148e9d6..5db5dedef5b8 100644 --- a/test/source/sheet/sheetlink.cxx +++ b/test/source/sheet/sheetlink.cxx @@ -32,11 +32,11 @@ void SheetLink::testSheetLinkProperties() CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Url", xSheetLink->getPropertyValue(propName) >>= aUrlGet); - aNewValue <<= OUString("file:///tmp/ScSheetLinkObj.ods"); + aNewValue <<= u"file:///tmp/ScSheetLinkObj.ods"_ustr; xSheetLink->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetLink->getPropertyValue(propName) >>= aUrlSet); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Url", - OUString("file:///tmp/ScSheetLinkObj.ods"), aUrlSet); + u"file:///tmp/ScSheetLinkObj.ods"_ustr, aUrlSet); propName = "Filter"; OUString aFilterGet; @@ -44,11 +44,11 @@ void SheetLink::testSheetLinkProperties() CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Filter", xSheetLink->getPropertyValue(propName) >>= aFilterGet); - aNewValue <<= OUString("Text - txt - csv (StarCalc)"); + aNewValue <<= u"Text - txt - csv (StarCalc)"_ustr; xSheetLink->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetLink->getPropertyValue(propName) >>= aFilterSet); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Filter", - OUString("Text - txt - csv (StarCalc)"), aFilterSet); + u"Text - txt - csv (StarCalc)"_ustr, aFilterSet); propName = "FilterOptions"; OUString aFilterOptionsGet; @@ -56,10 +56,10 @@ void SheetLink::testSheetLinkProperties() CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FilterOptions", xSheetLink->getPropertyValue(propName) >>= aFilterOptionsGet); - aNewValue <<= OUString("NewValue"); + aNewValue <<= u"NewValue"_ustr; xSheetLink->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSheetLink->getPropertyValue(propName) >>= aFilterOptionsSet); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FilterOptions", OUString("NewValue"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FilterOptions", u"NewValue"_ustr, aFilterOptionsSet); } } diff --git a/test/source/sheet/spreadsheet.cxx b/test/source/sheet/spreadsheet.cxx index 8e2ca12cf867..fa785973d148 100644 --- a/test/source/sheet/spreadsheet.cxx +++ b/test/source/sheet/spreadsheet.cxx @@ -39,7 +39,7 @@ void Spreadsheet::testSpreadsheetProperties() testBooleanProperty(xSpreadsheet, propName); propName = "PageStyle"; - testStringProperty(xSpreadsheet, propName, "Report"); + testStringProperty(xSpreadsheet, propName, u"Report"_ustr); propName = "TableLayout"; testShortProperty(xSpreadsheet, propName, text::WritingMode2::RL_TB); @@ -71,12 +71,12 @@ void Spreadsheet::testSpreadsheetProperties() uno::Reference<lang::XMultiServiceFactory> xMSF(xDoc, UNO_QUERY_THROW); uno::Reference<container::XNameContainer> xRanges( - xMSF->createInstance("com.sun.star.sheet.SheetCellRanges"), UNO_QUERY_THROW); + xMSF->createInstance(u"com.sun.star.sheet.SheetCellRanges"_ustr), UNO_QUERY_THROW); uno::Reference<sheet::XSheetCellRanges> xSheetCellRanges(xRanges, UNO_QUERY_THROW); uno::Any xCellRange; - xCellRange <<= xSheet->getCellRangeByName("C1:D4"); - xRanges->insertByName("Range1", xCellRange); + xCellRange <<= xSheet->getCellRangeByName(u"C1:D4"_ustr); + xRanges->insertByName(u"Range1"_ustr, xCellRange); xConditionalFormatsGet->createByRange(xSheetCellRanges); aNewValue <<= xConditionalFormatsGet; diff --git a/test/source/sheet/tablevalidation.cxx b/test/source/sheet/tablevalidation.cxx index 3069c6c06553..836cbc53538a 100644 --- a/test/source/sheet/tablevalidation.cxx +++ b/test/source/sheet/tablevalidation.cxx @@ -56,27 +56,26 @@ void TableValidation::testTableValidationProperties() propName = "InputMessage"; OUString aInputMessage; CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aInputMessage); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputMessage", OUString(""), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputMessage", u""_ustr, aInputMessage); - aNewValue <<= OUString("UnitTest InputMessage"); + aNewValue <<= u"UnitTest InputMessage"_ustr; xTableValidation->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aInputMessage); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputMessage", - OUString("UnitTest InputMessage"), aInputMessage); + u"UnitTest InputMessage"_ustr, aInputMessage); // only possible if ShowInputMessage is true propName = "InputTitle"; OUString aInputTitle; CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aInputTitle); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputTitle", OUString(""), - aInputTitle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputTitle", u""_ustr, aInputTitle); - aNewValue <<= OUString("UnitTest InputTitle"); + aNewValue <<= u"UnitTest InputTitle"_ustr; xTableValidation->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aInputTitle); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value InputTitle", - OUString("UnitTest InputTitle"), aInputTitle); + u"UnitTest InputTitle"_ustr, aInputTitle); propName = "ShowErrorMessage"; bool aShowErrorMessage = true; @@ -92,27 +91,26 @@ void TableValidation::testTableValidationProperties() propName = "ErrorMessage"; OUString aErrorMessage; CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aErrorMessage); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorMessage", OUString(""), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorMessage", u""_ustr, aErrorMessage); - aNewValue <<= OUString("UnitTest ErrorMessage"); + aNewValue <<= u"UnitTest ErrorMessage"_ustr; xTableValidation->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aErrorMessage); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorMessage", - OUString("UnitTest ErrorMessage"), aErrorMessage); + u"UnitTest ErrorMessage"_ustr, aErrorMessage); // only possible if ShowErrorMessage is true propName = "ErrorTitle"; OUString aErrorTitle; CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aErrorTitle); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorTitle", OUString(""), - aErrorTitle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorTitle", u""_ustr, aErrorTitle); - aNewValue <<= OUString("UnitTest ErrorTitle"); + aNewValue <<= u"UnitTest ErrorTitle"_ustr; xTableValidation->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xTableValidation->getPropertyValue(propName) >>= aErrorTitle); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get property value ErrorTitle", - OUString("UnitTest ErrorTitle"), aErrorTitle); + u"UnitTest ErrorTitle"_ustr, aErrorTitle); propName = "IgnoreBlankCells"; bool aIgnoreBlankCells = false; diff --git a/test/source/sheet/xarealink.cxx b/test/source/sheet/xarealink.cxx index 77e9cb98b867..1c1bcfc88830 100644 --- a/test/source/sheet/xarealink.cxx +++ b/test/source/sheet/xarealink.cxx @@ -39,9 +39,9 @@ void XAreaLink::testSetSourceArea() { uno::Reference< sheet::XAreaLink > xAreaLink(init(), UNO_QUERY_THROW); - xAreaLink->setSourceArea("Sheet1.A1:B1"); + xAreaLink->setSourceArea(u"Sheet1.A1:B1"_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Couldn't set new source area", - OUString("Sheet1.A1:B1"), xAreaLink->getSourceArea()); + u"Sheet1.A1:B1"_ustr, xAreaLink->getSourceArea()); } void XAreaLink::testGetDestArea() @@ -57,7 +57,7 @@ void XAreaLink::testGetSourceArea() uno::Reference< sheet::XAreaLink > xAreaLink(init(), UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("Couldn't get source area", - OUString("a2:b5"), xAreaLink->getSourceArea()); + u"a2:b5"_ustr, xAreaLink->getSourceArea()); } } diff --git a/test/source/sheet/xarealinks.cxx b/test/source/sheet/xarealinks.cxx index f52dcc35b1da..3efc69081538 100644 --- a/test/source/sheet/xarealinks.cxx +++ b/test/source/sheet/xarealinks.cxx @@ -25,7 +25,7 @@ void XAreaLinks::testInsertAtPosition() uno::Reference< sheet::XAreaLinks > xAreaLinks(init(), UNO_QUERY_THROW); table::CellAddress aCellAddress(1, 2, 3); - xAreaLinks->insertAtPosition(aCellAddress, "", "a2:b5", "", ""); + xAreaLinks->insertAtPosition(aCellAddress, u""_ustr, u"a2:b5"_ustr, u""_ustr, u""_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to insert new CellAddress", sal_Int32(1), xAreaLinks->getCount()); @@ -36,7 +36,7 @@ void XAreaLinks::testRemoveByIndex() uno::Reference< sheet::XAreaLinks > xAreaLinks(init(), UNO_QUERY_THROW); table::CellAddress aCellAddress(1, 2, 3); - xAreaLinks->insertAtPosition(aCellAddress, "", "a2:b5", "", ""); + xAreaLinks->insertAtPosition(aCellAddress, u""_ustr, u"a2:b5"_ustr, u""_ustr, u""_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to insert CellAddress for removal", sal_Int32(1), xAreaLinks->getCount()); diff --git a/test/source/sheet/xcellrangeformula.cxx b/test/source/sheet/xcellrangeformula.cxx index ce7fc54eb620..9cfe72ba3f3d 100644 --- a/test/source/sheet/xcellrangeformula.cxx +++ b/test/source/sheet/xcellrangeformula.cxx @@ -29,7 +29,7 @@ void XCellRangeFormula::testGetSetFormulaArray() aFormulaArrayNew.getArray()[0].getArray()[0] = "NewValue"; xCRF->setFormulaArray(aFormulaArrayNew); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get new FormulaArray", OUString("NewValue"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get new FormulaArray", u"NewValue"_ustr, xCRF->getFormulaArray()[0][0]); xCRF->setFormulaArray(aFormulaArrayOriginal); diff --git a/test/source/sheet/xcellrangesquery.cxx b/test/source/sheet/xcellrangesquery.cxx index 55d24224ab7a..e754aae19d3c 100644 --- a/test/source/sheet/xcellrangesquery.cxx +++ b/test/source/sheet/xcellrangesquery.cxx @@ -28,7 +28,7 @@ void XCellRangesQuery::testQueryColumnDifference() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryColumnDifferences(table::CellAddress(0, 1, 1)); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryColumnDifference: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryColumnDifference", OUString( "Sheet1.B1:C1,Sheet1.B3:C5" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryColumnDifference", u"Sheet1.B1:C1,Sheet1.B3:C5"_ustr, aResult); } void XCellRangesQuery::testQueryContentDifference() @@ -37,7 +37,7 @@ void XCellRangesQuery::testQueryContentDifference() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryContentCells(sheet::CellFlags::VALUE); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryContentDifference: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryContentDifference", OUString( "Sheet1.B3,Sheet1.C2" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryContentDifference", u"Sheet1.B3,Sheet1.C2"_ustr, aResult); } void XCellRangesQuery::testQueryEmptyCells() @@ -46,7 +46,7 @@ void XCellRangesQuery::testQueryEmptyCells() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryEmptyCells(); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryEmptyCells: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryEmptyCells", OUString( "Sheet1.A1:A5,Sheet1.B1:C1,Sheet1.B5,Sheet1.C3:C5,Sheet1.D1:E5" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryEmptyCells", u"Sheet1.A1:A5,Sheet1.B1:C1,Sheet1.B5,Sheet1.C3:C5,Sheet1.D1:E5"_ustr, aResult); } void XCellRangesQuery::testQueryFormulaCells() @@ -55,7 +55,7 @@ void XCellRangesQuery::testQueryFormulaCells() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryFormulaCells(sheet::CellFlags::FORMULA); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryFormulaCells: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryFormulaCells", OUString( "Sheet1.B2" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryFormulaCells", u"Sheet1.B2"_ustr, aResult); } void XCellRangesQuery::testQueryIntersection() @@ -64,7 +64,7 @@ void XCellRangesQuery::testQueryIntersection() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryIntersection(table::CellRangeAddress(0,3,3,7,7)); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryIntersection: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryIntersection", OUString( "Sheet1.D4:E5" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryIntersection", u"Sheet1.D4:E5"_ustr, aResult); } void XCellRangesQuery::testQueryRowDifference() @@ -73,7 +73,7 @@ void XCellRangesQuery::testQueryRowDifference() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryRowDifferences(table::CellAddress(0,1,1)); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryRowDifference: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryRowDifference", OUString( "Sheet1.A2:A4,Sheet1.C2:E4" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryRowDifference", u"Sheet1.A2:A4,Sheet1.C2:E4"_ustr, aResult); } void XCellRangesQuery::testQueryVisibleCells() @@ -82,7 +82,7 @@ void XCellRangesQuery::testQueryVisibleCells() uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryVisibleCells(); OUString aResult = xRanges->getRangeAddressesAsString(); std::cout << "testQueryVisibleCells: Result: " << aResult << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryVisibleCells", OUString( "Sheet1.A1:E5" ), aResult); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testQueryVisibleCells", u"Sheet1.A1:E5"_ustr, aResult); } } diff --git a/test/source/sheet/xcellseries.cxx b/test/source/sheet/xcellseries.cxx index 3aff084f8e7c..cb53acfb65e6 100644 --- a/test/source/sheet/xcellseries.cxx +++ b/test/source/sheet/xcellseries.cxx @@ -46,9 +46,9 @@ void XCellSeries::testFillAuto() for(sal_Int32 i = 1; i < 3; i++) { uno::Reference<table::XCell> xCellResultH(xCellRange->getCellByPosition(maStartX + i, maStartY), UNO_SET_THROW); - xCellResultH->setFormula(""); + xCellResultH->setFormula(u""_ustr); uno::Reference<table::XCell> xCellResultV(xCellRange->getCellByPosition(maStartX, maStartY + i), UNO_SET_THROW); - xCellResultV->setFormula(""); + xCellResultV->setFormula(u""_ustr); } } @@ -103,9 +103,9 @@ void XCellSeries::testFillSeries() for(sal_Int32 i = 1; i < 3; i++) { uno::Reference<table::XCell> xCellResultH(xCellRange->getCellByPosition(maStartX + i, maStartY), UNO_SET_THROW); - xCellResultH->setFormula(""); + xCellResultH->setFormula(u""_ustr); uno::Reference<table::XCell> xCellResultV(xCellRange->getCellByPosition(maStartX, maStartY + i), UNO_SET_THROW); - xCellResultV->setFormula(""); + xCellResultV->setFormula(u""_ustr); } } diff --git a/test/source/sheet/xdatabaserange.cxx b/test/source/sheet/xdatabaserange.cxx index 9f0828a30513..7e23f01f50a8 100644 --- a/test/source/sheet/xdatabaserange.cxx +++ b/test/source/sheet/xdatabaserange.cxx @@ -33,7 +33,7 @@ namespace apitest */ void XDatabaseRange::testDataArea() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("DataArea"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"DataArea"_ustr), UNO_QUERY_THROW); table::CellRangeAddress aCellAddress; aCellAddress.Sheet = 0; @@ -52,14 +52,15 @@ void XDatabaseRange::testDataArea() void XDatabaseRange::testGetSubtotalDescriptor() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("SubtotalDescriptor"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"SubtotalDescriptor"_ustr), + UNO_QUERY_THROW); uno::Reference<sheet::XSubTotalDescriptor> xSubtotalDescr = xDBRange->getSubTotalDescriptor(); CPPUNIT_ASSERT(xSubtotalDescr.is()); } void XDatabaseRange::testGetSortDescriptor() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("SortDescriptor"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"SortDescriptor"_ustr), UNO_QUERY_THROW); const uno::Sequence<beans::PropertyValue> xSortDescr = xDBRange->getSortDescriptor(); for (const beans::PropertyValue& aProp : xSortDescr) { @@ -118,22 +119,22 @@ void XDatabaseRange::testGetSortDescriptor() void XDatabaseRange::testGetFilterDescriptor() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("FilterDescriptor"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"FilterDescriptor"_ustr), UNO_QUERY_THROW); uno::Reference<uno::XInterface> xFilterDescr(xDBRange->getFilterDescriptor(), UNO_QUERY_THROW); } void XDatabaseRange::testGetImportDescriptor() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("ImportDescriptor"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"ImportDescriptor"_ustr), UNO_QUERY_THROW); (void)xDBRange->getImportDescriptor(); } void XDatabaseRange::testRefresh() { - uno::Reference<sheet::XDatabaseRange> xDBRange(init("Refresh"), UNO_QUERY_THROW); + uno::Reference<sheet::XDatabaseRange> xDBRange(init(u"Refresh"_ustr), UNO_QUERY_THROW); const sal_Int32 nCol = 0; - OUString aHidden("IsVisible"); + OUString aHidden(u"IsVisible"_ustr); uno::Reference<sheet::XCellRangeReferrer> xCellRangeReferrer(xDBRange, UNO_QUERY_THROW); uno::Reference<table::XCellRange> xCellRange = xCellRangeReferrer->getReferredCells(); diff --git a/test/source/sheet/xdatabaseranges.cxx b/test/source/sheet/xdatabaseranges.cxx index 650a0faa3943..aeda9110c5a8 100644 --- a/test/source/sheet/xdatabaseranges.cxx +++ b/test/source/sheet/xdatabaseranges.cxx @@ -25,19 +25,19 @@ void XDatabaseRanges::testAddRemoveDbRanges() { uno::Reference<sheet::XDatabaseRanges> xDbRanges(init(), UNO_QUERY_THROW); - xDbRanges->addNewByName("addNewRange", table::CellRangeAddress(0, 1, 2, 3, 4)); - CPPUNIT_ASSERT_MESSAGE("Unable to add new db range", xDbRanges->hasByName("addNewRange")); + xDbRanges->addNewByName(u"addNewRange"_ustr, table::CellRangeAddress(0, 1, 2, 3, 4)); + CPPUNIT_ASSERT_MESSAGE("Unable to add new db range", xDbRanges->hasByName(u"addNewRange"_ustr)); CPPUNIT_ASSERT_THROW_MESSAGE( "No exception thrown, when adding range with existing name", - xDbRanges->addNewByName("addNewRange", table::CellRangeAddress(0, 1, 2, 3, 4)), + xDbRanges->addNewByName(u"addNewRange"_ustr, table::CellRangeAddress(0, 1, 2, 3, 4)), css::uno::RuntimeException); - xDbRanges->removeByName("addNewRange"); - CPPUNIT_ASSERT_MESSAGE("Unable to remove db range", !xDbRanges->hasByName("addNewRange")); + xDbRanges->removeByName(u"addNewRange"_ustr); + CPPUNIT_ASSERT_MESSAGE("Unable to remove db range", !xDbRanges->hasByName(u"addNewRange"_ustr)); CPPUNIT_ASSERT_THROW_MESSAGE("No exception, when removing none-existing range", - xDbRanges->removeByName("addNewRange"), + xDbRanges->removeByName(u"addNewRange"_ustr), css::uno::RuntimeException); } } diff --git a/test/source/sheet/xdatapilotdescriptor.cxx b/test/source/sheet/xdatapilotdescriptor.cxx index 20392ff8ae4b..116c22ca5be3 100644 --- a/test/source/sheet/xdatapilotdescriptor.cxx +++ b/test/source/sheet/xdatapilotdescriptor.cxx @@ -27,7 +27,7 @@ std::vector< OUString > XDataPilotDescriptor::maFieldNames; void XDataPilotDescriptor::testTag() { - OUString aTag("DataPilotDescriptor_Tag"); + OUString aTag(u"DataPilotDescriptor_Tag"_ustr); uno::Reference< sheet::XDataPilotDescriptor > xDescr(init(), UNO_QUERY_THROW); xDescr->setTag(aTag); OUString aNewTag = xDescr->getTag(); @@ -72,7 +72,7 @@ void XDataPilotDescriptor::testGetDataPilotFields_Impl( uno::Reference< sheet::X sal_Int32 nCount = xIndex->getCount(); - OUString aOrientation("Orientation"); + OUString aOrientation(u"Orientation"_ustr); for (sal_Int32 i = 0; i < nCount && i < 5; ++i) { uno::Reference< container::XNamed > xNamed( xIndex->getByIndex( i ), UNO_QUERY_THROW); diff --git a/test/source/sheet/xdatapilottable2.cxx b/test/source/sheet/xdatapilottable2.cxx index 2e802eeadbda..a747428dbdf7 100644 --- a/test/source/sheet/xdatapilottable2.cxx +++ b/test/source/sheet/xdatapilottable2.cxx @@ -221,7 +221,7 @@ void XDataPilotTable2::buildDataFields( uno::Reference< sheet::XDataPilotTable2 for( sal_Int32 i = 0; i < nFieldCount; ++i) { uno::Reference< beans::XPropertySet > xPropSet(xIndex->getByIndex(i), UNO_QUERY_THROW); - Any aAny = xPropSet->getPropertyValue("Orientation"); + Any aAny = xPropSet->getPropertyValue(u"Orientation"_ustr); sheet::DataPilotFieldOrientation aOrientation; CPPUNIT_ASSERT( aAny >>= aOrientation ); diff --git a/test/source/sheet/xdatapilottables.cxx b/test/source/sheet/xdatapilottables.cxx index b666650eaa71..20b5a1e04a4e 100644 --- a/test/source/sheet/xdatapilottables.cxx +++ b/test/source/sheet/xdatapilottables.cxx @@ -31,21 +31,21 @@ void XDataPilotTables::testXDataPilotTables() uno::Reference<sheet::XDataPilotDescriptor> xDPD(xDPT->createDataPilotDescriptor(), UNO_SET_THROW); - xDPT->insertNewByName("XDataPilotTables", table::CellAddress(0, 9, 8), xDPD); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to insert new DataPilotTable", OUString("Filter"), + xDPT->insertNewByName(u"XDataPilotTables"_ustr, table::CellAddress(0, 9, 8), xDPD); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to insert new DataPilotTable", u"Filter"_ustr, xSheet->getCellByPosition(9, 8)->getFormula()); CPPUNIT_ASSERT_THROW_MESSAGE( "No exception thrown, when inserting element with existing name", - xDPT->insertNewByName("XDataPilotTables", table::CellAddress(0, 7, 7), xDPD), + xDPT->insertNewByName(u"XDataPilotTables"_ustr, table::CellAddress(0, 7, 7), xDPD), css::uno::RuntimeException); - xDPT->removeByName("XDataPilotTables"); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove DataPilotTable", OUString(""), + xDPT->removeByName(u"XDataPilotTables"_ustr); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove DataPilotTable", u""_ustr, xSheet->getCellByPosition(9, 8)->getFormula()); CPPUNIT_ASSERT_THROW_MESSAGE("No exception, when removing no existing element", - xDPT->removeByName("XDataPilotTables"), + xDPT->removeByName(u"XDataPilotTables"_ustr), css::uno::RuntimeException); } } diff --git a/test/source/sheet/xddelink.cxx b/test/source/sheet/xddelink.cxx index cf56fe9cdc6d..9f1ccc9bd515 100644 --- a/test/source/sheet/xddelink.cxx +++ b/test/source/sheet/xddelink.cxx @@ -23,14 +23,14 @@ void XDDELink::testGetApplication() { uno::Reference<sheet::XDDELink> xLink(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", OUString("soffice"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", u"soffice"_ustr, xLink->getApplication()); } void XDDELink::testGetItem() { uno::Reference<sheet::XDDELink> xLink(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", OUString("Sheet1.A1"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", u"Sheet1.A1"_ustr, xLink->getItem()); } void XDDELink::testGetTopic() diff --git a/test/source/sheet/xddelinks.cxx b/test/source/sheet/xddelinks.cxx index fc18a16a1eb9..4291cfcc1ceb 100644 --- a/test/source/sheet/xddelinks.cxx +++ b/test/source/sheet/xddelinks.cxx @@ -26,14 +26,14 @@ void XDDELinks::testAddDDELink() { uno::Reference<sheet::XDDELinks> xLinks(init(), UNO_QUERY_THROW); - uno::Reference<sheet::XDDELink> xLink - = xLinks->addDDELink("soffice", m_aTopic, "Sheet1.A1", sheet::DDELinkMode_DEFAULT); + uno::Reference<sheet::XDDELink> xLink = xLinks->addDDELink( + u"soffice"_ustr, m_aTopic, u"Sheet1.A1"_ustr, sheet::DDELinkMode_DEFAULT); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", OUString("soffice"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", u"soffice"_ustr, xLink->getApplication()); CPPUNIT_ASSERT_MESSAGE("Unable to execute getTopic()", xLink->getTopic().endsWith("ScDDELinksObj.ods")); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", OUString("Sheet1.A1"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", u"Sheet1.A1"_ustr, xLink->getItem()); } } // namespace apitest diff --git a/test/source/sheet/xdocumentauditing.cxx b/test/source/sheet/xdocumentauditing.cxx index 8728f02bfd8d..cec7b1c58e23 100644 --- a/test/source/sheet/xdocumentauditing.cxx +++ b/test/source/sheet/xdocumentauditing.cxx @@ -52,7 +52,7 @@ void XDocumentAuditing::dispatch(const uno::Reference<frame::XFrame>& xFrame, uno::Reference<frame::XDispatchProvider> xDispatchProvider(xFrame, UNO_QUERY_THROW); CPPUNIT_ASSERT(xDispatchProvider.is()); - xDispatchHelper->executeDispatch(xDispatchProvider, ".uno:AutoRefreshArrows", "", 0, + xDispatchHelper->executeDispatch(xDispatchProvider, u".uno:AutoRefreshArrows"_ustr, u""_ustr, 0, rArguments); } @@ -95,7 +95,7 @@ void XDocumentAuditing::testRefreshArrows() nDrawPageElementCount = xDrawPage->getCount(); uno::Sequence<beans::PropertyValue> aPropertyValue{ comphelper::makePropertyValue( - "AutoRefreshArrows", false) }; + u"AutoRefreshArrows"_ustr, false) }; uno::Reference<frame::XModel> xModel(xDocumentAuditing, UNO_QUERY_THROW); dispatch(xModel->getCurrentController()->getFrame(), aPropertyValue); @@ -104,7 +104,7 @@ void XDocumentAuditing::testRefreshArrows() OUString sSheet1Name = xNA1->getName(); xSheet2->getCellByPosition(6, 6)->setValue(16); - xSheet2->getCellByPosition(6, 7)->setFormula("= SQRT(G7)"); + xSheet2->getCellByPosition(6, 7)->setFormula(u"= SQRT(G7)"_ustr); uno::Reference<sheet::XSheetAuditing> xSheetAuditing(xSheet2, UNO_QUERY_THROW); xSheetAuditing->showPrecedents(table::CellAddress(1, 6, 7)); diff --git a/test/source/sheet/xformulaquery.cxx b/test/source/sheet/xformulaquery.cxx index 32540847e0e9..784ac44fb4d3 100644 --- a/test/source/sheet/xformulaquery.cxx +++ b/test/source/sheet/xformulaquery.cxx @@ -34,7 +34,7 @@ void XFormulaQuery::testQueryDependents() xSheet->getCellByPosition(3, 0)->setValue(1); uno::Reference<table::XCell> xCell = getXCell(); - xCell->setFormula("=SUM(A1:D1)"); + xCell->setFormula(u"=SUM(A1:D1)"_ustr); uno::Reference<sheet::XFormulaQuery> xFormulaQuery(init(), UNO_QUERY_THROW); uno::Reference<sheet::XSheetCellRanges> xSCR = xFormulaQuery->queryDependents(false); @@ -50,10 +50,10 @@ void XFormulaQuery::testQueryPrecedents() xSheet->getCellByPosition(1, 0)->setValue(1); xSheet->getCellByPosition(2, 0)->setValue(1); xSheet->getCellByPosition(3, 0)->setValue(1); - xSheet->getCellByPosition(1, 2)->setFormula("=A16 * 2"); + xSheet->getCellByPosition(1, 2)->setFormula(u"=A16 * 2"_ustr); uno::Reference<table::XCell> xCell = getXCell(); - xCell->setFormula("=SUM(A1:D1)"); + xCell->setFormula(u"=SUM(A1:D1)"_ustr); uno::Reference<sheet::XFormulaQuery> xFormulaQuery(init(), UNO_QUERY_THROW); uno::Reference<sheet::XSheetCellRanges> xSCR = xFormulaQuery->queryPrecedents(false); diff --git a/test/source/sheet/xgoalseek.cxx b/test/source/sheet/xgoalseek.cxx index b1de09d2e22b..e521c1895408 100644 --- a/test/source/sheet/xgoalseek.cxx +++ b/test/source/sheet/xgoalseek.cxx @@ -25,7 +25,7 @@ void XGoalSeek::testSeekGoal() table::CellAddress aFormulaAddr(0, 3, 5); table::CellAddress aVariableAddr(0, 3, 4); - sheet::GoalResult aResult = xGoalSeek->seekGoal(aFormulaAddr, aVariableAddr, "4"); + sheet::GoalResult aResult = xGoalSeek->seekGoal(aFormulaAddr, aVariableAddr, u"4"_ustr); double nDivergence = 0.01; CPPUNIT_ASSERT(aResult.Divergence < nDivergence); diff --git a/test/source/sheet/xheaderfootercontent.cxx b/test/source/sheet/xheaderfootercontent.cxx index 1683cc7e771c..3793d3c2ecf7 100644 --- a/test/source/sheet/xheaderfootercontent.cxx +++ b/test/source/sheet/xheaderfootercontent.cxx @@ -25,8 +25,7 @@ void XHeaderFooterContent::testGetCenterText() uno::Reference<sheet::XHeaderFooterContent> xHFC(init(), UNO_QUERY_THROW); uno::Reference<text::XText> xText(xHFC->getCenterText(), UNO_SET_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get center text", OUString("CENTER"), - xText->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get center text", u"CENTER"_ustr, xText->getString()); } void XHeaderFooterContent::testGetLeftText() @@ -34,14 +33,14 @@ void XHeaderFooterContent::testGetLeftText() uno::Reference<sheet::XHeaderFooterContent> xHFC(init(), UNO_QUERY_THROW); uno::Reference<text::XText> xText(xHFC->getLeftText(), UNO_SET_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get left text", OUString("LEFT"), xText->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get left text", u"LEFT"_ustr, xText->getString()); } void XHeaderFooterContent::testGetRightText() { uno::Reference<sheet::XHeaderFooterContent> xHFC(init(), UNO_QUERY_THROW); uno::Reference<text::XText> xText(xHFC->getRightText(), UNO_SET_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get right text", OUString("RIGHT"), xText->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get right text", u"RIGHT"_ustr, xText->getString()); } } diff --git a/test/source/sheet/xmultipleoperation.cxx b/test/source/sheet/xmultipleoperation.cxx index d97f269340d5..eb08b2a1b53e 100644 --- a/test/source/sheet/xmultipleoperation.cxx +++ b/test/source/sheet/xmultipleoperation.cxx @@ -30,12 +30,12 @@ void XMultipleOperation::testSetTableOperation() uno::Reference<sheet::XMultipleOperation> xMultipleOperation(init(), UNO_QUERY_THROW); uno::Reference<sheet::XSpreadsheet> xSheet(getXSpreadsheet(), UNO_QUERY_THROW); - uno::Reference<table::XCellRange> xCellRange(xSheet->getCellRangeByName("$A$20:$A$20"), + uno::Reference<table::XCellRange> xCellRange(xSheet->getCellRangeByName(u"$A$20:$A$20"_ustr), UNO_SET_THROW); uno::Reference<sheet::XCellRangeAddressable> xCellRangeAddr(xCellRange, UNO_QUERY_THROW); uno::Reference<table::XCell> xCell = xSheet->getCellByPosition(0, 19); - xCell->setFormula("=a18+a19"); + xCell->setFormula(u"=a18+a19"_ustr); uno::Reference<table::XCell> xCell1 = xSheet->getCellByPosition(0, 17); uno::Reference<sheet::XCellAddressable> xCellAddr1(xCell1, UNO_QUERY_THROW); diff --git a/test/source/sheet/xnamedrange.cxx b/test/source/sheet/xnamedrange.cxx index ea9fb778199a..0bdf41df6e92 100644 --- a/test/source/sheet/xnamedrange.cxx +++ b/test/source/sheet/xnamedrange.cxx @@ -23,14 +23,14 @@ namespace apitest { void XNamedRange::testGetContent() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial1"_ustr); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong expected content for initial1 on GetContent", OUString("$Sheet1.$B$1"), xNamedRange->getContent()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong expected content for initial1 on GetContent", u"$Sheet1.$B$1"_ustr, xNamedRange->getContent()); } void XNamedRange::testSetContent() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial1"_ustr); OUString aExpectedContent; @@ -53,13 +53,13 @@ void XNamedRange::testSetContent() void XNamedRange::testGetType() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial1"_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong expected Type", sal_Int32(0), xNamedRange->getType()); } void XNamedRange::testSetType() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial1"_ustr); sal_Int32 nType = ::sheet::NamedRangeFlag::ROW_HEADER; xNamedRange->setType(nType); @@ -84,7 +84,7 @@ void XNamedRange::testSetType() void XNamedRange::testGetReferencePosition() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial2"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial2"_ustr); table::CellAddress aCellAddress = xNamedRange->getReferencePosition(); // the expected address is on B1, as it was the active cell when initial2 was created @@ -95,7 +95,7 @@ void XNamedRange::testGetReferencePosition() void XNamedRange::testSetReferencePosition() { - uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange("initial1"); + uno::Reference< sheet::XNamedRange > xNamedRange = getNamedRange(u"initial1"_ustr); table::CellAddress aBaseAddress(1,2,3); diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx index e07911f421ab..00f34077e111 100644 --- a/test/source/sheet/xnamedranges.cxx +++ b/test/source/sheet/xnamedranges.cxx @@ -42,38 +42,38 @@ void XNamedRanges::testAddNewByName() table::CellAddress aBaseAddress(0, 0, 0); sal_Int32 nType = 0; - OUString aName1("type_0"); - xNamedRanges->addNewByName(aName1, "D1", aBaseAddress, nType); + OUString aName1(u"type_0"_ustr); + xNamedRanges->addNewByName(aName1, u"D1"_ustr, aBaseAddress, nType); CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type 0 - Normal case", xNamedRanges->hasByName(aName1)); nType = ::sheet::NamedRangeFlag::COLUMN_HEADER; - OUString aName2("type_COLUMN_HEADER"); - xNamedRanges->addNewByName(aName2, "D2", aBaseAddress, nType); + OUString aName2(u"type_COLUMN_HEADER"_ustr); + xNamedRanges->addNewByName(aName2, u"D2"_ustr, aBaseAddress, nType); CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type COLUMN_HEADER", xNamedRanges->hasByName(aName2)); nType = ::sheet::NamedRangeFlag::FILTER_CRITERIA; - OUString aName3("type_FILTER_CRITERIA"); - xNamedRanges->addNewByName(aName3, "D3", aBaseAddress, nType); + OUString aName3(u"type_FILTER_CRITERIA"_ustr); + xNamedRanges->addNewByName(aName3, u"D3"_ustr, aBaseAddress, nType); CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type FILTER_CRITERIA", xNamedRanges->hasByName(aName3)); nType = ::sheet::NamedRangeFlag::PRINT_AREA; - OUString aName4("type_PRINT_AREA"); - xNamedRanges->addNewByName(aName4, "D4", aBaseAddress, nType); + OUString aName4(u"type_PRINT_AREA"_ustr); + xNamedRanges->addNewByName(aName4, u"D4"_ustr, aBaseAddress, nType); CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type PRINT_AREA", xNamedRanges->hasByName(aName4)); nType = ::sheet::NamedRangeFlag::ROW_HEADER; - OUString aName5("type_ROW_HEADER"); - xNamedRanges->addNewByName(aName5, "D5", aBaseAddress, nType); + OUString aName5(u"type_ROW_HEADER"_ustr); + xNamedRanges->addNewByName(aName5, u"D5"_ustr, aBaseAddress, nType); CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type ROW_HEADER", xNamedRanges->hasByName(aName5)); // tdf#119457 - check for a valid range name - OUString aName6("type_INVALID_BAD_STRING.+:"); - CPPUNIT_ASSERT_THROW(xNamedRanges->addNewByName(aName6, "D6", aBaseAddress, 0), + OUString aName6(u"type_INVALID_BAD_STRING.+:"_ustr); + CPPUNIT_ASSERT_THROW(xNamedRanges->addNewByName(aName6, u"D6"_ustr, aBaseAddress, 0), uno::RuntimeException); CPPUNIT_ASSERT_MESSAGE("Created Namedrange with invalid name", !xNamedRanges->hasByName(aName6)); @@ -164,7 +164,8 @@ void XNamedRanges::testRemoveByName() CPPUNIT_ASSERT_MESSAGE("Wrong NamedRange removed, initial1 still present", !xNamedRanges->hasByName(maNameToRemove)); // try to remove non existing - xNamedRanges->removeByName("dummyNonExistingNamedRange"); // an exception should be raised here + xNamedRanges->removeByName( + u"dummyNonExistingNamedRange"_ustr); // an exception should be raised here } void XNamedRanges::testOutputList() diff --git a/test/source/sheet/xscenario.cxx b/test/source/sheet/xscenario.cxx index 9d874d95175d..9f3d15c46c76 100644 --- a/test/source/sheet/xscenario.cxx +++ b/test/source/sheet/xscenario.cxx @@ -34,8 +34,8 @@ void XScenario::testScenario() CPPUNIT_ASSERT_MESSAGE("Unable execute getScenarioComment()", !xScenario->getScenarioComment().isEmpty()); - xScenario->setScenarioComment("Test"); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable execute setScenarioComment()", OUString("Test"), + xScenario->setScenarioComment(u"Test"_ustr); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable execute setScenarioComment()", u"Test"_ustr, xScenario->getScenarioComment()); } } // namespace apitest diff --git a/test/source/sheet/xscenarios.cxx b/test/source/sheet/xscenarios.cxx index 77781361ea22..65dc9df099ed 100644 --- a/test/source/sheet/xscenarios.cxx +++ b/test/source/sheet/xscenarios.cxx @@ -27,16 +27,17 @@ void XScenarios::testAddNewByName() uno::Sequence<table::CellRangeAddress> aCellRangeAddresses{ table::CellRangeAddress(0, 0, 0, 0, 0) }; - xScenarios->addNewByName("XScenarios2", aCellRangeAddresses, "new"); - CPPUNIT_ASSERT_MESSAGE("Unable to add new XScenario", xScenarios->hasByName("XScenarios2")); + xScenarios->addNewByName(u"XScenarios2"_ustr, aCellRangeAddresses, u"new"_ustr); + CPPUNIT_ASSERT_MESSAGE("Unable to add new XScenario", + xScenarios->hasByName(u"XScenarios2"_ustr)); } void XScenarios::testRemoveByName() { uno::Reference<sheet::XScenarios> xScenarios(init(), UNO_QUERY_THROW); - xScenarios->removeByName("XScenarios"); - CPPUNIT_ASSERT_MESSAGE("Unable to remove XScenario", !xScenarios->hasByName("XScenario")); + xScenarios->removeByName(u"XScenarios"_ustr); + CPPUNIT_ASSERT_MESSAGE("Unable to remove XScenario", !xScenarios->hasByName(u"XScenario"_ustr)); } } diff --git a/test/source/sheet/xsheetannotation.cxx b/test/source/sheet/xsheetannotation.cxx index 1ce4e1a7969d..4846a1a1a4ae 100644 --- a/test/source/sheet/xsheetannotation.cxx +++ b/test/source/sheet/xsheetannotation.cxx @@ -40,14 +40,14 @@ void XSheetAnnotation::testGetAuthor() uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (init(), UNO_QUERY_THROW); OUString aAuthor = aSheetAnnotation->getAuthor(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong author", OUString("LG"), aAuthor); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong author", u"LG"_ustr, aAuthor); } void XSheetAnnotation::testGetDate() { uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (init(), UNO_QUERY_THROW); OUString aDate = aSheetAnnotation->getDate(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong date", OUString("01/17/2013"), aDate); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong date", u"01/17/2013"_ustr, aDate); } void XSheetAnnotation::testGetIsVisible() { diff --git a/test/source/sheet/xsheetannotations.cxx b/test/source/sheet/xsheetannotations.cxx index 9f082eeb903c..79e5d87dccfe 100644 --- a/test/source/sheet/xsheetannotations.cxx +++ b/test/source/sheet/xsheetannotations.cxx @@ -35,7 +35,7 @@ void XSheetAnnotations::testCount() // insert a note on sheet 2 table::CellAddress aTargetCellAddress (1,0,0); - xSheet2Annotations->insertNew(aTargetCellAddress, "an inserted annotation on sheet 2"); + xSheet2Annotations->insertNew(aTargetCellAddress, u"an inserted annotation on sheet 2"_ustr); // count again on sheet 1 sal_Int32 nAfter = xAnnotationsIndex->getCount(); @@ -56,7 +56,7 @@ void XSheetAnnotations::testInsertNew() // insert the annotation table::CellAddress aTargetCellAddress (0,3,4); - aSheetAnnotations->insertNew(aTargetCellAddress, "an inserted annotation"); + aSheetAnnotations->insertNew(aTargetCellAddress, u"an inserted annotation"_ustr); // count after inserting //uno::Reference< container::XIndexAccess > xAnnotationsIndexAfter (aSheetAnnotations, UNO_QUERY_THROW); @@ -84,7 +84,7 @@ void XSheetAnnotations::testInsertNew() OUString aString = aTextSheetAnnotation->getString(); CPPUNIT_ASSERT_EQUAL_MESSAGE( - "Insert Annotation - Wrong string", OUString("an inserted annotation"), + "Insert Annotation - Wrong string", u"an inserted annotation"_ustr, aString); } @@ -95,11 +95,11 @@ void XSheetAnnotations::testRemoveByIndex() // insert some annotations table::CellAddress aTargetCellAddress (0,4,5); - aSheetAnnotations->insertNew(aTargetCellAddress, "an inserted annotation 1"); + aSheetAnnotations->insertNew(aTargetCellAddress, u"an inserted annotation 1"_ustr); table::CellAddress aToBeRemovedCellAddress (0,5,6); - aSheetAnnotations->insertNew(aToBeRemovedCellAddress, "an inserted annotation 2"); + aSheetAnnotations->insertNew(aToBeRemovedCellAddress, u"an inserted annotation 2"_ustr); table::CellAddress aOtherCellAddress (0,7,8); - aSheetAnnotations->insertNew(aOtherCellAddress, "an inserted annotation 3"); + aSheetAnnotations->insertNew(aOtherCellAddress, u"an inserted annotation 3"_ustr); // count before removing uno::Reference< container::XIndexAccess > xAnnotationsIndex (aSheetAnnotations, UNO_QUERY_THROW); @@ -132,7 +132,7 @@ void XSheetAnnotations::testRemoveByIndex() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Remove Annotation - Wrong string", - OUString("an inserted annotation 3"), aLastString); + u"an inserted annotation 3"_ustr, aLastString); // the previous should be xTargetCellAddress uno::Reference< sheet::XSheetAnnotation > aPreviousSheetAnnotation (xAnnotationsIndex->getByIndex(nAfter-2), UNO_QUERY_THROW); @@ -154,7 +154,7 @@ void XSheetAnnotations::testRemoveByIndex() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Remove Annotation - Wrong string", - OUString("an inserted annotation 1"), aPreviousString); + u"an inserted annotation 1"_ustr, aPreviousString); } void XSheetAnnotations::testIndex() @@ -165,20 +165,20 @@ void XSheetAnnotations::testIndex() // insert annotations in first sheet uno::Reference< sheet::XSheetAnnotations > aSheet0Annotations (init(), UNO_QUERY_THROW); table::CellAddress aTargetCellAddress0 (0,0,1); - aSheet0Annotations->insertNew(aTargetCellAddress0, "an inserted annotation 1 on sheet 1"); + aSheet0Annotations->insertNew(aTargetCellAddress0, u"an inserted annotation 1 on sheet 1"_ustr); table::CellAddress aSecondTargetCellAddress0 (0,0,2); - aSheet0Annotations->insertNew(aSecondTargetCellAddress0, "an inserted annotation 2 on sheet 1"); + aSheet0Annotations->insertNew(aSecondTargetCellAddress0, u"an inserted annotation 2 on sheet 1"_ustr); table::CellAddress aThirdCellAddress0 (0,0,3); - aSheet0Annotations->insertNew(aThirdCellAddress0, "an inserted annotation 3 on sheet 1"); + aSheet0Annotations->insertNew(aThirdCellAddress0, u"an inserted annotation 3 on sheet 1"_ustr); // insert annotations in third sheet uno::Reference< sheet::XSheetAnnotations > aSheet2Annotations (getAnnotations(2), UNO_SET_THROW); table::CellAddress aTargetCellAddress2 (2,4,5); - aSheet2Annotations->insertNew(aTargetCellAddress2, "an inserted annotation 1 on sheet 3"); + aSheet2Annotations->insertNew(aTargetCellAddress2, u"an inserted annotation 1 on sheet 3"_ustr); table::CellAddress aSecondTargetCellAddress2 (2,5,6); - aSheet2Annotations->insertNew(aSecondTargetCellAddress2, "an inserted annotation 2 on sheet 3"); + aSheet2Annotations->insertNew(aSecondTargetCellAddress2, u"an inserted annotation 2 on sheet 3"_ustr); table::CellAddress aThirdCellAddress2 (2,7,8); - aSheet2Annotations->insertNew(aThirdCellAddress2, "an inserted annotation 3 on sheet 3"); + aSheet2Annotations->insertNew(aThirdCellAddress2, u"an inserted annotation 3 on sheet 3"_ustr); // get second annotation for second sheet uno::Reference< sheet::XSheetAnnotations > aSheetAnnotations (getAnnotations(2), UNO_SET_THROW); @@ -204,7 +204,7 @@ void XSheetAnnotations::testIndex() CPPUNIT_ASSERT_EQUAL_MESSAGE( "GetByIndex Annotation - Wrong string", - OUString("an inserted annotation 2 on sheet 3"), aString); + u"an inserted annotation 2 on sheet 3"_ustr, aString); } } diff --git a/test/source/sheet/xsheetauditing.cxx b/test/source/sheet/xsheetauditing.cxx index 992a7441ce05..a7aef422b178 100644 --- a/test/source/sheet/xsheetauditing.cxx +++ b/test/source/sheet/xsheetauditing.cxx @@ -91,7 +91,7 @@ void XSheetAuditing::testShowErrors() + ")"); uno::Reference<text::XText> xText(xCell, UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("No error code", OUString("Err:522"), xText->getString()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("No error code", u"Err:522"_ustr, xText->getString()); xAuditing->showErrors(table::CellAddress(0, 7, 6)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to show errors", nElements + 1, xDrawPage->getCount()); @@ -110,14 +110,14 @@ void XSheetAuditing::testShowInvalid() xCell->setValue(2.5); uno::Reference<beans::XPropertySet> xPropSet(xCell, UNO_QUERY_THROW); - uno::Any aValidation = xPropSet->getPropertyValue("Validation"); + uno::Any aValidation = xPropSet->getPropertyValue(u"Validation"_ustr); uno::Reference<beans::XPropertySet> xValidation(aValidation, UNO_QUERY_THROW); uno::Any aAny; aAny <<= sheet::ValidationType_WHOLE; - xValidation->setPropertyValue("Type", aAny); + xValidation->setPropertyValue(u"Type"_ustr, aAny); aAny <<= xValidation; - xPropSet->setPropertyValue("Validation", aAny); + xPropSet->setPropertyValue(u"Validation"_ustr, aAny); xAuditing->showInvalid(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to show invalid (WHOLE)", nElements + 1, xDrawPage->getCount()); @@ -125,9 +125,9 @@ void XSheetAuditing::testShowInvalid() xAuditing->clearArrows(); aAny <<= sheet::ValidationType_ANY; - xValidation->setPropertyValue("Type", aAny); + xValidation->setPropertyValue(u"Type"_ustr, aAny); aAny <<= xValidation; - xPropSet->setPropertyValue("Validation", aAny); + xPropSet->setPropertyValue(u"Validation"_ustr, aAny); xAuditing->showInvalid(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to show invalid (ANY)", nElements, xDrawPage->getCount()); diff --git a/test/source/sheet/xsheetcellcursor.cxx b/test/source/sheet/xsheetcellcursor.cxx index fcaeb7fe7e79..a2620bf384ae 100644 --- a/test/source/sheet/xsheetcellcursor.cxx +++ b/test/source/sheet/xsheetcellcursor.cxx @@ -50,7 +50,7 @@ void XSheetCellCursor::testCollapseToCurrentArray() xColRowRange->getColumns()->getCount()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to collapseToCurrentArray (rows)", nHeight, xColRowRange->getRows()->getCount()); - xArrayFormulaRange->setArrayFormula(""); + xArrayFormulaRange->setArrayFormula(u""_ustr); } void XSheetCellCursor::testCollapseToCurrentRegion() diff --git a/test/source/sheet/xsheetcondition.cxx b/test/source/sheet/xsheetcondition.cxx index 27068fec62ee..d3eb29c4f764 100644 --- a/test/source/sheet/xsheetcondition.cxx +++ b/test/source/sheet/xsheetcondition.cxx @@ -28,7 +28,7 @@ void XSheetCondition::testGetSetFormula1() CPPUNIT_ASSERT_NO_THROW_MESSAGE("Unable to get Formula1", aFormula1 = xSheetCondition->getFormula1()); - xSheetCondition->setFormula1("$Sheet1.$C$"); + xSheetCondition->setFormula1(u"$Sheet1.$C$"_ustr); CPPUNIT_ASSERT_MESSAGE("Unable to set Formula1", aFormula1 != xSheetCondition->getFormula1()); } @@ -39,7 +39,7 @@ void XSheetCondition::testGetSetFormula2() CPPUNIT_ASSERT_NO_THROW_MESSAGE("Unable to get Formula2", aFormula2 = xSheetCondition->getFormula2()); - xSheetCondition->setFormula2("$Sheet1.$A$"); + xSheetCondition->setFormula2(u"$Sheet1.$A$"_ustr); CPPUNIT_ASSERT_MESSAGE("Unable to set Formula2", aFormula2 != xSheetCondition->getFormula2()); } diff --git a/test/source/sheet/xsheetconditionalentry.cxx b/test/source/sheet/xsheetconditionalentry.cxx index 0523d9be6955..cc01f6a21e96 100644 --- a/test/source/sheet/xsheetconditionalentry.cxx +++ b/test/source/sheet/xsheetconditionalentry.cxx @@ -24,9 +24,9 @@ void XSheetConditionalEntry::testGetSetStyleName() { uno::Reference<sheet::XSheetConditionalEntry> xSheetConditionalEntry(init(), UNO_QUERY_THROW); OUString aStyleName = xSheetConditionalEntry->getStyleName(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get StyleName", OUString("Result2"), aStyleName); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get StyleName", u"Result2"_ustr, aStyleName); - xSheetConditionalEntry->setStyleName("Heading"); + xSheetConditionalEntry->setStyleName(u"Heading"_ustr); CPPUNIT_ASSERT_MESSAGE("Unable to set StyleName", aStyleName != xSheetConditionalEntry->getStyleName()); } diff --git a/test/source/sheet/xsheetfilterable.cxx b/test/source/sheet/xsheetfilterable.cxx index 2f5509e95f98..ce5ea55ebd03 100644 --- a/test/source/sheet/xsheetfilterable.cxx +++ b/test/source/sheet/xsheetfilterable.cxx @@ -44,7 +44,7 @@ void XSheetFilterable::testCreateFilterDescriptor() /* Operator */ sheet::FilterOperator_LESS, /* IsNumeric */ false, /* NumericValue */ {}, - /* StringValue */ "C" } + /* StringValue */ u"C"_ustr } }; CPPUNIT_ASSERT_NO_THROW_MESSAGE("Unable to create XSheetFilterDescriptor", xSFD->setFilterFields(xTFF)); @@ -69,23 +69,23 @@ void XSheetFilterable::testFilter() /* Operator */ sheet::FilterOperator_LESS, /* IsNumeric */ false, /* NumericValue */ {}, - /* StringValue */ "C" } + /* StringValue */ u"C"_ustr } }; xSFD->setFilterFields(xTFF); xSheet->getCellByPosition(0, 0)->setValue(1); xSheet->getCellByPosition(0, 1)->setValue(2); xSheet->getCellByPosition(0, 2)->setValue(3); - xSheet->getCellByPosition(1, 0)->setFormula("A"); - xSheet->getCellByPosition(1, 1)->setFormula("B"); - xSheet->getCellByPosition(1, 2)->setFormula("C"); + xSheet->getCellByPosition(1, 0)->setFormula(u"A"_ustr); + xSheet->getCellByPosition(1, 1)->setFormula(u"B"_ustr); + xSheet->getCellByPosition(1, 2)->setFormula(u"C"_ustr); xFA->filter(xSFD); uno::Reference< table::XColumnRowRange > xColRowRange(xSheet, UNO_QUERY_THROW); uno::Reference< table::XTableRows > xTableRows = xColRowRange->getRows(); uno::Reference< beans::XPropertySet > xRowProps(xTableRows->getByIndex(0), UNO_QUERY_THROW); bool bIsVisible = true; - CPPUNIT_ASSERT(xRowProps->getPropertyValue("IsVisible") >>= bIsVisible); + CPPUNIT_ASSERT(xRowProps->getPropertyValue(u"IsVisible"_ustr) >>= bIsVisible); CPPUNIT_ASSERT_MESSAGE("Row 1 should be invisible", !bIsVisible); } diff --git a/test/source/sheet/xsheetlinkable.cxx b/test/source/sheet/xsheetlinkable.cxx index aa394a0064e1..79390b4245d2 100644 --- a/test/source/sheet/xsheetlinkable.cxx +++ b/test/source/sheet/xsheetlinkable.cxx @@ -24,21 +24,21 @@ void XSheetLinkable::testSheetLinkable() { uno::Reference< sheet::XSheetLinkable > xSheetLinkable(init(), UNO_QUERY_THROW); - xSheetLinkable->link(getFileURL(), "Sheet1", "", "", sheet::SheetLinkMode_VALUE); + xSheetLinkable->link(getFileURL(), u"Sheet1"_ustr, u""_ustr, u""_ustr, sheet::SheetLinkMode_VALUE); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get link mode", sheet::SheetLinkMode_VALUE, xSheetLinkable->getLinkMode()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get link URL", getFileURL(), xSheetLinkable->getLinkUrl()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get sheet name", - OUString("Sheet1"), xSheetLinkable->getLinkSheetName()); + u"Sheet1"_ustr, xSheetLinkable->getLinkSheetName()); xSheetLinkable->setLinkMode(sheet::SheetLinkMode_NONE); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set link mode", sheet::SheetLinkMode_NONE, xSheetLinkable->getLinkMode()); - xSheetLinkable->setLinkSheetName("Sheet2"); + xSheetLinkable->setLinkSheetName(u"Sheet2"_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set sheet name", - OUString("Sheet2"), xSheetLinkable->getLinkSheetName()); + u"Sheet2"_ustr, xSheetLinkable->getLinkSheetName()); xSheetLinkable->setLinkUrl(getFileURL()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set link URL", diff --git a/test/source/sheet/xsheetoutline.cxx b/test/source/sheet/xsheetoutline.cxx index ff3e519d301d..abe609c099fb 100644 --- a/test/source/sheet/xsheetoutline.cxx +++ b/test/source/sheet/xsheetoutline.cxx @@ -137,13 +137,13 @@ void XSheetOutline::testShowLevel() aSheetOutline->showLevel(2, table::TableOrientation_COLUMNS); - std::cout << " verify showLevel col apres" << getVisibleAddress(aSheet, "OutlineSheet.A1:Z30") << std::endl; + std::cout << " verify showLevel col apres" << getVisibleAddress(aSheet, u"OutlineSheet.A1:Z30"_ustr) << std::endl; // verify that level 2 and level 1 are shown --> column 0..3 & column 22..26 // level 3 & 4 are hidden --> column 4..19 - CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.A1:D1"), getVisibleAddress(aSheet, "OutlineSheet.A1:D1")); - CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString("OutlineSheet.V1:Z1"), getVisibleAddress(aSheet, "OutlineSheet.V1:Z1")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", u"OutlineSheet.A1:D1"_ustr, getVisibleAddress(aSheet, u"OutlineSheet.A1:D1"_ustr)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", u"OutlineSheet.V1:Z1"_ustr, getVisibleAddress(aSheet, u"OutlineSheet.V1:Z1"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE("testShowLevel Column", OUString(), getVisibleAddress(aSheet, colLevel3)); /* FIXME !! @@ -190,7 +190,7 @@ void XSheetOutline::testGroup() uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW); // Column level 2 - OUString aNewString = "OutlineSheet.AB1:AG1"; + OUString aNewString = u"OutlineSheet.AB1:AG1"_ustr; table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString); aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_COLUMNS); @@ -215,7 +215,7 @@ void XSheetOutline::testUngroup() uno::Reference< sheet::XSheetOutline > aSheetOutline(aSheet, UNO_QUERY_THROW); // New Column level - OUString aNewString = "OutlineSheet.BB1:BG1"; + OUString aNewString = u"OutlineSheet.BB1:BG1"_ustr; table::CellRangeAddress aLevelRangeAddress = getAddressFromRangeString(aSheet, aNewString); aSheetOutline->group(aLevelRangeAddress, table::TableOrientation_COLUMNS); aSheetOutline->hideDetail(aLevelRangeAddress); diff --git a/test/source/sheet/xspreadsheets.cxx b/test/source/sheet/xspreadsheets.cxx index 14e2bf9965ae..e2b2640d682d 100644 --- a/test/source/sheet/xspreadsheets.cxx +++ b/test/source/sheet/xspreadsheets.cxx @@ -25,7 +25,7 @@ void XSpreadsheets::testInsertNewByName() { uno::Reference< sheet::XSpreadsheets > xSpreadsheets(init(), UNO_QUERY_THROW); - OUString newSheetName( "SheetToInsert" ); + OUString newSheetName( u"SheetToInsert"_ustr ); xSpreadsheets->insertNewByName(newSheetName, 0); uno::Reference< container::XNameAccess > xNameAccess(xSpreadsheets, UNO_QUERY_THROW); @@ -38,7 +38,7 @@ void XSpreadsheets::testInsertNewByNameBadName() uno::Reference< sheet::XSpreadsheets > xSpreadsheets(init(), UNO_QUERY_THROW); CPPUNIT_ASSERT_THROW_MESSAGE("No exception thrown", - xSpreadsheets->insertNewByName("$%#/?\\", 0), + xSpreadsheets->insertNewByName(u"$%#/?\\"_ustr, 0), uno::RuntimeException); } @@ -47,12 +47,12 @@ void XSpreadsheets::testMoveByName() uno::Reference< sheet::XSpreadsheets > xSpreadsheets(init(), UNO_QUERY_THROW); // first insert one that should be moved - xSpreadsheets->insertNewByName("SheetToMove", 0); + xSpreadsheets->insertNewByName(u"SheetToMove"_ustr, 0); uno::Reference< container::XNameAccess > xNameAccess(xSpreadsheets, UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("Sheet to move was not insert", - xNameAccess->hasByName("SheetToMove")); + xNameAccess->hasByName(u"SheetToMove"_ustr)); - xSpreadsheets->moveByName("SheetToMove", 2); + xSpreadsheets->moveByName(u"SheetToMove"_ustr, 2); // get sheet from the new position uno::Reference< container::XIndexAccess > oIndexAccess(xSpreadsheets, UNO_QUERY_THROW); @@ -61,7 +61,7 @@ void XSpreadsheets::testMoveByName() CPPUNIT_ASSERT(aAny >>= xNamed); CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet was not moved", - OUString("SheetToMove"), + u"SheetToMove"_ustr, xNamed->getName()); } @@ -70,14 +70,14 @@ void XSpreadsheets::testCopyByName() uno::Reference< sheet::XSpreadsheets > xSpreadsheets(init(), UNO_QUERY_THROW); // insert new sheet to copy - xSpreadsheets->insertNewByName("SheetToCopySrc", 0); + xSpreadsheets->insertNewByName(u"SheetToCopySrc"_ustr, 0); uno::Reference< container::XNameAccess > xNameAccess(xSpreadsheets, UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("Sheet to copy was not insert", - xNameAccess->hasByName("SheetToCopySrc")); + xNameAccess->hasByName(u"SheetToCopySrc"_ustr)); - xSpreadsheets->copyByName("SheetToCopySrc", "SheetToCopyDst", 0); + xSpreadsheets->copyByName(u"SheetToCopySrc"_ustr, u"SheetToCopyDst"_ustr, 0); CPPUNIT_ASSERT_MESSAGE("Sheet was not copied", - xNameAccess->hasByName("SheetToCopyDst")); + xNameAccess->hasByName(u"SheetToCopyDst"_ustr)); } } diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index dd0fbbace5ac..2303b188af87 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -146,12 +146,12 @@ void XSpreadsheets2::testImportOverExistingNamedRange() importSheetToCopy(); uno::Reference< container::XNameAccess > xDestNamedRangesNameAccess(getNamedRanges(xDestDoc), UNO_QUERY_THROW); - uno::Any aNr = xDestNamedRangesNameAccess->getByName("initial1"); + uno::Any aNr = xDestNamedRangesNameAccess->getByName(u"initial1"_ustr); uno::Reference< sheet::XNamedRange > xDestNamedRange(aNr, UNO_QUERY_THROW); OUString aNrDestContent = xDestNamedRange->getContent(); std::cout << "testImportSheet : initial1 aNrDestContent " << aNrDestContent << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for initial1", OUString("$Sheet1.$B$1"), aNrDestContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for initial1", u"$Sheet1.$B$1"_ustr, aNrDestContent); } @@ -165,14 +165,14 @@ void XSpreadsheets2::testImportNamedRangeDefinedInSource() importSheetToCopy(); // New range name defined in imported sheet $SheetToCopy.$A$7 - OUString aNewInSheetNamedRangeString("InSheetRangeName"); + OUString aNewInSheetNamedRangeString(u"InSheetRangeName"_ustr); uno::Reference< container::XNameAccess > xDestNamedRangesNameAccess(getNamedRanges(xDestDoc), UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("InSheetRangeName", xDestNamedRangesNameAccess->hasByName(aNewInSheetNamedRangeString)); uno::Any aNewInSheetNr = xDestNamedRangesNameAccess->getByName(aNewInSheetNamedRangeString); uno::Reference< sheet::XNamedRange > xDestNewInSheetNamedRange(aNewInSheetNr, UNO_QUERY_THROW); OUString aNewInSheetNrDestContent = xDestNewInSheetNamedRange->getContent(); - OUString aNewInSheetExpectedContent("$SheetToCopy.$A$7"); + OUString aNewInSheetExpectedContent(u"$SheetToCopy.$A$7"_ustr); std::cout << "testImportSheet : InSheetRangeName content " << aNewInSheetNrDestContent << std::endl; std::cout << "testImportSheet : InSheetRangeName expected " << aNewInSheetExpectedContent << std::endl; @@ -189,7 +189,7 @@ void XSpreadsheets2::testImportNamedRangeRedefinedInSource() importSheetToCopy(); // the source file redefines an existing named range in the imported sheet --> the target should not be changed - OUString aRedefinedInSheetNamedRangeString("initial2"); + OUString aRedefinedInSheetNamedRangeString(u"initial2"_ustr); uno::Reference< container::XNameAccess > xDestNamedRangesNameAccess(getNamedRanges(xDestDoc), UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("aRedefinedInSheetNamedRangeString", xDestNamedRangesNameAccess->hasByName(aRedefinedInSheetNamedRangeString)); @@ -197,7 +197,7 @@ void XSpreadsheets2::testImportNamedRangeRedefinedInSource() uno::Reference< sheet::XNamedRange > xDestRedefinedInSheetNamedRange(aRedefinedInSheetNr, UNO_QUERY_THROW); OUString aRedefinedInSheetNrDestContent = xDestRedefinedInSheetNamedRange->getContent(); std::cout << "testImportSheet : initial2 content " << aRedefinedInSheetNrDestContent << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for Redefined InSheet named range", OUString("$Sheet1.$B$2"), aRedefinedInSheetNrDestContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for Redefined InSheet named range", u"$Sheet1.$B$2"_ustr, aRedefinedInSheetNrDestContent); } void XSpreadsheets2::testImportNewNamedRange() @@ -210,7 +210,7 @@ void XSpreadsheets2::testImportNewNamedRange() importSheetToCopy(); //formula with a non-existent named range in dest - new_rangename - OUString aNewNamedRangeString("new_rangename"); + OUString aNewNamedRangeString(u"new_rangename"_ustr); uno::Reference< container::XNameAccess > xDestNamedRangesNameAccess(getNamedRanges(xDestDoc), UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("New NamedRange not created", xDestNamedRangesNameAccess->hasByName(aNewNamedRangeString)); @@ -220,7 +220,7 @@ void XSpreadsheets2::testImportNewNamedRange() uno::Reference< sheet::XNamedRange > xDestNewNamedRange(aNewNr, UNO_QUERY_THROW); OUString aNewNrDestContent = xDestNewNamedRange->getContent(); - OUString aNewExpectedContent("$Sheet1.$B$1"); + OUString aNewExpectedContent(u"$Sheet1.$B$1"_ustr); std::cout << "testImportSheet : new_rangename aNewExpectedContent " << aNewExpectedContent << std::endl; std::cout << "testImportSheet : new_rangename aNewNrDestContent " << aNewNrDestContent << std::endl; @@ -255,7 +255,7 @@ void XSpreadsheets2::testImportCellStyle() uno::Reference< style::XStyleFamiliesSupplier > xFamiliesSupplier (xDestDoc, UNO_QUERY_THROW); uno::Reference< container::XNameAccess > xFamiliesNameAccess (xFamiliesSupplier->getStyleFamilies(), UNO_SET_THROW); - uno::Any aCellStylesFamily = xFamiliesNameAccess->getByName("CellStyles"); + uno::Any aCellStylesFamily = xFamiliesNameAccess->getByName(u"CellStyles"_ustr); uno::Reference< container::XNameContainer > xCellStylesFamilyNameAccess (aCellStylesFamily, UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("New cell style not present", xCellStylesFamilyNameAccess->hasByName(aDestStyleName)); @@ -263,7 +263,7 @@ void XSpreadsheets2::testImportCellStyle() uno::Any aCellStyle = xCellStylesFamilyNameAccess->getByName(aDestStyleName); uno::Reference< beans::XPropertySet > xCellStyleProp (aCellStyle, UNO_QUERY_THROW); sal_Int32 aVertJustify = 0; - CPPUNIT_ASSERT(xCellStyleProp->getPropertyValue("VertJustify") >>= aVertJustify); + CPPUNIT_ASSERT(xCellStyleProp->getPropertyValue(u"VertJustify"_ustr) >>= aVertJustify); CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", table::CellVertJustify_CENTER, static_cast<table::CellVertJustify>(aVertJustify)); } @@ -328,7 +328,7 @@ uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUStri uno::Reference< sheet::XNamedRanges> XSpreadsheets2::getNamedRanges(uno::Reference< sheet::XSpreadsheetDocument> const & xDoc) { uno::Reference< beans::XPropertySet > xPropSet (xDoc, UNO_QUERY_THROW); - uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue("NamedRanges"), UNO_QUERY_THROW); + uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue(u"NamedRanges"_ustr), UNO_QUERY_THROW); return xNamedRanges; } diff --git a/test/source/sheet/xsubtotalcalculatable.cxx b/test/source/sheet/xsubtotalcalculatable.cxx index ad29154d60a4..bf994318af77 100644 --- a/test/source/sheet/xsubtotalcalculatable.cxx +++ b/test/source/sheet/xsubtotalcalculatable.cxx @@ -46,9 +46,9 @@ void XSubTotalCalculatable::testApplyRemoveSubTotals() /* Function */ sheet::GeneralFunction_SUM } }; xSTD->addNew(xCols, 1); - xSheet->getCellByPosition(0, 0)->setFormula("first"); - xSheet->getCellByPosition(1, 0)->setFormula("second"); - xSheet->getCellByPosition(0, 3)->setFormula(""); + xSheet->getCellByPosition(0, 0)->setFormula(u"first"_ustr); + xSheet->getCellByPosition(1, 0)->setFormula(u"second"_ustr); + xSheet->getCellByPosition(0, 3)->setFormula(u""_ustr); xSheet->getCellByPosition(0, 1)->setValue(5); xSheet->getCellByPosition(0, 2)->setValue(5); xSheet->getCellByPosition(1, 1)->setValue(17); @@ -56,12 +56,12 @@ void XSubTotalCalculatable::testApplyRemoveSubTotals() xSTC->applySubTotals(xSTD, true); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to apply SubTotals", - OUString("=SUBTOTAL(9;$A$2:$A$3)"), + u"=SUBTOTAL(9;$A$2:$A$3)"_ustr, xSheet->getCellByPosition(0, 3)->getFormula()); xSTC->removeSubTotals(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove SubTotals", - OUString(""), + u""_ustr, xSheet->getCellByPosition(0, 3)->getFormula()); } diff --git a/test/source/style/xstyleloader.cxx b/test/source/style/xstyleloader.cxx index 4b58758d9e8b..7bbcb81e436c 100644 --- a/test/source/style/xstyleloader.cxx +++ b/test/source/style/xstyleloader.cxx @@ -78,7 +78,7 @@ void XStyleLoader::testLoadStylesFromStream() aInputStream.Value = aTmp; aOptions.getArray()[nLength] = aInputStream; - xStyleLoader->loadStylesFromURL("private:stream", aOptions); + xStyleLoader->loadStylesFromURL(u"private:stream"_ustr, aOptions); uno::Reference<style::XStyleFamiliesSupplier> xFamilySupplier(xDoc, UNO_QUERY_THROW); checkStyleProperties(xFamilySupplier); @@ -90,28 +90,29 @@ void XStyleLoader::checkStyleProperties( // check if targetDocument has myStyle uno::Reference<container::XNameAccess> xFamilies(xFamilySupplier->getStyleFamilies(), UNO_SET_THROW); - uno::Reference<container::XNameContainer> xCellStyles(xFamilies->getByName("CellStyles"), + uno::Reference<container::XNameContainer> xCellStyles(xFamilies->getByName(u"CellStyles"_ustr), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Style not imported", xCellStyles->hasByName("myStyle")); + CPPUNIT_ASSERT_MESSAGE("Style not imported", xCellStyles->hasByName(u"myStyle"_ustr)); // test the backgroundcolor is correctly imported - uno::Reference<style::XStyle> xMyStyle(xCellStyles->getByName("myStyle"), UNO_QUERY_THROW); + uno::Reference<style::XStyle> xMyStyle(xCellStyles->getByName(u"myStyle"_ustr), + UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropSet(xMyStyle, UNO_QUERY_THROW); - uno::Any aBackColor = xPropSet->getPropertyValue("CellBackColor"); + uno::Any aBackColor = xPropSet->getPropertyValue(u"CellBackColor"_ustr); uno::Any expectedBackColor(sal_Int32(16724787)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong CellBackColor", expectedBackColor, aBackColor); // test default pageStyle - uno::Reference<container::XNameContainer> xPageStyles(xFamilies->getByName("PageStyles"), + uno::Reference<container::XNameContainer> xPageStyles(xFamilies->getByName(u"PageStyles"_ustr), UNO_QUERY_THROW); - uno::Reference<beans::XPropertySet> xPagePropSet(xPageStyles->getByName("Default"), + uno::Reference<beans::XPropertySet> xPagePropSet(xPageStyles->getByName(u"Default"_ustr), UNO_QUERY_THROW); - uno::Any aPageBackColor = xPagePropSet->getPropertyValue("BackColor"); + uno::Any aPageBackColor = xPagePropSet->getPropertyValue(u"BackColor"_ustr); uno::Any expectedPageBackColor(sal_Int32(13434879)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong page style BackColor", expectedPageBackColor, diff --git a/test/source/table/tablecolumn.cxx b/test/source/table/tablecolumn.cxx index 08a008ce8823..8f586869c471 100644 --- a/test/source/table/tablecolumn.cxx +++ b/test/source/table/tablecolumn.cxx @@ -28,17 +28,17 @@ void TableColumn::testTableColumnProperties() { uno::Reference<beans::XPropertySet> xPS(init(), uno::UNO_QUERY_THROW); - OUString aPropName = "Width"; + OUString aPropName = u"Width"_ustr; testLongProperty(xPS, aPropName); // currently changing the value to false has no effect aPropName = "OptimalWidth"; uno::Reference<table::XCellRange> xCR(m_xSheet, uno::UNO_QUERY_THROW); - xCR->getCellByPosition(0, 0)->setFormula("That's a pretty long text."); - const sal_Int64 nWidthBefore = ::comphelper::getINT64(xPS->getPropertyValue("Width")); + xCR->getCellByPosition(0, 0)->setFormula(u"That's a pretty long text."_ustr); + const sal_Int64 nWidthBefore = ::comphelper::getINT64(xPS->getPropertyValue(u"Width"_ustr)); xPS->setPropertyValue(aPropName, uno::Any(true)); CPPUNIT_ASSERT(::comphelper::getBOOL(xPS->getPropertyValue(aPropName))); - const sal_Int64 nWidthAfter = ::comphelper::getINT64(xPS->getPropertyValue("Width")); + const sal_Int64 nWidthAfter = ::comphelper::getINT64(xPS->getPropertyValue(u"Width"_ustr)); CPPUNIT_ASSERT(nWidthBefore != nWidthAfter); aPropName = "IsVisible"; diff --git a/test/source/table/xcell.cxx b/test/source/table/xcell.cxx index 8540117a5618..8409fd3efdcb 100644 --- a/test/source/table/xcell.cxx +++ b/test/source/table/xcell.cxx @@ -25,7 +25,7 @@ void XCell::testGetError() { uno::Reference<table::XCell> xCell(init(), UNO_QUERY_THROW); const sal_Int32 nCorrectFormula = xCell->getError(); - xCell->setFormula("=sqrt(-2)"); + xCell->setFormula(u"=sqrt(-2)"_ustr); const sal_Int32 nIncorrectFormula = xCell->getError(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to get Error", sal_Int32(0), nCorrectFormula); @@ -54,7 +54,7 @@ void XCell::testGetType() void XCell::testSetGetFormula() { uno::Reference<table::XCell> xCell(init(), UNO_QUERY_THROW); - OUString aFormula = "=2+2"; + OUString aFormula = u"=2+2"_ustr; xCell->setFormula(aFormula); diff --git a/test/source/table/xcellcursor.cxx b/test/source/table/xcellcursor.cxx index 6f6cc33e0cc2..92f72e0f4219 100644 --- a/test/source/table/xcellcursor.cxx +++ b/test/source/table/xcellcursor.cxx @@ -104,7 +104,7 @@ void XCellCursor::testGoToEnd() uno::Reference<table::XCellCursor> xCellCursor(init(), UNO_QUERY_THROW); uno::Reference<sheet::XSpreadsheet> xSpreadsheet(getXSpreadsheet(), UNO_QUERY_THROW); uno::Reference<table::XCellRange> xCellRange(xCellCursor, UNO_QUERY_THROW); - xCellRange = xSpreadsheet->getCellRangeByName("$A$1:$g$7"); + xCellRange = xSpreadsheet->getCellRangeByName(u"$A$1:$g$7"_ustr); uno::Reference<sheet::XSheetCellRange> xSheetCellRange(xCellCursor, UNO_QUERY_THROW); uno::Reference<sheet::XSheetCellCursor> xSheetCellCursor(xCellCursor, UNO_QUERY_THROW); xSheetCellCursor = xSpreadsheet->createCursorByRange(xSheetCellRange); diff --git a/test/source/table/xtablecharts.cxx b/test/source/table/xtablecharts.cxx index 15aa710ffca3..cb232e1b6e5e 100644 --- a/test/source/table/xtablecharts.cxx +++ b/test/source/table/xtablecharts.cxx @@ -27,11 +27,12 @@ void XTableCharts::testAddNewRemoveByName() uno::Reference<table::XTableCharts> xTC(init(), uno::UNO_QUERY_THROW); uno::Sequence<table::CellRangeAddress> aRanges{ table::CellRangeAddress(0, 1, 1, 14, 4) }; - xTC->addNewByName("XTableCharts", awt::Rectangle(500, 3000, 25000, 11000), aRanges, true, true); - CPPUNIT_ASSERT(xTC->hasByName("XTableCharts")); + xTC->addNewByName(u"XTableCharts"_ustr, awt::Rectangle(500, 3000, 25000, 11000), aRanges, true, + true); + CPPUNIT_ASSERT(xTC->hasByName(u"XTableCharts"_ustr)); - xTC->removeByName("XTableCharts"); - CPPUNIT_ASSERT(!xTC->hasByName("XTableCharts")); + xTC->removeByName(u"XTableCharts"_ustr); + CPPUNIT_ASSERT(!xTC->hasByName(u"XTableCharts"_ustr)); } } // namespace apitest diff --git a/test/source/table/xtablecolumns.cxx b/test/source/table/xtablecolumns.cxx index 0d72a8dd196c..fcb7e45290c3 100644 --- a/test/source/table/xtablecolumns.cxx +++ b/test/source/table/xtablecolumns.cxx @@ -29,50 +29,50 @@ void XTableColumns::testInsertByIndex() // insert one column at position one xTC->insertByIndex(1, 1); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(3, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 1))); // insert one column at position zero xTC->insertByIndex(0, 1); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(3, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(4, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(4, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(5, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(5, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(4, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(4, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(5, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(5, 1))); // insert two columns at position zero xTC->insertByIndex(0, 2); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(3, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(5, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(5, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(6, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(6, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(7, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(7, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(5, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(5, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(6, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(6, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(7, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(7, 1))); } void XTableColumns::testInsertByIndexWithNegativeIndex() @@ -105,42 +105,42 @@ void XTableColumns::testRemoveByIndex() // remove two columns at position zero xTC->removeByIndex(0, 2); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(3, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(4, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(4, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(5, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(5, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(4, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(4, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(5, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(5, 1))); // remove one column at position zero xTC->removeByIndex(0, 1); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(3, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(4, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(4, 1))); // remove one column at position one xTC->removeByIndex(1, 1); - CPPUNIT_ASSERT_EQUAL(OUString("0a"), getCellText(xCR->getCellByPosition(0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("0b"), getCellText(xCR->getCellByPosition(0, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("1a"), getCellText(xCR->getCellByPosition(1, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("1b"), getCellText(xCR->getCellByPosition(1, 1))); - CPPUNIT_ASSERT_EQUAL(OUString("2a"), getCellText(xCR->getCellByPosition(2, 0))); - CPPUNIT_ASSERT_EQUAL(OUString("2b"), getCellText(xCR->getCellByPosition(2, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(3, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(""), getCellText(xCR->getCellByPosition(3, 1))); + CPPUNIT_ASSERT_EQUAL(u"0a"_ustr, getCellText(xCR->getCellByPosition(0, 0))); + CPPUNIT_ASSERT_EQUAL(u"0b"_ustr, getCellText(xCR->getCellByPosition(0, 1))); + CPPUNIT_ASSERT_EQUAL(u"1a"_ustr, getCellText(xCR->getCellByPosition(1, 0))); + CPPUNIT_ASSERT_EQUAL(u"1b"_ustr, getCellText(xCR->getCellByPosition(1, 1))); + CPPUNIT_ASSERT_EQUAL(u"2a"_ustr, getCellText(xCR->getCellByPosition(2, 0))); + CPPUNIT_ASSERT_EQUAL(u"2b"_ustr, getCellText(xCR->getCellByPosition(2, 1))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(3, 0))); + CPPUNIT_ASSERT_EQUAL(u""_ustr, getCellText(xCR->getCellByPosition(3, 1))); } void XTableColumns::testRemoveByIndexWithNegativeIndex() diff --git a/test/source/text/baseindex.cxx b/test/source/text/baseindex.cxx index 172cabb57981..eb0ece0659f3 100644 --- a/test/source/text/baseindex.cxx +++ b/test/source/text/baseindex.cxx @@ -52,25 +52,25 @@ BaseIndex::~BaseIndex() {} void BaseIndex::testBaseIndexProperties() { css::uno::Reference<css::beans::XPropertySet> xBaseIndex(init(), css::uno::UNO_QUERY_THROW); - testStringProperty(xBaseIndex, "Title", "Value"); - testBooleanProperty(xBaseIndex, "IsProtected"); - - testStringProperty(xBaseIndex, "ParaStyleHeading", "Value"); - testStringProperty(xBaseIndex, "ParaStyleLevel1", "Value"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel2"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel3"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel4"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel5"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel6"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel7"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel8"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel9"); - testStringOptionalProperty(xBaseIndex, "ParaStyleLevel10"); - testStringOptionalProperty(xBaseIndex, "ParaStyleSeparator"); + testStringProperty(xBaseIndex, u"Title"_ustr, u"Value"_ustr); + testBooleanProperty(xBaseIndex, u"IsProtected"_ustr); + + testStringProperty(xBaseIndex, u"ParaStyleHeading"_ustr, u"Value"_ustr); + testStringProperty(xBaseIndex, u"ParaStyleLevel1"_ustr, u"Value"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel2"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel3"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel4"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel5"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel6"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel7"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel8"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel9"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleLevel10"_ustr); + testStringOptionalProperty(xBaseIndex, u"ParaStyleSeparator"_ustr); // [property] XTextColumns TextColumns; { - OUString name = "TextColumns"; + OUString name = u"TextColumns"_ustr; css::uno::Reference<css::text::XTextColumns> xGetTextColumns; CPPUNIT_ASSERT(xBaseIndex->getPropertyValue(name) >>= xGetTextColumns); @@ -87,7 +87,7 @@ void BaseIndex::testBaseIndexProperties() // [property] com::sun::star::graphic::XGraphic BackGraphic; // [property] string BackGraphicURL; { - OUString name = "BackGraphicURL"; + OUString name = u"BackGraphicURL"_ustr; bool bOK = false; try { @@ -105,40 +105,40 @@ void BaseIndex::testBaseIndexProperties() writerFileWithBitmap(aTempFile.GetURL()); css::uno::Reference<css::graphic::XGraphic> xGraphic; - CPPUNIT_ASSERT(xBaseIndex->getPropertyValue("BackGraphic") >>= xGraphic); + CPPUNIT_ASSERT(xBaseIndex->getPropertyValue(u"BackGraphic"_ustr) >>= xGraphic); CPPUNIT_ASSERT(!xGraphic.is()); xBaseIndex->setPropertyValue(name, css::uno::Any(aTempFile.GetURL())); - CPPUNIT_ASSERT(xBaseIndex->getPropertyValue("BackGraphic") >>= xGraphic); + CPPUNIT_ASSERT(xBaseIndex->getPropertyValue(u"BackGraphic"_ustr) >>= xGraphic); CPPUNIT_ASSERT(xGraphic.is()); } - testStringProperty(xBaseIndex, "BackGraphicFilter", "Value"); + testStringProperty(xBaseIndex, u"BackGraphicFilter"_ustr, u"Value"_ustr); // [property] com::sun::star::style::GraphicLocation BackGraphicLocation; - testColorProperty(xBaseIndex, "BackColor"); - testBooleanProperty(xBaseIndex, "BackTransparent"); + testColorProperty(xBaseIndex, u"BackColor"_ustr); + testBooleanProperty(xBaseIndex, u"BackTransparent"_ustr); // [optional, property] com::sun::star::container::XIndexReplace LevelFormat; - testBooleanOptionalProperty(xBaseIndex, "CreateFromChapter"); + testBooleanOptionalProperty(xBaseIndex, u"CreateFromChapter"_ustr); // [property] com::sun::star::text::XTextSection ContentSection; { - OUString name = "ContentSection"; + OUString name = u"ContentSection"_ustr; css::uno::Reference<css::text::XTextSection> xGetTextSection; CPPUNIT_ASSERT_MESSAGE(name.toUtf8().getStr(), xBaseIndex->getPropertyValue(name) >>= xGetTextSection); - CPPUNIT_ASSERT_EQUAL_MESSAGE(name.toUtf8().getStr(), OUString(""), + CPPUNIT_ASSERT_EQUAL_MESSAGE(name.toUtf8().getStr(), u""_ustr, xGetTextSection->getAnchor()->getString()); } // [property] com::sun::star::text::XTextSection HeaderSection; { - OUString name = "HeaderSection"; + OUString name = u"HeaderSection"_ustr; css::uno::Reference<css::text::XTextSection> xGetTextSection; if (xBaseIndex->getPropertyValue(name).hasValue()) diff --git a/test/source/text/baseindexmark.cxx b/test/source/text/baseindexmark.cxx index 755b55856cf8..426012c632e2 100644 --- a/test/source/text/baseindexmark.cxx +++ b/test/source/text/baseindexmark.cxx @@ -29,11 +29,11 @@ void BaseIndexMark::testBaseIndexMarkProperties() uno::Any aNewValue; propName = "AlternativeText"; - OUString aAlternativeTextGet = ""; + OUString aAlternativeTextGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue AlternativeText", xBaseIndexMark->getPropertyValue(propName) >>= aAlternativeTextGet); - OUString aAlternativeTextSet = "testProperty"; + OUString aAlternativeTextSet = u"testProperty"_ustr; aNewValue <<= aAlternativeTextSet; xBaseIndexMark->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xBaseIndexMark->getPropertyValue(propName) >>= aAlternativeTextGet); diff --git a/test/source/text/documentindexmark.cxx b/test/source/text/documentindexmark.cxx index 86c1cd9bc151..b79825965145 100644 --- a/test/source/text/documentindexmark.cxx +++ b/test/source/text/documentindexmark.cxx @@ -29,11 +29,11 @@ void DocumentIndexMark::testDocumentIndexMarkProperties() uno::Any aNewValue; propName = "PrimaryKey"; - OUString aPrimaryKeyGet = ""; + OUString aPrimaryKeyGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue PrimaryKey", xDocumentIndexMark->getPropertyValue(propName) >>= aPrimaryKeyGet); - OUString aPrimaryKeySet = "testPropertyPK"; + OUString aPrimaryKeySet = u"testPropertyPK"_ustr; aNewValue <<= aPrimaryKeySet; xDocumentIndexMark->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xDocumentIndexMark->getPropertyValue(propName) >>= aPrimaryKeyGet); @@ -41,11 +41,11 @@ void DocumentIndexMark::testDocumentIndexMarkProperties() aPrimaryKeySet); propName = "SecondaryKey"; - OUString aSecondaryKeyGet = ""; + OUString aSecondaryKeyGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue SecondaryKey", xDocumentIndexMark->getPropertyValue(propName) >>= aSecondaryKeyGet); - OUString aSecondaryKeySet = "testPropertySK"; + OUString aSecondaryKeySet = u"testPropertySK"_ustr; aNewValue <<= aSecondaryKeySet; xDocumentIndexMark->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xDocumentIndexMark->getPropertyValue(propName) >>= aSecondaryKeyGet); diff --git a/test/source/text/footnote.cxx b/test/source/text/footnote.cxx index 9f484cfd30cc..62ed550ddff9 100644 --- a/test/source/text/footnote.cxx +++ b/test/source/text/footnote.cxx @@ -24,7 +24,7 @@ void Footnote::testFootnoteProperties() short aReferenceIdGet; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue ReferenceId", - xFootnote->getPropertyValue("ReferenceId") >>= aReferenceIdGet); + xFootnote->getPropertyValue(u"ReferenceId"_ustr) >>= aReferenceIdGet); } } diff --git a/test/source/text/numberingrules.cxx b/test/source/text/numberingrules.cxx index c54925650523..4d3fed5c9b34 100644 --- a/test/source/text/numberingrules.cxx +++ b/test/source/text/numberingrules.cxx @@ -68,7 +68,7 @@ void NumberingRules::testNumberingRulesProperties() !bIsContinuousNumberingGet, bIsContinuousNumberingSet); propName = "Name"; - OUString aNameGet = ""; + OUString aNameGet = u""_ustr; CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Name", xNumberingRules->getPropertyValue(propName) >>= aNameGet); } diff --git a/test/source/text/textcontent.cxx b/test/source/text/textcontent.cxx index 61990d869f97..ff63dff398a3 100644 --- a/test/source/text/textcontent.cxx +++ b/test/source/text/textcontent.cxx @@ -27,14 +27,14 @@ void TextContent::testTextContentProperties() uno::Reference<beans::XPropertySet> xPS(init(), uno::UNO_QUERY_THROW); text::TextContentAnchorType aExpectedTCAT; - CPPUNIT_ASSERT(xPS->getPropertyValue("AnchorType") >>= aExpectedTCAT); + CPPUNIT_ASSERT(xPS->getPropertyValue(u"AnchorType"_ustr) >>= aExpectedTCAT); CPPUNIT_ASSERT_EQUAL(m_aExpectedTCAT, aExpectedTCAT); try { - xPS->setPropertyValue("AnchorType", uno::Any(m_aNewTCAT)); + xPS->setPropertyValue(u"AnchorType"_ustr, uno::Any(m_aNewTCAT)); text::TextContentAnchorType aNewTCAT; - CPPUNIT_ASSERT(xPS->getPropertyValue("AnchorType") >>= aNewTCAT); + CPPUNIT_ASSERT(xPS->getPropertyValue(u"AnchorType"_ustr) >>= aNewTCAT); CPPUNIT_ASSERT_EQUAL(m_aNewTCAT, aNewTCAT); } catch (const beans::UnknownPropertyException& /* ex */) @@ -43,18 +43,18 @@ void TextContent::testTextContentProperties() } uno::Sequence<text::TextContentAnchorType> aAnchorTypes; - CPPUNIT_ASSERT(xPS->getPropertyValue("AnchorTypes") >>= aAnchorTypes); + CPPUNIT_ASSERT(xPS->getPropertyValue(u"AnchorTypes"_ustr) >>= aAnchorTypes); CPPUNIT_ASSERT(aAnchorTypes.hasElements()); text::WrapTextMode aExpectedWTM; - CPPUNIT_ASSERT(xPS->getPropertyValue("TextWrap") >>= aExpectedWTM); + CPPUNIT_ASSERT(xPS->getPropertyValue(u"TextWrap"_ustr) >>= aExpectedWTM); CPPUNIT_ASSERT_EQUAL(m_aExpectedWTM, aExpectedWTM); try { - xPS->setPropertyValue("TextWrap", uno::Any(m_aNewWTM)); + xPS->setPropertyValue(u"TextWrap"_ustr, uno::Any(m_aNewWTM)); text::WrapTextMode aNewWTM; - CPPUNIT_ASSERT(xPS->getPropertyValue("TextWrap") >>= aNewWTM); + CPPUNIT_ASSERT(xPS->getPropertyValue(u"TextWrap"_ustr) >>= aNewWTM); CPPUNIT_ASSERT_EQUAL(m_aNewWTM, aNewWTM); } catch (const beans::UnknownPropertyException& /* ex */) diff --git a/test/source/text/textdocumentindex.cxx b/test/source/text/textdocumentindex.cxx index 67f161cf3472..38243c4fdbee 100644 --- a/test/source/text/textdocumentindex.cxx +++ b/test/source/text/textdocumentindex.cxx @@ -20,17 +20,17 @@ void TextDocumentIndex::testDocumentIndexProperties() { css::uno::Reference<css::beans::XPropertySet> xDocumentIndex(init(), css::uno::UNO_QUERY_THROW); - testBooleanProperty(xDocumentIndex, "UseAlphabeticalSeparators"); - testBooleanProperty(xDocumentIndex, "UseKeyAsEntry"); - testBooleanProperty(xDocumentIndex, "UseCombinedEntries"); - testBooleanProperty(xDocumentIndex, "IsCaseSensitive"); - testBooleanProperty(xDocumentIndex, "UsePP"); - testBooleanProperty(xDocumentIndex, "UseDash"); - testBooleanProperty(xDocumentIndex, "UseUpperCase"); - testStringOptionalProperty(xDocumentIndex, "MainEntryCharacterStyleName"); + testBooleanProperty(xDocumentIndex, u"UseAlphabeticalSeparators"_ustr); + testBooleanProperty(xDocumentIndex, u"UseKeyAsEntry"_ustr); + testBooleanProperty(xDocumentIndex, u"UseCombinedEntries"_ustr); + testBooleanProperty(xDocumentIndex, u"IsCaseSensitive"_ustr); + testBooleanProperty(xDocumentIndex, u"UsePP"_ustr); + testBooleanProperty(xDocumentIndex, u"UseDash"_ustr); + testBooleanProperty(xDocumentIndex, u"UseUpperCase"_ustr); + testStringOptionalProperty(xDocumentIndex, u"MainEntryCharacterStyleName"_ustr); // [readonly, property] sequence <com::sun::star::text::XDocumentIndexMark> DocumentIndexMarks; // [property] com::sun::star::lang::Locale Locale; - testStringProperty(xDocumentIndex, "SortAlgorithm", "Value"); + testStringProperty(xDocumentIndex, u"SortAlgorithm"_ustr, u"Value"_ustr); } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/source/text/textdocumentsettings.cxx b/test/source/text/textdocumentsettings.cxx index 9ef0518b05ca..d1ab16b6ff0f 100644 --- a/test/source/text/textdocumentsettings.cxx +++ b/test/source/text/textdocumentsettings.cxx @@ -24,17 +24,17 @@ void TextDocumentSettings::testDocumentSettingsProperties() css::uno::Reference<css::beans::XPropertySet> xDocumentSettings(init(), css::uno::UNO_QUERY_THROW); - testBooleanOptionalProperty(xDocumentSettings, "ChartAutoUpdate"); - testBooleanOptionalProperty(xDocumentSettings, "AddParaTableSpacing"); - testBooleanOptionalProperty(xDocumentSettings, "AddParaTableSpacingAtStart"); - testBooleanOptionalProperty(xDocumentSettings, "AlignTabStopPosition"); - testBooleanOptionalProperty(xDocumentSettings, "SaveGlobalDocumentLinks"); - testBooleanOptionalProperty(xDocumentSettings, "IsLabelDocument"); - testBooleanOptionalProperty(xDocumentSettings, "UseFormerLineSpacing"); - testBooleanOptionalProperty(xDocumentSettings, "AddParaSpacingToTableCells"); - testBooleanOptionalProperty(xDocumentSettings, "UseFormerObjectPositioning"); - testBooleanOptionalProperty(xDocumentSettings, "ConsiderTextWrapOnObjPos"); - testBooleanOptionalProperty(xDocumentSettings, "MathBaselineAlignment"); + testBooleanOptionalProperty(xDocumentSettings, u"ChartAutoUpdate"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"AddParaTableSpacing"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"AddParaTableSpacingAtStart"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"AlignTabStopPosition"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"SaveGlobalDocumentLinks"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"IsLabelDocument"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"UseFormerLineSpacing"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"AddParaSpacingToTableCells"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"UseFormerObjectPositioning"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"ConsiderTextWrapOnObjPos"_ustr); + testBooleanOptionalProperty(xDocumentSettings, u"MathBaselineAlignment"_ustr); } } // end namespace apitest diff --git a/test/source/text/textprintersettings.cxx b/test/source/text/textprintersettings.cxx index da94c20203c1..6aee8504ea7e 100644 --- a/test/source/text/textprintersettings.cxx +++ b/test/source/text/textprintersettings.cxx @@ -20,15 +20,15 @@ void TextPrinterSettings::testPrinterSettingsProperties() css::uno::Reference<css::beans::XPropertySet> xPrinterSettings(init(), css::uno::UNO_QUERY_THROW); - testBooleanProperty(xPrinterSettings, "PrintGraphics"); - testBooleanProperty(xPrinterSettings, "PrintLeftPages"); - testBooleanProperty(xPrinterSettings, "PrintRightPages"); - testBooleanProperty(xPrinterSettings, "PrintControls"); - testStringProperty(xPrinterSettings, "PrintFaxName", "FaxName"); - testBooleanProperty(xPrinterSettings, "PrintProspect"); - testBooleanProperty(xPrinterSettings, "PrintPageBackground"); - testBooleanProperty(xPrinterSettings, "PrintBlackFonts"); - testBooleanOptionalProperty(xPrinterSettings, "PrintEmptyPages"); + testBooleanProperty(xPrinterSettings, u"PrintGraphics"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintLeftPages"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintRightPages"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintControls"_ustr); + testStringProperty(xPrinterSettings, u"PrintFaxName"_ustr, u"FaxName"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintProspect"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintPageBackground"_ustr); + testBooleanProperty(xPrinterSettings, u"PrintBlackFonts"_ustr); + testBooleanOptionalProperty(xPrinterSettings, u"PrintEmptyPages"_ustr); } } // end namespace apitest diff --git a/test/source/text/textsettings.cxx b/test/source/text/textsettings.cxx index 039210390765..c930c13e4356 100644 --- a/test/source/text/textsettings.cxx +++ b/test/source/text/textsettings.cxx @@ -118,35 +118,35 @@ void TextSettings::testSettingsProperties() //testShortOptionalProperty(xSettings, "LinkUpdateMode"); testPrinterName(xSettings); // [property] sequence< byte > PrinterSetup; - testBooleanOptionalProperty(xSettings, "IsKernAsianPunctuation"); + testBooleanOptionalProperty(xSettings, u"IsKernAsianPunctuation"_ustr); //testShortOptionalProperty(xSettings, "CharacterCompressionType"); - testBooleanOptionalProperty(xSettings, "ApplyUserData"); - testBooleanOptionalProperty(xSettings, "SaveVersionOnClose"); - testBooleanOptionalProperty(xSettings, "UpdateFromTemplate"); - testBooleanOptionalProperty(xSettings, "FieldAutoUpdate"); - testStringOptionalProperty(xSettings, "CurrentDatabaseDataSource"); - testStringOptionalProperty(xSettings, "CurrentDatabaseCommand"); - testLongOptionalProperty(xSettings, "CurrentDatabaseCommandType"); - testLongOptionalProperty(xSettings, "DefaultTabStop"); - testBooleanOptionalProperty(xSettings, "IsPrintBooklet"); - testBooleanOptionalProperty(xSettings, "IsPrintBookletFront"); - testBooleanOptionalProperty(xSettings, "IsPrintBookletBack"); - testLongOptionalProperty(xSettings, "PrintQuality"); - testStringOptionalProperty(xSettings, "ColorTableURL"); - testStringOptionalProperty(xSettings, "DashTableURL"); - testStringOptionalProperty(xSettings, "LineEndTableURL"); - testStringOptionalProperty(xSettings, "HatchTableURL"); - testStringOptionalProperty(xSettings, "GradientTableURL"); - testStringOptionalProperty(xSettings, "BitmapTableURL"); - testBooleanOptionalProperty(xSettings, "AutoCalculate"); + testBooleanOptionalProperty(xSettings, u"ApplyUserData"_ustr); + testBooleanOptionalProperty(xSettings, u"SaveVersionOnClose"_ustr); + testBooleanOptionalProperty(xSettings, u"UpdateFromTemplate"_ustr); + testBooleanOptionalProperty(xSettings, u"FieldAutoUpdate"_ustr); + testStringOptionalProperty(xSettings, u"CurrentDatabaseDataSource"_ustr); + testStringOptionalProperty(xSettings, u"CurrentDatabaseCommand"_ustr); + testLongOptionalProperty(xSettings, u"CurrentDatabaseCommandType"_ustr); + testLongOptionalProperty(xSettings, u"DefaultTabStop"_ustr); + testBooleanOptionalProperty(xSettings, u"IsPrintBooklet"_ustr); + testBooleanOptionalProperty(xSettings, u"IsPrintBookletFront"_ustr); + testBooleanOptionalProperty(xSettings, u"IsPrintBookletBack"_ustr); + testLongOptionalProperty(xSettings, u"PrintQuality"_ustr); + testStringOptionalProperty(xSettings, u"ColorTableURL"_ustr); + testStringOptionalProperty(xSettings, u"DashTableURL"_ustr); + testStringOptionalProperty(xSettings, u"LineEndTableURL"_ustr); + testStringOptionalProperty(xSettings, u"HatchTableURL"_ustr); + testStringOptionalProperty(xSettings, u"GradientTableURL"_ustr); + testStringOptionalProperty(xSettings, u"BitmapTableURL"_ustr); + testBooleanOptionalProperty(xSettings, u"AutoCalculate"_ustr); testPrinterIndependentLayout(xSettings); - testBooleanOptionalProperty(xSettings, "AddExternalLeading"); - testBooleanOptionalProperty(xSettings, "EmbedFonts"); - testBooleanOptionalProperty(xSettings, "EmbedSystemFonts"); - testBooleanOptionalProperty(xSettings, "EmbedOnlyUsedFonts"); - testBooleanOptionalProperty(xSettings, "EmbedLatinScriptFonts"); - testBooleanOptionalProperty(xSettings, "EmbedAsianScriptFonts"); - testBooleanOptionalProperty(xSettings, "EmbedComplexScriptFonts"); + testBooleanOptionalProperty(xSettings, u"AddExternalLeading"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedFonts"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedSystemFonts"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedOnlyUsedFonts"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedLatinScriptFonts"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedAsianScriptFonts"_ustr); + testBooleanOptionalProperty(xSettings, u"EmbedComplexScriptFonts"_ustr); } } // end namespace apitest diff --git a/test/source/text/xdocumentindex.cxx b/test/source/text/xdocumentindex.cxx index 9f9ad73c83a3..9048f2ae6ad5 100644 --- a/test/source/text/xdocumentindex.cxx +++ b/test/source/text/xdocumentindex.cxx @@ -38,11 +38,11 @@ void XDocumentIndex::testUpdate() { auto xText = getTextDocument()->getText(); auto xTextRange = xText->getEnd(); - xTextRange->setString("IndexMark"); + xTextRange->setString(u"IndexMark"_ustr); css::uno::Reference<css::lang::XMultiServiceFactory> xFactory(getTextDocument(), css::uno::UNO_QUERY_THROW); css::uno::Reference<css::text::XTextContent> xTextContentMark( - xFactory->createInstance("com.sun.star.text.DocumentIndexMark"), + xFactory->createInstance(u"com.sun.star.text.DocumentIndexMark"_ustr), css::uno::UNO_QUERY_THROW); xText->insertTextContent(xTextRange, xTextContentMark, true); } diff --git a/test/source/text/xfootnote.cxx b/test/source/text/xfootnote.cxx index d46506bf1fd4..3899cb3bb406 100644 --- a/test/source/text/xfootnote.cxx +++ b/test/source/text/xfootnote.cxx @@ -29,7 +29,7 @@ void XFootnote::testGetSetLabel() { Reference<text::XFootnote> xFootnote(init(), UNO_QUERY_THROW); - rtl::OUString labelName = "New XFootnote Label"; + rtl::OUString labelName = u"New XFootnote Label"_ustr; xFootnote->setLabel(labelName); rtl::OUString newLabel = xFootnote->getLabel(); CPPUNIT_ASSERT(!newLabel.isEmpty()); diff --git a/test/source/text/xsimpletext.cxx b/test/source/text/xsimpletext.cxx index 23ea6c785eeb..3a946f40b91d 100644 --- a/test/source/text/xsimpletext.cxx +++ b/test/source/text/xsimpletext.cxx @@ -39,7 +39,7 @@ void XSimpleText::testInsertString() { uno::Reference<text::XSimpleText> xSimpleText(init(), UNO_QUERY_THROW); uno::Reference<text::XTextRange> xCursor(xSimpleText->createTextCursor(), UNO_QUERY_THROW); - ::rtl::OUString sString = "TestString"; + ::rtl::OUString sString = u"TestString"_ustr; xSimpleText->insertString(xCursor, sString, false); ::rtl::OUString gString = xSimpleText->getText()->getString(); @@ -60,7 +60,7 @@ void XSimpleText::testInsertControlCharacter() xSimpleText->insertControlCharacter(xCursor, text::ControlCharacter::PARAGRAPH_BREAK, false); xSimpleText->insertControlCharacter(xCursor, text::ControlCharacter::LINE_BREAK, false); - xSimpleText->insertString(xSimpleText->createTextCursor(), "newLine", false); + xSimpleText->insertString(xSimpleText->createTextCursor(), u"newLine"_ustr, false); } catch (const lang::IllegalArgumentException&) { diff --git a/test/source/text/xtextrange.cxx b/test/source/text/xtextrange.cxx index 64428b476e6e..234e60e0b940 100644 --- a/test/source/text/xtextrange.cxx +++ b/test/source/text/xtextrange.cxx @@ -22,9 +22,9 @@ void XTextRange::testGetEnd() { uno::Reference<text::XTextRange> xTextRange(init(), uno::UNO_QUERY_THROW); - xTextRange->setString("UnitTest"); + xTextRange->setString(u"UnitTest"_ustr); uno::Reference<text::XTextRange> xTR_end(xTextRange->getEnd(), uno::UNO_SET_THROW); - xTR_end->setString("End"); + xTR_end->setString(u"End"_ustr); CPPUNIT_ASSERT(xTextRange->getText()->getString().endsWith("End")); } @@ -33,17 +33,17 @@ void XTextRange::testGetSetString() { uno::Reference<text::XTextRange> xTextRange(init(), uno::UNO_QUERY_THROW); - xTextRange->setString("UnitTest"); - CPPUNIT_ASSERT_EQUAL(OUString("UnitTest"), xTextRange->getString()); + xTextRange->setString(u"UnitTest"_ustr); + CPPUNIT_ASSERT_EQUAL(u"UnitTest"_ustr, xTextRange->getString()); } void XTextRange::testGetStart() { uno::Reference<text::XTextRange> xTextRange(init(), uno::UNO_QUERY_THROW); - xTextRange->setString("UnitTest"); + xTextRange->setString(u"UnitTest"_ustr); uno::Reference<text::XTextRange> xTR_start(xTextRange->getStart(), uno::UNO_SET_THROW); - xTR_start->setString("Start"); + xTR_start->setString(u"Start"_ustr); CPPUNIT_ASSERT(xTextRange->getText()->getString().startsWith("Start")); } @@ -52,9 +52,9 @@ void XTextRange::testGetText() { uno::Reference<text::XTextRange> xTextRange(init(), uno::UNO_QUERY_THROW); - xTextRange->setString("UnitTest"); + xTextRange->setString(u"UnitTest"_ustr); uno::Reference<text::XText> xText(xTextRange->getText(), uno::UNO_SET_THROW); - CPPUNIT_ASSERT_EQUAL(OUString("UnitTest"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"UnitTest"_ustr, xTextRange->getString()); } } // namespace apitest diff --git a/test/source/text/xtextrangecompare.cxx b/test/source/text/xtextrangecompare.cxx index b31d6b864332..55203d340d84 100644 --- a/test/source/text/xtextrangecompare.cxx +++ b/test/source/text/xtextrangecompare.cxx @@ -33,7 +33,7 @@ void XTextRangeCompare::testCompareRegionStarts() try { Reference<text::XTextCursor> xCursor1 = xText->createTextCursor(); - xText->insertString(xCursor1, "XTextRangeCompare", false); + xText->insertString(xCursor1, u"XTextRangeCompare"_ustr, false); xCursor1->gotoStart(false); xCursor1->goRight(5, true); @@ -56,7 +56,7 @@ void XTextRangeCompare::testCompareRegionEnds() try { Reference<text::XTextCursor> xCursor1 = xText->createTextCursor(); - xText->insertString(xCursor1, "XTextRangeCompare", false); + xText->insertString(xCursor1, u"XTextRangeCompare"_ustr, false); xCursor1->gotoStart(false); xCursor1->goRight(5, true); diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index ce88aac3158e..af6506c525f3 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -150,23 +150,23 @@ uno::Any UnoApiTest::executeMacro(const OUString& rScriptURL, void UnoApiTest::save(const OUString& rFilter, const char* pPassword) { utl::MediaDescriptor aMediaDescriptor; - aMediaDescriptor["FilterName"] <<= rFilter; + aMediaDescriptor[u"FilterName"_ustr] <<= rFilter; if (!maFilterOptions.isEmpty()) - aMediaDescriptor["FilterOptions"] <<= maFilterOptions; + aMediaDescriptor[u"FilterOptions"_ustr] <<= maFilterOptions; if (pPassword) { if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open XML" && rFilter != "Impress Office Open XML") { - aMediaDescriptor["Password"] <<= OUString::createFromAscii(pPassword); + aMediaDescriptor[u"Password"_ustr] <<= OUString::createFromAscii(pPassword); } else { OUString sPassword = OUString::createFromAscii(pPassword); uno::Sequence<beans::NamedValue> aEncryptionData{ - { "CryptoType", uno::Any(OUString("Standard")) }, - { "OOXPassword", uno::Any(sPassword) } + { u"CryptoType"_ustr, uno::Any(u"Standard"_ustr) }, + { u"OOXPassword"_ustr, uno::Any(sPassword) } }; aMediaDescriptor[utl::MediaDescriptor::PROP_ENCRYPTIONDATA] <<= aEncryptionData; diff --git a/test/source/util/xindent.cxx b/test/source/util/xindent.cxx index 6b15407f970f..714b9e91eb8e 100644 --- a/test/source/util/xindent.cxx +++ b/test/source/util/xindent.cxx @@ -26,12 +26,12 @@ void XIndent::testIncrementIndent() { uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW); - uno::Any aAny = xPropertySet->getPropertyValue("ParaIndent"); + uno::Any aAny = xPropertySet->getPropertyValue(u"ParaIndent"_ustr); sal_Int32 nOldValue = aAny.get<sal_Int32>(); xIndent->incrementIndent(); - uno::Any aAny2 = xPropertySet->getPropertyValue("ParaIndent"); + uno::Any aAny2 = xPropertySet->getPropertyValue(u"ParaIndent"_ustr); sal_Int32 nNewValue = aAny2.get<sal_Int32>(); CPPUNIT_ASSERT_MESSAGE("Successfully able to Increment Indent", nOldValue < nNewValue); } @@ -40,12 +40,12 @@ void XIndent::testDecrementIndent() uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW); xIndent->incrementIndent(); - uno::Any aAny = xPropertySet->getPropertyValue("ParaIndent"); + uno::Any aAny = xPropertySet->getPropertyValue(u"ParaIndent"_ustr); sal_Int32 nOldValue = aAny.get<sal_Int32>(); xIndent->decrementIndent(); - uno::Any aAny2 = xPropertySet->getPropertyValue("ParaIndent"); + uno::Any aAny2 = xPropertySet->getPropertyValue(u"ParaIndent"_ustr); sal_Int32 nNewValue = aAny2.get<sal_Int32>(); CPPUNIT_ASSERT_MESSAGE("Successfully able to Decrement Indent", nOldValue > nNewValue); } diff --git a/test/source/util/xreplacedescriptor.cxx b/test/source/util/xreplacedescriptor.cxx index b3b042a2d826..5b34ea2fc5e0 100644 --- a/test/source/util/xreplacedescriptor.cxx +++ b/test/source/util/xreplacedescriptor.cxx @@ -26,9 +26,9 @@ void XReplaceDescriptor::testGetSetReplaceString() const OUString aReplaceStringOld = xRD->getReplaceString(); CPPUNIT_ASSERT(aReplaceStringOld.isEmpty()); - xRD->setReplaceString("_XReplaceDescriptor"); + xRD->setReplaceString(u"_XReplaceDescriptor"_ustr); const OUString aReplaceStringNew = xRD->getReplaceString(); - CPPUNIT_ASSERT_EQUAL(OUString("_XReplaceDescriptor"), aReplaceStringNew); + CPPUNIT_ASSERT_EQUAL(u"_XReplaceDescriptor"_ustr, aReplaceStringNew); CPPUNIT_ASSERT(aReplaceStringOld != aReplaceStringNew); } diff --git a/test/source/util/xsearchdescriptor.cxx b/test/source/util/xsearchdescriptor.cxx index 2740b2e266c9..163bca13efb7 100644 --- a/test/source/util/xsearchdescriptor.cxx +++ b/test/source/util/xsearchdescriptor.cxx @@ -25,9 +25,9 @@ void XSearchDescriptor::testGetSetSearchString() const OUString aSearchStringOld = xDS->getSearchString(); CPPUNIT_ASSERT(aSearchStringOld.isEmpty()); - xDS->setSearchString("_XSearchDescriptor"); + xDS->setSearchString(u"_XSearchDescriptor"_ustr); const OUString aSearchStringNew = xDS->getSearchString(); - CPPUNIT_ASSERT_EQUAL(OUString("_XSearchDescriptor"), aSearchStringNew); + CPPUNIT_ASSERT_EQUAL(u"_XSearchDescriptor"_ustr, aSearchStringNew); CPPUNIT_ASSERT(aSearchStringOld != aSearchStringNew); } diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 22fa266a966d..06678b1f33f1 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -137,7 +137,7 @@ OUString XmlTestTools::getXPathContent(const xmlDocUniquePtr& pXmlDoc, const OSt { auto boolVal = pXmlObj->boolval; xmlXPathFreeObject(pXmlObj); - return boolVal ? OUString("true") : OUString("false"); + return boolVal ? u"true"_ustr : u"false"_ustr; } case XPATH_NUMBER: { |